From d0cff20bfddd36f35317de29213779e9d0508b60 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Mon, 17 Oct 2022 12:25:31 +0200 Subject: [PATCH] FIX - editfieldkey --- htdocs/product/stock/product.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index c53454f0fc3..551bfd5f9d0 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -649,15 +649,19 @@ if ($id > 0 || $ref) { $textdesc = $langs->trans("CostPriceDescription"); $textdesc .= "
".$langs->trans("CostPriceUsage"); $text = $form->textwithpicto($langs->trans("CostPrice"), $textdesc, 1, 'help', ''); - $costprice = $object->cost_price; if (!$usercancreadprice) { - $costprice = ''; + print $form->editfieldkey($text, 'cost_price', '', $object, 0, 'amount:6'); + print ''; + print $form->editfieldval($text, 'cost_price', '', $object, 0, 'amount:6'); + print ''; + } else { + print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); + print ''; + print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); + print ''; } - print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); - print ''; - print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); - print ''; + // AWP print '';