23require
'../main.inc.php';
24require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
25require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
26require_once DOL_DOCUMENT_ROOT.
'/stripe/class/stripe.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
31if (isModEnabled(
'accounting')) {
32 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
44$langs->loadLangs(array(
'compta',
'salaries',
'bills',
'hrm',
'stripe'));
49 $socid = $user->socid;
54$rowid =
GETPOST(
"rowid",
'alpha');
55$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
56$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
58if (empty($page) || $page == -1) {
61$offset = $limit * $page;
64$optioncss =
GETPOST(
'optioncss',
'alpha');
76$societestatic =
new Societe($db);
81llxHeader(
'', $langs->trans(
"StripeTransactionList"));
84 $service =
'StripeTest';
86 dol_htmloutput_mesg($langs->trans(
'YouAreCurrentlyInSandboxMode',
'Stripe'), [],
'warning');
88 $service =
'StripeLive';
91$stripeacc = $stripe->getStripeAccount($service);
98 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
99 if ($optioncss !=
'') {
100 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
102 print
'<input type="hidden" name="token" value="'.newToken().
'">';
103 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
104 print
'<input type="hidden" name="action" value="list">';
105 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
106 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
107 print
'<input type="hidden" name="page" value="'.$page.
'">';
109 $title = $langs->trans(
"StripeTransactionList");
110 $title .= (!empty($stripeacc) ?
' (Stripe connection with Stripe OAuth Connect account '.$stripeacc.
')' :
' (Stripe connection with keys from Stripe module setup)');
112 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $totalnboflines,
'title_accountancy.png', 0,
'',
'', $limit);
114 print
'<div class="div-table-responsive">';
115 print
'<table class="tagtable liste'.(!empty($moreforfilter) ?
" listwithfilterbefore" :
"").
'">'.
"\n";
117 print
'<tr class="liste_titre">';
119 print_liste_field_titre(
"DatePayment", $_SERVER[
"PHP_SELF"],
"",
"",
"",
'', $sortfield, $sortorder,
'center ');
129 $txn_all = \Stripe\BalanceTransaction::all(array(
"limit" => $limit), array(
"stripe_account" => $stripeacc));
131 $txn_all = \Stripe\BalanceTransaction::all(array(
"limit" => $limit));
133 '@phan-var-force \Stripe\BalanceTransaction $txn_all';
135 foreach ($txn_all->data as $txn) {
136 '@phan-var-force \Stripe\BalanceTransaction $txn';
172 print
'<tr class="oddeven">';
175 if (!empty($stripeacc)) {
176 $connect = $stripeacc.
'/';
180 if (preg_match(
'/po_/i', $txn->source)) {
182 } elseif (preg_match(
'/fee_/i', $txn->source)) {
183 $origin =
"connect/application_fees";
185 $origin =
"payments";
188 $url =
'https://dashboard.stripe.com/'.$connect.
'test/'.$origin.
'/'.$txn->source;
189 if ($servicestatus) {
190 $url =
'https://dashboard.stripe.com/'.$connect.$origin.
'/'.$txn->source;
192 if ($txn->type ==
'stripe_fee' || $txn->type ==
'reserve_transaction') {
193 print
"<td>".$txn->type.
"</td>";
195 print
"<td><a href='".$url.
"' target='_stripe'>".
img_picto($langs->trans(
'ShowInStripe'),
'globe').
" ".$txn->source.
"</a></td>\n";
222 print
'<td class="center">'.dol_print_date($txn->created,
'dayhour').
"</td>\n";
224 print
'<td>'.$txn->type.
'</td>';
226 print
'<td class="right"><span class="amount">'.price(($txn->amount) / 100, 0,
'', 1, - 1, - 1, strtoupper($txn->currency)).
"</span></td>";
227 print
'<td class="right"><span class="amount">'.price(($txn->fee) / 100, 0,
'', 1, - 1, - 1, strtoupper($txn->currency)).
"</span></td>";
229 print
"<td class='right'>";
230 if ($txn->status ==
'available') {
231 print
img_picto($langs->trans($txn->status),
'statut4');
232 } elseif ($txn->status ==
'pending') {
233 print
img_picto($langs->trans($txn->status),
'statut7');
234 } elseif ($txn->status ==
'failed') {
235 print
img_picto($langs->trans($txn->status),
'statut8');
241 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage bank accounts.
Class to manage members of a foundation.
Class to manage third parties objects (customers, suppliers, prospects...)
Stripe class @TODO No reason to extends CommonObject.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formatted messages to output (Used to show messages on html output).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.