22 require
'../main.inc.php';
23 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
24 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
25 require_once DOL_DOCUMENT_ROOT.
'/stripe/class/stripe.class.php';
27 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
35 $langs->loadLangs(array(
'compta',
'salaries',
'bills',
'hrm',
'stripe'));
38 $socid =
GETPOST(
"socid",
"int");
40 $socid = $user->socid;
44 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
45 $rowid =
GETPOST(
"rowid",
'alpha');
46 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
47 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
49 if (empty($page) || $page == -1) {
52 $offset = $limit * $page;
53 $pageprev = $page - 1;
54 $pagenext = $page + 1;
55 $optioncss =
GETPOST(
'optioncss',
'alpha');
67 $societestatic =
new Societe($db);
72 llxHeader(
'', $langs->trans(
"StripeTransactionList"));
74 if (
isModEnabled(
'stripe') && (empty($conf->global->STRIPE_LIVE) ||
GETPOST(
'forcesandbox',
'alpha'))) {
75 $service =
'StripeTest';
77 dol_htmloutput_mesg($langs->trans(
'YouAreCurrentlyInSandboxMode',
'Stripe'),
'',
'warning');
79 $service =
'StripeLive';
82 $stripeacc = $stripe->getStripeAccount($service);
89 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
90 if ($optioncss !=
'') {
91 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
93 print
'<input type="hidden" name="token" value="'.newToken().
'">';
94 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
95 print
'<input type="hidden" name="action" value="list">';
96 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
97 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
98 print
'<input type="hidden" name="page" value="'.$page.
'">';
100 $title = $langs->trans(
"StripeTransactionList");
101 $title .= (!empty($stripeacc) ?
' (Stripe connection with Stripe OAuth Connect account '.$stripeacc.
')' :
' (Stripe connection with keys from Stripe module setup)');
103 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $totalnboflines,
'title_accountancy.png', 0,
'',
'', $limit);
105 print
'<div class="div-table-responsive">';
106 print
'<table class="tagtable liste'.(!empty($moreforfilter) ?
" listwithfilterbefore" :
"").
'">'.
"\n";
108 print
'<tr class="liste_titre">';
113 print_liste_field_titre(
"DatePayment", $_SERVER[
"PHP_SELF"],
"",
"",
"",
'', $sortfield, $sortorder,
'center ');
123 $txn = \Stripe\BalanceTransaction::all(array(
"limit" => $limit), array(
"stripe_account" => $stripeacc));
125 $txn = \Stripe\BalanceTransaction::all(array(
"limit" => $limit));
128 foreach ($txn->data as $txn) {
164 print
'<tr class="oddeven">';
167 if (!empty($stripeacc)) {
168 $connect = $stripeacc.
'/';
172 if (preg_match(
'/po_/i', $txn->source)) {
174 } elseif (preg_match(
'/fee_/i', $txn->source)) {
175 $origin =
"connect/application_fees";
177 $origin =
"payments";
180 $url =
'https://dashboard.stripe.com/'.$connect.
'test/'.$origin.
'/'.$txn->source;
181 if ($servicestatus) {
182 $url =
'https://dashboard.stripe.com/'.$connect.$origin.
'/'.$txn->source;
184 if ($txn->type ==
'stripe_fee' || $txn->type ==
'reserve_transaction') {
185 print
"<td>".$txn->type.
"</td>";
187 print
"<td><a href='".$url.
"' target='_stripe'>".
img_picto($langs->trans(
'ShowInStripe'),
'globe').
" ".$txn->source.
"</a></td>\n";
214 print
'<td class="center">'.dol_print_date($txn->created,
'dayhour').
"</td>\n";
216 print
'<td>'.$txn->type.
'</td>';
218 print
'<td class="right"><span class="amount">'.price(($txn->amount) / 100, 0,
'', 1, - 1, - 1, strtoupper($txn->currency)).
"</span></td>";
219 print
'<td class="right"><span class="amount">'.price(($txn->fee) / 100, 0,
'', 1, - 1, - 1, strtoupper($txn->currency)).
"</span></td>";
221 print
"<td class='right'>";
222 if ($txn->status ==
'available') {
223 print
img_picto($langs->trans($txn->status),
'statut4');
224 } elseif ($txn->status ==
'pending') {
225 print
img_picto($langs->trans($txn->status),
'statut7');
226 } elseif ($txn->status ==
'failed') {
227 print
img_picto($langs->trans($txn->status),
'statut8');
233 print
'<tr><td colspan="6">'.$e->getMessage().
'</td></td>';
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.
Class to manage members of a foundation.
Class to manage third parties objects (customers, suppliers, prospects...)
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formated messages to output (Used to show messages on html output).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.