mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 11:46:27 +00:00
Upddate
This commit is contained in:
@@ -468,7 +468,7 @@ const _postingInvoice = async (uniqueCode) => {
|
||||
winston.logger.info(`SCHEDULER-RETRY-${uniqueCode} ITEM REFERENCE ${item.reference}`);
|
||||
winston.logger.info(`SCHEDULER-RETRY-${uniqueCode} URL SAP ${parameter.c_value}`);
|
||||
let invoice = await model.getInvoice(item.reference, trx)
|
||||
await wait(2000)
|
||||
await wait(1000)
|
||||
winston.logger.info(`SCHEDULER-RETRY-${uniqueCode} RETRY INVOICE ${JSON.stringify(invoice)}`);
|
||||
const cms = await model.setReturnSAP(
|
||||
invoice,
|
||||
@@ -477,7 +477,7 @@ const _postingInvoice = async (uniqueCode) => {
|
||||
false,
|
||||
item.reference
|
||||
);
|
||||
await wait(2000)
|
||||
await wait(1000)
|
||||
|
||||
winston.logger.info(
|
||||
`SCHEDULER-RETRY-${uniqueCode} RESULT CMS : ${JSON.stringify(cms)}`
|
||||
|
||||
@@ -92,8 +92,8 @@ const setReturnSAP = async (invoice, resSAP, trx, posting = false, c_invoice_no
|
||||
if(resSAP.type == 'S'){
|
||||
// update invoice
|
||||
t_invoice = await trx('payment.t_d_invoice').update({
|
||||
c_return_sap: "S-"+resSAP.data.E_DOCUMENTNUMBER
|
||||
}, ['c_invoice_no','c_return_sap','m_amount'])
|
||||
c_return_sap: resSAP.data.E_DOCUMENTNUMBER
|
||||
}, ["*"])
|
||||
.where({
|
||||
c_invoice_no: c_invoice_no
|
||||
});
|
||||
@@ -114,9 +114,9 @@ const setReturnSAP = async (invoice, resSAP, trx, posting = false, c_invoice_no
|
||||
})
|
||||
|
||||
if(posting) {
|
||||
await writePaynentHistory(invoice, "SUCCESSFULLY", 102, trx)
|
||||
await writePaynentHistory(t_invoice, "SUCCESSFULLY", 102, trx)
|
||||
} else {
|
||||
await writePaynentHistory(invoice, "SUCCESS TO RETRY SAP", 118, trx)
|
||||
await writePaynentHistory(t_invoice, "SUCCESS TO RETRY SAP", 118, trx)
|
||||
}
|
||||
|
||||
}else {
|
||||
@@ -143,7 +143,7 @@ const setReturnSAP = async (invoice, resSAP, trx, posting = false, c_invoice_no
|
||||
// update invoice
|
||||
t_invoice = await trx('payment.t_d_invoice').update({
|
||||
c_return_sap: doc_number
|
||||
}, ['c_invoice_no','c_return_sap','m_amount'])
|
||||
}, ['*'])
|
||||
.where({
|
||||
c_invoice_no: c_invoice_no
|
||||
});
|
||||
@@ -155,9 +155,9 @@ const setReturnSAP = async (invoice, resSAP, trx, posting = false, c_invoice_no
|
||||
.whereRaw(`c_load_balance_no IN (SELECT c_load_balance_no FROM payment.t_d_payment_request_topup_online WHERE c_payment = '${c_invoice_no}')`)
|
||||
|
||||
if(posting) {
|
||||
await writePaynentHistory(invoice, "SUCCESSFULLY", 102, trx)
|
||||
await writePaynentHistory(t_invoice, "SUCCESSFULLY", 102, trx)
|
||||
} else {
|
||||
await writePaynentHistory(invoice, "SUCCESS TO RETRY SAP", 118, trx)
|
||||
await writePaynentHistory(t_invoice, "SUCCESS TO RETRY SAP", 118, trx)
|
||||
}
|
||||
|
||||
}else{
|
||||
@@ -178,9 +178,9 @@ const setReturnSAP = async (invoice, resSAP, trx, posting = false, c_invoice_no
|
||||
});
|
||||
|
||||
if(posting) {
|
||||
await writePaynentHistory(invoice, `SUCCESS WITH SAP ERR: ${resSAP.message}`,102, trx)
|
||||
await writePaynentHistory(t_invoice, `SUCCESS WITH SAP ERR: ${resSAP.message}`,102, trx)
|
||||
} else {
|
||||
await writePaynentHistory(invoice, `FAIL TO RETRY WITH SAP ERR: ${resSAP.message}`,118, trx)
|
||||
await writePaynentHistory(t_invoice, `FAIL TO RETRY WITH SAP ERR: ${resSAP.message}`,118, trx)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user