mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Update payout.php
This commit is contained in:
parent
d33a7ff4d4
commit
47d4483251
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
|
||||
/* Copyright (C) 2018-2023 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -65,8 +65,6 @@ $result = restrictedArea($user, 'banque');
|
|||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$societestatic = new Societe($db);
|
||||
$memberstatic = new Adherent($db);
|
||||
$acc = new Account($db);
|
||||
$stripe = new Stripe($db);
|
||||
|
||||
|
|
@ -129,47 +127,13 @@ if (!$rowid) {
|
|||
}
|
||||
|
||||
foreach ($payout->data as $payout) {
|
||||
//$charge = $payout;
|
||||
//var_dump($payout);
|
||||
|
||||
// The metadata FULLTAG is defined by the online payment page
|
||||
/*$FULLTAG=$charge->metadata->FULLTAG;
|
||||
|
||||
// Save into $tmparray all metadata
|
||||
$tmparray = dolExplodeIntoArray($FULLTAG,'.','=');
|
||||
// Load origin object according to metadata
|
||||
if (!empty($tmparray['CUS']))
|
||||
{
|
||||
$societestatic->fetch($tmparray['CUS']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$societestatic->id = 0;
|
||||
}
|
||||
if (!empty($tmparray['MEM']))
|
||||
{
|
||||
$memberstatic->fetch($tmparray['MEM']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$memberstatic->id = 0;
|
||||
}*/
|
||||
|
||||
$societestatic->fetch($charge->metadata->idcustomer);
|
||||
$societestatic->id = $charge->metadata->idcustomer;
|
||||
$societestatic->lastname = $obj->lastname;
|
||||
$societestatic->firstname = $obj->firstname;
|
||||
$societestatic->admin = $obj->admin;
|
||||
$societestatic->login = $obj->login;
|
||||
$societestatic->email = $obj->email;
|
||||
$societestatic->socid = $obj->fk_soc;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref
|
||||
if (!empty($stripeacc)) {
|
||||
$connect = $stripeacc.'/';
|
||||
}
|
||||
} else $connect = null;
|
||||
|
||||
$url = 'https://dashboard.stripe.com/'.$connect.'test/payouts/'.$payout->id;
|
||||
if ($servicestatus) {
|
||||
|
|
@ -178,32 +142,6 @@ if (!$rowid) {
|
|||
|
||||
print "<td><a href='".$url."' target='_stripe'>".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$payout->id."</a></td>\n";
|
||||
|
||||
|
||||
// Stripe customer
|
||||
//print "<td>".$charge->customer."</td>\n";
|
||||
// Link
|
||||
/*print "<td>";
|
||||
if ($societestatic->id > 0)
|
||||
{
|
||||
print $societestatic->getNomUrl(1);
|
||||
}
|
||||
if ($memberstatic->id > 0)
|
||||
{
|
||||
print $memberstatic->getNomUrl(1);
|
||||
}
|
||||
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>";
|
||||
//} 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 "</td>\n";
|
||||
// Date payment
|
||||
print '<td class="center">'.dol_print_date($payout->created, 'dayhour')."</td>\n";
|
||||
// Date payment
|
||||
|
|
@ -215,15 +153,15 @@ if (!$rowid) {
|
|||
// Status
|
||||
print "<td class='right'>";
|
||||
if ($payout->status == 'paid') {
|
||||
print img_picto($langs->trans("".$payout->status.""), 'statut4');
|
||||
print img_picto($langs->trans($payout->status), 'statut4');
|
||||
} elseif ($payout->status == 'pending') {
|
||||
print img_picto($langs->trans("".$payout->status.""), 'statut7');
|
||||
print img_picto($langs->trans($payout->status), 'statut7');
|
||||
} elseif ($payout->status == 'in_transit') {
|
||||
print img_picto($langs->trans("".$payout->status.""), 'statut7');
|
||||
print img_picto($langs->trans($payout->status), 'statut7');
|
||||
} elseif ($payout->status == 'failed') {
|
||||
print img_picto($langs->trans("".$payout->status.""), 'statut7');
|
||||
print img_picto($langs->trans($payout->status), 'statut7');
|
||||
} elseif ($payout->status == 'canceled') {
|
||||
print img_picto($langs->trans("".$payout->status.""), 'statut8');
|
||||
print img_picto($langs->trans($payout->status), 'statut8');
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user