From b1be54d5ba060de6fcde0850dc8ade9f0dbfb27e Mon Sep 17 00:00:00 2001 From: lutfi Date: Thu, 28 Dec 2023 14:19:37 +0700 Subject: [PATCH] update generate cash-in --- application/modules/cashin/cahsin.model.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/modules/cashin/cahsin.model.js b/application/modules/cashin/cahsin.model.js index 55dde8a..a7cf714 100644 --- a/application/modules/cashin/cahsin.model.js +++ b/application/modules/cashin/cahsin.model.js @@ -372,7 +372,7 @@ const getPartnerRecon = async (trx) => { 'tdi.d_invoice_date', trx.raw("to_char(tdpr.d_payment, 'YYYY-MM-DD') AS d_payment"), trx.raw('coalesce(SUM(tdrb.i_reservation_amount),0) AS amount'), - trx.raw('coalesce(SUM(tdcid.m_amount),0) AS amount_cash_in'), + // trx.raw('coalesce(SUM(tdcid.m_amount),0) AS amount_cash_in'), 'tmp.c_account_topup', 'tmp.c_account_code_topup', 'i_company', @@ -401,9 +401,9 @@ const getPartnerRecon = async (trx) => { .leftJoin('public.t_m_partner as tmp', function () { this.on('tmp.i_partner', '=', 'tdrb.i_partner'); }) - .leftJoin('payment.t_d_cash_in_detail as tdcid', function () { - this.on('tdcid.c_reservation_no', '=', 'tdrb.c_reservation_no'); - }) + // .leftJoin('payment.t_d_cash_in_detail as tdcid', function () { + // this.on('tdcid.c_reservation_no', '=', 'tdrb.c_reservation_no'); + // }) .where('tdrb.c_status', '=', 'A') .where('tdi.c_status', '!=', 'X') @@ -421,10 +421,10 @@ const getPartnerRecon = async (trx) => { 'tmp.c_account_code_topup', 'tdi.i_company', 'i_holding', - ]) - .havingRaw( - 'coalesce(SUM(tdrb.i_reservation_amount),0) > coalesce(SUM(tdcid.m_amount),0)' - ); + ]); + // .havingRaw( + // 'coalesce(SUM(tdrb.i_reservation_amount),0) > coalesce(SUM(tdcid.m_amount),0)' + // ); return res; };