From 3d45a7f35995f2ec26f11e33de9f12a35870dfd6 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 9 Oct 2024 11:32:11 +0700 Subject: add where condition in calculate margin invoice v2 --- calculate_margin_invoice_v2.ktr | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/calculate_margin_invoice_v2.ktr b/calculate_margin_invoice_v2.ktr index 83afda0..f145e2b 100644 --- a/calculate_margin_invoice_v2.ktr +++ b/calculate_margin_invoice_v2.ktr @@ -1166,7 +1166,8 @@ left join res_partner rp3 on rp3.id = tsol.vendor_id where aml.account_id in (466) and am.state = 'posted' and tso.state in ('sale', 'done') -and aml.date >= '2024-06-01' +--and aml.date >= '2024-06-01' +and aml.write_date >= (now() - '3 days'::interval) order by tsol.id 0 @@ -1623,7 +1624,7 @@ order by tsol.id 368 - 128 + 112 Y @@ -1658,7 +1659,8 @@ left join res_partner rp3 on rp3.id = tsol.vendor_id where aml.account_id in (462) and am.state = 'posted' and tso.state in ('sale', 'done') -and aml.date >= '2024-06-01' +--and aml.date >= '2024-06-01' +and aml.write_date >= (now() - '3 days'::interval) order by tsol.id 0 -- cgit v1.2.3