From a705d4e3336c5b3b38bd51d30c3f67daaed7f288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 23 May 2014 03:00:46 +0200 Subject: [PATCH] Fix: [ bug #1410 ] Add customer order line asks for required Unit Price but doesn't interrupt the creation of the line --- ChangeLog | 1 + htdocs/commande/fiche.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3bb088b99f3..ed85d409840 100644 --- a/ChangeLog +++ b/ChangeLog @@ -113,6 +113,7 @@ Fix: [ bug #1306 ] Fatal error when adding an external calendar. New: Added es_CL language Fix: Margin tabs bad data show Fix: [ bug #1318 ] Problem with enter key when adding an existing product to a customer invoice. +Fix: [ bug #1410 ] Add customer order line asks for required Unit Price but doesn't interrupt the creation of the line ***** ChangeLog for 3.5 compared to 3.4.* ***** For users: diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 10856f27c5e..4a00c1a661b 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -617,27 +617,27 @@ else if ($action == 'addline' && $user->rights->commande->creer) if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && ($qty < 0)) { setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); - $error++; + $error = true; } if (empty($idprod) && GETPOST('type') < 0) { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); - $error++; + $error = true; } if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); - $error++; + $error = true; } if ($qty == '') { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); - $error++; + $error = true; } if (empty($idprod) && empty($product_desc)) { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors'); - $error++; + $error = true; } if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod)))