Skip to content
Snippets Groups Projects
Commit 55a83f9d authored by aspangaro's avatar aspangaro
Browse files

Fix: Accountancy - Problem to define account_parent for an accounting account & presentation

parent 8c63d680
No related branches found
No related tags found
No related merge requests found
......@@ -69,10 +69,10 @@ if ($action == 'add') {
$account_number = clean_account(GETPOST('account_number'));
}
if (GETPOST('account_category') <= 0) {
if (GETPOST('account_parent') <= 0) {
$account_parent = '';
} 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 '<table class="border" width="100%">';
// Account number
print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"</td></tr>';
// Label
......@@ -247,7 +249,7 @@ if ($action == 'create') {
print '<table class="border" width="100%">';
// Account number
print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"</td></tr>';
// Label
......@@ -299,7 +301,7 @@ if ($action == 'create') {
print '<table class="border" width="100%">';
// Account number
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
print '<tr><td class="titlefield">' . $langs->trans("AccountNumber") . '</td>';
print '<td>' . $object->account_number . '</td>';
print '<td align="right" width="25%">' . $linkback . '</td></tr>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment