summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2025-10-22 09:05:52 +0700
committerstephanchrst <stephanchrst@gmail.com>2025-10-22 09:05:52 +0700
commit8d4d7e4a1a6cf6be044ad23e930bdda7f86a890e (patch)
tree13f3a57b778b5327d40757cdcf6c205c5cf7907a
parent4c2822a3452c5995b2216ea82c78a260318b1796 (diff)
update cogs fixco
-rw-r--r--update_cogs_fixco.ktr513
1 files changed, 257 insertions, 256 deletions
diff --git a/update_cogs_fixco.ktr b/update_cogs_fixco.ktr
index 8b40b4e..f26d5e0 100644
--- a/update_cogs_fixco.ktr
+++ b/update_cogs_fixco.ktr
@@ -430,7 +430,7 @@
<created_date>2025/10/20 09:38:47.206</created_date>
<modified_user>-</modified_user>
<modified_date>2025/10/20 09:38:47.206</modified_date>
- <key_for_session_key/>
+ <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
@@ -514,7 +514,169 @@
</hop>
</order>
<step>
- <name>sales order</name>
+ <name>Calculator</name>
+ <type>Calculator</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <failIfNoFile>Y</failIfNoFile>
+ <calculation>
+ <field_name>total_cogs</field_name>
+ <calc_type>MULTIPLY</calc_type>
+ <field_a>qty</field_a>
+ <field_b>cogs</field_b>
+ <field_c/>
+ <value_type>BigNumber</value_type>
+ <value_length>-1</value_length>
+ <value_precision>-1</value_precision>
+ <remove>N</remove>
+ <conversion_mask/>
+ <decimal_symbol/>
+ <grouping_symbol/>
+ <currency_symbol/>
+ </calculation>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>400</xloc>
+ <yloc>64</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Select values</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>id</name>
+ </field>
+ <field>
+ <name>total_cogs</name>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>528</xloc>
+ <yloc>64</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Stream lookup</name>
+ <type>StreamLookup</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <from>product cogs</from>
+ <input_sorted>N</input_sorted>
+ <preserve_memory>Y</preserve_memory>
+ <sorted_list>N</sorted_list>
+ <integer_pair>N</integer_pair>
+ <lookup>
+ <key>
+ <name>item_code</name>
+ <field>item_code</field>
+ </key>
+ <value>
+ <name>cost</name>
+ <rename>cogs</rename>
+ <default>0</default>
+ <type>BigNumber</type>
+ </value>
+ </lookup>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>256</xloc>
+ <yloc>64</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Update</name>
+ <type>Update</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi fixco</connection>
+ <skip_lookup>N</skip_lookup>
+ <commit>100</commit>
+ <use_batch>N</use_batch>
+ <error_ignored>N</error_ignored>
+ <ignore_flag_field/>
+ <lookup>
+ <schema>public</schema>
+ <table>total_omzet_by_product</table>
+ <key>
+ <name>id</name>
+ <field>id</field>
+ <condition>=</condition>
+ <name2/>
+ </key>
+ <value>
+ <name>cogs</name>
+ <rename>total_cogs</rename>
+ </value>
+ </lookup>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>672</xloc>
+ <yloc>64</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>product cogs</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
@@ -525,8 +687,8 @@
<schema_name/>
</partitioning>
<connection>dw bi fixco</connection>
- <sql>select id, item_code, qty, harga, total_harga, ppn, dpp
-from total_omzet_by_product where tanggal between '2025-01-01' and '2025-10-30'</sql>
+ <sql>select item_code, cost_with_tax, cost, tax
+from product_cost where year = 2025</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
@@ -535,14 +697,14 @@ from total_omzet_by_product where tanggal between '2025-01-01' and '2025-10-30'<
<cached_row_meta_active>N</cached_row_meta_active>
<row-meta>
<value-meta>
- <type>Integer</type>
+ <type>String</type>
<storagetype>normal</storagetype>
- <name>id</name>
- <length>9</length>
- <precision>0</precision>
- <origin>Table input</origin>
- <comments>id</comments>
- <conversion_Mask>####0;-####0</conversion_Mask>
+ <name>item_code</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input 2</origin>
+ <comments>item_code</comments>
+ <conversion_Mask/>
<decimal_symbol>.</decimal_symbol>
<grouping_symbol>,</grouping_symbol>
<currency_symbol/>
@@ -558,16 +720,16 @@ from total_omzet_by_product where tanggal between '2025-01-01' and '2025-10-30'<
<lenient_string_to_number>N</lenient_string_to_number>
</value-meta>
<value-meta>
- <type>String</type>
+ <type>BigNumber</type>
<storagetype>normal</storagetype>
- <name>item_code</name>
- <length>2147483647</length>
+ <name>cost_with_tax</name>
+ <length>-1</length>
<precision>-1</precision>
- <origin>Table input</origin>
- <comments>item_code</comments>
- <conversion_Mask/>
+ <origin>Table input 2</origin>
+ <comments>cost_with_tax</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
<decimal_symbol>.</decimal_symbol>
- <grouping_symbol>,</grouping_symbol>
+ <grouping_symbol/>
<currency_symbol/>
<trim_type>none</trim_type>
<case_insensitive>N</case_insensitive>
@@ -583,11 +745,11 @@ from total_omzet_by_product where tanggal between '2025-01-01' and '2025-10-30'<
<value-meta>
<type>BigNumber</type>
<storagetype>normal</storagetype>
- <name>qty</name>
+ <name>cost</name>
<length>-1</length>
<precision>-1</precision>
- <origin>Table input</origin>
- <comments>qty</comments>
+ <origin>Table input 2</origin>
+ <comments>cost</comments>
<conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
<decimal_symbol>.</decimal_symbol>
<grouping_symbol/>
@@ -606,11 +768,11 @@ from total_omzet_by_product where tanggal between '2025-01-01' and '2025-10-30'<
<value-meta>
<type>BigNumber</type>
<storagetype>normal</storagetype>
- <name>harga</name>
+ <name>tax</name>
<length>-1</length>
<precision>-1</precision>
- <origin>Table input</origin>
- <comments>harga</comments>
+ <origin>Table input 2</origin>
+ <comments>tax</comments>
<conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
<decimal_symbol>.</decimal_symbol>
<grouping_symbol/>
@@ -626,17 +788,56 @@ from total_omzet_by_product where tanggal between '2025-01-01' and '2025-10-30'<
<date_format_timezone>Asia/Bangkok</date_format_timezone>
<lenient_string_to_number>N</lenient_string_to_number>
</value-meta>
+ </row-meta>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>256</xloc>
+ <yloc>160</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>sales order</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi fixco</connection>
+ <sql>select id, item_code, qty, harga, total_harga, ppn, dpp
+from total_omzet_by_product
+where 1=1
+and tanggal >= '2025-01-01'
+and cogs &lt;= 0</sql>
+ <limit>0</limit>
+ <lookup/>
+ <execute_each_row>N</execute_each_row>
+ <variables_active>N</variables_active>
+ <lazy_conversion_active>N</lazy_conversion_active>
+ <cached_row_meta_active>N</cached_row_meta_active>
+ <row-meta>
<value-meta>
- <type>BigNumber</type>
+ <type>Integer</type>
<storagetype>normal</storagetype>
- <name>total_harga</name>
- <length>-1</length>
- <precision>-1</precision>
+ <name>id</name>
+ <length>9</length>
+ <precision>0</precision>
<origin>Table input</origin>
- <comments>total_harga</comments>
- <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <comments>id</comments>
+ <conversion_Mask>####0;-####0</conversion_Mask>
<decimal_symbol>.</decimal_symbol>
- <grouping_symbol/>
+ <grouping_symbol>,</grouping_symbol>
<currency_symbol/>
<trim_type>none</trim_type>
<case_insensitive>N</case_insensitive>
@@ -650,16 +851,16 @@ from total_omzet_by_product where tanggal between '2025-01-01' and '2025-10-30'<
<lenient_string_to_number>N</lenient_string_to_number>
</value-meta>
<value-meta>
- <type>BigNumber</type>
+ <type>String</type>
<storagetype>normal</storagetype>
- <name>ppn</name>
- <length>-1</length>
+ <name>item_code</name>
+ <length>2147483647</length>
<precision>-1</precision>
<origin>Table input</origin>
- <comments>ppn</comments>
- <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <comments>item_code</comments>
+ <conversion_Mask/>
<decimal_symbol>.</decimal_symbol>
- <grouping_symbol/>
+ <grouping_symbol>,</grouping_symbol>
<currency_symbol/>
<trim_type>none</trim_type>
<case_insensitive>N</case_insensitive>
@@ -675,11 +876,11 @@ from total_omzet_by_product where tanggal between '2025-01-01' and '2025-10-30'<
<value-meta>
<type>BigNumber</type>
<storagetype>normal</storagetype>
- <name>dpp</name>
+ <name>qty</name>
<length>-1</length>
<precision>-1</precision>
<origin>Table input</origin>
- <comments>dpp</comments>
+ <comments>qty</comments>
<conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
<decimal_symbol>.</decimal_symbol>
<grouping_symbol/>
@@ -695,95 +896,17 @@ from total_omzet_by_product where tanggal between '2025-01-01' and '2025-10-30'<
<date_format_timezone>Asia/Bangkok</date_format_timezone>
<lenient_string_to_number>N</lenient_string_to_number>
</value-meta>
- </row-meta>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>128</xloc>
- <yloc>64</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
- <step>
- <name>Stream lookup</name>
- <type>StreamLookup</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <from>product cogs</from>
- <input_sorted>N</input_sorted>
- <preserve_memory>Y</preserve_memory>
- <sorted_list>N</sorted_list>
- <integer_pair>N</integer_pair>
- <lookup>
- <key>
- <name>item_code</name>
- <field>item_code</field>
- </key>
- <value>
- <name>cost</name>
- <rename>cogs</rename>
- <default>0</default>
- <type>BigNumber</type>
- </value>
- </lookup>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>256</xloc>
- <yloc>64</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
- <step>
- <name>product cogs</name>
- <type>TableInput</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <connection>dw bi fixco</connection>
- <sql>select item_code, cost_with_tax, cost, tax
-from product_cost where year = 2025</sql>
- <limit>0</limit>
- <lookup/>
- <execute_each_row>N</execute_each_row>
- <variables_active>N</variables_active>
- <lazy_conversion_active>N</lazy_conversion_active>
- <cached_row_meta_active>N</cached_row_meta_active>
- <row-meta>
<value-meta>
- <type>String</type>
+ <type>BigNumber</type>
<storagetype>normal</storagetype>
- <name>item_code</name>
- <length>2147483647</length>
+ <name>harga</name>
+ <length>-1</length>
<precision>-1</precision>
- <origin>Table input 2</origin>
- <comments>item_code</comments>
- <conversion_Mask/>
+ <origin>Table input</origin>
+ <comments>harga</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
<decimal_symbol>.</decimal_symbol>
- <grouping_symbol>,</grouping_symbol>
+ <grouping_symbol/>
<currency_symbol/>
<trim_type>none</trim_type>
<case_insensitive>N</case_insensitive>
@@ -799,11 +922,11 @@ from product_cost where year = 2025</sql>
<value-meta>
<type>BigNumber</type>
<storagetype>normal</storagetype>
- <name>cost_with_tax</name>
+ <name>total_harga</name>
<length>-1</length>
<precision>-1</precision>
- <origin>Table input 2</origin>
- <comments>cost_with_tax</comments>
+ <origin>Table input</origin>
+ <comments>total_harga</comments>
<conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
<decimal_symbol>.</decimal_symbol>
<grouping_symbol/>
@@ -822,11 +945,11 @@ from product_cost where year = 2025</sql>
<value-meta>
<type>BigNumber</type>
<storagetype>normal</storagetype>
- <name>cost</name>
+ <name>ppn</name>
<length>-1</length>
<precision>-1</precision>
- <origin>Table input 2</origin>
- <comments>cost</comments>
+ <origin>Table input</origin>
+ <comments>ppn</comments>
<conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
<decimal_symbol>.</decimal_symbol>
<grouping_symbol/>
@@ -845,11 +968,11 @@ from product_cost where year = 2025</sql>
<value-meta>
<type>BigNumber</type>
<storagetype>normal</storagetype>
- <name>tax</name>
+ <name>dpp</name>
<length>-1</length>
<precision>-1</precision>
- <origin>Table input 2</origin>
- <comments>tax</comments>
+ <origin>Table input</origin>
+ <comments>dpp</comments>
<conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
<decimal_symbol>.</decimal_symbol>
<grouping_symbol/>
@@ -875,129 +998,7 @@ from product_cost where year = 2025</sql>
</output>
</remotesteps>
<GUI>
- <xloc>256</xloc>
- <yloc>160</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
- <step>
- <name>Calculator</name>
- <type>Calculator</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <failIfNoFile>Y</failIfNoFile>
- <calculation>
- <field_name>total_cogs</field_name>
- <calc_type>MULTIPLY</calc_type>
- <field_a>qty</field_a>
- <field_b>cogs</field_b>
- <field_c/>
- <value_type>BigNumber</value_type>
- <value_length>-1</value_length>
- <value_precision>-1</value_precision>
- <remove>N</remove>
- <conversion_mask/>
- <decimal_symbol/>
- <grouping_symbol/>
- <currency_symbol/>
- </calculation>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>400</xloc>
- <yloc>64</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
- <step>
- <name>Select values</name>
- <type>SelectValues</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <fields>
- <field>
- <name>id</name>
- <rename/>
- </field>
- <field>
- <name>total_cogs</name>
- <rename/>
- </field>
- <select_unspecified>N</select_unspecified>
- </fields>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>528</xloc>
- <yloc>64</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
- <step>
- <name>Update</name>
- <type>Update</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <connection>dw bi fixco</connection>
- <skip_lookup>N</skip_lookup>
- <commit>100</commit>
- <use_batch>N</use_batch>
- <error_ignored>N</error_ignored>
- <ignore_flag_field/>
- <lookup>
- <schema>public</schema>
- <table>total_omzet_by_product</table>
- <key>
- <name>id</name>
- <field>id</field>
- <condition>=</condition>
- <name2/>
- </key>
- <value>
- <name>cogs</name>
- <rename>total_cogs</rename>
- </value>
- </lookup>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>672</xloc>
+ <xloc>128</xloc>
<yloc>64</yloc>
<draw>Y</draw>
</GUI>