From 44f383c8b976537de95d045dd802725671365bfa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Jun 2019 13:57:34 +0200 Subject: [PATCH] Fix data lost when creation in error --- htdocs/accountancy/bookkeeping/card.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index d94ce0ec315..ca0476f3a3c 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -373,7 +373,7 @@ if ($action == 'create') print ''; print '' . $langs->trans("Piece") . ''; - print ''; + print ''; print ''; /* @@ -615,23 +615,23 @@ if ($action == 'create') if ($action == 'update' && $line->id == $id) { print ''; - print $formaccounting->select_account($line->numero_compte, 'accountingaccount_number', 1, array (), 1, 1, ''); + print $formaccounting->select_account((GETPOSTISSET("accountingaccount_number") ? GETPOST("accountingaccount_number", "alpha") : $line->numero_compte), 'accountingaccount_number', 1, array (), 1, 1, ''); print ''; print ''; // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because it does not // use setup of keypress to select thirdparty and this hang browser on large database. if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print $formaccounting->select_auxaccount($line->subledger_account, 'subledger_account', 1); + print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1); } else { - print ''; + print 'subledger_account).'">'; } print ''; - print ''; - print ''; - print ''; + print 'label_operation). '">'; + print 'debit)) . '">'; + print 'credit)) . '">'; print ''; print '' . "\n"; print ''; @@ -672,21 +672,21 @@ if ($action == 'create') if ($action == "" || $action == 'add') { print ''; print ''; - print $formaccounting->select_account($accountingaccount_number, 'accountingaccount_number', 1, array (), 1, 1, ''); + print $formaccounting->select_account('', 'accountingaccount_number', 1, array (), 1, 1, ''); print ''; print ''; // TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not // use setup of keypress to select thirdparty and this hang browser on large database. if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print $formaccounting->select_auxaccount($subledger_account, 'subledger_account', 1); + print $formaccounting->select_auxaccount('', 'subledger_account', 1); } else { print ''; } print ''; - print ''; + print ''; print ''; print ''; print '';