From 15b7f37027c0591a18b5c223abe8173de8ee1524 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 14 Feb 2022 09:08:58 +0100 Subject: [PATCH] FIX missing default or current value --- htdocs/compta/bank/card.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 73edd31755d..62b97f6d100 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -358,7 +358,7 @@ if ($action == 'create') { // Type print ''.$langs->trans("AccountType").''; print ''; - $formbank->selectTypeOfBankAccount(GETPOSTISSET("type") ? GETPOST('type', 'alpha') : Account::TYPE_CURRENT, 'type'); + $formbank->selectTypeOfBankAccount(GETPOSTISSET("type") ? GETPOST('type', 'int') : Account::TYPE_CURRENT, 'type'); print ''; // Currency @@ -471,7 +471,7 @@ if ($action == 'create') { print ''; print '
'; - $type = GETPOST('type'); + $type = (GETPOSTISSET("type") ? GETPOST('type', 'int') : Account::TYPE_CURRENT); // add default value if ($type == Account::TYPE_SAVINGS || $type == Account::TYPE_CURRENT) { print ''; @@ -857,7 +857,7 @@ if ($action == 'create') { // Type print ''; print ''; // Currency @@ -1002,7 +1002,8 @@ if ($action == 'create') { print '
'.$langs->trans("AccountType").''; - $formbank->selectTypeOfBankAccount((GETPOSTISSET('type') ? GETPOST('type', 'alpha') : $object->type), 'type'); + $formbank->selectTypeOfBankAccount((GETPOSTISSET('type') ? GETPOST('type', 'int') : $object->type), 'type'); print '
'; - if (GETPOST("type") == Account::TYPE_SAVINGS || GETPOST("type") == Account::TYPE_CURRENT) { + $type = (GETPOSTISSET('type') ? GETPOST('type', 'int') : $object->type); // add default current value + if ($type == Account::TYPE_SAVINGS || $type == Account::TYPE_CURRENT) { print '
'; //print '
';