summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--calculate_margin_invoice_v3.ktr2328
-rw-r--r--run_single_ktr.sh2
2 files changed, 2329 insertions, 1 deletions
diff --git a/calculate_margin_invoice_v3.ktr b/calculate_margin_invoice_v3.ktr
new file mode 100644
index 0000000..fa17fbb
--- /dev/null
+++ b/calculate_margin_invoice_v3.ktr
@@ -0,0 +1,2328 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transformation>
+ <info>
+ <name>calculate_margin_invoice_v3</name>
+ <description/>
+ <extended_description/>
+ <trans_version/>
+ <trans_type>Normal</trans_type>
+ <directory>/</directory>
+ <parameters>
+ </parameters>
+ <log>
+ <trans-log-table>
+ <connection/>
+ <schema/>
+ <table/>
+ <size_limit_lines/>
+ <interval/>
+ <timeout_days/>
+ <field>
+ <id>ID_BATCH</id>
+ <enabled>Y</enabled>
+ <name>ID_BATCH</name>
+ </field>
+ <field>
+ <id>CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>CHANNEL_ID</name>
+ </field>
+ <field>
+ <id>TRANSNAME</id>
+ <enabled>Y</enabled>
+ <name>TRANSNAME</name>
+ </field>
+ <field>
+ <id>STATUS</id>
+ <enabled>Y</enabled>
+ <name>STATUS</name>
+ </field>
+ <field>
+ <id>LINES_READ</id>
+ <enabled>Y</enabled>
+ <name>LINES_READ</name>
+ <subject/>
+ </field>
+ <field>
+ <id>LINES_WRITTEN</id>
+ <enabled>Y</enabled>
+ <name>LINES_WRITTEN</name>
+ <subject/>
+ </field>
+ <field>
+ <id>LINES_UPDATED</id>
+ <enabled>Y</enabled>
+ <name>LINES_UPDATED</name>
+ <subject/>
+ </field>
+ <field>
+ <id>LINES_INPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_INPUT</name>
+ <subject/>
+ </field>
+ <field>
+ <id>LINES_OUTPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_OUTPUT</name>
+ <subject/>
+ </field>
+ <field>
+ <id>LINES_REJECTED</id>
+ <enabled>Y</enabled>
+ <name>LINES_REJECTED</name>
+ <subject/>
+ </field>
+ <field>
+ <id>ERRORS</id>
+ <enabled>Y</enabled>
+ <name>ERRORS</name>
+ </field>
+ <field>
+ <id>STARTDATE</id>
+ <enabled>Y</enabled>
+ <name>STARTDATE</name>
+ </field>
+ <field>
+ <id>ENDDATE</id>
+ <enabled>Y</enabled>
+ <name>ENDDATE</name>
+ </field>
+ <field>
+ <id>LOGDATE</id>
+ <enabled>Y</enabled>
+ <name>LOGDATE</name>
+ </field>
+ <field>
+ <id>DEPDATE</id>
+ <enabled>Y</enabled>
+ <name>DEPDATE</name>
+ </field>
+ <field>
+ <id>REPLAYDATE</id>
+ <enabled>Y</enabled>
+ <name>REPLAYDATE</name>
+ </field>
+ <field>
+ <id>LOG_FIELD</id>
+ <enabled>Y</enabled>
+ <name>LOG_FIELD</name>
+ </field>
+ <field>
+ <id>EXECUTING_SERVER</id>
+ <enabled>N</enabled>
+ <name>EXECUTING_SERVER</name>
+ </field>
+ <field>
+ <id>EXECUTING_USER</id>
+ <enabled>N</enabled>
+ <name>EXECUTING_USER</name>
+ </field>
+ <field>
+ <id>CLIENT</id>
+ <enabled>N</enabled>
+ <name>CLIENT</name>
+ </field>
+ </trans-log-table>
+ <perf-log-table>
+ <connection/>
+ <schema/>
+ <table/>
+ <interval/>
+ <timeout_days/>
+ <field>
+ <id>ID_BATCH</id>
+ <enabled>Y</enabled>
+ <name>ID_BATCH</name>
+ </field>
+ <field>
+ <id>SEQ_NR</id>
+ <enabled>Y</enabled>
+ <name>SEQ_NR</name>
+ </field>
+ <field>
+ <id>LOGDATE</id>
+ <enabled>Y</enabled>
+ <name>LOGDATE</name>
+ </field>
+ <field>
+ <id>TRANSNAME</id>
+ <enabled>Y</enabled>
+ <name>TRANSNAME</name>
+ </field>
+ <field>
+ <id>STEPNAME</id>
+ <enabled>Y</enabled>
+ <name>STEPNAME</name>
+ </field>
+ <field>
+ <id>STEP_COPY</id>
+ <enabled>Y</enabled>
+ <name>STEP_COPY</name>
+ </field>
+ <field>
+ <id>LINES_READ</id>
+ <enabled>Y</enabled>
+ <name>LINES_READ</name>
+ </field>
+ <field>
+ <id>LINES_WRITTEN</id>
+ <enabled>Y</enabled>
+ <name>LINES_WRITTEN</name>
+ </field>
+ <field>
+ <id>LINES_UPDATED</id>
+ <enabled>Y</enabled>
+ <name>LINES_UPDATED</name>
+ </field>
+ <field>
+ <id>LINES_INPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_INPUT</name>
+ </field>
+ <field>
+ <id>LINES_OUTPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_OUTPUT</name>
+ </field>
+ <field>
+ <id>LINES_REJECTED</id>
+ <enabled>Y</enabled>
+ <name>LINES_REJECTED</name>
+ </field>
+ <field>
+ <id>ERRORS</id>
+ <enabled>Y</enabled>
+ <name>ERRORS</name>
+ </field>
+ <field>
+ <id>INPUT_BUFFER_ROWS</id>
+ <enabled>Y</enabled>
+ <name>INPUT_BUFFER_ROWS</name>
+ </field>
+ <field>
+ <id>OUTPUT_BUFFER_ROWS</id>
+ <enabled>Y</enabled>
+ <name>OUTPUT_BUFFER_ROWS</name>
+ </field>
+ </perf-log-table>
+ <channel-log-table>
+ <connection/>
+ <schema/>
+ <table/>
+ <timeout_days/>
+ <field>
+ <id>ID_BATCH</id>
+ <enabled>Y</enabled>
+ <name>ID_BATCH</name>
+ </field>
+ <field>
+ <id>CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>CHANNEL_ID</name>
+ </field>
+ <field>
+ <id>LOG_DATE</id>
+ <enabled>Y</enabled>
+ <name>LOG_DATE</name>
+ </field>
+ <field>
+ <id>LOGGING_OBJECT_TYPE</id>
+ <enabled>Y</enabled>
+ <name>LOGGING_OBJECT_TYPE</name>
+ </field>
+ <field>
+ <id>OBJECT_NAME</id>
+ <enabled>Y</enabled>
+ <name>OBJECT_NAME</name>
+ </field>
+ <field>
+ <id>OBJECT_COPY</id>
+ <enabled>Y</enabled>
+ <name>OBJECT_COPY</name>
+ </field>
+ <field>
+ <id>REPOSITORY_DIRECTORY</id>
+ <enabled>Y</enabled>
+ <name>REPOSITORY_DIRECTORY</name>
+ </field>
+ <field>
+ <id>FILENAME</id>
+ <enabled>Y</enabled>
+ <name>FILENAME</name>
+ </field>
+ <field>
+ <id>OBJECT_ID</id>
+ <enabled>Y</enabled>
+ <name>OBJECT_ID</name>
+ </field>
+ <field>
+ <id>OBJECT_REVISION</id>
+ <enabled>Y</enabled>
+ <name>OBJECT_REVISION</name>
+ </field>
+ <field>
+ <id>PARENT_CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>PARENT_CHANNEL_ID</name>
+ </field>
+ <field>
+ <id>ROOT_CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>ROOT_CHANNEL_ID</name>
+ </field>
+ </channel-log-table>
+ <step-log-table>
+ <connection/>
+ <schema/>
+ <table/>
+ <timeout_days/>
+ <field>
+ <id>ID_BATCH</id>
+ <enabled>Y</enabled>
+ <name>ID_BATCH</name>
+ </field>
+ <field>
+ <id>CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>CHANNEL_ID</name>
+ </field>
+ <field>
+ <id>LOG_DATE</id>
+ <enabled>Y</enabled>
+ <name>LOG_DATE</name>
+ </field>
+ <field>
+ <id>TRANSNAME</id>
+ <enabled>Y</enabled>
+ <name>TRANSNAME</name>
+ </field>
+ <field>
+ <id>STEPNAME</id>
+ <enabled>Y</enabled>
+ <name>STEPNAME</name>
+ </field>
+ <field>
+ <id>STEP_COPY</id>
+ <enabled>Y</enabled>
+ <name>STEP_COPY</name>
+ </field>
+ <field>
+ <id>LINES_READ</id>
+ <enabled>Y</enabled>
+ <name>LINES_READ</name>
+ </field>
+ <field>
+ <id>LINES_WRITTEN</id>
+ <enabled>Y</enabled>
+ <name>LINES_WRITTEN</name>
+ </field>
+ <field>
+ <id>LINES_UPDATED</id>
+ <enabled>Y</enabled>
+ <name>LINES_UPDATED</name>
+ </field>
+ <field>
+ <id>LINES_INPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_INPUT</name>
+ </field>
+ <field>
+ <id>LINES_OUTPUT</id>
+ <enabled>Y</enabled>
+ <name>LINES_OUTPUT</name>
+ </field>
+ <field>
+ <id>LINES_REJECTED</id>
+ <enabled>Y</enabled>
+ <name>LINES_REJECTED</name>
+ </field>
+ <field>
+ <id>ERRORS</id>
+ <enabled>Y</enabled>
+ <name>ERRORS</name>
+ </field>
+ <field>
+ <id>LOG_FIELD</id>
+ <enabled>N</enabled>
+ <name>LOG_FIELD</name>
+ </field>
+ </step-log-table>
+ <metrics-log-table>
+ <connection/>
+ <schema/>
+ <table/>
+ <timeout_days/>
+ <field>
+ <id>ID_BATCH</id>
+ <enabled>Y</enabled>
+ <name>ID_BATCH</name>
+ </field>
+ <field>
+ <id>CHANNEL_ID</id>
+ <enabled>Y</enabled>
+ <name>CHANNEL_ID</name>
+ </field>
+ <field>
+ <id>LOG_DATE</id>
+ <enabled>Y</enabled>
+ <name>LOG_DATE</name>
+ </field>
+ <field>
+ <id>METRICS_DATE</id>
+ <enabled>Y</enabled>
+ <name>METRICS_DATE</name>
+ </field>
+ <field>
+ <id>METRICS_CODE</id>
+ <enabled>Y</enabled>
+ <name>METRICS_CODE</name>
+ </field>
+ <field>
+ <id>METRICS_DESCRIPTION</id>
+ <enabled>Y</enabled>
+ <name>METRICS_DESCRIPTION</name>
+ </field>
+ <field>
+ <id>METRICS_SUBJECT</id>
+ <enabled>Y</enabled>
+ <name>METRICS_SUBJECT</name>
+ </field>
+ <field>
+ <id>METRICS_TYPE</id>
+ <enabled>Y</enabled>
+ <name>METRICS_TYPE</name>
+ </field>
+ <field>
+ <id>METRICS_VALUE</id>
+ <enabled>Y</enabled>
+ <name>METRICS_VALUE</name>
+ </field>
+ </metrics-log-table>
+ </log>
+ <maxdate>
+ <connection/>
+ <table/>
+ <field/>
+ <offset>0.0</offset>
+ <maxdiff>0.0</maxdiff>
+ </maxdate>
+ <size_rowset>10000</size_rowset>
+ <sleep_time_empty>50</sleep_time_empty>
+ <sleep_time_full>50</sleep_time_full>
+ <unique_connections>N</unique_connections>
+ <feedback_shown>Y</feedback_shown>
+ <feedback_size>50000</feedback_size>
+ <using_thread_priorities>Y</using_thread_priorities>
+ <shared_objects_file/>
+ <capture_step_performance>N</capture_step_performance>
+ <step_performance_capturing_delay>1000</step_performance_capturing_delay>
+ <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
+ <dependencies>
+ </dependencies>
+ <partitionschemas>
+ </partitionschemas>
+ <slaveservers>
+ </slaveservers>
+ <clusterschemas>
+ </clusterschemas>
+ <created_user>-</created_user>
+ <created_date>2025/08/13 09:47:28.228</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2025/08/13 09:47:28.228</modified_date>
+ <key_for_session_key/>
+ <is_key_private>N</is_key_private>
+ </info>
+ <notepads>
+ </notepads>
+ <connection>
+ <name>dw bi indoteknik (localhost)</name>
+ <server>localhost</server>
+ <type>POSTGRESQL</type>
+ <access>Native</access>
+ <database>dw_bi_indoteknik</database>
+ <port>5432</port>
+ <username>odoo</username>
+ <password>Encrypted 2be98afc82bdfd8dd9a2ca45acc83f6c3</password>
+ <servername/>
+ <data_tablespace/>
+ <index_tablespace/>
+ <attributes>
+ <attribute>
+ <code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
+ <attribute>N</attribute>
+ </attribute>
+ <attribute>
+ <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
+ <attribute>N</attribute>
+ </attribute>
+ <attribute>
+ <code>IS_CLUSTERED</code>
+ <attribute>N</attribute>
+ </attribute>
+ <attribute>
+ <code>PORT_NUMBER</code>
+ <attribute>5432</attribute>
+ </attribute>
+ <attribute>
+ <code>PRESERVE_RESERVED_WORD_CASE</code>
+ <attribute>Y</attribute>
+ </attribute>
+ <attribute>
+ <code>QUOTE_ALL_FIELDS</code>
+ <attribute>N</attribute>
+ </attribute>
+ <attribute>
+ <code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
+ <attribute>Y</attribute>
+ </attribute>
+ <attribute>
+ <code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
+ <attribute>N</attribute>
+ </attribute>
+ <attribute>
+ <code>USE_POOLING</code>
+ <attribute>N</attribute>
+ </attribute>
+ </attributes>
+ </connection>
+ <order>
+ <hop>
+ <from>Table input</from>
+ <to>penjualan</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Table input 2</from>
+ <to>hpp</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>penjualan</from>
+ <to>Merge join</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>hpp</from>
+ <to>Merge join</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Merge join</from>
+ <to>Filter rows</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Filter rows</from>
+ <to>Write to log</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Filter rows</from>
+ <to>select all</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>select all</from>
+ <to>param only</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>param only</from>
+ <to>Table input 3</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>select all</from>
+ <to>all</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>all</from>
+ <to>Sort rows</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Table input 3</from>
+ <to>Sort rows 2</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Sort rows</from>
+ <to>Merge join 2</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Sort rows 2</from>
+ <to>Merge join 2</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Merge join 2</from>
+ <to>Add constants</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Add constants</from>
+ <to>Calculator</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Calculator</from>
+ <to>Select values</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Select values</from>
+ <to>Insert / update</to>
+ <enabled>Y</enabled>
+ </hop>
+ </order>
+ <step>
+ <name>Table input</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <sql>select aml.id, am.id as move_id, am.date, am.invoice_origin, am.name as invoice, coalesce(gp.name, rp.name) as customer,
+rpi.name as lob, b.name as brand, p.product_id, p.item_code, p.name as product, rp2.name as salesperson,
+aml.quantity, aml.price_unit, aml.price_subtotal, aml.price_total,
+0-aml.balance as penjualan
+from account_move_line aml
+join account_move am on am.id = aml.move_id
+join product p on p.product_id = aml.product_id
+join res_partner rp on rp.id = am.partner_id
+join res_users ru on ru.id = am.invoice_user_id
+join res_partner rp2 on rp2.id = ru.partner_id
+join account_account aa on aa.id = aml.account_id
+left join res_partner_industry rpi on rpi.id = rp.industry_id
+left join group_partner gp on gp.id = rp.group_partner_id
+left join brand b on b.id = p.brand_id
+where 1=1
+and aml.account_id = 462
+and am.state = 'posted'
+and aml.date >= '2024-06-01'
+--and aml.write_date >= (now() - '3 days'::interval)</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>Integer</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>
+ <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>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>move_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>Table input</origin>
+ <comments>move_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>
+ <value-meta>
+ <type>Date</type>
+ <storagetype>normal</storagetype>
+ <name>date</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>date</comments>
+ <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>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>invoice_origin</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>invoice_origin</comments>
+ <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>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>invoice</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>invoice</comments>
+ <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>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>customer</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>customer</comments>
+ <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>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>lob</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>lob</comments>
+ <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>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>brand</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>brand</comments>
+ <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>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>product_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>Table input</origin>
+ <comments>product_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>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>item_code</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>item_code</comments>
+ <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>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>product</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>product</comments>
+ <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>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>salesperson</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>salesperson</comments>
+ <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>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>quantity</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>quantity</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_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>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>price_unit</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>price_unit</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_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>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>price_subtotal</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>price_subtotal</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_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>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>price_total</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>price_total</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_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>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>penjualan</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input</origin>
+ <comments>penjualan</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_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/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>144</xloc>
+ <yloc>80</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>penjualan</name>
+ <type>SortRows</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <directory>%%java.io.tmpdir%%</directory>
+ <prefix>out</prefix>
+ <sort_size>1000000</sort_size>
+ <free_memory/>
+ <compress>N</compress>
+ <compress_variable/>
+ <unique_rows>N</unique_rows>
+ <fields>
+ <field>
+ <name>id</name>
+ <ascending>Y</ascending>
+ <case_sensitive>N</case_sensitive>
+ <collator_enabled>N</collator_enabled>
+ <collator_strength>0</collator_strength>
+ <presorted>N</presorted>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>144</xloc>
+ <yloc>176</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Table input 2</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <sql>select aml.id, am.id as move_id, aml.product_id, aml.balance as hpp
+from account_move_line aml
+join account_move am on am.id = aml.move_id
+--join product p on p.product_id = aml.product_id
+--join res_partner rp on rp.id = am.partner_id
+--join res_users ru on ru.id = am.invoice_user_id
+--join res_partner rp2 on rp2.id = ru.partner_id
+--join account_account aa on aa.id = aml.account_id
+--left join res_partner_industry rpi on rpi.id = rp.industry_id
+--left join group_partner gp on gp.id = rp.group_partner_id
+--left join brand b on b.id = p.brand_id
+where 1=1
+and aml.account_id = 466
+and am.state = 'posted'
+and aml.date >= '2024-06-01'
+--and aml.write_date >= (now() - '3 days'::interval)</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>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>Table input 2</origin>
+ <comments>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>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>move_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>Table input 2</origin>
+ <comments>move_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>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>product_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>Table input 2</origin>
+ <comments>product_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>
+ <value-meta>
+ <type>BigNumber</type>
+ <storagetype>normal</storagetype>
+ <name>hpp</name>
+ <length>-1</length>
+ <precision>-1</precision>
+ <origin>Table input 2</origin>
+ <comments>hpp</comments>
+ <conversion_Mask>######0.0###################;-######0.0###################</conversion_Mask>
+ <decimal_symbol>.</decimal_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/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>320</xloc>
+ <yloc>80</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>hpp</name>
+ <type>SortRows</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <directory>%%java.io.tmpdir%%</directory>
+ <prefix>out</prefix>
+ <sort_size>1000000</sort_size>
+ <free_memory/>
+ <compress>N</compress>
+ <compress_variable/>
+ <unique_rows>N</unique_rows>
+ <fields>
+ <field>
+ <name>id</name>
+ <ascending>Y</ascending>
+ <case_sensitive>N</case_sensitive>
+ <collator_enabled>N</collator_enabled>
+ <collator_strength>0</collator_strength>
+ <presorted>N</presorted>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>320</xloc>
+ <yloc>176</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Merge join</name>
+ <type>MergeJoin</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <join_type>LEFT OUTER</join_type>
+ <step1>penjualan</step1>
+ <step2>hpp</step2>
+ <keys_1>
+ <key>move_id</key>
+ <key>product_id</key>
+ </keys_1>
+ <keys_2>
+ <key>move_id</key>
+ <key>product_id</key>
+ </keys_2>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>240</xloc>
+ <yloc>288</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Filter rows</name>
+ <type>FilterRows</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <send_true_to>select all</send_true_to>
+ <send_false_to>Write to log</send_false_to>
+ <compare>
+ <condition>
+ <negated>N</negated>
+ <conditions>
+ <condition>
+ <negated>N</negated>
+ <leftvalue>penjualan</leftvalue>
+ <function>&gt;</function>
+ <rightvalue/>
+ <value>
+ <name>constant</name>
+ <type>BigNumber</type>
+ <text>0.0</text>
+ <length>-1</length>
+ <precision>-1</precision>
+ <isnull>N</isnull>
+ <mask>######0.0###################;-######0.0###################</mask>
+ </value>
+ </condition>
+ <condition>
+ <negated>N</negated>
+ <operator>AND</operator>
+ <leftvalue>hpp</leftvalue>
+ <function>&gt;</function>
+ <rightvalue/>
+ <value>
+ <name>constant</name>
+ <type>BigNumber</type>
+ <text>0.0</text>
+ <length>-1</length>
+ <precision>-1</precision>
+ <isnull>N</isnull>
+ <mask>######0.0###################;-######0.0###################</mask>
+ </value>
+ </condition>
+ </conditions>
+ </condition>
+ </compare>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>416</xloc>
+ <yloc>288</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Write to log</name>
+ <type>WriteToLog</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <loglevel>log_level_basic</loglevel>
+ <displayHeader>Y</displayHeader>
+ <limitRows>N</limitRows>
+ <limitRowsNumber>0</limitRowsNumber>
+ <logmessage/>
+ <fields>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>416</xloc>
+ <yloc>400</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>select all</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>N</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>move_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>date</name>
+ <rename/>
+ </field>
+ <field>
+ <name>invoice_origin</name>
+ <rename/>
+ </field>
+ <field>
+ <name>invoice</name>
+ <rename/>
+ </field>
+ <field>
+ <name>customer</name>
+ <rename/>
+ </field>
+ <field>
+ <name>lob</name>
+ <rename/>
+ </field>
+ <field>
+ <name>brand</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>item_code</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product</name>
+ <rename/>
+ </field>
+ <field>
+ <name>salesperson</name>
+ <rename/>
+ </field>
+ <field>
+ <name>quantity</name>
+ <rename/>
+ </field>
+ <field>
+ <name>price_unit</name>
+ <rename/>
+ </field>
+ <field>
+ <name>price_subtotal</name>
+ <rename/>
+ </field>
+ <field>
+ <name>price_total</name>
+ <rename/>
+ </field>
+ <field>
+ <name>penjualan</name>
+ <rename/>
+ </field>
+ <field>
+ <name>id_1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>move_id_1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product_id_1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hpp</name>
+ <rename/>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>560</xloc>
+ <yloc>288</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>param only</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>invoice_origin</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product_id</name>
+ <rename/>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>688</xloc>
+ <yloc>192</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Table input 3</name>
+ <type>TableInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <sql>select ? as id, tso.name as sale_order, tsol.product_id as sale_product_id, tsol.vendor_id, rp.name as vendor
+from t_sale_order_line tsol
+join t_sale_order tso on tso.id = tsol.order_id
+join res_partner rp on rp.id = tsol.vendor_id
+where 1=1
+and tso.name = ? and tsol.vendor_id = ?</sql>
+ <limit>0</limit>
+ <lookup>param only</lookup>
+ <execute_each_row>Y</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>
+ <storagetype>normal</storagetype>
+ <name>id</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input 3</origin>
+ <comments>id</comments>
+ <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>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>sale_order</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input 3</origin>
+ <comments>sale_order</comments>
+ <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>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>sale_product_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>Table input 3</origin>
+ <comments>sale_product_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>
+ <value-meta>
+ <type>Integer</type>
+ <storagetype>normal</storagetype>
+ <name>vendor_id</name>
+ <length>9</length>
+ <precision>0</precision>
+ <origin>Table input 3</origin>
+ <comments>vendor_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>
+ <value-meta>
+ <type>String</type>
+ <storagetype>normal</storagetype>
+ <name>vendor</name>
+ <length>2147483647</length>
+ <precision>-1</precision>
+ <origin>Table input 3</origin>
+ <comments>vendor</comments>
+ <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/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>832</xloc>
+ <yloc>192</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>all</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>move_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>date</name>
+ <rename/>
+ </field>
+ <field>
+ <name>invoice_origin</name>
+ <rename/>
+ </field>
+ <field>
+ <name>invoice</name>
+ <rename/>
+ </field>
+ <field>
+ <name>customer</name>
+ <rename/>
+ </field>
+ <field>
+ <name>lob</name>
+ <rename/>
+ </field>
+ <field>
+ <name>brand</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>item_code</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product</name>
+ <rename/>
+ </field>
+ <field>
+ <name>salesperson</name>
+ <rename/>
+ </field>
+ <field>
+ <name>quantity</name>
+ <rename/>
+ </field>
+ <field>
+ <name>price_unit</name>
+ <rename/>
+ </field>
+ <field>
+ <name>price_subtotal</name>
+ <rename/>
+ </field>
+ <field>
+ <name>price_total</name>
+ <rename/>
+ </field>
+ <field>
+ <name>penjualan</name>
+ <rename/>
+ </field>
+ <field>
+ <name>id_1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>move_id_1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product_id_1</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hpp</name>
+ <rename/>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>688</xloc>
+ <yloc>320</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Sort rows</name>
+ <type>SortRows</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <directory>%%java.io.tmpdir%%</directory>
+ <prefix>out</prefix>
+ <sort_size>1000000</sort_size>
+ <free_memory/>
+ <compress>N</compress>
+ <compress_variable/>
+ <unique_rows>N</unique_rows>
+ <fields>
+ <field>
+ <name>id</name>
+ <ascending>Y</ascending>
+ <case_sensitive>N</case_sensitive>
+ <collator_enabled>N</collator_enabled>
+ <collator_strength>0</collator_strength>
+ <presorted>N</presorted>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>688</xloc>
+ <yloc>400</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Sort rows 2</name>
+ <type>SortRows</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <directory>%%java.io.tmpdir%%</directory>
+ <prefix>out</prefix>
+ <sort_size>1000000</sort_size>
+ <free_memory/>
+ <compress>N</compress>
+ <compress_variable/>
+ <unique_rows>N</unique_rows>
+ <fields>
+ <field>
+ <name>id</name>
+ <ascending>Y</ascending>
+ <case_sensitive>N</case_sensitive>
+ <collator_enabled>N</collator_enabled>
+ <collator_strength>0</collator_strength>
+ <presorted>N</presorted>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>832</xloc>
+ <yloc>272</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Merge join 2</name>
+ <type>MergeJoin</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <join_type>LEFT OUTER</join_type>
+ <step1>Sort rows</step1>
+ <step2>Sort rows 2</step2>
+ <keys_1>
+ <key>id</key>
+ </keys_1>
+ <keys_2>
+ <key>id</key>
+ </keys_2>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>832</xloc>
+ <yloc>400</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>margin</field_name>
+ <calc_type>SUBTRACT</calc_type>
+ <field_a>penjualan</field_a>
+ <field_b>hpp</field_b>
+ <field_c/>
+ <value_type>None</value_type>
+ <value_length>-1</value_length>
+ <value_precision>-1</value_precision>
+ <remove>N</remove>
+ <conversion_mask/>
+ <decimal_symbol/>
+ <grouping_symbol/>
+ <currency_symbol/>
+ </calculation>
+ <calculation>
+ <field_name>div_margin</field_name>
+ <calc_type>DIVIDE</calc_type>
+ <field_a>margin</field_a>
+ <field_b>penjualan</field_b>
+ <field_c/>
+ <value_type>None</value_type>
+ <value_length>-1</value_length>
+ <value_precision>-1</value_precision>
+ <remove>N</remove>
+ <conversion_mask/>
+ <decimal_symbol/>
+ <grouping_symbol/>
+ <currency_symbol/>
+ </calculation>
+ <calculation>
+ <field_name>percent_margin</field_name>
+ <calc_type>MULTIPLY</calc_type>
+ <field_a>div_margin</field_a>
+ <field_b>one_hundred</field_b>
+ <field_c/>
+ <value_type>None</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>992</xloc>
+ <yloc>160</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Add constants</name>
+ <type>Constant</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>one_hundred</name>
+ <type>BigNumber</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <nullif>100</nullif>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>992</xloc>
+ <yloc>32</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>move_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>date</name>
+ <rename/>
+ </field>
+ <field>
+ <name>invoice_origin</name>
+ <rename/>
+ </field>
+ <field>
+ <name>invoice</name>
+ <rename/>
+ </field>
+ <field>
+ <name>customer</name>
+ <rename/>
+ </field>
+ <field>
+ <name>lob</name>
+ <rename/>
+ </field>
+ <field>
+ <name>brand</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>item_code</name>
+ <rename/>
+ </field>
+ <field>
+ <name>product</name>
+ <rename/>
+ </field>
+ <field>
+ <name>salesperson</name>
+ <rename/>
+ </field>
+ <field>
+ <name>quantity</name>
+ <rename/>
+ </field>
+ <field>
+ <name>price_unit</name>
+ <rename/>
+ </field>
+ <field>
+ <name>price_subtotal</name>
+ <rename/>
+ </field>
+ <field>
+ <name>price_total</name>
+ <rename/>
+ </field>
+ <field>
+ <name>penjualan</name>
+ <rename/>
+ </field>
+ <field>
+ <name>hpp</name>
+ <rename/>
+ </field>
+ <field>
+ <name>sale_order</name>
+ <rename/>
+ </field>
+ <field>
+ <name>sale_product_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>vendor_id</name>
+ <rename/>
+ </field>
+ <field>
+ <name>vendor</name>
+ <rename/>
+ </field>
+ <field>
+ <name>margin</name>
+ <rename/>
+ </field>
+ <field>
+ <name>div_margin</name>
+ <rename/>
+ </field>
+ <field>
+ <name>percent_margin</name>
+ <rename/>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>992</xloc>
+ <yloc>256</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Insert / update</name>
+ <type>InsertUpdate</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>dw bi indoteknik (localhost)</connection>
+ <commit>100</commit>
+ <update_bypassed>N</update_bypassed>
+ <lookup>
+ <schema>public</schema>
+ <table>margin_invoice_v3</table>
+ <key>
+ <name/>
+ <field>id</field>
+ <condition/>
+ <name2/>
+ </key>
+ <value>
+ <name>id</name>
+ <rename>id</rename>
+ <update>N</update>
+ </value>
+ <value>
+ <name>move_id</name>
+ <rename>move_id</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>date</name>
+ <rename>date</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>invoice_origin</name>
+ <rename>invoice_origin</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>invoice</name>
+ <rename>invoice</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>customer</name>
+ <rename>customer</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>lob</name>
+ <rename>lob</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>brand</name>
+ <rename>brand</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>product_id</name>
+ <rename>product_id</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>item_code</name>
+ <rename>item_code</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>product</name>
+ <rename>product</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>salesperson</name>
+ <rename>salesperson</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>quantity</name>
+ <rename>quantity</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>price_unit</name>
+ <rename>price_unit</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>price_subtotal</name>
+ <rename>price_subtotal</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>price_total</name>
+ <rename>price_total</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>penjualan</name>
+ <rename>penjualan</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>hpp</name>
+ <rename>hpp</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>sale_order</name>
+ <rename>sale_order</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>sale_product_id</name>
+ <rename>sale_product_id</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>vendor_id</name>
+ <rename>vendor_id</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>vendor</name>
+ <rename>vendor</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>margin</name>
+ <rename>margin</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>div_margin</name>
+ <rename>div_margin</rename>
+ <update>Y</update>
+ </value>
+ <value>
+ <name>percent_margin</name>
+ <rename>percent_margin</rename>
+ <update>Y</update>
+ </value>
+ </lookup>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>992</xloc>
+ <yloc>352</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step_error_handling>
+ </step_error_handling>
+ <slave-step-copy-partition-distribution>
+ </slave-step-copy-partition-distribution>
+ <slave_transformation>N</slave_transformation>
+ <attributes/>
+</transformation>
diff --git a/run_single_ktr.sh b/run_single_ktr.sh
index a684fb9..f87e0d9 100644
--- a/run_single_ktr.sh
+++ b/run_single_ktr.sh
@@ -1 +1 @@
-sh /home/stephan/data-integration/pan.sh -level="Debug" -file="/home/stephan/transformation-job-bi/calculate_leadtime_po_to_mr.ktr" > "/home/stephan/transformation-job-bi/log/run_single_ktr.log"
+sh /home/stephan/data-integration/pan.sh -level="Debug" -file="/home/stephan/transformation-job-bi/calculate_margin_invoice_v3" > "/home/stephan/transformation-job-bi/log/run_single_ktr.log"