mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 20:26:28 +00:00
Update
This commit is contained in:
@@ -468,15 +468,16 @@ 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)
|
||||
winston.logger.info(`SCHEDULER-RETRY-${uniqueCode} RETRY INVOICE ${JSON.stringify(invoice)}`);
|
||||
|
||||
const cms = await model.setReturnSAP(
|
||||
invoice,
|
||||
resSAP,
|
||||
trx,
|
||||
false,
|
||||
item.reference
|
||||
);
|
||||
);
|
||||
await wait(2000)
|
||||
|
||||
winston.logger.info(
|
||||
`SCHEDULER-RETRY-${uniqueCode} RESULT CMS : ${JSON.stringify(cms)}`
|
||||
@@ -490,6 +491,10 @@ const _postingInvoice = async (uniqueCode) => {
|
||||
return collection;
|
||||
};
|
||||
|
||||
function wait(milliseconds) {
|
||||
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
validate,
|
||||
apiPostingInvoice,
|
||||
|
||||
Reference in New Issue
Block a user