Fix filter on parent account in list of accounting accounts
This commit is contained in:
parent
fd02ed4317
commit
a36b0ea4f5
@ -27,6 +27,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries"));
|
||||
@ -180,6 +181,7 @@ if (empty($reshook))
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
llxHeader('', $langs->trans("ListAccounts"));
|
||||
|
||||
@ -200,7 +202,7 @@ $sql .= " WHERE asy.rowid = ".$pcgver;
|
||||
//print $sql;
|
||||
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
|
||||
if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label);
|
||||
if (strlen(trim($search_accountparent))) $sql .= natural_search("aa.account_parent", $search_accountparent);
|
||||
if (strlen(trim($search_accountparent)) && $search_accountparent != '-1') $sql .= natural_search("aa.account_parent", $search_accountparent, 2);
|
||||
if (strlen(trim($search_pcgtype))) $sql .= natural_search("aa.pcg_type", $search_pcgtype);
|
||||
if (strlen(trim($search_pcgsubtype))) $sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype);
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
@ -232,7 +234,7 @@ if ($resql)
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
|
||||
if ($search_account) $param .= '&search_account='.urlencode($search_account);
|
||||
if ($search_label) $param .= '&search_label='.urlencode($search_label);
|
||||
if ($search_accountparent) $param .= '&search_accountparent='.urlencode($search_accountparent);
|
||||
if ($search_accountparent > 0 || $search_accountparent == '0') $param .= '&search_accountparent='.urlencode($search_accountparent);
|
||||
if ($search_pcgtype) $param .= '&search_pcgtype='.urlencode($search_pcgtype);
|
||||
if ($search_pcgsubtype) $param .= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||
if ($optioncss != '') $param .= '&optioncss='.$optioncss;
|
||||
@ -316,8 +318,13 @@ if ($resql)
|
||||
print '<tr class="liste_titre_filter">';
|
||||
if (!empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="'.$search_account.'"></td>';
|
||||
if (!empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
|
||||
if (!empty($arrayfields['aa.account_parent']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_accountparent" value="'.$search_accountparent.'"></td>';
|
||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
||||
if (!empty($arrayfields['aa.account_parent']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print $formaccounting->select_account($search_accountparent, 'search_accountparent', 2);
|
||||
//print '<input type="text" class="flat" size="10" name="search_accountparent" value="'.$search_accountparent.'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
||||
if (!empty($arrayfields['aa.pcg_subtype']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="'.$search_pcgsubtype.'"></td>';
|
||||
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
@ -339,6 +346,7 @@ if ($resql)
|
||||
$accountstatic = new AccountingAccount($db);
|
||||
$accountparent = new AccountingAccount($db);
|
||||
|
||||
$totalarray = array();
|
||||
$i = 0;
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
|
||||
@ -6235,7 +6235,7 @@ class Form
|
||||
|
||||
$out .= '<option value="'.$key.'"';
|
||||
$out .= $style.$disabled;
|
||||
if ($id != '' && $id == $key && !$disabled) $out .= ' selected'; // To preselect a value
|
||||
if (((string) $id) != '' && $id == $key && !$disabled) $out .= ' selected'; // To preselect a value
|
||||
if ($nohtmlescape) $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
|
||||
if (is_array($tmpvalue))
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user