Merge pull request #20074 from altairisfr/fix_parentline_13.0

More generic management of parentline
This commit is contained in:
Laurent Destailleur 2022-02-16 20:25:04 +01:00 committed by GitHub
commit aad292b41b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 6 deletions

View File

@ -1248,7 +1248,7 @@ class Propal extends CommonObject
break;
}
// Defined the new fk_parent_line
if ($result > 0 && $line->product_type == 9) {
if ($result > 0) {
$fk_parent_line = $result;
}
}

View File

@ -421,7 +421,7 @@ if (empty($reshook)) {
}
// Defined the new fk_parent_line
if ($result > 0 && $lines[$i]->product_type == 9) {
if ($result > 0) {
$fk_parent_line = $result;
}
}

View File

@ -1056,7 +1056,7 @@ class Commande extends CommonOrder
return -1;
}
// Defined the new fk_parent_line
if ($result > 0 && $line->product_type == 9) {
if ($result > 0) {
$fk_parent_line = $result;
}
}

View File

@ -1270,7 +1270,7 @@ if (empty($reshook)) {
$object->lines[] = $line; // insert new line in current object
// Defined the new fk_parent_line
if ($result > 0 && $line->product_type == 9) {
if ($result > 0) {
$fk_parent_line = $result;
}
}
@ -1781,7 +1781,7 @@ if (empty($reshook)) {
}
// Defined the new fk_parent_line
if ($result > 0 && $lines[$i]->product_type == 9) {
if ($result > 0) {
$fk_parent_line = $result;
}
}

View File

@ -788,6 +788,9 @@ class Facture extends CommonInvoice
dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects");
foreach ($this->lines as $i => $val) {
$newinvoiceline = $this->lines[$i];
$newinvoiceline->context = $this->context;
$newinvoiceline->fk_facture = $this->id;
$newinvoiceline->origin = $this->lines[$i]->element;
@ -820,7 +823,7 @@ class Facture extends CommonInvoice
$result = $newinvoiceline->insert();
// Defined the new fk_parent_line
if ($result > 0 && $newinvoiceline->product_type == 9) {
if ($result > 0) {
$fk_parent_line = $result;
}
}