diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 2ae2c858b46..8f753e3b7b5 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -80,6 +80,28 @@ $stripeacc = $stripe->getStripeAccount($service); if (!$rowid) { + $option = array('limit' => $limit + 1); + if (GETPOSTISSET('starting_after_'.$page)) $option['starting_after'] = GETPOST('starting_after_'.$page, 'alphanohtml'); + if ($stripeacc) + { + $list = \Stripe\Charge::all($option, array("stripe_account" => $stripeacc)); + } + else + { + $list = \Stripe\Charge::all($option); + } + + $num = count($list->data); + $totalnboflines = ''; + + $param = ''; + //if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + $param.='&starting_after_'.($page+1).'='.$list->data[($limit-1)]->id; + //$param.='&ending_before_'.($page+1).'='.$list->data[($limit-1)]->id; + + $moreforfilter = ''; + print '
'; if ($optioncss != '') print ''; print ''; @@ -92,7 +114,7 @@ if (!$rowid) $title = $langs->trans("StripeChargeList"); $title .= ($stripeacc ? ' (Stripe connection with Stripe OAuth Connect account '.$stripeacc.')' : ' (Stripe connection with keys from Stripe module setup)'); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, '', 'hidepaginationprevious', $limit); print '
'; print ''."\n"; @@ -108,29 +130,23 @@ if (!$rowid) print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right '); print "\n"; - print "\n"; - - if ($stripeacc) - { - $list=\Stripe\Charge::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); - } - else - { - $list=\Stripe\Charge::all(array("limit" => $limit)); - } - //print $list; + $i = 0; foreach ($list->data as $charge) { + if ($i >= $limit) { + break; + } + if ($charge->refunded=='1') { $status = img_picto($langs->trans("refunded"), 'statut6'); } elseif ($charge->paid=='1') { - $status = img_picto($langs->trans("".$charge->status.""), 'statut4'); + $status = img_picto($langs->trans((string) $charge->status), 'statut4'); } else { - $label="Message: ".$charge->failure_message."
"; - $label.="Réseau: ".$charge->outcome->network_status."
"; - $label.="Statut: ".$langs->trans("".$charge->outcome->seller_message.""); - $status = $form->textwithpicto(img_picto($langs->trans("".$charge->status.""), 'statut8'), $label, 1); + $label = $langs->trans("Message").": ".$charge->failure_message."
"; + $label.= $langs->trans("Network").": ".$charge->outcome->network_status."
"; + $label.= $langs->trans("Status").": ".$langs->trans((string) $charge->outcome->seller_message); + $status = $form->textwithpicto(img_picto($langs->trans((string) $charge->status), 'statut8'), $label, -1); } if ($charge->payment_method_details->type=='card') { @@ -145,13 +161,14 @@ if (!$rowid) $type = $langs->trans("iDEAL"); } - if (! empty($charge->payment_intent)) { + // Why this ? + /*if (! empty($charge->payment_intent)) { if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); } else { $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); } - } + }*/ // The metadata FULLTAG is defined by the online payment page $FULLTAG = $charge->metadata->FULLTAG; @@ -192,7 +209,9 @@ if (!$rowid) } print "\n"; + // Stripe customer print "\n"; + // Link print "\n"; - // Origine + + // Origin print "\n"; + // Date payment print '\n"; // Type @@ -253,8 +276,9 @@ if (!$rowid) print "\n"; print "\n"; + + $i++; } -} else { } // End of page diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 23119b4c8c8..efe17c67e03 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3161,7 +3161,12 @@ div.pagination li.paginationafterarrows { .paginationatbottom { margin-top: 9px; } - +table.hidepaginationprevious .paginationprevious { + display: none; +} +table.hidepaginationnext .paginationnext { + display: none; +} diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 2a1aa367656..8f03e70f460 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3149,6 +3149,13 @@ div.pagination li.paginationafterarrows { .paginationatbottom { margin-top: 9px; } +table.hidepaginationprevious .paginationprevious { + display: none; +} +table.hidepaginationnext .paginationnext { + display: none; +} + /* Prepare to remove class pair - impair .noborder > tbody > tr:nth-child(even) td {
"; print "".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$charge->id.""; + if ($charge->payment_intent) print '
'.$charge->payment_intent.''; print "
"; if (!empty($conf->stripe->enabled) && !empty($stripeacc)) $connect = $stripeacc.'/'; @@ -206,6 +225,7 @@ if (!$rowid) print ''.img_picto($langs->trans('ShowInStripe'), 'globe').' '.$charge->customer.''; } print ""; if ($societestatic->id > 0) @@ -217,7 +237,8 @@ if (!$rowid) print $memberstatic->getNomUrl(1); } print ""; if ($charge->metadata->dol_type=="order" || $charge->metadata->dol_type=="commande") { $object = new Commande($db); @@ -228,6 +249,7 @@ if (!$rowid) print $FULLTAG; } } elseif ($charge->metadata->dol_type=="invoice" || $charge->metadata->dol_type=="facture") { + print $charge->metadata->dol_type.' '.$charge->metadata->dol_id.' - '; $object = new Facture($db); $object->fetch($charge->metadata->dol_id); if ($object->id > 0) { @@ -239,6 +261,7 @@ if (!$rowid) print $FULLTAG; } print "'.dol_print_date($charge->created, '%d/%m/%Y %H:%M')."