Remove $_POST

This commit is contained in:
Laurent Destailleur 2020-03-26 02:21:50 +01:00
parent d2163c95d6
commit 3ae3e9a16e

View File

@ -487,10 +487,10 @@ if (empty($reshook))
// POST[remise_id] or POST[remise_id_for_payment] // POST[remise_id] or POST[remise_id_for_payment]
// We use the credit to reduce amount of invoice // We use the credit to reduce amount of invoice
if (!empty($_POST["remise_id"])) { if (GETPOST("remise_id", 'int') > 0) {
$ret = $object->fetch($id); $ret = $object->fetch($id);
if ($ret > 0) { if ($ret > 0) {
$result = $object->insert_discount($_POST["remise_id"]); $result = $object->insert_discount(GETPOST("remise_id", 'int'));
if ($result < 0) { if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
@ -499,11 +499,11 @@ if (empty($reshook))
} }
} }
// We use the credit to reduce remain to pay // We use the credit to reduce remain to pay
if (!empty($_POST["remise_id_for_payment"])) if (GETPOST("remise_id_for_payment", 'int') > 0)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
$discount = new DiscountAbsolute($db); $discount = new DiscountAbsolute($db);
$discount->fetch($_POST["remise_id_for_payment"]); $discount->fetch(GETPOST("remise_id_for_payment", 'int'));
//var_dump($object->getRemainToPay(0)); //var_dump($object->getRemainToPay(0));
//var_dump($discount->amount_ttc);exit; //var_dump($discount->amount_ttc);exit;