From 0e1cc2b0965c79c787afe51f29fd621eb2f96a53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Sep 2021 18:46:27 +0200 Subject: [PATCH] Fix cost price is 0. --- htdocs/bom/bom_card.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index ab6112c0fed..4396dd36e92 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -75,6 +75,7 @@ if ($object->id > 0) { $object->calculateCosts(); } + // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; @@ -115,8 +116,13 @@ if (empty($reshook)) { $triggermodname = 'BOM_MODIFY'; // Name of trigger action code to execute when we modify record + // Actions cancel, add, update, delete or clone include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + // The fetch/fetch_lines was redone into the inc.php so we must recall the calculateCosts() + if ($action == 'confirm_validate' && $object->id > 0) { + $object->calculateCosts(); + } // Actions when linking object each other include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';