22require
'../main.inc.php';
23require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
24require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
25require_once DOL_DOCUMENT_ROOT.
'/stripe/class/stripe.class.php';
27require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
30if (isModEnabled(
'accounting')) {
31 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
35$langs->loadLangs(array(
'compta',
'salaries',
'bills',
'hrm',
'stripe'));
40 $socid = $user->socid;
45$rowid =
GETPOST(
"rowid",
'alpha');
46$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
47$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
49if (empty($page) || $page == -1) {
52$offset = $limit * $page;
55$optioncss =
GETPOST(
'optioncss',
'alpha');
70llxHeader(
'', $langs->trans(
"StripePayoutList"));
73 $service =
'StripeTest';
75 dol_htmloutput_mesg($langs->trans(
'YouAreCurrentlyInSandboxMode',
'Stripe'),
'',
'warning');
77 $service =
'StripeLive';
81$stripeacc = $stripe->getStripeAccount($service);
91 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
92 if ($optioncss !=
'') {
93 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
95 print
'<input type="hidden" name="token" value="'.newToken().
'">';
96 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
97 print
'<input type="hidden" name="action" value="list">';
98 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
99 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
100 print
'<input type="hidden" name="page" value="'.$page.
'">';
102 $title = $langs->trans(
"StripePayoutList");
103 $title .= ($stripeacc ?
' (Stripe connection with Stripe OAuth Connect account '.$stripeacc.
')' :
' (Stripe connection with keys from Stripe module setup)');
105 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $totalnboflines,
'title_accountancy.png', 0,
'',
'', $limit);
107 print
'<div class="div-table-responsive">';
108 print
'<table class="tagtable liste'.(!empty($moreforfilter) ?
" listwithfilterbefore" :
"").
'">'.
"\n";
110 print
'<tr class="liste_titre">';
112 print_liste_field_titre(
"DatePayment", $_SERVER[
"PHP_SELF"],
"",
"",
"",
'', $sortfield, $sortorder,
'center ');
113 print_liste_field_titre(
"DateOperation", $_SERVER[
"PHP_SELF"],
"",
"",
"",
'', $sortfield, $sortorder,
'center ');
123 $payout = \Stripe\Payout::all(array(
"limit" => $limit), array(
"stripe_account" => $stripeacc));
125 $payout = \Stripe\Payout::all(array(
"limit" => $limit));
128 foreach ($payout->data as $payout) {
129 print
'<tr class="oddeven">';
132 if (!empty($stripeacc)) {
133 $connect = $stripeacc.
'/';
138 $url =
'https://dashboard.stripe.com/'.$connect.
'test/payouts/'.$payout->id;
139 if ($servicestatus) {
140 $url =
'https://dashboard.stripe.com/'.$connect.
'payouts/'.$payout->id;
143 print
"<td><a href='".$url.
"' target='_stripe'>".
img_picto($langs->trans(
'ShowInStripe'),
'globe').
" ".$payout->id.
"</a></td>\n";
146 print
'<td class="center">'.dol_print_date($payout->created,
'dayhour').
"</td>\n";
148 print
'<td class="center">'.dol_print_date($payout->arrival_date,
'dayhour').
"</td>\n";
150 print
'<td>'.$payout->description.
'</td>';
152 print
'<td class="right"><span class="amount">'.price(($payout->amount) / 100, 0,
'', 1, -1, -1, strtoupper($payout->currency)).
"</span></td>";
154 print
"<td class='right'>";
155 if ($payout->status ==
'paid') {
156 print
img_picto($langs->trans($payout->status),
'statut4');
157 } elseif ($payout->status ==
'pending') {
158 print
img_picto($langs->trans($payout->status),
'statut7');
159 } elseif ($payout->status ==
'in_transit') {
160 print
img_picto($langs->trans($payout->status),
'statut7');
161 } elseif ($payout->status ==
'failed') {
162 print
img_picto($langs->trans($payout->status),
'statut7');
163 } elseif ($payout->status ==
'canceled') {
164 print
img_picto($langs->trans($payout->status),
'statut8');
170 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.
Stripe class @TODO No reason to extends CommonObject.
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.
print_barre_liste($title, $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.
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 dolibarr global constant string value.
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.