summaryrefslogtreecommitdiff
path: root/update_aging_info.ktr
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2025-08-02 11:45:40 +0700
committerstephanchrst <stephanchrst@gmail.com>2025-08-02 11:45:40 +0700
commitb79570d01a156b05b91e6564adb8f6dc0730eabe (patch)
treea8f5f1bccb02eb31186b2f32efb8a1c161fd5901 /update_aging_info.ktr
parentfa5eb02756f3cfd5e243284a6246faf43921a8b5 (diff)
update aging info for 365 days before now
Diffstat (limited to 'update_aging_info.ktr')
-rw-r--r--update_aging_info.ktr302
1 files changed, 149 insertions, 153 deletions
diff --git a/update_aging_info.ktr b/update_aging_info.ktr
index a83a169..46a8336 100644
--- a/update_aging_info.ktr
+++ b/update_aging_info.ktr
@@ -436,14 +436,14 @@
<notepads>
</notepads>
<connection>
- <name>dw bi indoteknik</name>
+ <name>dw bi indoteknik (localhost)</name>
<server>localhost</server>
<type>POSTGRESQL</type>
<access>Native</access>
<database>dw_bi_indoteknik</database>
- <port>5703</port>
- <username>metabase</username>
- <password>Encrypted 2be98dfba28d7bf86853c9f58cfc4f889</password>
+ <port>5432</port>
+ <username>odoo</username>
+ <password>Encrypted 2be98afc82bdfd8dd9a2ca45acc83f6c3</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
@@ -462,7 +462,7 @@
</attribute>
<attribute>
<code>PORT_NUMBER</code>
- <attribute>5703</attribute>
+ <attribute>5432</attribute>
</attribute>
<attribute>
<code>PRESERVE_RESERVED_WORD_CASE</code>
@@ -478,7 +478,7 @@
</attribute>
<attribute>
<code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
- <attribute>Y</attribute>
+ <attribute>N</attribute>
</attribute>
<attribute>
<code>USE_POOLING</code>
@@ -487,14 +487,14 @@
</attributes>
</connection>
<connection>
- <name>erp indoteknik production</name>
- <server>localhost</server>
+ <name>erp indoteknik production (localhost)</name>
+ <server>10.148.0.3</server>
<type>POSTGRESQL</type>
<access>Native</access>
<database>erp_indoteknik</database>
- <port>5901</port>
- <username>odoo</username>
- <password>Encrypted 2be98afc82bdfd8dd9a2ca45acc83f6c3</password>
+ <port>5432</port>
+ <username>pdi</username>
+ <password>Encrypted 2be989bb20084ca95810197629d9ea18e</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
@@ -513,7 +513,7 @@
</attribute>
<attribute>
<code>PORT_NUMBER</code>
- <attribute>5901</attribute>
+ <attribute>5432</attribute>
</attribute>
<attribute>
<code>PRESERVE_RESERVED_WORD_CASE</code>
@@ -529,7 +529,7 @@
</attribute>
<attribute>
<code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
- <attribute>Y</attribute>
+ <attribute>N</attribute>
</attribute>
<attribute>
<code>USE_POOLING</code>
@@ -560,6 +560,140 @@
</hop>
</order>
<step>
+ <name>If field value is null</name>
+ <type>IfNull</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <replaceAllByValue/>
+ <replaceAllMask/>
+ <selectFields>Y</selectFields>
+ <selectValuesType>N</selectValuesType>
+ <setEmptyStringAll>N</setEmptyStringAll>
+ <valuetypes>
+ </valuetypes>
+ <fields>
+ <field>
+ <name>aging</name>
+ <value>0</value>
+ <mask/>
+ <set_empty_string>N</set_empty_string>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>304</xloc>
+ <yloc>112</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Modified JavaScript value</name>
+ <type>ScriptValueMod</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <compatible>N</compatible>
+ <optimizationLevel>9</optimizationLevel>
+ <jsScripts>
+ <jsScript>
+ <jsScript_type>0</jsScript_type>
+ <jsScript_name>Script 1</jsScript_name>
+ <jsScript_script>var result = '';
+
+if (aging &lt;= 5) {
+ result = 'normal';
+} else if (aging > 5 &amp;&amp; aging &lt;= 10) {
+ result = 'agak_sulit';
+} else if (aging > 10 &amp;&amp; aging &lt;= 20) {
+ result = 'sulit';
+} else {
+ result = 'bermasalah';
+}</jsScript_script>
+ </jsScript>
+ </jsScripts>
+ <fields>
+ <field>
+ <name>result</name>
+ <rename>result</rename>
+ <type>String</type>
+ <length>-1</length>
+ <precision>-1</precision>
+ <replace>N</replace>
+ </field>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>496</xloc>
+ <yloc>112</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>partner_id</name>
+ </field>
+ <field>
+ <name>aging</name>
+ </field>
+ <field>
+ <name>url_bi</name>
+ </field>
+ <field>
+ <name>result</name>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>496</xloc>
+ <yloc>224</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
<name>Table input</name>
<type>TableInput</type>
<description/>
@@ -570,7 +704,7 @@
<method>none</method>
<schema_name/>
</partitioning>
- <connection>dw bi indoteknik</connection>
+ <connection>dw bi indoteknik (localhost)</connection>
<sql>select partner_id, round(avg(aging::numeric),2) as aging,
'https://analytic.indoteknik.com/dashboard/140-customer-aging?date=past12months&amp;partner_id='||partner_id as url_bi
from mv_aging_customer
@@ -678,7 +812,7 @@ group by partner_id</sql>
<method>none</method>
<schema_name/>
</partitioning>
- <connection>erp indoteknik production</connection>
+ <connection>erp indoteknik production (localhost)</connection>
<skip_lookup>N</skip_lookup>
<commit>100</commit>
<use_batch>N</use_batch>
@@ -720,144 +854,6 @@ group by partner_id</sql>
<draw>Y</draw>
</GUI>
</step>
- <step>
- <name>Modified JavaScript value</name>
- <type>ScriptValueMod</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <compatible>N</compatible>
- <optimizationLevel>9</optimizationLevel>
- <jsScripts>
- <jsScript>
- <jsScript_type>0</jsScript_type>
- <jsScript_name>Script 1</jsScript_name>
- <jsScript_script>var result = '';
-
-if (aging &lt;= 5) {
- result = 'normal';
-} else if (aging > 5 &amp;&amp; aging &lt;= 10) {
- result = 'agak_sulit';
-} else if (aging > 10 &amp;&amp; aging &lt;= 20) {
- result = 'sulit';
-} else {
- result = 'bermasalah';
-}</jsScript_script>
- </jsScript>
- </jsScripts>
- <fields>
- <field>
- <name>result</name>
- <rename>result</rename>
- <type>String</type>
- <length>-1</length>
- <precision>-1</precision>
- <replace>N</replace>
- </field>
- </fields>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>496</xloc>
- <yloc>112</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
- <step>
- <name>If field value is null</name>
- <type>IfNull</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <replaceAllByValue/>
- <replaceAllMask/>
- <selectFields>Y</selectFields>
- <selectValuesType>N</selectValuesType>
- <setEmptyStringAll>N</setEmptyStringAll>
- <valuetypes>
- </valuetypes>
- <fields>
- <field>
- <name>aging</name>
- <value>0</value>
- <mask/>
- <set_empty_string>N</set_empty_string>
- </field>
- </fields>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>304</xloc>
- <yloc>112</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>partner_id</name>
- <rename/>
- </field>
- <field>
- <name>aging</name>
- <rename/>
- </field>
- <field>
- <name>url_bi</name>
- <rename/>
- </field>
- <field>
- <name>result</name>
- <rename/>
- </field>
- <select_unspecified>N</select_unspecified>
- </fields>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>496</xloc>
- <yloc>224</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
<step_error_handling>
</step_error_handling>
<slave-step-copy-partition-distribution>