Skip to content

Commit

Permalink
Merge pull request #8072 from laudeco/hotfix/8028_replacement_bill
Browse files Browse the repository at this point in the history
fix the bill replacement with discounts #8028
  • Loading branch information
eldy committed Feb 20, 2018
2 parents 01c2971 + 53ac13c commit 7f419a2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions htdocs/compta/facture/class/facture.class.php
Expand Up @@ -539,6 +539,15 @@ function create($user,$notrigger=0,$forceduedate=0)
}

$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
Expand Down

0 comments on commit 7f419a2

Please sign in to comment.