Update transaction.php
This commit is contained in:
parent
35f2f5f48c
commit
3c5a9326e1
@ -26,9 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
if (! empty($conf->accounting->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
}
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('compta', 'salaries', 'bills', 'hrm', 'stripe'));
|
||||
@ -65,13 +63,13 @@ llxHeader('', $langs->trans("StripeTransactionList"));
|
||||
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha')))
|
||||
{
|
||||
$service = 'StripeTest';
|
||||
$servicestatus = '0';
|
||||
$servicestatus = '0';
|
||||
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning');
|
||||
}
|
||||
else
|
||||
{
|
||||
$service = 'StripeLive';
|
||||
$servicestatus = '1';
|
||||
$service = 'StripeLive';
|
||||
$servicestatus = '1';
|
||||
}
|
||||
|
||||
$stripeaccount = $stripe->getStripeAccount($service);
|
||||
@ -82,25 +80,25 @@ $stripeaccount = $stripe->getStripeAccount($service);
|
||||
|
||||
if (! $rowid) {
|
||||
|
||||
print '<FORM method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
if ($optioncss != '')
|
||||
print '<INPUT type="hidden" name="optioncss" value="' . $optioncss . '">';
|
||||
print '<INPUT type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<INPUT type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<INPUT type="hidden" name="action" value="list">';
|
||||
print '<INPUT type="hidden" name="sortfield" value="' . $sortfield . '">';
|
||||
print '<INPUT type="hidden" name="sortorder" value="' . $sortorder . '">';
|
||||
print '<INPUT type="hidden" name="page" value="' . $page . '">';
|
||||
print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
|
||||
print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
|
||||
print '<input type="hidden" name="page" value="' . $page . '">';
|
||||
|
||||
$title=$langs->trans("StripeTransactionList");
|
||||
$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 '<DIV class="div-table-responsive">';
|
||||
print '<TABLE class="tagtable liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
|
||||
|
||||
print '<TR class="liste_titre">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
|
||||
//print_liste_field_titre("StripeCustomerId",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
|
||||
//print_liste_field_titre("CustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
|
||||
@ -110,9 +108,9 @@ if (! $rowid) {
|
||||
print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Fee", $_SERVER["PHP_SELF"], "", "", "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", 'align="right"');
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
if ($stripeaccount)
|
||||
{
|
||||
@ -123,11 +121,11 @@ if (! $rowid) {
|
||||
$txn = \Stripe\BalanceTransaction::all(array("limit" => $limit));
|
||||
}
|
||||
|
||||
foreach ($txn->data as $txn)
|
||||
foreach ($txn->data as $txn)
|
||||
{
|
||||
//$charge = $txn;
|
||||
//var_dump($txn);
|
||||
|
||||
|
||||
// The metadata FULLTAG is defined by the online payment page
|
||||
/*$FULLTAG=$charge->metadata->FULLTAG;
|
||||
|
||||
@ -150,7 +148,7 @@ if (! $rowid) {
|
||||
{
|
||||
$memberstatic->id = 0;
|
||||
}*/
|
||||
|
||||
|
||||
$societestatic->fetch($charge->metadata->idcustomer);
|
||||
$societestatic->id = $charge->metadata->idcustomer;
|
||||
$societestatic->lastname = $obj->lastname;
|
||||
@ -160,7 +158,7 @@ if (! $rowid) {
|
||||
$societestatic->email = $obj->email;
|
||||
$societestatic->societe_id = $obj->fk_soc;
|
||||
|
||||
print '<TR class="oddeven">';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref
|
||||
if (! empty($conf->stripe->enabled) && !empty($stripeacc)) $connect=$stripeacc.'/';
|
||||
@ -179,7 +177,10 @@ if (! $rowid) {
|
||||
{
|
||||
$url='https://dashboard.stripe.com/'.$connect.$origin.'/'.$txn->source;
|
||||
}
|
||||
print "<TD><A href='".$url."' target='_stripe'>".img_picto($langs->trans('ShowInStripe'), 'object_globe')." " . $txn->source . "</A></TD>\n";
|
||||
if ($txn->type == 'stripe_fee' || $txn->type == 'reserve_transaction') {
|
||||
print "<td>".$txn->type."</td>";
|
||||
} else print "<td><a href='".$url."' target='_stripe'>".img_picto($langs->trans('ShowInStripe'), 'object_globe')." " . $txn->source . "</a></td>\n";
|
||||
|
||||
// Stripe customer
|
||||
//print "<td>".$charge->customer."</td>\n";
|
||||
// Link
|
||||
@ -194,16 +195,15 @@ if (! $rowid) {
|
||||
}
|
||||
print "</td>\n";*/
|
||||
// Origine
|
||||
|
||||
//print "<td>";
|
||||
////if ($charge->metadata->dol_type=="order"){
|
||||
// $object = new Commande($db);
|
||||
// $object->fetch($charge->metadata->dol_id);
|
||||
// print "<A href='".DOL_URL_ROOT."/commande/card.php?id=".$charge->metadata->dol_id."'>".img_picto('', 'object_order')." ".$object->ref."</A>";
|
||||
// print "<a href='".DOL_URL_ROOT."/commande/card.php?id=".$charge->metadata->dol_id."'>".img_picto('', 'object_order')." ".$object->ref."</a>";
|
||||
//} elseif ($charge->metadata->dol_type=="invoice"){
|
||||
// $object = new Facture($db);
|
||||
// $object->fetch($charge->metadata->dol_id);
|
||||
// print "<A href='".DOL_URL_ROOT."/compta/facture/card.php?facid=".$charge->metadata->dol_id."'>".img_picto('', 'object_invoice')." ".$object->ref."</A>";
|
||||
// print "<a href='".DOL_URL_ROOT."/compta/facture/card.php?facid=".$charge->metadata->dol_id."'>".img_picto('', 'object_invoice')." ".$object->ref."</a>";
|
||||
//}
|
||||
//print "</td>\n";
|
||||
// Date payment
|
||||
@ -215,13 +215,12 @@ if (! $rowid) {
|
||||
print "<td align=\"right\">" . price(($txn->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)) . "</td>";
|
||||
// Status
|
||||
print "<td align='right'>";
|
||||
if ($txn->status=='available') {
|
||||
print img_picto($langs->trans("".$txn->status.""),'statut4');
|
||||
} elseif ($txn->status=='pending') {
|
||||
print img_picto($langs->trans("".$txn->status.""),'statut7');
|
||||
} elseif ($txn->status=='failed') {
|
||||
print img_picto($langs->trans("".$txn->status.""),'statut8');
|
||||
}
|
||||
if ($txn->status=='available')
|
||||
{print img_picto($langs->trans("".$txn->status.""),'statut4');}
|
||||
elseif ($txn->status=='pending')
|
||||
{print img_picto($langs->trans("".$txn->status.""),'statut7');}
|
||||
elseif ($txn->status=='failed')
|
||||
{print img_picto($langs->trans("".$txn->status.""),'statut8');}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user