2
0
forked from Wavyzz/dolibarr

FIX SUPPLIER PROPOSAL v12 bug add

This commit is contained in:
atm-benoit
2020-12-04 15:37:00 +01:00
parent ac30348081
commit b9461322d9

View File

@@ -555,7 +555,7 @@ if (empty($reshook))
else
{
$idprod = GETPOST('idprod', 'int');
$price_ht = '';
$price_ht = GETPOST('price_ht');
$tva_tx = '';
}
@@ -589,8 +589,8 @@ if (empty($reshook))
$error++;
}
if (!$error && ($qty >= 0)) {
$pu_ht = 0;
$pu_ttc = 0;
$pu_ht = price2num($price_ht, 'MU');
$pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
$price_min = 0;
$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT');
@@ -658,12 +658,12 @@ if (empty($reshook))
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr);
$localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr);
$pu_ht = $productsupplier->fourn_pu;
if (empty($pu_ht)) $pu_ht = 0; // If pu is '' or null, we force to have a numeric value
// If GETPOST('idprodfournprice') is a numeric, we can use it. If it is empty or if it is 'idprod_123', we should use -1 (not used)
$fournprice = (is_numeric(GETPOST('idprodfournprice', 'alpha')) ? GETPOST('idprodfournprice', 'alpha') : -1);
$buyingprice = 0;
$pu_ht_devise = price2num($price_ht_devise, 'MU');
$result = $object->addline(
$desc,
@@ -689,7 +689,7 @@ if (empty($reshook))
$productsupplier->fk_unit,
'',
0,
$productsupplier->fourn_multicurrency_unitprice,
$pu_ht_devise,
$date_start,
$date_end
);