Fix: Bad translation of payment type

This commit is contained in:
Laurent Destailleur 2010-07-25 21:23:57 +00:00
parent 2809631a4f
commit be1ef0ccbe
3 changed files with 13 additions and 7 deletions

View File

@ -515,8 +515,9 @@ if ($account || $_GET["ref"])
// Payment type
print "<td nowrap>";
if ($objp->fk_type == 'SOLD') print '&nbsp;';
else print $langs->trans("PaymentTypeShort".$objp->fk_type);
$label=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$objp->fk_type;
if ($objp->fk_type == 'SOLD') $label='&nbsp;';
print $label;
print "</td>\n";
print '<td nowrap>'.($objp->num_chq?$objp->num_chq:"")."</td>\n";

View File

@ -227,7 +227,9 @@ if ($resql)
}
// Number
print '<td nowrap="nowrap">'.$objp->type.($objp->num_chq?' '.$objp->num_chq:'').'</td>';
$label=($langs->trans("PaymentType".$objp->type)!="PaymentType".$objp->type)?$langs->trans("PaymentType".$objp->type):$objp->type; // $objp->type is a code
if ($label=='SOLD') $label='';
print '<td nowrap="nowrap">'.$label.($objp->num_chq?' '.$objp->num_chq:'').'</td>';
// Description
print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'">';

View File

@ -25,7 +25,7 @@
/**
* \file htdocs/compta/facture.php
* \ingroup facture
* \brief Page de creation/visu facture
* \brief Page to cree=ate/see an invoice
* \version $Id$
*/
@ -1348,6 +1348,7 @@ $html = new Form($db);
$formfile = new FormFile($db);
/*********************************************************************
*
* Mode creation
@ -2395,8 +2396,9 @@ else
*/
// Payments already done (from payment on this invoice)
$sql = 'SELECT datep as dp, pf.amount,';
$sql.= ' c.libelle as paiement_type, p.num_paiement, p.rowid';
$sql = 'SELECT p.datep as dp, p.num_paiement, p.rowid,';
$sql.= ' c.code as payment_code, c.libelle as payment_label,';
$sql.= ' pf.amount';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf';
$sql.= ' WHERE pf.fk_facture = '.$fac->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid';
$sql.= ' ORDER BY dp, tms';
@ -2416,7 +2418,8 @@ else
print '<tr '.$bc[$var].'><td>';
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' ';
print dol_print_date($db->jdate($objp->dp),'day').'</a></td>';
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement.'</td>';
$label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$obj->payment_label;
print '<td>'.$label.' '.$objp->num_paiement.'</td>';
print '<td align="right">'.price($objp->amount).'</td>';
print '<td>&nbsp;</td>';
print '</tr>';