Merge pull request #17865 from ATM-Consulting/NEW_develop_autocomplete_accounting_account_groups
New develop autocomplete accounting account groups
This commit is contained in:
commit
aee291d079
@ -257,7 +257,16 @@ if ($action == 'create') {
|
|||||||
print $form->textwithpicto($langs->trans("Pcgtype"), $langs->transnoentitiesnoconv("PcgtypeDesc"));
|
print $form->textwithpicto($langs->trans("Pcgtype"), $langs->transnoentitiesnoconv("PcgtypeDesc"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
print '<input type="text" name="pcg_type" list="pcg_type_datalist" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||||
|
// autosuggest from existing account types if found
|
||||||
|
print '<datalist id="pcg_type_datalist">';
|
||||||
|
$sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account';
|
||||||
|
$sql .= ' WHERE fk_pcg_version = "' . $db->escape($accountsystem->ref) . '"';
|
||||||
|
$sql .= ' LIMIT 50000'; // just as a sanity check
|
||||||
|
foreach ($db->getRows($sql) as $obj) {
|
||||||
|
print '<option value="' . dol_escape_htmltag($obj->pcg_type) . '">';
|
||||||
|
}
|
||||||
|
print '</datalist>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Category
|
// Category
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user