diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index a8c268ccfee..86a7c6526ba 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -634,7 +634,7 @@ 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'); - $tva_tx = GETPOST('tva_tx'); + $tva_tx = (GETPOST('tva_tx')?GETPOST('tva_tx'):0); if (empty($idprod) && GETPOST('type') < 0) { @@ -844,7 +844,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa $description=dol_htmlcleanlastbr(GETPOST('product_desc')); // Define vat_rate - $vat_rate=GETPOST('tva_tx'); + $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); $vat_rate=str_replace('*','',$vat_rate); $localtax1_rate=get_localtax($vat_rate,1,$object->client); $localtax2_rate=get_localtax($vat_rate,2,$object->client); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 167f4c53268..a1e9acf3607 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -537,7 +537,7 @@ else if ($action == 'addline' && $user->rights->commande->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'); - $tva_tx = GETPOST('tva_tx'); + $tva_tx = (GETPOST('tva_tx')?GETPOST('tva_tx'):0); if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && (GETPOST('qty') < 0)) { @@ -767,13 +767,13 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' $date_end=dol_mktime(0, 0, 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $description=dol_htmlcleanlastbr(GETPOST('product_desc')); $pu_ht=GETPOST('price_ht'); + $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); // Define info_bits $info_bits=0; - if (preg_match('/\*/', GETPOST('tva_tx'))) $info_bits |= 0x01; + if (preg_match('/\*/', $vat_rate)) $info_bits |= 0x01; // Define vat_rate - $vat_rate=GETPOST('tva_tx'); $vat_rate=str_replace('*','',$vat_rate); $localtax1_rate=get_localtax($vat_rate,1,$object->client); $localtax2_rate=get_localtax($vat_rate,2,$object->client); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 809bd6eb452..75a67be6bff 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -965,7 +965,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $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'); - $tva_tx = GETPOST('tva_tx'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && (GETPOST('qty') < 0)) { @@ -1220,13 +1220,13 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $description=dol_htmlcleanlastbr(GETPOST('product_desc')); $pu_ht=GETPOST('price_ht'); + $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); // Define info_bits $info_bits=0; - if (preg_match('/\*/', GETPOST('tva_tx'))) $info_bits |= 0x01; + if (preg_match('/\*/', $vat_rate)) $info_bits |= 0x01; // Define vat_rate - $vat_rate=$_POST['tva_tx']; $vat_rate=str_replace('*','',$vat_rate); $localtax1_rate=get_localtax($vat_rate,1,$object->client); $localtax2_rate=get_localtax($vat_rate,2,$object->client);