mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 23:46:28 +00:00
Update invoice
This commit is contained in:
@@ -168,6 +168,11 @@ const _generateInvoice = async (invoiceDate, uniqueCode) => {
|
||||
winston.logger.info(`SCHEDULER-FB70-${uniqueCode} success insert posting et : ${JSON.stringify(postingEt)}`)
|
||||
}
|
||||
|
||||
// write payment history
|
||||
winston.logger.info(`SCHEDULER-FB70-${uniqueCode} insert payment history et : ${JSON.stringify(invoice)}`)
|
||||
let history = await model.writePaynentHistory(invoice, trx)
|
||||
winston.logger.info(`SCHEDULER-FB70-${uniqueCode} result insert payment history et : ${JSON.stringify(history)}`)
|
||||
|
||||
})
|
||||
|
||||
if(invoice.length > 0){
|
||||
|
||||
@@ -125,9 +125,29 @@ const setReturnSAP = async (invoice, resSAP, trx) => {
|
||||
|
||||
}
|
||||
|
||||
const writePaynentHistory = async (data, trx) => {
|
||||
|
||||
const result = await trx('public.t_log_invoice').insert({
|
||||
i_log_name : 27,
|
||||
d_log : trx.raw('NOW()'),
|
||||
c_invoice_no : data.c_invoice_no,
|
||||
i_partner : data.i_partner,
|
||||
c_partner_name : data.c_partner_name,
|
||||
j_new_data : trx.raw(`${JSON.stringify(data)}::jsonb`),
|
||||
c_device_type : 'WEB CMS',
|
||||
c_note : 'SUKSES POSTING TO INVOICE',
|
||||
c_status : 'S',
|
||||
d_created : trx.raw('NOW()')
|
||||
}, ['i_log_name', 'c_note'])
|
||||
|
||||
return result
|
||||
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
generateInvoice,
|
||||
insertPostingEt,
|
||||
setReturnSAP,
|
||||
getPostingEt
|
||||
getPostingEt,
|
||||
writePaynentHistory
|
||||
};
|
||||
Reference in New Issue
Block a user