From 40860a84d17b2e54f18d68a66ca2461a3a687cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 4 Apr 2015 17:28:24 +0200 Subject: [PATCH] Closes #2543: Untranslated "Contract" origin string when creating an invoice from a contract --- ChangeLog | 1 + htdocs/commande/fiche.php | 22 ++++++++++++++++++---- htdocs/compta/facture.php | 24 +++++++++++++++++------- 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2bcf02febf8..9982226def4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,7 @@ English Dolibarr ChangeLog - Fix: Bad SEPA xml file creation - Fix: [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment - Fix: Showing system error if not enough stock of product into orders creation with lines +- Fix: [ bug #2543 ] Untranslated "Contract" origin string when creating an invoice from a contract ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 02e6c74c13c..9a844b0a5d5 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -7,7 +7,7 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel - * Copyright (C) 2012 Marcos García + * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -1599,9 +1599,23 @@ if ($action == 'create' && $user->rights->commande->creer) { print ''; print ''; - $newclassname = $classname; - if ($newclassname == 'Propal') - $newclassname = 'CommercialProposal'; + switch ($classname) { + case 'Propal': + $newclassname = 'CommercialProposal'; + break; + case 'Commande': + $newclassname = 'Order'; + break; + case 'Expedition': + $newclassname = 'Sending'; + break; + case 'Contrat': + $newclassname = 'Contract'; + break; + default: + $newclassname = $classname; + } + print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a3403e0d9dd..d5c11cf5b63 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -10,6 +10,7 @@ * Copyright (C) 2013 Jean-Francois FERRY * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2294,13 +2295,22 @@ if ($action == 'create') print ''; print ''; - $newclassname = $classname; - if ($newclassname == 'Propal') - $newclassname = 'CommercialProposal'; - elseif ($newclassname == 'Commande') - $newclassname = 'Order'; - elseif ($newclassname == 'Expedition') - $newclassname = 'Sending'; + switch ($classname) { + case 'Propal': + $newclassname = 'CommercialProposal'; + break; + case 'Commande': + $newclassname = 'Order'; + break; + case 'Expedition': + $newclassname = 'Sending'; + break; + case 'Contrat': + $newclassname = 'Contract'; + break; + default: + $newclassname = $classname; + } print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . '';