From c0d216c1f3c1bbfcd8939c7d8afe9ca775e5ffbd Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 19 Mar 2024 15:17:35 +0700 Subject: update calculate price with order by group brand vendor --- calculate_price_after_disc.ktr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calculate_price_after_disc.ktr b/calculate_price_after_disc.ktr index 4b477a3..6e1688a 100644 --- a/calculate_price_after_disc.ktr +++ b/calculate_price_after_disc.ktr @@ -626,7 +626,7 @@ coalesce(( join product p2 on p2.product_id = ppd.product_id where ppd.product_id = p.product_id and (system_last_update >= (now() - '365 days'::interval) or human_last_update >= (now() - '365 days'::interval) or p2.qty_available > 0) - order by ppd.count_trx_po desc, ppd.count_trx_po_vendor desc + order by ppd.count_brand_vendor desc, ppd.count_trx_po desc, ppd.count_trx_po_vendor desc limit 1 ),0) as purchase_price, coalesce(( @@ -637,7 +637,7 @@ coalesce(( join res_partner rp on rp.id = ppd.vendor_id where ppd.product_id = p.product_id and (system_last_update >= (now() - '365 days'::interval) or human_last_update >= (now() - '365 days'::interval) or p2.qty_available > 0) - order by ppd.count_trx_po desc, ppd.count_trx_po_vendor desc + order by ppd.count_brand_vendor desc, ppd.count_trx_po desc, ppd.count_trx_po_vendor desc limit 1 ),'-') as vendor, (select group1 from price_group_dw pgd where id = 2) as markup_std1, -- cgit v1.2.3