Update payout.php
This commit is contained in:
parent
d33a7ff4d4
commit
47d4483251
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?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>
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -65,8 +65,6 @@ $result = restrictedArea($user, 'banque');
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$societestatic = new Societe($db);
|
|
||||||
$memberstatic = new Adherent($db);
|
|
||||||
$acc = new Account($db);
|
$acc = new Account($db);
|
||||||
$stripe = new Stripe($db);
|
$stripe = new Stripe($db);
|
||||||
|
|
||||||
@ -129,47 +127,13 @@ if (!$rowid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($payout->data as $payout) {
|
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">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
if (!empty($stripeacc)) {
|
if (!empty($stripeacc)) {
|
||||||
$connect = $stripeacc.'/';
|
$connect = $stripeacc.'/';
|
||||||
}
|
} else $connect = null;
|
||||||
|
|
||||||
$url = 'https://dashboard.stripe.com/'.$connect.'test/payouts/'.$payout->id;
|
$url = 'https://dashboard.stripe.com/'.$connect.'test/payouts/'.$payout->id;
|
||||||
if ($servicestatus) {
|
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";
|
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
|
// Date payment
|
||||||
print '<td class="center">'.dol_print_date($payout->created, 'dayhour')."</td>\n";
|
print '<td class="center">'.dol_print_date($payout->created, 'dayhour')."</td>\n";
|
||||||
// Date payment
|
// Date payment
|
||||||
@ -215,15 +153,15 @@ if (!$rowid) {
|
|||||||
// Status
|
// Status
|
||||||
print "<td class='right'>";
|
print "<td class='right'>";
|
||||||
if ($payout->status == 'paid') {
|
if ($payout->status == 'paid') {
|
||||||
print img_picto($langs->trans("".$payout->status.""), 'statut4');
|
print img_picto($langs->trans($payout->status), 'statut4');
|
||||||
} elseif ($payout->status == 'pending') {
|
} 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') {
|
} 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') {
|
} elseif ($payout->status == 'failed') {
|
||||||
print img_picto($langs->trans("".$payout->status.""), 'statut7');
|
print img_picto($langs->trans($payout->status), 'statut7');
|
||||||
} elseif ($payout->status == 'canceled') {
|
} elseif ($payout->status == 'canceled') {
|
||||||
print img_picto($langs->trans("".$payout->status.""), 'statut8');
|
print img_picto($langs->trans($payout->status), 'statut8');
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user