mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 12:36:27 +00:00
Add invoice History
This commit is contained in:
@@ -161,6 +161,12 @@ const _generateInvoice = async (invoiceDate, uniqueCode) => {
|
||||
|
||||
if(invoice.length > 0) for (const key in invoice) {
|
||||
|
||||
winston.logger.info(`SCHEDULER-FB70-${uniqueCode} insert payment history et : ${JSON.stringify(invoice)}`)
|
||||
|
||||
let history = await model.writePaynentHistory(invoice[key], trx)
|
||||
|
||||
winston.logger.info(`SCHEDULER-FB70-${uniqueCode} result insert payment history et : ${JSON.stringify(history)}`)
|
||||
|
||||
winston.logger.info(`SCHEDULER-FB70-${uniqueCode} insert posting et ${JSON.stringify(invoice[key])}`)
|
||||
|
||||
let postingEt = await model.insertPostingEt(invoice[key], trx)
|
||||
@@ -168,10 +174,6 @@ 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)}`)
|
||||
|
||||
})
|
||||
|
||||
@@ -209,11 +211,11 @@ const _generateInvoice = async (invoiceDate, uniqueCode) => {
|
||||
|
||||
let xmlRequest = helper.generateXMLRequest('ZFMCMS_FI_001', xmlHeader, xmlItem)
|
||||
|
||||
winston.logger.info(`SCHEDULER-FB70-${uniqueCode} REQUEST posting ${invoice[key].c_invoice_no} to SAP : ${xmlRequest}`);
|
||||
winston.logger.debug(`SCHEDULER-FB70-${uniqueCode} REQUEST posting ${invoice[key].c_invoice_no} to SAP : ${xmlRequest}`);
|
||||
|
||||
const response = await helper.postingSAP(url, xmlRequest)
|
||||
|
||||
winston.logger.info(`SCHEDULER-FB70-${uniqueCode} RESPONSE posting ${invoice[key].c_invoice_no} to SAP : ${JSON.stringify(response)}`);
|
||||
winston.logger.debug(`SCHEDULER-FB70-${uniqueCode} RESPONSE posting ${invoice[key].c_invoice_no} to SAP : ${JSON.stringify(response)}`);
|
||||
|
||||
// new transaction
|
||||
await knex.transaction(async trx => {
|
||||
|
||||
Reference in New Issue
Block a user