FIX: Accountancy - Correct the display of account_parent
This commit is contained in:
parent
281b06a2d3
commit
0c5f504881
@ -161,11 +161,11 @@ if ($result) {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_accountparent" value="' . $search_accountparent . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="' . $search_account . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_accountparent" value="' . $search_accountparent . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td align="right" colspan="2" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
@ -190,7 +190,7 @@ if ($result) {
|
||||
print '<td>' . $accountstatic->getNomUrl(1) . '</td>';
|
||||
print '<td>' . $obj->label . '</td>';
|
||||
|
||||
if ($obj->account_parent)
|
||||
if (! empty($obj->account_parent))
|
||||
{
|
||||
$accountparent->id = $obj->rowid2;
|
||||
$accountparent->label = $obj->label2;
|
||||
|
||||
@ -59,12 +59,17 @@ if ($action == 'add') {
|
||||
|
||||
// Clean code
|
||||
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
|
||||
if (GETPOST('account_category') <= 0) {
|
||||
$account_parent = '';
|
||||
} else {
|
||||
$account_parent = GETPOST('account_category','int');
|
||||
}
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type');
|
||||
$object->pcg_subtype = GETPOST('pcg_subtype');
|
||||
$object->account_number = $account_number;
|
||||
$object->account_parent = GETPOST('account_parent', 'int');
|
||||
$object->account_parent = $account_parent;
|
||||
$object->account_category = GETPOST('account_category');
|
||||
$object->label = GETPOST('label', 'alpha');
|
||||
$object->active = 1;
|
||||
@ -96,12 +101,17 @@ if ($action == 'add') {
|
||||
|
||||
// Clean code
|
||||
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
|
||||
|
||||
if (GETPOST('account_category') <= 0) {
|
||||
$account_parent = '';
|
||||
} else {
|
||||
$account_parent = GETPOST('account_category','int');
|
||||
}
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type');
|
||||
$object->pcg_subtype = GETPOST('pcg_subtype');
|
||||
$object->account_number = $account_number;
|
||||
$object->account_parent = GETPOST('account_parent', 'int');
|
||||
$object->account_parent = account_parent;
|
||||
$object->account_category = GETPOST('account_category');
|
||||
$object->label = GETPOST('label', 'alpha');
|
||||
|
||||
|
||||
@ -342,3 +342,5 @@ CREATE TABLE llx_c_accounting_category (
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_c_accounting_category ADD UNIQUE INDEX uk_c_accounting_category(code);
|
||||
|
||||
ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer;
|
||||
|
||||
@ -29,7 +29,7 @@ create table llx_accounting_account
|
||||
pcg_type varchar(20) NOT NULL,
|
||||
pcg_subtype varchar(20) NOT NULL,
|
||||
account_number varchar(32) NOT NULL,
|
||||
account_parent varchar(32),
|
||||
account_parent integer, -- Hierarchic parent
|
||||
label varchar(255) NOT NULL,
|
||||
fk_accounting_category integer DEFAULT 0,
|
||||
fk_user_author integer DEFAULT NULL,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user