From 1eebb8c2cbd3b79e4a9385653fb82433168d032e Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 21 Jan 2026 10:18:30 +0700 Subject: add calculate price group to 10 --- calculate_price_after_disc.ktr | 668 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 665 insertions(+), 3 deletions(-) (limited to 'calculate_price_after_disc.ktr') diff --git a/calculate_price_after_disc.ktr b/calculate_price_after_disc.ktr index 426b744..eac6ff3 100644 --- a/calculate_price_after_disc.ktr +++ b/calculate_price_after_disc.ktr @@ -442,8 +442,8 @@ Native dw_bi_indoteknik 5432 - pdi - Encrypted 2be989bb20084ca95810197629d9ea18e + odoo + Encrypted 2be98afc82bdfd8dd9a2ca45acc83f6c3 @@ -658,6 +658,8 @@ coalesce(( (select group6 from price_group_dw pgd where id = 2) as markup_std6, (select group7 from price_group_dw pgd where id = 2) as markup_std7, (select group8 from price_group_dw pgd where id = 2) as markup_std8, +(select group9 from price_group_dw pgd where id = 2) as markup_std9,--new +(select group10 from price_group_dw pgd where id = 2) as markup_std10,--new (select group1 from price_group_dw pgd where id = 1) as markup_group1, (select group2 from price_group_dw pgd where id = 1) as markup_group2, (select group3 from price_group_dw pgd where id = 1) as markup_group3, @@ -666,6 +668,8 @@ coalesce(( (select group6 from price_group_dw pgd where id = 1) as markup_group6, (select group7 from price_group_dw pgd where id = 1) as markup_group7, (select group8 from price_group_dw pgd where id = 1) as markup_group8, +(select group9 from price_group_dw pgd where id = 1) as markup_group9,--new +(select group10 from price_group_dw pgd where id = 1) as markup_group10,--new (select group1 from price_group_dw pgd where id = 3) as markup_tier2_1, (select group2 from price_group_dw pgd where id = 3) as markup_tier2_2, (select group3 from price_group_dw pgd where id = 3) as markup_tier2_3, @@ -674,6 +678,8 @@ coalesce(( (select group6 from price_group_dw pgd where id = 3) as markup_tier2_6, (select group7 from price_group_dw pgd where id = 3) as markup_tier2_7, (select group8 from price_group_dw pgd where id = 3) as markup_tier2_8, +(select group9 from price_group_dw pgd where id = 3) as markup_tier2_9,--new +(select group10 from price_group_dw pgd where id = 3) as markup_tier2_10,--new (select group1 from price_group_dw pgd where id = 4) as markup_tier3_1, (select group2 from price_group_dw pgd where id = 4) as markup_tier3_2, (select group3 from price_group_dw pgd where id = 4) as markup_tier3_3, @@ -682,6 +688,8 @@ coalesce(( (select group6 from price_group_dw pgd where id = 4) as markup_tier3_6, (select group7 from price_group_dw pgd where id = 4) as markup_tier3_7, (select group8 from price_group_dw pgd where id = 4) as markup_tier3_8, +(select group9 from price_group_dw pgd where id = 4) as markup_tier3_9,--new +(select group10 from price_group_dw pgd where id = 4) as markup_tier3_10,--new (select group1 from price_group_dw pgd where id = 5) as markup_tier4_1, (select group2 from price_group_dw pgd where id = 5) as markup_tier4_2, (select group3 from price_group_dw pgd where id = 5) as markup_tier4_3, @@ -690,6 +698,8 @@ coalesce(( (select group6 from price_group_dw pgd where id = 5) as markup_tier4_6, (select group7 from price_group_dw pgd where id = 5) as markup_tier4_7, (select group8 from price_group_dw pgd where id = 5) as markup_tier4_8, +(select group9 from price_group_dw pgd where id = 5) as markup_tier4_9,--new +(select group10 from price_group_dw pgd where id = 5) as markup_tier4_10,--new (select group1 from price_group_dw pgd where id = 6) as markup_tier5_1, (select group2 from price_group_dw pgd where id = 6) as markup_tier5_2, (select group3 from price_group_dw pgd where id = 6) as markup_tier5_3, @@ -697,7 +707,9 @@ coalesce(( (select group5 from price_group_dw pgd where id = 6) as markup_tier5_5, (select group6 from price_group_dw pgd where id = 6) as markup_tier5_6, (select group7 from price_group_dw pgd where id = 6) as markup_tier5_7, -(select group8 from price_group_dw pgd where id = 6) as markup_tier5_8 +(select group8 from price_group_dw pgd where id = 6) as markup_tier5_8, +(select group9 from price_group_dw pgd where id = 6) as markup_tier5_9,--new +(select group10 from price_group_dw pgd where id = 6) as markup_tier5_10--new from product p left join brand b on b.id = p.brand_id 0 @@ -2119,6 +2131,36 @@ left join brand b on b.id = p.brand_id + + diff1_9 + SUBTRACT + price_before_disc9 + price_after_disc_9 + + None + -1 + -1 + N + + + + + + + diff1_10 + SUBTRACT + price_before_disc10 + price_after_disc_10 + + None + -1 + -1 + N + + + + + diff2_1 SUBTRACT @@ -2239,6 +2281,36 @@ left join brand b on b.id = p.brand_id + + diff2_9 + SUBTRACT + price_before_disc9 + price_tier2_9 + + None + -1 + -1 + N + + + + + + + diff3_10 + SUBTRACT + price_before_disc10 + price_tier2_10 + + None + -1 + -1 + N + + + + + diff3_1 SUBTRACT @@ -2359,6 +2431,36 @@ left join brand b on b.id = p.brand_id + + diff3_9 + SUBTRACT + price_before_disc9 + price_tier3_9 + + None + -1 + -1 + N + + + + + + + diff3_10 + SUBTRACT + price_before_disc10 + price_tier3_10 + + None + -1 + -1 + N + + + + + diff4_1 SUBTRACT @@ -2479,6 +2581,36 @@ left join brand b on b.id = p.brand_id + + diff4_9 + SUBTRACT + price_before_disc9 + price_tier4_9 + + None + -1 + -1 + N + + + + + + + diff4_10 + SUBTRACT + price_before_disc10 + price_tier4_10 + + None + -1 + -1 + N + + + + + diff5_1 SUBTRACT @@ -2599,6 +2731,36 @@ left join brand b on b.id = p.brand_id + + diff5_9 + SUBTRACT + price_before_disc9 + price_tier5_9 + + None + -1 + -1 + N + + + + + + + diff5_10 + SUBTRACT + price_before_disc10 + price_tier5_10 + + None + -1 + -1 + N + + + + + @@ -2745,6 +2907,36 @@ left join brand b on b.id = p.brand_id + + disc1_9 + PERCENT_1 + diff1_9 + price_before_disc9 + + Number + -1 + -1 + N + + + + + + + disc1_10 + PERCENT_1 + diff1_10 + price_before_disc10 + + Number + -1 + -1 + N + + + + + disc2_1 PERCENT_1 @@ -2865,6 +3057,36 @@ left join brand b on b.id = p.brand_id + + disc2_9 + PERCENT_1 + diff2_9 + price_before_disc9 + + Number + -1 + -1 + N + + + + + + + disc2_10 + PERCENT_1 + diff2_10 + price_before_disc10 + + Number + -1 + -1 + N + + + + + disc3_1 PERCENT_1 @@ -2985,6 +3207,36 @@ left join brand b on b.id = p.brand_id + + disc3_9 + PERCENT_1 + diff3_9 + price_before_disc9 + + Number + -1 + -1 + N + + + + + + + disc3_10 + PERCENT_1 + diff3_10 + price_before_disc10 + + Number + -1 + -1 + N + + + + + disc4_1 PERCENT_1 @@ -3105,6 +3357,36 @@ left join brand b on b.id = p.brand_id + + disc4_9 + PERCENT_1 + diff4_9 + price_before_disc9 + + Number + -1 + -1 + N + + + + + + + disc4_10 + PERCENT_1 + diff4_10 + price_before_disc10 + + Number + -1 + -1 + N + + + + + disc5_1 PERCENT_1 @@ -3225,6 +3507,36 @@ left join brand b on b.id = p.brand_id + + disc5_9 + PERCENT_1 + diff5_9 + price_before_disc9 + + Number + -1 + -1 + N + + + + + + + disc5_10 + PERCENT_1 + diff5_10 + price_before_disc10 + + Number + -1 + -1 + N + + + + + @@ -3371,6 +3683,36 @@ left join brand b on b.id = p.brand_id + + price_before_disc9 + PERCENT_3 + purchase_price + markup_group9 + + Number + -1 + -1 + N + + + + + + + price_before_disc10 + PERCENT_3 + purchase_price + markup_group10 + + Number + -1 + -1 + N + + + + + price_after_disc_1 PERCENT_3 @@ -3491,6 +3833,36 @@ left join brand b on b.id = p.brand_id + + price_after_disc_9 + PERCENT_3 + purchase_price + markup_std9 + + Number + -1 + -1 + N + + + + + + + price_after_disc_10 + PERCENT_3 + purchase_price + markup_std10 + + Number + -1 + -1 + N + + + + + price_tier2_1 PERCENT_3 @@ -3611,6 +3983,36 @@ left join brand b on b.id = p.brand_id + + price_tier2_9 + PERCENT_3 + purchase_price + markup_tier2_9 + + Number + -1 + -1 + N + + + + + + + price_tier2_10 + PERCENT_3 + purchase_price + markup_tier2_10 + + Number + -1 + -1 + N + + + + + price_tier3_1 PERCENT_3 @@ -3731,6 +4133,36 @@ left join brand b on b.id = p.brand_id + + price_tier3_9 + PERCENT_3 + purchase_price + markup_tier3_9 + + Number + -1 + -1 + N + + + + + + + price_tier3_10 + PERCENT_3 + purchase_price + markup_tier3_10 + + Number + -1 + -1 + N + + + + + price_tier4_1 PERCENT_3 @@ -3851,6 +4283,36 @@ left join brand b on b.id = p.brand_id + + price_tier4_9 + PERCENT_3 + purchase_price + markup_tier4_9 + + Number + -1 + -1 + N + + + + + + + price_tier4_10 + PERCENT_3 + purchase_price + markup_tier4_10 + + Number + -1 + -1 + N + + + + + price_tier5_1 PERCENT_3 @@ -3971,6 +4433,36 @@ left join brand b on b.id = p.brand_id + + price_tier5_9 + PERCENT_3 + purchase_price + markup_tier5_9 + + Number + -1 + -1 + N + + + + + + + price_tier5_10 + PERCENT_3 + purchase_price + markup_tier5_10 + + Number + -1 + -1 + N + + + + + @@ -4048,6 +4540,16 @@ left join brand b on b.id = p.brand_id disc1_8 Y + + disc1_9 + disc1_9 + Y + + + disc1_10 + disc1_10 + Y + disc2_1 disc2_1 @@ -4088,6 +4590,16 @@ left join brand b on b.id = p.brand_id disc2_8 Y + + disc2_9 + disc2_9 + Y + + + disc2_10 + disc2_10 + Y + disc3_1 disc3_1 @@ -4128,6 +4640,16 @@ left join brand b on b.id = p.brand_id disc3_8 Y + + disc3_9 + disc3_9 + Y + + + disc3_10 + disc3_10 + Y + disc4_1 disc4_1 @@ -4168,6 +4690,16 @@ left join brand b on b.id = p.brand_id disc4_8 Y + + disc4_9 + disc4_9 + Y + + + disc4_10 + disc4_10 + Y + disc5_1 disc5_1 @@ -4208,6 +4740,16 @@ left join brand b on b.id = p.brand_id disc5_8 Y + + disc5_9 + disc5_9 + Y + + + disc5_10 + disc5_10 + Y + item_code item_code @@ -4253,6 +4795,16 @@ left join brand b on b.id = p.brand_id markup_group8 Y + + markup_group9 + markup_group9 + Y + + + markup_group10 + markup_group10 + Y + markup_std1 markup_std1 @@ -4293,6 +4845,16 @@ left join brand b on b.id = p.brand_id markup_std8 Y + + markup_std9 + markup_std9 + Y + + + markup_std10 + markup_std10 + Y + markup_tier2_1 markup_tier2_1 @@ -4333,6 +4895,16 @@ left join brand b on b.id = p.brand_id markup_tier2_8 Y + + markup_tier2_9 + markup_tier2_9 + Y + + + markup_tier2_10 + markup_tier2_10 + Y + markup_tier3_1 markup_tier3_1 @@ -4373,6 +4945,16 @@ left join brand b on b.id = p.brand_id markup_tier3_8 Y + + markup_tier3_9 + markup_tier3_9 + Y + + + markup_tier3_10 + markup_tier3_10 + Y + markup_tier4_1 markup_tier4_1 @@ -4413,6 +4995,16 @@ left join brand b on b.id = p.brand_id markup_tier4_8 Y + + markup_tier4_9 + markup_tier4_9 + Y + + + markup_tier4_10 + markup_tier4_10 + Y + markup_tier5_1 markup_tier5_1 @@ -4453,6 +5045,16 @@ left join brand b on b.id = p.brand_id markup_tier5_8 Y + + markup_tier5_9 + markup_tier5_9 + Y + + + markup_tier5_10 + markup_tier5_10 + Y + name name @@ -4498,6 +5100,16 @@ left join brand b on b.id = p.brand_id price_after_disc_8 Y + + price_after_disc_9 + price_after_disc_9 + Y + + + price_after_disc_10 + price_after_disc_10 + Y + price_before_disc1 price_before_disc1 @@ -4538,6 +5150,16 @@ left join brand b on b.id = p.brand_id price_before_disc8 Y + + price_before_disc9 + price_before_disc9 + Y + + + price_before_disc10 + price_before_disc10 + Y + price_tier2_1 price_tier2_1 @@ -4578,6 +5200,16 @@ left join brand b on b.id = p.brand_id price_tier2_8 Y + + price_tier2_9 + price_tier2_9 + Y + + + price_tier2_10 + price_tier2_10 + Y + price_tier3_1 price_tier3_1 @@ -4618,6 +5250,16 @@ left join brand b on b.id = p.brand_id price_tier3_8 Y + + price_tier3_9 + price_tier3_9 + Y + + + price_tier3_10 + price_tier3_10 + Y + price_tier4_1 price_tier4_1 @@ -4658,6 +5300,16 @@ left join brand b on b.id = p.brand_id price_tier4_8 Y + + price_tier4_9 + price_tier4_9 + Y + + + price_tier4_10 + price_tier4_10 + Y + price_tier5_1 price_tier5_1 @@ -4698,6 +5350,16 @@ left join brand b on b.id = p.brand_id price_tier5_8 Y + + price_tier5_9 + price_tier5_9 + Y + + + price_tier5_10 + price_tier5_10 + Y + pricing_group pricing_group -- cgit v1.2.3