mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 21:56:27 +00:00
Upddate
This commit is contained in:
@@ -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