Merge pull request #9467 from ptibogxiv/patch-59
update status display in charge list
This commit is contained in:
commit
ed2d215e19
@ -125,15 +125,19 @@ if (!$rowid)
|
||||
// Save into $tmparray all metadata
|
||||
$tmparray = dolExplodeIntoArray($FULLTAG,'.','=');
|
||||
// Load origin object according to metadata
|
||||
if (! empty($tmparray['CUS']))
|
||||
if (! empty($tmparray['CUS']) && $tmparray['CUS'] > 0)
|
||||
{
|
||||
$societestatic->fetch($tmparray['CUS']);
|
||||
}
|
||||
elseif (! empty($charge->metadata->dol_thirdparty_id) && $charge->metadata->dol_thirdparty_id > 0)
|
||||
{
|
||||
$societestatic->fetch($charge->metadata->dol_thirdparty_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$societestatic->id = 0;
|
||||
}
|
||||
if (! empty($tmparray['MEM']))
|
||||
if (! empty($tmparray['MEM']) && $tmparray['MEM'] > 0)
|
||||
{
|
||||
$memberstatic->fetch($tmparray['MEM']);
|
||||
}
|
||||
@ -142,9 +146,14 @@ if (!$rowid)
|
||||
$memberstatic->id = 0;
|
||||
}
|
||||
|
||||
print '<TR class="oddeven">';
|
||||
// Ref
|
||||
print "<TD><A href='".DOL_URL_ROOT."/stripe/charge.php?rowid=".$charge->id."'>".$charge->id."</A></TD>\n";
|
||||
print '<TR class="oddeven">';
|
||||
// Ref
|
||||
$url='https://dashboard.stripe.com/test/payments/'.$charge->id;
|
||||
if ($servicestatus)
|
||||
{
|
||||
$url='https://dashboard.stripe.com/payments/'.$charge->id;
|
||||
}
|
||||
print "<TD><a href='".$url."' target='_stripe'>".img_picto($langs->trans('ShowInStripe'), 'object_globe')." ".$charge->id."</a></TD>\n";
|
||||
// Stripe customer
|
||||
print "<TD>".$charge->customer."</TD>\n";
|
||||
// Link
|
||||
@ -153,23 +162,26 @@ if (!$rowid)
|
||||
{
|
||||
print $societestatic->getNomUrl(1);
|
||||
}
|
||||
if ($memberstatic->id > 0)
|
||||
elseif ($memberstatic->id > 0)
|
||||
{
|
||||
print $memberstatic->getNomUrl(1);
|
||||
}
|
||||
print "</TD>\n";
|
||||
// Origine
|
||||
print "<TD>";
|
||||
print $FULLTAG;
|
||||
if ($charge->metadata->source=="order"){
|
||||
if ($charge->metadata->dol_type=="order"){
|
||||
$object = new Commande($db);
|
||||
$object->fetch($charge->metadata->idsource);
|
||||
print "<A href='".DOL_URL_ROOT."/commande/card.php?id=".$charge->metadata->idsource."'>".img_picto('', 'object_order')." ".$object->ref."</A>";
|
||||
} elseif ($charge->metadata->source=="invoice"){
|
||||
$object->fetch($charge->metadata->dol_id);
|
||||
if ($object->id > 0) {
|
||||
print "<A href='".DOL_URL_ROOT."/commande/card.php?id=".$object->id."'>".img_picto('', 'object_order')." ".$object->ref."</A>";
|
||||
} else print $FULLTAG;
|
||||
} elseif ($charge->metadata->dol_type=="invoice"){
|
||||
$object = new Facture($db);
|
||||
$object->fetch($charge->metadata->idsource);
|
||||
print "<A href='".DOL_URL_ROOT."/compta/facture/card.php?facid=".$charge->metadata->idsource."'>".img_picto('', 'object_invoice')." ".$object->ref."</A>";
|
||||
}
|
||||
$object->fetch($charge->metadata->dol_id);
|
||||
if ($object->id > 0) {
|
||||
print "<A href='".DOL_URL_ROOT."/compta/facture/card.php?facid=".$charge->metadata->dol_id."'>".img_picto('', 'object_invoice')." ".$object->ref."</A>";
|
||||
} else print $FULLTAG;
|
||||
} else print $FULLTAG;
|
||||
print "</TD>\n";
|
||||
// Date payment
|
||||
print '<TD align="center">'.dol_print_date($charge->created,'%d/%m/%Y %H:%M')."</TD>\n";
|
||||
@ -190,14 +202,16 @@ if (!$rowid)
|
||||
// Status
|
||||
print '<TD align="right">';
|
||||
if ($charge->refunded=='1'){
|
||||
print $langs->trans("refunded");
|
||||
print img_picto($langs->trans("refunded"),'statut6');
|
||||
} elseif ($charge->paid=='1'){
|
||||
print $langs->trans("".$charge->status."");
|
||||
|
||||
print img_picto($langs->trans("".$charge->status.""),'statut4');
|
||||
|
||||
} else {
|
||||
$label="Message: ".$charge->failure_message."<br>";
|
||||
$label.="Réseau: ".$charge->outcome->network_status."<br>";
|
||||
$label.="Statut: ".$langs->trans("".$charge->outcome->seller_message."");
|
||||
print $form->textwithpicto($langs->trans("".$charge->status.""),$label,1);
|
||||
print $form->textwithpicto(img_picto($langs->trans("".$charge->status.""),'statut8'),$label,1);
|
||||
}
|
||||
print "</TD>\n";
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user