mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-03 23:52:24 +01:00
Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/core/class/commonobject.class.php
This commit is contained in:
@@ -925,6 +925,12 @@ if (empty($reshook))
|
||||
|
||||
foreach($facture_source->lines as $line)
|
||||
{
|
||||
// Extrafields
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($line, 'fetch_optionals')) {
|
||||
// load extrafields
|
||||
$line->fetch_optionals();
|
||||
}
|
||||
|
||||
// Reset fk_parent_line for no child products and special product
|
||||
if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) {
|
||||
$fk_parent_line = 0;
|
||||
|
||||
@@ -557,6 +557,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
|
||||
|
||||
Reference in New Issue
Block a user