diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 2950d5d2248..69d3e5b59c9 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2461,136 +2461,6 @@ class Propal extends CommonObject return -1; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Set an overall discount on the proposal - * - * @param User $user Object user that modify - * @param double $remise Amount discount - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers - * @return int Return integer <0 if ko, >0 if ok - * @deprecated remise_percent is a deprecated field for object parent - */ - /* - public function set_remise_percent($user, $remise, $notrigger = 0) - { - // phpcs:enable - $remise = trim($remise) ?trim($remise) : 0; - - if ($user->hasRight('propal', 'creer')) { - $remise = price2num($remise, 2); - - $error = 0; - - $this->db->begin(); - - $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET remise_percent = ".((float) $remise); - $sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT; - - dol_syslog(__METHOD__, LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - $this->errors[] = $this->db->error(); - $error++; - } - - if (!$error) { - $this->oldcopy = clone $this; - $this->remise_percent = $remise; - $this->update_price(1); - } - - if (!$notrigger && empty($error)) { - // Call trigger - $result = $this->call_trigger('PROPAL_MODIFY', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } - - if (!$error) { - $this->db->commit(); - return 1; - } else { - foreach ($this->errors as $errmsg) { - dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); - } - $this->db->rollback(); - return -1 * $error; - } - } - - return -1; - } - */ - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Set an absolute overall discount on the proposal - * - * @param User $user Object user that modify - * @param double $remise Amount discount - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers - * @return int Return integer <0 if ko, >0 if ok - */ - /* - public function set_remise_absolue($user, $remise, $notrigger = 0) - { - // phpcs:enable - if (empty($remise)) { - $remise = 0; - } - $remise = price2num($remise); - - if ($user->hasRight('propal', 'creer')) { - $error = 0; - - $this->db->begin(); - - $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql .= " SET remise_absolue = ".((float) $remise); - $sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT; - - dol_syslog(__METHOD__, LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - $this->errors[] = $this->db->error(); - $error++; - } - - if (!$error) { - $this->oldcopy = clone $this; - $this->update_price(1); - } - - if (!$notrigger && empty($error)) { - // Call trigger - $result = $this->call_trigger('PROPAL_MODIFY', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } - - if (!$error) { - $this->db->commit(); - return 1; - } else { - foreach ($this->errors as $errmsg) { - dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); - } - $this->db->rollback(); - return -1 * $error; - } - } - - return -1; - } - */ - /** * Reopen the commercial proposal diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 8d67611ad20..b03fe2ae009 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2445,7 +2445,6 @@ class Commande extends CommonOrder * @param float $remise Discount (percent) * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int Return integer <0 if KO, >0 if OK - * @deprecated remise_percent is a deprecated field for object parent */ public function setDiscount($user, $remise, $notrigger = 0) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 55c89240fa8..c161836279c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4424,7 +4424,6 @@ class Facture extends CommonInvoice * @param float $remise Discount * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int Return integer <0 if KO, >0 if OK - * @deprecated remise_percent is a deprecated field for object parent */ public function setDiscount($user, $remise, $notrigger = 0) {