diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2024-03-19 15:17:35 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2024-03-19 15:17:35 +0700 |
| commit | c0d216c1f3c1bbfcd8939c7d8afe9ca775e5ffbd (patch) | |
| tree | bedb8bf79b431475d3bf441df34c3d79c5a096ba | |
| parent | 5882074ab09c141c9382a76e5034ee0354b02579 (diff) | |
update calculate price with order by group brand vendor
| -rw-r--r-- | calculate_price_after_disc.ktr | 4 |
1 files 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, |
