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 '| '.$langs->trans("AccountType").' | ';
print '';
- $formbank->selectTypeOfBankAccount((GETPOSTISSET('type') ? GETPOST('type', 'alpha') : $object->type), 'type');
+ $formbank->selectTypeOfBankAccount((GETPOSTISSET('type') ? GETPOST('type', 'int') : $object->type), 'type');
print ' |
';
// Currency
@@ -1002,7 +1002,8 @@ if ($action == 'create') {
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 '';