From ab2b445b53ce807408fb293ce8af9573af1affee Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 24 Aug 2022 12:15:28 +0200 Subject: [PATCH] FIX accolade et gestion fk_unit --- htdocs/bom/bom_card.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index e66462d8584..3c188077237 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -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'); + } } }