summaryrefslogtreecommitdiff
path: root/insert_update_pricelist.ktr
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-09-13 15:56:35 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-09-13 15:56:35 +0700
commitedd327be5966f69e36ffa8013fe3b3f94ed0d14f (patch)
tree4061911e3a25c9dae56549e4f05ee90e4e89c713 /insert_update_pricelist.ktr
parent6e387cf014005bfde3d7aebf87871d2b0bf97c14 (diff)
add price tiering from 1 to 5
Diffstat (limited to 'insert_update_pricelist.ktr')
-rw-r--r--insert_update_pricelist.ktr203
1 files changed, 115 insertions, 88 deletions
diff --git a/insert_update_pricelist.ktr b/insert_update_pricelist.ktr
index fd58764..435b4f5 100644
--- a/insert_update_pricelist.ktr
+++ b/insert_update_pricelist.ktr
@@ -491,7 +491,7 @@
<server>localhost</server>
<type>POSTGRESQL</type>
<access>Native</access>
- <database>indoteknik_20230821</database>
+ <database>indoteknik_20230912</database>
<port>5432</port>
<username>odoo</username>
<password>Encrypted 2be98afc86aa7f2e4cb79ce10d196a0d5</password>
@@ -890,6 +890,92 @@
</GUI>
</step>
<step>
+ <name>Insert / update 2</name>
+ <type>InsertUpdate</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>erp indoteknik local</connection>
+ <commit>100</commit>
+ <update_bypassed>N</update_bypassed>
+ <lookup>
+ <schema>public</schema>
+ <table>product_template</table>
+ <key>
+ <name>template_id</name>
+ <field>id</field>
+ <condition>=</condition>
+ <name2/>
+ </key>
+ <value>
+ <name>solr_flag</name>
+ <rename>solr_flag</rename>
+ <update>Y</update>
+ </value>
+ </lookup>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>864</xloc>
+ <yloc>272</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Insert / update 3</name>
+ <type>InsertUpdate</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>erp indoteknik local</connection>
+ <commit>100</commit>
+ <update_bypassed>N</update_bypassed>
+ <lookup>
+ <schema>public</schema>
+ <table>product_product</table>
+ <key>
+ <name>product_id</name>
+ <field>id</field>
+ <condition>=</condition>
+ <name2/>
+ </key>
+ <value>
+ <name>solr_flag</name>
+ <rename>solr_flag</rename>
+ <update>Y</update>
+ </value>
+ </lookup>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>992</xloc>
+ <yloc>272</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
<name>Merge join</name>
<type>MergeJoin</type>
<description/>
@@ -967,7 +1053,11 @@
<schema_name/>
</partitioning>
<connection>dw bi indoteknik</connection>
- <sql>select product_id, price_before_disc, disc_web_tier1, disc_tier2, disc_tier3, template_id from mv_pricelist_compute order by product_id</sql>
+ <sql>select pc.product_id, p.template_id, price_before_disc, disc_tier1,
+disc_tier2, disc_tier3, disc_tier4, disc_tier5
+from v_pricelist_compute pc
+join product p on p.product_id = pc.product_id
+order by product_id</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
@@ -1090,6 +1180,29 @@
<date_format_timezone>Asia/Bangkok</date_format_timezone>
<lenient_string_to_number>N</lenient_string_to_number>
</value-meta>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>template_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>price compute</origin>
+ <comments>template_id</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
+ <decimal_symbol>.</decimal_symbol>
+ <grouping_symbol>,</grouping_symbol>
+ <currency_symbol/>
+ <trim_type>none</trim_type>
+ <case_insensitive>N</case_insensitive>
+ <collator_disabled>Y</collator_disabled>
+ <collator_strength>0</collator_strength>
+ <sort_descending>N</sort_descending>
+ <output_padding>N</output_padding>
+ <date_format_lenient>N</date_format_lenient>
+ <date_format_locale>en_US</date_format_locale>
+ <date_format_timezone>Asia/Bangkok</date_format_timezone>
+ <lenient_string_to_number>N</lenient_string_to_number>
+ </value-meta>
</row-meta>
<attributes/>
<cluster_schema/>
@@ -1761,92 +1874,6 @@
<draw>Y</draw>
</GUI>
</step>
- <step>
- <name>Insert / update 2</name>
- <type>InsertUpdate</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <connection>erp indoteknik local</connection>
- <commit>100</commit>
- <update_bypassed>N</update_bypassed>
- <lookup>
- <schema>public</schema>
- <table>product_template</table>
- <key>
- <name>template_id</name>
- <field>id</field>
- <condition>=</condition>
- <name2/>
- </key>
- <value>
- <name>solr_flag</name>
- <rename>solr_flag</rename>
- <update>Y</update>
- </value>
- </lookup>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>864</xloc>
- <yloc>272</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
- <step>
- <name>Insert / update 3</name>
- <type>InsertUpdate</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <connection>erp indoteknik local</connection>
- <commit>100</commit>
- <update_bypassed>N</update_bypassed>
- <lookup>
- <schema>public</schema>
- <table>product_product</table>
- <key>
- <name>product_id</name>
- <field>id</field>
- <condition>=</condition>
- <name2/>
- </key>
- <value>
- <name>solr_flag</name>
- <rename>solr_flag</rename>
- <update>Y</update>
- </value>
- </lookup>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>992</xloc>
- <yloc>272</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
<step_error_handling>
</step_error_handling>
<slave-step-copy-partition-distribution>