From c16cd91d8e886b782408df6424e603b8db9fb250 Mon Sep 17 00:00:00 2001 From: John Botella Date: Thu, 1 Oct 2020 09:40:11 +0200 Subject: [PATCH 1/2] FIX default accountancy values and posted values --- htdocs/product/card.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d0dc01bac33..ea1b2ef0e9f 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -78,6 +78,14 @@ $confirm = GETPOST('confirm', 'alpha'); $socid = GETPOST('socid', 'int'); $duration_value = GETPOST('duration_value', 'int'); $duration_unit = GETPOST('duration_unit', 'alpha'); + +$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); +$accountancy_code_sell_intra = GETPOST('accountancy_code_sell_intra', 'alpha'); +$accountancy_code_sell_export = GETPOST('accountancy_code_sell_export', 'alpha'); +$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); +$accountancy_code_buy_intra = GETPOST('accountancy_code_buy_intra', 'alpha'); +$accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha'); + if (!empty($user->socid)) $socid = $user->socid; $object = new Product($db); @@ -1323,6 +1331,14 @@ else } else // For external software { + + if (!empty($accountancy_code_sell)) { $object->accountancy_code_sell = $accountancy_code_sell; } + if (!empty($accountancy_code_sell_intra)) { $object->accountancy_code_sell_intra = $accountancy_code_sell_intra; } + if (!empty($accountancy_code_sell_export)) { $object->accountancy_code_sell_export = $accountancy_code_sell_export; } + if (!empty($accountancy_code_buy)) { $object->accountancy_code_buy = $accountancy_code_buy; } + if (!empty($accountancy_code_buy_intra)) { $object->accountancy_code_buy_intra = $accountancy_code_buy_intra; } + if (!empty($accountancy_code_buy_export)) { $object->accountancy_code_buy_export = $accountancy_code_buy_export; } + // Accountancy_code_sell print ''.$langs->trans("ProductAccountancySellCode").''; print ''; From e558dc3f275b95507298eb52d4778a50ef8ea639 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 1 Oct 2020 07:48:24 +0000 Subject: [PATCH 2/2] Fixing style errors. --- htdocs/product/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index ea1b2ef0e9f..8b4654ba921 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1331,7 +1331,6 @@ else } else // For external software { - if (!empty($accountancy_code_sell)) { $object->accountancy_code_sell = $accountancy_code_sell; } if (!empty($accountancy_code_sell_intra)) { $object->accountancy_code_sell_intra = $accountancy_code_sell_intra; } if (!empty($accountancy_code_sell_export)) { $object->accountancy_code_sell_export = $accountancy_code_sell_export; }