*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* \file htdocs/paypal/transaction.php
* \ingroup paypal
* \brief Page to list transactions in paypal account
* \version $Id$
*/
require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT.'/lib/date.lib.php');
require_once(DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php');
require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypalfunctions.lib.php");
$langs->load("paypal");
$langs->load("paybox");
$langs->load("companies");
$langs->load("orders");
$langs->load("bills");
if (! $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT) accessforbidden();
// Security check
$result=restrictedArea($user,'paypal','','','transaction');
$action = GETPOST('action');
$id = GETPOST('id');
$page = GETPOST("page",'int');
$startDateStr = GETPOST('startDateStr');
$endDateStr = GETPOST('endDateStr');
$transactionID = urlencode(GETPOST('transactionID'));
if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$errors='';
/*
* Actions
*/
/*
* View
*/
$nvpStr='';
$now=dol_now();
if(isset($startDateStr) && ! empty($startDateStr)) {
$start_date_str = $startDateStr;
$start_time = dol_stringtotime($start_date_str);
} else {
$start_time = dol_time_plus_duree($now,-1,'m'); // 30 days
$start_date_str = dol_print_date($start_time,'day');
}
$iso_start = dol_print_date($start_time,'dayhourrfc');
$nvpStr.="&STARTDATE=$iso_start";
if(isset($endDateStr) && ! empty($endDateStr)) {
$end_date_str = $endDateStr;
$end_time = dol_stringtotime($end_date_str);
} else {
$end_time = $now;
$end_date_str = dol_print_date($end_time,'day');
}
$iso_end = dol_print_date($end_time,'dayhourrfc');
$nvpStr.="&ENDDATE=".$iso_end;
if(isset($transactionID) && ! empty($transactionID)) {
$nvpStr.="&TRANSACTIONID=$transactionID";
}
llxHeader();
dol_htmloutput_errors('',$errors);
print_fiche_titre(' - '.$langs->trans('PaypalTransaction'), '', 'paypal_logo@paypal');
print '
';
if (empty($conf->global->PAYPAL_API_USER) || empty($conf->global->PAYPAL_API_PASSWORD)
|| empty($conf->global->PAYPAL_API_SIGNATURE))
{
$langs->load("errors");
print $langs->trans("ErrorModuleSetupNotComplete");
llxFooter();
exit;
}
?>
| '; print $langs->trans('DateStart').': '; print ' '; print $langs->trans('DateEnd').': '; print ' '; print $langs->trans('Ref').': '; print ' '; print ''; print ' |
| '.$langs->trans("NoTransactionSelected").' | '; print '||||||
'.$transactionID.' | ';
print ''.$payerName.' | '; print ''.dol_print_date($timeStamp,'dayhour').' | '; print ''.$amount.' '.$currency.' | '; print ''.$feeamount.' '.$currency.' | '; print ''.$netamount.' '.$currency.' | '; print ''.getLibStatut($status, 1, $url).' | '; print '