mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 10:56:27 +00:00
update generate cash-in
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user