From 3c8fc4d81d10dd74b29236f557e2e0aa2deb0d10 Mon Sep 17 00:00:00 2001 From: lutfi Date: Wed, 1 Jan 2025 14:52:36 +0700 Subject: [PATCH] update cash in --- application/modules/cashin/cahsin.controller.js | 12 ++++++++++++ application/modules/cashin/cahsin.model.js | 8 +++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/application/modules/cashin/cahsin.controller.js b/application/modules/cashin/cahsin.controller.js index 28dbd67..c13eda9 100644 --- a/application/modules/cashin/cahsin.controller.js +++ b/application/modules/cashin/cahsin.controller.js @@ -261,6 +261,12 @@ const _generateCashIn = async (uniqueCode) => { item.d_payment, item.c_invoice_no ); + + winston.logger.info( + `SCHEDULER-FB70-${uniqueCode} cashIn reserv ${code} DATA : ${JSON.stringify( + reserv + )}` + ); //TOTAL AMOUNT CASH-IN let cashInAmount = 0; @@ -269,6 +275,12 @@ const _generateCashIn = async (uniqueCode) => { } dataCahsIn.i_amount = cashInAmount; + winston.logger.info( + `SCHEDULER-FB70-${uniqueCode} cashInAmount ${code} DATA : ${JSON.stringify( + cashInAmount + )}` + ); + if(cashInAmount > 0) { //INSERT CASH-IN const cashIn = await model.insertCashIn(trx, dataCahsIn); diff --git a/application/modules/cashin/cahsin.model.js b/application/modules/cashin/cahsin.model.js index 5f64591..104c251 100644 --- a/application/modules/cashin/cahsin.model.js +++ b/application/modules/cashin/cahsin.model.js @@ -299,9 +299,11 @@ const getReserve = async (trx, code, date, invoice) => { .where('tdpr.c_status', '=', 'S') .whereNotNull('tdi.c_return_sap') .whereNotNull('tdrb.c_load_balance_no') - .whereRaw( - `tdrb.c_reservation_no in (SELECT c_reservation_no FROM payment.t_d_payment_recon where c_status = 'S' ) AND tdrb.c_reservation_no NOT IN (SELECT c_reservation_no FROM payment.t_d_cash_in_detail WHERE b_reversal IS NOT TRUE)` - ); + .whereNull('tdrb.c_cash_in_no') + // .whereRaw( + // `tdrb.c_reservation_no in (SELECT c_reservation_no FROM payment.t_d_payment_recon where c_status = 'S' ) AND tdrb.c_reservation_no NOT IN (SELECT c_reservation_no FROM payment.t_d_cash_in_detail WHERE b_reversal IS NOT TRUE)` + // ); + return res; };