diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 56a7529fd9a..50f80da1c89 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -84,66 +84,12 @@ print $bprev->NbFactureAPrelever(); print ''; print ''; $var=!$var; -print ''.$langs->trans("AmountToWithdraw").''; +print ''.$langs->trans("AmountToWithdraw").''; print ''; -print price($bprev->SommeAPrelever()); +print price($bprev->SommeAPrelever(),'','',1,-1,-1,'auto'); print '
'; -print '
'; - - -/* - * 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\n"; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - while ($i < min($num,$limit)) - { - $obj = $db->fetch_object($result); - $var=!$var; - - print ""; - - print "\n"; - print '\n"; - print '\n"; - print '\n"; - - print "\n"; - $i++; - } - print "
'.$langs->trans("LastWithdrawalReceipt",$limit).''.$langs->trans("Date").''.$langs->trans("Amount").''.$langs->trans("Status").'
"; - $bprev->id=$obj->rowid; - $bprev->ref=$obj->ref; - $bprev->statut=$obj->statut; - print $bprev->getNomUrl(1); - print "'.dol_print_date($db->jdate($obj->datec),"dayhour")."'.price($obj->amount)."'.$bprev->getLibStatut(3)."

"; - $db->free($result); -} -else -{ - dol_print_error($db); -} /* * Invoices waiting for withdraw @@ -222,6 +168,62 @@ else } +print '
'; + + +/* + * 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\n"; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + while ($i < min($num,$limit)) + { + $obj = $db->fetch_object($result); + $var=!$var; + + print ""; + + print "\n"; + print '\n"; + print '\n"; + print '\n"; + + print "\n"; + $i++; + } + print "
'.$langs->trans("LastWithdrawalReceipt",$limit).''.$langs->trans("Date").''.$langs->trans("Amount").''.$langs->trans("Status").'
"; + $bprev->id=$obj->rowid; + $bprev->ref=$obj->ref; + $bprev->statut=$obj->statut; + print $bprev->getNomUrl(1); + print "'.dol_print_date($db->jdate($obj->datec),"dayhour")."'.price($obj->amount)."'.$bprev->getLibStatut(3)."

"; + $db->free($result); +} +else +{ + dol_print_error($db); +} + + print '
'; llxFooter(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 05d2d75bf9f..efcbff69a13 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 91d4a473d6e..d3dd7c9ca7c 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