diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 9dbef701f29..39a3c3bb28b 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -54,17 +54,18 @@ $pagenext = $page + 1; * View */ -llxHeader('', $langs->trans("StripeChargeList")); - $form = new Form($db); $societestatic = new Societe($db); $memberstatic = new Adherent($db); $acc = new Account($db); $stripe=new Stripe($db); + +llxHeader('', $langs->trans("StripeChargeList")); + if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))) { $service = 'StripeTest'; - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning'); + dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } else { @@ -91,20 +92,20 @@ if (!$rowid) $title=$langs->trans("StripeChargeList"); $title.=($stripeaccount?' (Stripe connection with Stripe OAuth Connect account '.$stripeaccount.')':' (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, '', '', $limit); print '
| ".$charge->id." | \n"; // Stripe customer print "".$charge->customer." | \n"; - // Employee + // Link print ""; if ($societestatic->id > 0) { @@ -190,7 +191,7 @@ if (!$rowid) // Amount print " | ".price(($charge->amount-$charge->amount_refunded)/100)." | "; // Status - print ""; + print ' | '; if ($charge->refunded=='1'){ print $langs->trans("refunded"); } elseif ($charge->paid=='1'){ diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index 0da3a838576..6628a3b46cd 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -18,6 +18,8 @@ // Put here all includes required by your class file require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; //require_once DOL_DOCUMENT_ROOT.'/core/lib/stripe.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -46,16 +48,21 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; - /* + + +/* * View */ -llxHeader('', $langs->trans("StripeTransactionList")); + $form = new Form($db); -$societestatic = new societe($db); +$societestatic = new Societe($db); +$memberstatic = new Adherent($db); $acc = new Account($db); $stripe = new Stripe($db); -if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) +llxHeader('', $langs->trans("StripeTransactionList")); + +if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))) { $service = 'StripeTest'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); @@ -66,10 +73,10 @@ else } $stripeaccount = $stripe->getStripeAccount($service); -if (empty($stripeaccount)) +/*if (empty($stripeaccount)) { print $langs->trans('ErrorStripeAccountNotDefined'); -} +}*/ if (! $rowid) { @@ -93,13 +100,14 @@ if (! $rowid) { print ' | |||||
| " . $txn->source . " | \n"; - // Employee - print "" . $societestatic->getNomUrl(1) . " | \n"; + // Stripe customer + //print "".$charge->customer." | \n"; + // Link + /*print ""; + if ($societestatic->id > 0) + { + print $societestatic->getNomUrl(1); + } + if ($memberstatic->id > 0) + { + print $memberstatic->getNomUrl(1); + } + print " | \n";*/ // Origine print ""; - if ($charge->metadata->source == "order") { + print $FULLTAG; + if ($charge->metadata->source=="order"){ $object = new Commande($db); $object->fetch($charge->metadata->idsource); - print "" . img_picto('', 'object_order') . " " . $object->ref . ""; - } elseif ($txn->metadata->source == "invoice") { + print "".img_picto('', 'object_order')." ".$object->ref.""; + } elseif ($charge->metadata->source=="invoice"){ $object = new Facture($db); - $object->fetch($txn->metadata->idsource); - print "" . img_picto('', 'object_invoice') . " " . $object->ref . ""; + $object->fetch($charge->metadata->idsource); + print "".img_picto('', 'object_invoice')." ".$object->ref.""; } print " | \n"; // Date payment print '' . dol_print_date($txn->created, '%d/%m/%Y %H:%M') . " | \n"; - // Label payment - print ""; - - print " | \n"; // Type print '' . $txn->type . ' | '; // Amount print "" . price(($txn->amount) / 100) . " | "; print "" . price(($txn->fee) / 100) . " | "; + // Status + print ""; + print $txn->status; + print ' | '; print "