upd
This commit is contained in:
@ -83,7 +83,7 @@ class FinanceAdapter extends Adapter{
|
|||||||
try {
|
try {
|
||||||
let idxpo = req.query.idxpo;
|
let idxpo = req.query.idxpo;
|
||||||
|
|
||||||
let qry = "select v.*, COALESCE(c.currency, 'USD') AS currency_code, COALESCE(c.symbol, '$') AS currency_symbol, po.rate_snapshot AS po_rate_snapshot ";
|
let qry = "select v.*, COALESCE(c.currency, 'USD') AS currency_code, COALESCE(c.symbol, '$') AS currency_symbol, po.rate_snapshot AS po_rate_snapshot, po.currency_id AS po_currency_id ";
|
||||||
qry += "from vw_popaylist v ";
|
qry += "from vw_popaylist v ";
|
||||||
qry += "left join tbl_po po on po._idx = v.idxpo ";
|
qry += "left join tbl_po po on po._idx = v.idxpo ";
|
||||||
qry += "left join tbl_currency c on c._idx = po.currency_id ";
|
qry += "left join tbl_currency c on c._idx = po.currency_id ";
|
||||||
@ -251,12 +251,17 @@ class FinanceAdapter extends Adapter{
|
|||||||
let reviewdescription = req.body.reviewdescription;
|
let reviewdescription = req.body.reviewdescription;
|
||||||
let nik = req.body.nik;
|
let nik = req.body.nik;
|
||||||
let checklistdata = req.body.checklistdata;
|
let checklistdata = req.body.checklistdata;
|
||||||
|
let currency_id = req.body.currency_id ?? null;
|
||||||
|
let rate_snapshot = req.body.rate_snapshot ?? null;
|
||||||
|
|
||||||
// console.log(checklistdata)
|
// console.log(checklistdata)
|
||||||
|
|
||||||
let qry = "insert into tbl_finance set idxpo='"+idxpo+"',ponumber='"+ponumber+"',idxvendor='"+idxvendor+"',";
|
let qry = "insert into tbl_finance set idxpo='"+idxpo+"',ponumber='"+ponumber+"',idxvendor='"+idxvendor+"',";
|
||||||
qry = qry + "vendorname='"+vendorname+"',totalpo='"+totalpo+"',contractnumber='"+contractnumber+"',";
|
qry = qry + "vendorname='"+vendorname+"',totalpo='"+totalpo+"',contractnumber='"+contractnumber+"',";
|
||||||
qry = qry + "percentpay='"+percentpay+"',totalinvoice='"+totalinvoice+"',payto='"+payto+"',paymentdate='"+paymentdate+"',";
|
qry = qry + "percentpay='"+percentpay+"',totalinvoice='"+totalinvoice+"',";
|
||||||
|
qry = qry + (currency_id ? "currency_id='"+currency_id+"'," : "");
|
||||||
|
qry = qry + (rate_snapshot ? "rate_snapshot='"+rate_snapshot+"'," : "");
|
||||||
|
qry = qry + "payto='"+payto+"',paymentdate='"+paymentdate+"',";
|
||||||
qry = qry + "payperiod='"+payperiod+"',whtvalue='"+whtvalue+"',costcenter='"+costcenter+"',";
|
qry = qry + "payperiod='"+payperiod+"',whtvalue='"+whtvalue+"',costcenter='"+costcenter+"',";
|
||||||
qry = qry + "description='"+description+"',status='"+status+"',statusdescription='"+statusdescription+"',";
|
qry = qry + "description='"+description+"',status='"+status+"',statusdescription='"+statusdescription+"',";
|
||||||
qry = qry + "laststatusupdate=now(),nikpreparedby='"+nikpreparedby+"',prepareddate='"+prepareddate+"',";
|
qry = qry + "laststatusupdate=now(),nikpreparedby='"+nikpreparedby+"',prepareddate='"+prepareddate+"',";
|
||||||
|
|||||||
Reference in New Issue
Block a user