From 9a92545d8d78ac5d82e25d4fcc17358c0d868373 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Mon, 30 Mar 2020 14:27:32 +0200 Subject: [PATCH] FIX missing default accountancy product buy code --- htdocs/product/card.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 27bf63f08fd..25700920d58 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1211,7 +1211,13 @@ else // Accountancy_code_buy print ''.$langs->trans("ProductAccountancyBuyCode").''; print ''; - print $formaccounting->select_account(GETPOST('accountancy_code_buy', 'alpha'), 'accountancy_code_buy', 1, null, 1, 1, ''); + if($type == 0) + { + $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha')?(GETPOST('accountancy_code_buy', 'alpha')):$conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT); + } else { + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); + } + print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, ''); print ''; } else // For external software