From 1cdd3267acec8a36f19bcbb4bd6d9c0e8a709edd Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 12 Sep 2023 17:33:38 +0700 Subject: modif compute pricelist --- calculate_price_after_disc.ktr | 1912 ++++++++++++++++++++++------------------ 1 file changed, 1061 insertions(+), 851 deletions(-) (limited to 'calculate_price_after_disc.ktr') diff --git a/calculate_price_after_disc.ktr b/calculate_price_after_disc.ktr index d0e2ceb..f3798dd 100644 --- a/calculate_price_after_disc.ktr +++ b/calculate_price_after_disc.ktr @@ -430,7 +430,7 @@ 2023/08/22 11:11:06.045 - 2023/08/22 11:11:06.045 - + H4sIAAAAAAAAAAMAAAAAAAAAAAA= N @@ -503,640 +503,6 @@ Y - - Table input - TableInput - - Y - - 1 - - none - - - dw bi indoteknik - select mpp.product_id, p.item_code, p."name", mpp.purchase_price, b.pricing_group, -(select group1 from price_group_dw pgd where id = 2) as markup_std1, -(select group2 from price_group_dw pgd where id = 2) as markup_std2, -(select group3 from price_group_dw pgd where id = 2) as markup_std3, -(select group4 from price_group_dw pgd where id = 2) as markup_std4, -(select group5 from price_group_dw pgd where id = 2) as markup_std5, -(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, -(select group4 from price_group_dw pgd where id = 1) as markup_group4, -(select group5 from price_group_dw pgd where id = 1) as markup_group5, -(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, -(select group4 from price_group_dw pgd where id = 3) as markup_tier2_4, -(select group5 from price_group_dw pgd where id = 3) as markup_tier2_5, -(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, -(select group4 from price_group_dw pgd where id = 4) as markup_tier3_4, -(select group5 from price_group_dw pgd where id = 4) as markup_tier3_5 -from mv_purchase_pricelist mpp -join product p on p.product_id = mpp.product_id -left join brand b on b.id = p.brand_id ---where b.id in(10, 122, 89) - 0 - - N - N - N - N - - - Integer - normal - product_id - 9 - 0 - Table input - product_id - ####0;-####0 - . - , - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - String - normal - item_code - 2147483647 - -1 - Table input - item_code - - . - , - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - String - normal - name - 2147483647 - -1 - Table input - name - - . - , - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - purchase_price - -1 - -1 - Table input - purchase_price - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - String - normal - pricing_group - 2147483647 - -1 - Table input - pricing_group - - . - , - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_std1 - -1 - -1 - Table input - markup_std1 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_std2 - -1 - -1 - Table input - markup_std2 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_std3 - -1 - -1 - Table input - markup_std3 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_std4 - -1 - -1 - Table input - markup_std4 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_std5 - -1 - -1 - Table input - markup_std5 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_group1 - -1 - -1 - Table input - markup_group1 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_group2 - -1 - -1 - Table input - markup_group2 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_group3 - -1 - -1 - Table input - markup_group3 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_group4 - -1 - -1 - Table input - markup_group4 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_group5 - -1 - -1 - Table input - markup_group5 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_tier2_1 - -1 - -1 - Table input - markup_tier2_1 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_tier2_2 - -1 - -1 - Table input - markup_tier2_2 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_tier2_3 - -1 - -1 - Table input - markup_tier2_3 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_tier2_4 - -1 - -1 - Table input - markup_tier2_4 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_tier2_5 - -1 - -1 - Table input - markup_tier2_5 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_tier3_1 - -1 - -1 - Table input - markup_tier3_1 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_tier3_2 - -1 - -1 - Table input - markup_tier3_2 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_tier3_3 - -1 - -1 - Table input - markup_tier3_3 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_tier3_4 - -1 - -1 - Table input - markup_tier3_4 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - BigNumber - normal - markup_tier3_5 - -1 - -1 - Table input - markup_tier3_5 - ######0.0###################;-######0.0################### - . - - - none - N - Y - 0 - N - N - N - en_US - Asia/Bangkok - N - - - - - - - - - - - - 240 - 64 - Y - - Calculator Calculator @@ -1475,6 +841,469 @@ left join brand b on b.id = p.brand_id + + price_tier4_1 + PERCENT_3 + purchase_price + markup_tier4_1 + + Number + -1 + -1 + N + + + + + + + price_tier4_2 + PERCENT_3 + purchase_price + markup_tier4_2 + + Number + -1 + -1 + N + + + + + + + price_tier4_3 + PERCENT_3 + purchase_price + markup_tier4_3 + + Number + -1 + -1 + N + + + + + + + price_tier4_4 + PERCENT_3 + purchase_price + markup_tier4_4 + + Number + -1 + -1 + N + + + + + + + price_tier4_5 + PERCENT_3 + purchase_price + markup_tier4_5 + + Number + -1 + -1 + N + + + + + + + price_tier5_1 + PERCENT_3 + purchase_price + markup_tier5_1 + + Number + -1 + -1 + N + + + + + + + price_tier5_2 + PERCENT_3 + purchase_price + markup_tier5_2 + + Number + -1 + -1 + N + + + + + + + price_tier5_3 + PERCENT_3 + purchase_price + markup_tier5_3 + + Number + -1 + -1 + N + + + + + + + price_tier5_4 + PERCENT_3 + purchase_price + markup_tier5_4 + + Number + -1 + -1 + N + + + + + + + price_tier5_5 + PERCENT_3 + purchase_price + markup_tier5_5 + + Number + -1 + -1 + N + + + + + + + + + + + + + + + 544 + 64 + Y + + + + Insert / update + InsertUpdate + + Y + + 1 + + none + + + dw bi indoteknik + 100 + N + + public + pricelist_compute
+ + product_id + product_id + = + + + + product_id + product_id + N + + + item_code + item_code + Y + + + name + name + Y + + + purchase_price + purchase_price + Y + + + pricing_group + pricing_group + Y + + + markup_std1 + markup_std1 + Y + + + markup_std2 + markup_std2 + Y + + + markup_std3 + markup_std3 + Y + + + markup_std4 + markup_std4 + Y + + + markup_std5 + markup_std5 + Y + + + markup_group1 + markup_group1 + Y + + + markup_group2 + markup_group2 + Y + + + markup_group3 + markup_group3 + Y + + + markup_group4 + markup_group4 + Y + + + markup_group5 + markup_group5 + Y + + + markup_tier2_1 + markup_tier2_1 + Y + + + markup_tier2_2 + markup_tier2_2 + Y + + + markup_tier2_3 + markup_tier2_3 + Y + + + markup_tier2_4 + markup_tier2_4 + Y + + + markup_tier2_5 + markup_tier2_5 + Y + + + markup_tier3_1 + markup_tier3_1 + Y + + + markup_tier3_2 + markup_tier3_2 + Y + + + markup_tier3_3 + markup_tier3_3 + Y + + + markup_tier3_4 + markup_tier3_4 + Y + + + markup_tier3_5 + markup_tier3_5 + Y + + + price_after_disc_1 + price_after_disc_1 + Y + + + price_after_disc_2 + price_after_disc_2 + Y + + + price_after_disc_3 + price_after_disc_3 + Y + + + price_after_disc_4 + price_after_disc_4 + Y + + + price_after_disc_5 + price_after_disc_5 + Y + + + price_before_disc1 + price_before_disc1 + Y + + + price_before_disc2 + price_before_disc2 + Y + + + price_before_disc3 + price_before_disc3 + Y + + + price_before_disc4 + price_before_disc4 + Y + + + price_before_disc5 + price_before_disc5 + Y + + + price_tier2_1 + price_tier2_1 + Y + + + price_tier2_2 + price_tier2_2 + Y + + + price_tier2_3 + price_tier2_3 + Y + + + price_tier2_4 + price_tier2_4 + Y + + + price_tier2_5 + price_tier2_5 + Y + + + price_tier3_1 + price_tier3_1 + Y + + + price_tier3_2 + price_tier3_2 + Y + + + price_tier3_3 + price_tier3_3 + Y + + + price_tier3_4 + price_tier3_4 + Y + + + price_tier3_5 + price_tier3_5 + Y + + + price_tier4_1 + price_tier4_1 + Y + + + price_tier4_2 + price_tier4_2 + Y + + + price_tier4_3 + price_tier4_3 + Y + + + price_tier4_4 + price_tier4_4 + Y + + + price_tier4_5 + price_tier4_5 + Y + + + price_tier5_1 + price_tier5_1 + Y + + + price_tier5_2 + price_tier5_2 + Y + + + price_tier5_3 + price_tier5_3 + Y + + + price_tier5_4 + price_tier5_4 + Y + + + price_tier5_5 + price_tier5_5 + Y + +
@@ -1484,14 +1313,14 @@ left join brand b on b.id = p.brand_id - 544 + 720 64 Y
- Insert / update - InsertUpdate + Table input + TableInput Y @@ -1501,243 +1330,624 @@ left join brand b on b.id = p.brand_id dw bi indoteknik - 100 - N - - public - pricelist_compute
- - product_id - product_id - = - - - + select mpp.product_id, p.item_code, p."name", mpp.purchase_price, b.pricing_group, +(select group1 from price_group_dw pgd where id = 2) as markup_std1, +(select group2 from price_group_dw pgd where id = 2) as markup_std2, +(select group3 from price_group_dw pgd where id = 2) as markup_std3, +(select group4 from price_group_dw pgd where id = 2) as markup_std4, +(select group5 from price_group_dw pgd where id = 2) as markup_std5, +(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, +(select group4 from price_group_dw pgd where id = 1) as markup_group4, +(select group5 from price_group_dw pgd where id = 1) as markup_group5, +(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, +(select group4 from price_group_dw pgd where id = 3) as markup_tier2_4, +(select group5 from price_group_dw pgd where id = 3) as markup_tier2_5, +(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, +(select group4 from price_group_dw pgd where id = 4) as markup_tier3_4, +(select group5 from price_group_dw pgd where id = 4) as markup_tier3_5, +(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, +(select group4 from price_group_dw pgd where id = 5) as markup_tier4_4, +(select group5 from price_group_dw pgd where id = 5) as markup_tier4_5, +(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, +(select group4 from price_group_dw pgd where id = 6) as markup_tier5_4, +(select group5 from price_group_dw pgd where id = 6) as markup_tier5_5 +from mv_purchase_pricelist mpp +join product p on p.product_id = mpp.product_id +left join brand b on b.id = p.brand_id +where b.id in(10, 122, 89) + 0 + + N + N + N + N + + + Integer + normal product_id - product_id - N - - + 9 + 0 + Table input + product_id + ####0;-####0 + . + , + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + String + normal item_code - item_code - Y - - + 2147483647 + -1 + Table input + item_code + + . + , + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + String + normal name - name - Y - - + 2147483647 + -1 + Table input + name + + . + , + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal purchase_price - purchase_price - Y - - + -1 + -1 + Table input + purchase_price + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + String + normal pricing_group - pricing_group - Y - - + 2147483647 + -1 + Table input + pricing_group + + . + , + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_std1 - markup_std1 - Y - - + -1 + -1 + Table input + markup_std1 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_std2 - markup_std2 - Y - - + -1 + -1 + Table input + markup_std2 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_std3 - markup_std3 - Y - - + -1 + -1 + Table input + markup_std3 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_std4 - markup_std4 - Y - - + -1 + -1 + Table input + markup_std4 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_std5 - markup_std5 - Y - - + -1 + -1 + Table input + markup_std5 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_group1 - markup_group1 - Y - - + -1 + -1 + Table input + markup_group1 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_group2 - markup_group2 - Y - - + -1 + -1 + Table input + markup_group2 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_group3 - markup_group3 - Y - - + -1 + -1 + Table input + markup_group3 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_group4 - markup_group4 - Y - - + -1 + -1 + Table input + markup_group4 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_group5 - markup_group5 - Y - - + -1 + -1 + Table input + markup_group5 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_tier2_1 - markup_tier2_1 - Y - - + -1 + -1 + Table input + markup_tier2_1 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_tier2_2 - markup_tier2_2 - Y - - + -1 + -1 + Table input + markup_tier2_2 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_tier2_3 - markup_tier2_3 - Y - - + -1 + -1 + Table input + markup_tier2_3 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_tier2_4 - markup_tier2_4 - Y - - + -1 + -1 + Table input + markup_tier2_4 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_tier2_5 - markup_tier2_5 - Y - - + -1 + -1 + Table input + markup_tier2_5 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_tier3_1 - markup_tier3_1 - Y - - + -1 + -1 + Table input + markup_tier3_1 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_tier3_2 - markup_tier3_2 - Y - - + -1 + -1 + Table input + markup_tier3_2 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_tier3_3 - markup_tier3_3 - Y - - + -1 + -1 + Table input + markup_tier3_3 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_tier3_4 - markup_tier3_4 - Y - - + -1 + -1 + Table input + markup_tier3_4 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + + BigNumber + normal markup_tier3_5 - markup_tier3_5 - Y - - - price_after_disc_1 - price_after_disc_1 - Y - - - price_after_disc_2 - price_after_disc_2 - Y - - - price_after_disc_3 - price_after_disc_3 - Y - - - price_after_disc_4 - price_after_disc_4 - Y - - - price_after_disc_5 - price_after_disc_5 - Y - - - price_before_disc1 - price_before_disc1 - Y - - - price_before_disc2 - price_before_disc2 - Y - - - price_before_disc3 - price_before_disc3 - Y - - - price_before_disc4 - price_before_disc4 - Y - - - price_before_disc5 - price_before_disc5 - Y - - - price_tier2_1 - price_tier2_1 - Y - - - price_tier2_2 - price_tier2_2 - Y - - - price_tier2_3 - price_tier2_3 - Y - - - price_tier2_4 - price_tier2_4 - Y - - - price_tier2_5 - price_tier2_5 - Y - - - price_tier3_1 - price_tier3_1 - Y - - - price_tier3_2 - price_tier3_2 - Y - - - price_tier3_3 - price_tier3_3 - Y - - - price_tier3_4 - price_tier3_4 - Y - - - price_tier3_5 - price_tier3_5 - Y - -
+ -1 + -1 + Table input + markup_tier3_5 + ######0.0###################;-######0.0################### + . + + + none + N + Y + 0 + N + N + N + en_US + Asia/Bangkok + N + + @@ -1747,7 +1957,7 @@ left join brand b on b.id = p.brand_id - 720 + 240 64 Y -- cgit v1.2.3