diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index bbc6bdbafb9..224c443754a 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -597,9 +597,9 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setremisepercent' && $usercancreate) { - $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2)); + $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2)); } elseif ($action == 'setremiseabsolue' && $usercancreate) { - $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU')); + $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2)); } elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '') { // Define vat_rate $vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d5187c6a040..1466f595b3d 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -204,7 +204,7 @@ if (empty($reshook)) { $object->note_private = GETPOST('note_private', 'alpha'); $object->note_public = GETPOST('note_public', 'alpha'); $object->fk_project = GETPOST('projectid', 'int'); - $object->remise_percent = price2num(GETPOST('remise_percent'), 2); + $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); $object->ref = GETPOST('ref', 'alpha'); $object->ref_customer = GETPOST('ref_customer', 'alpha'); $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 625ecca522f..f02ffb99d77 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -748,7 +748,7 @@ if (empty($reshook)) { GETPOST('product_desc', 'restricthtml'), $ht, price2num(GETPOST('qty'), 'MS'), - price2num(GETPOST('remise_percent'), 2), + price2num(GETPOST('remise_percent'), '', 2), $vat_rate, $localtax1_rate, $localtax2_rate, diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 04d99240f6b..42e2f528bc6 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1272,8 +1272,8 @@ if (empty($reshook)) { $localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty); $localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty); - $remise_percent = price2num(GETPOST('remise_percent'), 2); - $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), 'MU'); + $remise_percent = price2num(GETPOST('remise_percent'), '', 2); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), 'MU', 2); // Extrafields Lines $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 3a85eaaf47b..d0675ed465c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -820,7 +820,7 @@ if (empty($reshook)) { if (GETPOST('propalid') > 0) { // Define cost price for margin calculation $buyprice = 0; - if (($result = $propal->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), 2), $object->id)) < 0) { + if (($result = $propal->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), '', 2), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { @@ -835,7 +835,7 @@ if (empty($reshook)) { $localtax1_tx, // localtax1 $localtax2_tx, // localtax2 $object->id, - price2num(GETPOST('remise_percent'), 2), + price2num(GETPOST('remise_percent'), '', 2), $price_base_type, $pu_ttc, 0, @@ -860,7 +860,7 @@ if (empty($reshook)) { } elseif (GETPOST('commandeid') > 0) { // Define cost price for margin calculation $buyprice = 0; - if (($result = $commande->defineBuyPrice($pu_ht, GETPOST('remise_percent', 2), $object->id)) < 0) { + if (($result = $commande->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), '', 2), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { @@ -875,7 +875,7 @@ if (empty($reshook)) { $localtax1_tx, // localtax1 $localtax2_tx, // localtax2 $object->id, - price2num(GETPOST('remise_percent'), 2), + price2num(GETPOST('remise_percent'), '', 2), '', '', $price_base_type, @@ -894,13 +894,13 @@ if (empty($reshook)) { ); if ($result > 0) { - header("Location: ".DOL_URL_ROOT."/commande/card.php?id=".$commande->id); + header("Location: ".DOL_URL_ROOT."/commande/card.php?id=".urlencode($commande->id)); exit; } } elseif (GETPOST('factureid') > 0) { // Define cost price for margin calculation $buyprice = 0; - if (($result = $facture->defineBuyPrice($pu_ht, GETPOST('remise_percent', 2), $object->id)) < 0) { + if (($result = $facture->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), '', 2), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { @@ -915,7 +915,7 @@ if (empty($reshook)) { $localtax1_tx, $localtax2_tx, $object->id, - price2num(GETPOST('remise_percent'), 2), + price2num(GETPOST('remise_percent'), '', 2), '', '', '', diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 97f29de72f6..01a09a21335 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -715,7 +715,7 @@ END; // Discount qty min print '