diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 97886d66fd3..5b04af13fde 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -635,19 +635,13 @@ else if ($action == "addline" && $user->rights->propal->creer) $idprod=GETPOST('idprod', 'int'); $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); $price_ht = GETPOST('price_ht'); - $np_price = GETPOST('np_price'); if (empty($idprod) && GETPOST('type') < 0) { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); $error++; } - if ($conf->global->MAIN_FEATURES_LEVEL > 1 && empty($idprod) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); - $error++; - } - else if ($conf->global->MAIN_FEATURES_LEVEL < 2 && empty($idprod) && (!($np_price >= 0) || $np_price == '')) // Unit price can be 0 but not '' + if (empty($idprod) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); $error++; @@ -676,7 +670,7 @@ else if ($action == "addline" && $user->rights->propal->creer) $label = ((GETPOST('product_label') && GETPOST('product_label')!=$prod->label)?GETPOST('product_label'):''); // If prices fields are update - if ($conf->global->MAIN_FEATURES_LEVEL > 1 && isset($price_ht)) + if ($conf->global->MAIN_FEATURES_LEVEL > 1) { $pu_ht=price2num($price_ht, 'MU'); $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); @@ -753,7 +747,7 @@ else if ($action == "addline" && $user->rights->propal->creer) } else { - $pu_ht=(isset($price_ht)?$price_ht:$np_price); + $pu_ht= $price_ht; $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); $rate=GETPOST('tva_tx')?GETPOST('tva_tx'):GETPOST('np_tva_tx'); $tva_tx=str_replace('*','',$rate); @@ -836,7 +830,6 @@ else if ($action == "addline" && $user->rights->propal->creer) unset($_POST['buying_price']); // old method - unset($_POST['np_price']); unset($_POST['np_desc']); unset($_POST['dp_desc']); unset($_POST['np_fournprice']); diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index c300208e5f8..dc9a2935dd3 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -80,7 +80,7 @@ if (! empty($conf->margin->enabled)) { else echo $form->load_tva('np_tva_tx', (isset($_POST["np_tva_tx"])?$_POST["np_tva_tx"]:-1), $seller, $buyer); ?> - "> + "> "> %