diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 56a7529fd9a5d4c565eab53ebb671bc6d86257c8..50f80da1c8955b2ed5275c3c6a8fc0b5aa5f8069 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -84,66 +84,12 @@ print $bprev->NbFactureAPrelever(); print '</a>'; print '</td></tr>'; $var=!$var; -print '<tr class="liste_total"><td>'.$langs->trans("AmountToWithdraw").'</td>'; +print '<tr '.$bc[$var].'><td>'.$langs->trans("AmountToWithdraw").'</td>'; print '<td align="right">'; -print price($bprev->SommeAPrelever()); +print price($bprev->SommeAPrelever(),'','',1,-1,-1,'auto'); print '</td></tr></table><br>'; -print '</div><div class="fichetwothirdright"><div class="ficheaddleft">'; - - -/* - * Withdraw receipts - */ -$limit=5; -$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut"; -$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; -$sql.= " ORDER BY datec DESC"; -$sql.= $db->plimit($limit); - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - $var=True; - - print"\n<!-- debut table -->\n"; - print '<table class="noborder" width="100%">'; - print '<tr class="liste_titre"><td>'.$langs->trans("LastWithdrawalReceipt",$limit).'</td>'; - print '<td>'.$langs->trans("Date").'</td>'; - print '<td align="right">'.$langs->trans("Amount").'</td>'; - print '<td align="right">'.$langs->trans("Status").'</td>'; - print '</tr>'; - - while ($i < min($num,$limit)) - { - $obj = $db->fetch_object($result); - $var=!$var; - - print "<tr ".$bc[$var].">"; - - print "<td>"; - $bprev->id=$obj->rowid; - $bprev->ref=$obj->ref; - $bprev->statut=$obj->statut; - print $bprev->getNomUrl(1); - print "</td>\n"; - print '<td>'.dol_print_date($db->jdate($obj->datec),"dayhour")."</td>\n"; - print '<td align="right">'.price($obj->amount)."</td>\n"; - print '<td align="right">'.$bprev->getLibStatut(3)."</td>\n"; - - print "</tr>\n"; - $i++; - } - print "</table><br>"; - $db->free($result); -} -else -{ - dol_print_error($db); -} /* * Invoices waiting for withdraw @@ -222,6 +168,62 @@ else } +print '</div><div class="fichetwothirdright"><div class="ficheaddleft">'; + + +/* + * Withdraw receipts + */ +$limit=5; +$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut"; +$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; +$sql.= " ORDER BY datec DESC"; +$sql.= $db->plimit($limit); + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows($result); + $i = 0; + $var=True; + + print"\n<!-- debut table -->\n"; + print '<table class="noborder" width="100%">'; + print '<tr class="liste_titre"><td>'.$langs->trans("LastWithdrawalReceipt",$limit).'</td>'; + print '<td>'.$langs->trans("Date").'</td>'; + print '<td align="right">'.$langs->trans("Amount").'</td>'; + print '<td align="right">'.$langs->trans("Status").'</td>'; + print '</tr>'; + + while ($i < min($num,$limit)) + { + $obj = $db->fetch_object($result); + $var=!$var; + + print "<tr ".$bc[$var].">"; + + print "<td>"; + $bprev->id=$obj->rowid; + $bprev->ref=$obj->ref; + $bprev->statut=$obj->statut; + print $bprev->getNomUrl(1); + print "</td>\n"; + print '<td>'.dol_print_date($db->jdate($obj->datec),"dayhour")."</td>\n"; + print '<td align="right">'.price($obj->amount)."</td>\n"; + print '<td align="right">'.$bprev->getLibStatut(3)."</td>\n"; + + print "</tr>\n"; + $i++; + } + print "</table><br>"; + $db->free($result); +} +else +{ + dol_print_error($db); +} + + print '</div></div></div>'; llxFooter(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 05d2d75bf9f76dea4ac9699f9b9fc84d524e9df1..efcbff69a137c0266d5e1525df887837763f870e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2689,7 +2689,7 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0) * @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL) * @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force) - * @param string $currency_code To add currency symbol (''=add nothing, 'XXX'=add currency symbols for XXX currency) + * @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency) * @return string Chaine avec montant formate * * @see price2num Revert function of price @@ -2751,6 +2751,8 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou $cursymbolbefore=$cursymbolafter=''; if ($currency_code) { + if ($currency_code == 'auto') $currency_code=$conf->currency; + $listofcurrenciesbefore=array('USD'); if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code); else $cursymbolafter.=$outlangs->getCurrencySymbol($currency_code); diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index 91d4a473d6e73c244b892835339c87c39148ee26..d3dd7c9ca7c62cedb728e29b9f9077330c63cbe8 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -18,8 +18,8 @@ RequestStandingOrderToTreat=Request for standing orders to treat RequestStandingOrderTreated=Request for standing orders treated CustomersStandingOrders=Customer standing orders CustomerStandingOrder=Customer standing order -NbOfInvoiceToWithdraw=No. of invoice with withdraw request -NbOfInvoiceToWithdrawWithInfo=No. of invoice with withdraw request for customers having defined bank account information +NbOfInvoiceToWithdraw=Nb. of invoice with withdraw request +NbOfInvoiceToWithdrawWithInfo=Nb. of invoice with withdraw request for customers having defined bank account information InvoiceWaitingWithdraw=Invoice waiting for withdraw AmountToWithdraw=Amount to withdraw WithdrawsRefused=Withdraws refused