This commit is contained in:
Rizki
2026-03-25 10:51:03 +07:00
parent 963e791b5f
commit 6954099cab

View File

@ -321,9 +321,12 @@ class FinanceAdapter extends Adapter{
// qry = qry + "where podescription like '%" + keyword + "%' ";
// qry = qry + "order by idxpo asc limit " + offset + ", " + limit;
let qry = "select * from vw_financelist ";
qry = qry + "where podescription like '%" + keyword + "%' ";
qry = qry + "order by idxpo asc";
let qry = "select v.*, COALESCE(c.currency, 'USD') AS currency_code, COALESCE(c.symbol, '$') AS currency_symbol, po.rate_snapshot AS po_rate_snapshot ";
qry += "from vw_financelist v ";
qry += "left join tbl_po po on po._idx = v.idxpo ";
qry += "left join tbl_currency c on c._idx = po.currency_id ";
qry += "where v.podescription like '%" + keyword + "%' ";
qry += "order by v.idxpo asc";
// console.log(qry);
db.query(qry,[],function(err,result,fields){
@ -345,9 +348,12 @@ class FinanceAdapter extends Adapter{
"totalpage": pagination,
"totalrows": result.length
});
qry = "select * from vw_financelist ";
qry = qry + "where podescription like '%" + keyword + "%' ";
qry = qry + "order by idxpo asc limit " + offset + ", " + limit;
qry = "select v.*, COALESCE(c.currency, 'USD') AS currency_code, COALESCE(c.symbol, '$') AS currency_symbol, po.rate_snapshot AS po_rate_snapshot ";
qry += "from vw_financelist v ";
qry += "left join tbl_po po on po._idx = v.idxpo ";
qry += "left join tbl_currency c on c._idx = po.currency_id ";
qry += "where v.podescription like '%" + keyword + "%' ";
qry += "order by v.idxpo asc limit " + offset + ", " + limit;
db.query(qry,[],function(err,result,fields){
if(err){
apires.meta['message'] = err.toString();