Minor fix into standing order.

This commit is contained in:
Laurent Destailleur
2014-03-17 20:43:01 +01:00
parent 20006a1347
commit 7eea96c07c
3 changed files with 63 additions and 59 deletions

View File

@@ -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();

View File

@@ -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);

View File

@@ -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