accounting workflows
This commit is contained in:
@@ -128,8 +128,8 @@
|
||||
checkRequired: 0,
|
||||
action: 'read',
|
||||
onSuccess: function(res) {
|
||||
alasql('CREATE TABLE IF NOT EXISTS ac_department');
|
||||
alasql.tables.ac_department.data = res.output || [];
|
||||
alasql('CREATE TABLE IF NOT EXISTS md_department');
|
||||
alasql.tables.md_department.data = res.output || [];
|
||||
change_page(1);
|
||||
}
|
||||
});
|
||||
@@ -140,10 +140,10 @@
|
||||
var kw = search_term.toLowerCase();
|
||||
|
||||
var filtered = kw
|
||||
? alasql(`SELECT * FROM ac_department WHERE LOWER(dept_code) LIKE '%${kw}%' OR LOWER(dept_name) LIKE '%${kw}%' ORDER BY dept_code`)
|
||||
: alasql(`SELECT * FROM ac_department ORDER BY dept_code`);
|
||||
? alasql(`SELECT * FROM md_department WHERE LOWER(dept_code) LIKE '%${kw}%' OR LOWER(dept_name) LIKE '%${kw}%' ORDER BY dept_code`)
|
||||
: alasql(`SELECT * FROM md_department ORDER BY dept_code`);
|
||||
|
||||
$('table#dept_table tfoot').html(generate_pagination('ac_department', filtered.length));
|
||||
$('table#dept_table tfoot').html(generate_pagination('dept_table', filtered.length));
|
||||
|
||||
if (filtered.length === 0) {
|
||||
$('table#dept_table tbody').html('<tr><td colspan="5" class="text-center py-5 text-muted">No departments found.</td></tr>');
|
||||
|
||||
Reference in New Issue
Block a user