This commit is contained in:
atm-lena 2022-07-12 14:56:25 +02:00
parent b5d2e0f4bc
commit cc5a5e40d9
2 changed files with 75 additions and 79 deletions

View File

@ -553,8 +553,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$res = $object->fetchLinesbytypeproduct(0); $res = $object->fetchLinesbytypeproduct(0);
$object->calculateCosts(); $object->calculateCosts();
if ($res > 0) { print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMProductsList'), '', 'product');
print load_fiche_titre($langs->trans('BOMProductsList'), '', 'product');
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '') . '" method="POST"> print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '') . '" method="POST">
<input type="hidden" name="token" value="' . newToken() . '"> <input type="hidden" name="token" value="' . newToken() . '">
@ -599,23 +598,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print "</form>\n"; print "</form>\n";
mrpCollapseBomManagement(); mrpCollapseBomManagement();
}
//Services //Services
$filtertype = 1; $filtertype = 1;
$res = $object->fetchLinesbytypeproduct(1); $res = $object->fetchLinesbytypeproduct(1);
$object->calculateCosts(); $object->calculateCosts();
if ($res > 0) { print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service');
print load_fiche_titre($langs->trans('BOMServicesList'), '', 'service');
print ' <form name="addservice" id="addservice" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '') . '" method="POST"> print ' <form name="addservice" id="addservice" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '') . '" method="POST">
<input type="hidden" name="token" value="' . newToken() . '"> <input type="hidden" name="token" value="' . newToken() . '">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
<input type="hidden" name="mode" value=""> <input type="hidden" name="mode" value="">
<input type="hidden" name="page_y" value=""> <input type="hidden" name="page_y" value=""> <input type="hidden" name="id" value="' . $object->id . '">
<input type="hidden" name="id" value="' . $object->id . '">
'; ';
if (!empty($conf->use_javascript_ajax) && $object->status == 0) { if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
@ -648,11 +644,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</table>'; print '</table>';
} }
print '</div>'; print '</div>';
}
print "</form>\n"; print "</form>\n";
} }
$res = $object->fetchLines();
// Buttons for actions // Buttons for actions

View File

@ -444,7 +444,7 @@ class BOM extends CommonObject
$i++; $i++;
} }
return 1; return $num_rows;
} else { } else {
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->errors[] = $this->error; $this->errors[] = $this->error;