mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 19:16:27 +00:00
Update cahsin
This commit is contained in:
@@ -167,6 +167,8 @@ const _generateCashIn = async (uniqueCode) => {
|
||||
winston.logger.info(`SCHEDULER-FB70-${uniqueCode} cash in ${code} data : ${JSON.stringify(dataCahsIn)}`)
|
||||
const cashIn = await model.insertCashIn(trx, dataCahsIn)
|
||||
|
||||
const paymentyHistory = await model.writePaynentHistory(dataCahsIn, "SUCCESSFULLY", 0, trx)
|
||||
|
||||
// Insert cahs in detail
|
||||
let data = []
|
||||
const reserv = await model.getReserve(trx, item.c_partner_code, item.d_payment)
|
||||
|
||||
@@ -154,28 +154,6 @@ const setReturnSAP = async (code, resSAP, trx) => {
|
||||
|
||||
}
|
||||
|
||||
const writePaynentHistory = async (data, trx) => {
|
||||
console.log(data)
|
||||
const result = await trx('log.t_log_invoice').insert({
|
||||
i_log_name : 102,
|
||||
d_log : trx.raw('NOW()'),
|
||||
c_invoice_no : data.c_invoice_no,
|
||||
c_partner_name : data.c_partner_name,
|
||||
j_new_data : JSON.stringify(data),
|
||||
d_payment_date: trx.raw('NOW()'),
|
||||
c_note : 'SUCCESSFULLY',
|
||||
c_status : 'S',
|
||||
d_created : trx.raw('NOW()'),
|
||||
m_amount : data.amount,
|
||||
m_mdr_amount : 0,
|
||||
m_mdr_net : data.amount
|
||||
|
||||
}, ['i_log_name', 'c_note'])
|
||||
|
||||
return result
|
||||
|
||||
}
|
||||
|
||||
const getRecon = async (trx) => {
|
||||
|
||||
let sql = `SELECT
|
||||
@@ -355,6 +333,29 @@ const insertCashIn = async (trx, data) => {
|
||||
return result[0]
|
||||
}
|
||||
|
||||
const writePaynentHistory = async (data, message, i_log_name, trx) => {
|
||||
console.log(data)
|
||||
const result = await trx('log.t_log_invoice').insert({
|
||||
// i_log_name : 102,
|
||||
i_log_name : 119,
|
||||
d_log : trx.raw('NOW()'),
|
||||
c_invoice_no : data.c_cash_in_no,
|
||||
c_partner_name : data.c_partner_name,
|
||||
j_new_data : JSON.stringify(data),
|
||||
d_payment_date: trx.raw('NOW()'),
|
||||
c_note : message,
|
||||
c_status : 'S',
|
||||
d_created : trx.raw('NOW()'),
|
||||
m_amount : data.amount,
|
||||
m_mdr_amount : 0,
|
||||
m_mdr_net : data.amount
|
||||
|
||||
}, ['i_log_name', 'c_note'])
|
||||
|
||||
return result
|
||||
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
generateInvoice,
|
||||
insertPostingEt,
|
||||
|
||||
Reference in New Issue
Block a user