diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php
index 1dcb2a533de..057e2f0484c 100644
--- a/htdocs/accountancy/admin/card.php
+++ b/htdocs/accountancy/admin/card.php
@@ -69,10 +69,10 @@ if ($action == 'add') {
$account_number = clean_account(GETPOST('account_number'));
}
- if (GETPOST('account_category') <= 0) {
- $account_parent = '';
+ if (GETPOST('account_parent') <= 0) {
+ $account_parent = 0;
} else {
- $account_parent = GETPOST('account_category','int');
+ $account_parent = GETPOST('account_parent','int');
}
$object->fk_pcg_version = $obj->pcg_version;
@@ -98,7 +98,7 @@ if ($action == 'add') {
header("Location: account.php");
exit;
} else if ($action == 'edit') {
- if (! GETPOST('cancel', 'alpha')) {
+ if (! $cancel) {
$result = $object->fetch($id);
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
@@ -119,10 +119,10 @@ if ($action == 'add') {
$account_number = clean_account(GETPOST('account_number'));
}
- if (GETPOST('account_category') <= 0) {
- $account_parent = '';
+ if (GETPOST('account_parent') <= 0) {
+ $account_parent = 0;
} else {
- $account_parent = GETPOST('account_category','int');
+ $account_parent = GETPOST('account_parent','int');
}
$object->fk_pcg_version = $obj->pcg_version;
@@ -165,7 +165,9 @@ if ($action == 'add') {
/*
* View
*/
-llxheader('', $langs->trans('AccountAccounting'));
+$title = $langs->trans('AccountAccounting') ." - ". $langs->trans('Card');
+$helpurl = '';
+llxheader('', $title, $helpurl);
$form = new Form($db);
$htmlacc = new FormVentilation($db);
@@ -184,7 +186,7 @@ if ($action == 'create') {
print '