From 30428ec6e5a6119f10fbf600440bd6e66877a7c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Dec 2013 19:41:29 +0100 Subject: [PATCH] Fix: Control on minimum amount must be one only on standard and replacement invoices. Conflicts: htdocs/compta/facture.php --- htdocs/compta/facture.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 3f95060435d..9679f430807 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1479,7 +1479,8 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sav $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):''); - if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + // Check price is not lower than minimum (check is done only for standard or replacement invoices) + if (($object->type == 0 || $object->type == 1) && $price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) { setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors'); $error++; @@ -3874,7 +3875,7 @@ else if ($id > 0 || ! empty($ref)) $action='relance'; } else $action='send'; - + $ref = dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/'));