@@ -1854,7 +1854,7 @@ class Commande extends CommonOrder
/**
* Load array this->expeditions of lines of shipments with nb of products sent for each order line
* Note: For a dedicated shipment, the fetch_lines can be used to load the qty_asked and qty_shipped. This function is use to return qty_shipped cumulated for the order
*
*
* @param int $filtre_statut Filter on shipment status
* @return int <0 if KO, Nb of lines found if OK
*/
...
...
@@ -2044,30 +2044,57 @@ class Commande extends CommonOrder
*
* @param User $user User qui positionne la remise
* @param float $remise Discount (percent)
* @param int $notrigger Not Trigger
* @return int <0 if KO, >0 if OK
*/
functionset_remise($user,$remise)
functionset_remise($user,$remise,$notrigger=0)
{
$remise=trim($remise)?trim($remise):0;
if($user->rights->commande->creer)
{
$error=0;
$this->db->begin();
$remise=price2num($remise);
$sql='UPDATE '.MAIN_DB_PREFIX.'commande';
$sql.=' SET remise_percent = '.$remise;
$sql.=' WHERE rowid = '.$this->id.' AND fk_statut = '.self::STATUS_DRAFT.' ;';