FIX accolade et gestion fk_unit

This commit is contained in:
atm-lena 2022-08-24 12:15:28 +02:00
parent 44caf380cf
commit ab2b445b53

View File

@ -183,7 +183,7 @@ if ($action == 'addline' && $user->rights->bom->write) {
}
if (!$error) {
$result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null);
$result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit);
if ($result <= 0) {
setEventMessages($object->error, $object->errors, 'errors');
@ -195,10 +195,11 @@ if ($action == 'addline' && $user->rights->bom->write) {
unset($_POST['qty_frozen']);
unset($_POST['disable_stock_change']);
$object->fetchLines();
$object->calculateCosts();
}
$object->fetchLines();
$object->calculateCosts();
}
}
@ -223,7 +224,7 @@ if ($action == 'updateline' && $user->rights->bom->write) {
$bomline = new BOMLine($db);
$bomline->fetch($lineid);
$result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key);
$result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit);
if ($result <= 0) {
setEventMessages($object->error, $object->errors, 'errors');
@ -235,10 +236,11 @@ if ($action == 'updateline' && $user->rights->bom->write) {
unset($_POST['qty_frozen']);
unset($_POST['disable_stock_change']);
$object->fetchLines();
$object->calculateCosts();
}
$object->fetchLines();
$object->calculateCosts();
}
}
@ -619,6 +621,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
$object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
}
}
}