From 03ab77c8611ccdb428c3b3e8bf34aedbdb515c8e Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+BB2A-Anthony@users.noreply.github.com> Date: Tue, 17 Feb 2026 01:37:13 +0100 Subject: [PATCH] setPaymentTerms (#37232) Co-authored-by: Anthony Berton Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/card.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 8ed43cb19cd..1b00ceb92eb 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2062,24 +2062,7 @@ if (empty($reshook)) { $result = $object->set_demand_reason($user, GETPOSTINT('demand_reason_id')); } elseif ($action == 'setconditions' && $usercancreate) { // Terms of payment - $sql = "SELECT code "; - $sql .= "FROM " . $db->prefix() . "c_payment_term"; - $sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int')); - $result = $db->query($sql); - if ($result) { - $obj = $db->fetch_object($result); - if ($obj->code == 'DEP30PCTDEL') { - $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), GETPOSTFLOAT('cond_reglement_id_deposit_percent')); - } else { - $object->deposit_percent = 0; - $object->update($user); - $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), $object->deposit_percent); - } - } - //} elseif ($action == 'setremisepercent' && $usercancreate) { - // $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2)); - //} elseif ($action == 'setremiseabsolue' && $usercancreate) { - // $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2)); + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), GETPOSTFLOAT('cond_reglement_id_deposit_percent')); } elseif ($action == 'setmode' && $usercancreate) { // Payment choice $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); @@ -2311,7 +2294,6 @@ if ($action == 'create') { $fk_account = GETPOSTINT('fk_account'); } } - // Warehouse default if null if ($soc->fk_warehouse > 0) { $warehouse_id = $soc->fk_warehouse;