Merge pull request #20074 from altairisfr/fix_parentline_13.0
More generic management of parentline
This commit is contained in:
commit
aad292b41b
@ -1248,7 +1248,7 @@ class Propal extends CommonObject
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0 && $line->product_type == 9) {
|
if ($result > 0) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -421,7 +421,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0 && $lines[$i]->product_type == 9) {
|
if ($result > 0) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1056,7 +1056,7 @@ class Commande extends CommonOrder
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0 && $line->product_type == 9) {
|
if ($result > 0) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1270,7 +1270,7 @@ if (empty($reshook)) {
|
|||||||
$object->lines[] = $line; // insert new line in current object
|
$object->lines[] = $line; // insert new line in current object
|
||||||
|
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0 && $line->product_type == 9) {
|
if ($result > 0) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1781,7 +1781,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0 && $lines[$i]->product_type == 9) {
|
if ($result > 0) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -788,6 +788,9 @@ class Facture extends CommonInvoice
|
|||||||
dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects");
|
dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects");
|
||||||
foreach ($this->lines as $i => $val) {
|
foreach ($this->lines as $i => $val) {
|
||||||
$newinvoiceline = $this->lines[$i];
|
$newinvoiceline = $this->lines[$i];
|
||||||
|
|
||||||
|
$newinvoiceline->context = $this->context;
|
||||||
|
|
||||||
$newinvoiceline->fk_facture = $this->id;
|
$newinvoiceline->fk_facture = $this->id;
|
||||||
|
|
||||||
$newinvoiceline->origin = $this->lines[$i]->element;
|
$newinvoiceline->origin = $this->lines[$i]->element;
|
||||||
@ -820,7 +823,7 @@ class Facture extends CommonInvoice
|
|||||||
$result = $newinvoiceline->insert();
|
$result = $newinvoiceline->insert();
|
||||||
|
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0 && $newinvoiceline->product_type == 9) {
|
if ($result > 0) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user