mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 11:06:28 +00:00
modify query generate cash in sales and add indexing
This commit is contained in:
@@ -364,7 +364,11 @@ const getSalesInternal = async (trx, code, date, invoice) => {
|
||||
.where('tdpr.c_status', '=', 'S')
|
||||
.whereNotNull('tdsi.c_return_sap_fi')
|
||||
.whereRaw(
|
||||
`tdskm.c_sales_no NOT IN (SELECT c_reservation_no FROM payment.t_d_cash_in_detail WHERE b_reversal IS NOT TRUE)`
|
||||
`NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM payment.t_d_cash_in_detail cid
|
||||
WHERE cid.c_reservation_no = tdskm.c_sales_no
|
||||
AND cid.b_reversal IS NOT TRUE)`
|
||||
);
|
||||
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user