Merge pull request #8072 from laudeco/hotfix/8028_replacement_bill
fix the bill replacement with discounts #8028
This commit is contained in:
commit
7f419a29e7
@ -539,6 +539,15 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
$newinvoiceline->fk_parent_line=$fk_parent_line;
|
||||
|
||||
if($this->type === Facture::TYPE_REPLACEMENT && $newinvoiceline->fk_remise_except){
|
||||
$discount = new DiscountAbsolute($this->db);
|
||||
$discount->fetch($newinvoiceline->fk_remise_except);
|
||||
|
||||
$discountId = $soc->set_remise_except($discount->amount_ht, $user, $discount->description, $discount->tva_tx);
|
||||
$newinvoiceline->fk_remise_except = $discountId;
|
||||
}
|
||||
|
||||
$result=$newinvoiceline->insert();
|
||||
|
||||
// Defined the new fk_parent_line
|
||||
|
||||
Loading…
Reference in New Issue
Block a user