You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DiscountAbsolute class does not handle correctly Multi-Currency fields
Environment
Version: 7.0.3
Expected and actual behavior
Multicurrency fields are not available as data member of the class
Therefore the create method does not fill the database with umlticurrency values
Steps to reproduce the behavior
With multicurrency enabled:
create a deposit invoice
transform the deposit invoice as a discount using the dedicated button
At this step, the record in the table 'xxx_societe_remise_except' has the multicurrency fields set to 0
As a concequency: use the discount on a new invoice and the 'Total without VAT' is wrong.
Suggested implementation
As a short-term patch, modify the SQL statement of the DiscountAbsolute::create method as following:
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
$sql.= " (entity, datec, fk_soc, fk_user, description,";
$sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,";
$sql.= " fk_facture_source,multicurrency_amount_ht,multicurrency_amount_tva,multicurrency_amount_ttc";
$sql.= ")";
$sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',";
$sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
$sql.= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'":"null").",'".$this->amount_ht."','".$this->amount_tva."','".$this->amount_ttc."'";
$sql.= ")";
As a long term patch: review the DiscountAbsolute in order to handle correctly multicurrency
The text was updated successfully, but these errors were encountered:
Bug
DiscountAbsolute class does not handle correctly Multi-Currency fields
Environment
Expected and actual behavior
Steps to reproduce the behavior
With multicurrency enabled:
At this step, the record in the table 'xxx_societe_remise_except' has the multicurrency fields set to 0
Suggested implementation
As a short-term patch, modify the SQL statement of the DiscountAbsolute::create method as following:
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
$sql.= " (entity, datec, fk_soc, fk_user, description,";
$sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,";
$sql.= " fk_facture_source,multicurrency_amount_ht,multicurrency_amount_tva,multicurrency_amount_ttc";
$sql.= ")";
$sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',";
$sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
$sql.= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'":"null").",'".$this->amount_ht."','".$this->amount_tva."','".$this->amount_ttc."'";
$sql.= ")";
As a long term patch: review the DiscountAbsolute in order to handle correctly multicurrency
The text was updated successfully, but these errors were encountered: