Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
fc59193123
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2015-2019 Frederic France <frederic.france@free.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
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -85,7 +85,7 @@ class box_fournisseurs extends ModeleBoxes
|
|||||||
if ($user->rights->societe->lire)
|
if ($user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status,";
|
$sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status,";
|
||||||
$sql.= " s.code_fournisseur,";
|
$sql.= " s.code_fournisseur, s.email as semail,";
|
||||||
$sql.= " s.logo";
|
$sql.= " s.logo";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -109,6 +109,7 @@ class box_fournisseurs extends ModeleBoxes
|
|||||||
$datem=$this->db->jdate($objp->tms);
|
$datem=$this->db->jdate($objp->tms);
|
||||||
$thirdpartytmp->id = $objp->socid;
|
$thirdpartytmp->id = $objp->socid;
|
||||||
$thirdpartytmp->name = $objp->name;
|
$thirdpartytmp->name = $objp->name;
|
||||||
|
$thirdpartytmp->email = $objp->semail;
|
||||||
$thirdpartytmp->code_client = $objp->code_client;
|
$thirdpartytmp->code_client = $objp->code_client;
|
||||||
$thirdpartytmp->logo = $objp->logo;
|
$thirdpartytmp->logo = $objp->logo;
|
||||||
|
|
||||||
|
|||||||
@ -1307,19 +1307,21 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||||||
$balance = \Stripe\Balance::retrieve(array("stripe_account" => $stripesupplieracc));
|
$balance = \Stripe\Balance::retrieve(array("stripe_account" => $stripesupplieracc));
|
||||||
print '<table class="liste" width="100%">'."\n";
|
print '<table class="liste" width="100%">'."\n";
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans('Status').'</td>';
|
|
||||||
print '<td>'.$langs->trans('Amount').'</td>';
|
|
||||||
print '<td>'.$langs->trans('Currency').'</td>';
|
print '<td>'.$langs->trans('Currency').'</td>';
|
||||||
|
print '<td>'.$langs->trans('Available').'</td>';
|
||||||
|
print '<td>'.$langs->trans('Pending').'</td>';
|
||||||
|
print '<td>'.$langs->trans('Total').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
$currencybalance = array();
|
||||||
if (is_array($balance->available) && count($balance->available))
|
if (is_array($balance->available) && count($balance->available))
|
||||||
{
|
{
|
||||||
foreach ($balance->available as $cpt)
|
foreach ($balance->available as $cpt)
|
||||||
{
|
{
|
||||||
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
|
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
|
||||||
if (! in_array($cpt->currency, $arrayzerounitcurrency)) $amount = $cpt->amount / 100;
|
if (! in_array($cpt->currency, $arrayzerounitcurrency)) $currencybalance[$cpt->currency]->available=$cpt->amount / 100;
|
||||||
else $amount = $cpt->amount;
|
else $currencybalance[$cpt->currency]->available=$cpt->amount;
|
||||||
print '<tr><td>'.$langs->trans("Available").'</td><td>'.price($amount, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).' </td><td>'.$langs->trans("Currency".strtoupper($cpt->currency)).'</td></tr>';
|
$currencybalance[$cpt->currency]->currency=$cpt->currency;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1328,11 +1330,19 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||||||
foreach ($balance->pending as $cpt)
|
foreach ($balance->pending as $cpt)
|
||||||
{
|
{
|
||||||
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
|
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
|
||||||
if (! in_array($cpt->currency, $arrayzerounitcurrency)) $amount = $cpt->amount / 100;
|
if (! in_array($cpt->currency, $arrayzerounitcurrency)) $currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount / 100;
|
||||||
else $amount = $cpt->amount;
|
else $currencybalance[$cpt->currency]->pending=$currencybalance[$cpt->currency]->available+$cpt->amount;
|
||||||
print '<tr><td>'.$langs->trans("Pending").'</td><td>'.price($amount, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).' </td><td>'.$langs->trans("Currency".strtoupper($cpt->currency)).'</td></tr>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_array($currencybalance))
|
||||||
|
{
|
||||||
|
foreach ($currencybalance as $cpt)
|
||||||
|
{
|
||||||
|
print '<tr><td>'.$langs->trans("Currency".strtoupper($cpt->currency)).'</td><td>'.price($cpt->available, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).'</td><td>'.price($cpt->pending, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).'</td><td>'.price($cpt->available+$cpt->pending, 0, '', 1, - 1, - 1, strtoupper($cpt->currency)).'</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user