From be1ef0ccbe49b5aed7bc44ae1ce4be4876761b56 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Jul 2010 21:23:57 +0000 Subject: [PATCH] Fix: Bad translation of payment type --- htdocs/compta/bank/account.php | 5 +++-- htdocs/compta/bank/rappro.php | 4 +++- htdocs/compta/facture.php | 11 +++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 8716ac20a27..32a0a5dbae8 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -515,8 +515,9 @@ if ($account || $_GET["ref"]) // Payment type print ""; - if ($objp->fk_type == 'SOLD') print ' '; - 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=' '; + print $label; print "\n"; print ''.($objp->num_chq?$objp->num_chq:"")."\n"; diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index 5c81b3bffca..ec1acfdb604 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -227,7 +227,9 @@ if ($resql) } // Number - print ''.$objp->type.($objp->num_chq?' '.$objp->num_chq:'').''; + $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 ''.$label.($objp->num_chq?' '.$objp->num_chq:'').''; // Description print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8c01897fcda..02f1ecbb005 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -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 ''; print ''.img_object($langs->trans('ShowPayment'),'payment').' '; print dol_print_date($db->jdate($objp->dp),'day').''; - print ''.$objp->paiement_type.' '.$objp->num_paiement.''; + $label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$obj->payment_label; + print ''.$label.' '.$objp->num_paiement.''; print ''.price($objp->amount).''; print ' '; print '';