From ef35fb84076fe6c780cd6b881cbfd66a0032da93 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 6 Dec 2007 22:13:46 +0000 Subject: [PATCH] =?UTF-8?q?On=20affiche=20l'intitul=E9=20"offert"=20au=20l?= =?UTF-8?q?ieu=20de=20100%=20pour=20une=20r=E9duction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/propal.php | 2 +- htdocs/commande/fiche.php | 4 ++-- htdocs/compta/facture.php | 2 +- .../modules/commande/pdf_einstein.modules.php | 2 +- .../modules/facture/pdf_crabe.modules.php | 2 +- .../propale/pdf_propale_azur.modules.php | 2 +- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + htdocs/lib/functions.inc.php | 24 +++++++++++++++++++ 9 files changed, 33 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index a80e55b25a0..2355efaec98 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1233,7 +1233,7 @@ if ($_GET['propalid'] > 0) // Remise % if ($objp->remise_percent > 0) { - print ''.$objp->remise_percent."%\n"; + print ''.dolibarr_print_reduction($objp->remise_percent)."\n"; } else { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 4db02e7e2ac..fab72dab264 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -924,7 +924,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print ''.$langs->trans('Ref').''.$langs->trans('Product').''; print ''.$langs->trans('Price').''; print ''.$langs->trans('Qty').''; - print ''.$langs->trans('Reductionshort').''; + print ''.$langs->trans('ReductionShort').''; print ''; $var=false; @@ -1399,7 +1399,7 @@ else print ''; if ($objp->remise_percent > 0) { - print ''.$objp->remise_percent.'%'; + print ''.dolibarr_print_reduction($objp->remise_percent).''; } else { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index e2d15375aaf..3dbec9a1a00 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2402,7 +2402,7 @@ else print ''; if ($objp->remise_percent > 0) { - print ''.$objp->remise_percent."%\n"; + print ''.dolibarr_print_reduction($objp->remise_percent)."\n"; } else { diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index f5825833916..fabf2751c17 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -296,7 +296,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY ($this->posxdiscount, $curY); if ($com->lignes[$i]->remise_percent) { - $pdf->MultiCell(14, 4, $com->lignes[$i]->remise_percent."%", 0, 'R'); + $pdf->MultiCell(14, 4, dolibarr_print_reduction($com->lignes[$i]->remise_percent), 0, 'R'); } // Total HT ligne diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index 173cb816e8f..83622a9a9e1 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -307,7 +307,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY ($this->posxdiscount, $curY); if ($fac->lignes[$i]->remise_percent) { - $pdf->MultiCell(14, 4, $fac->lignes[$i]->remise_percent."%", 0, 'R'); + $pdf->MultiCell(14, 4, dolibarr_print_reduction($fac->lignes[$i]->remise_percent), 0, 'R'); } // Total HT ligne diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 2ffd8e1aad6..db2ad520208 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -294,7 +294,7 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->SetXY ($this->posxdiscount, $curY); if ($propale->lignes[$i]->remise_percent) { - $pdf->MultiCell(14, 4, $propale->lignes[$i]->remise_percent."%", 0, 'R'); + $pdf->MultiCell(14, 4, dolibarr_print_reduction($propale->lignes[$i]->remise_percent), 0, 'R'); } // Total HT ligne diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 98fd0543138..554ec441031 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -393,6 +393,7 @@ AutomaticCode=Automatic code NotManaged=Not managed FeatureDisabled=Feature disabled MoveBox=Move box %s +Offered=Offered # Week day Monday=Monday Tuesday=Tuesday diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index a21914b8caf..560b110a5bf 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -394,6 +394,7 @@ AutomaticCode=Cr NotManaged=Non géré FeatureDisabled=Fonction désactivée MoveBox=Déplacer la boite %s +Offered=Offert # Week day Monday=Lundi Tuesday=Mardi diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 4a9217a8ac7..d38468180c5 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -3849,4 +3849,28 @@ function monthArrayOrSelected($selected=0) } } +/** + \brief Returns formated reduction + \param reduction Reduction percentage + \return string Formated reduction +*/ +function dolibarr_print_reduction($reduction=0) +{ + global $langs; + $langs->load("main"); + + $string = ''; + + if ($reduction == 100) + { + $string = $langs->trans("Offered"); + } + else + { + $string = $reduction.'%'; + } + + return $string; +} + ?>