mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 10:46:28 +00:00
bug fixed generate cash-in untuk transaksi topup cashless internal
This commit is contained in:
@@ -784,11 +784,12 @@ const _generateCashInTopUpCashlessInternal = async (uniqueCode) => {
|
||||
//TOTAL AMOUNT CASH-IN
|
||||
let cashInAmount = 0;
|
||||
for (const itemCI of topup) {
|
||||
cashInAmount += parseInt(itemCI.i_total_amount);
|
||||
cashInAmount += parseInt(itemCI.i_amount);
|
||||
}
|
||||
dataCahsIn.i_amount = cashInAmount;
|
||||
|
||||
if(cashInAmount > 0) {
|
||||
|
||||
//INSERT CASH-IN
|
||||
const cashIn = await model.insertCashIn(trx, dataCahsIn);
|
||||
winston.logger.info(
|
||||
@@ -805,7 +806,7 @@ const _generateCashInTopUpCashlessInternal = async (uniqueCode) => {
|
||||
let temp = {
|
||||
i_cash_in: cashIn.i_cash_in,
|
||||
c_reservation_no: detail.c_topup_no,
|
||||
m_amount: detail.i_total_amount,
|
||||
m_amount: detail.i_amount,
|
||||
c_payment_recon_no: detail.c_payment_recon_no,
|
||||
d_payment: detail.d_payment,
|
||||
d_payment_recon: detail.d_payment_recon,
|
||||
@@ -815,7 +816,7 @@ const _generateCashInTopUpCashlessInternal = async (uniqueCode) => {
|
||||
let dataTopup = {
|
||||
i_cash_in: cashIn.i_cash_in,
|
||||
};
|
||||
m_amount += parseInt(detail.i_total_amount);
|
||||
m_amount += parseInt(detail.i_amount);
|
||||
|
||||
if(m_amount <= detail.invoice_amount) {
|
||||
await model.updateIntoTopUpCashlessInternal(trx, dataTopup, topupNo);
|
||||
|
||||
Reference in New Issue
Block a user