summaryrefslogtreecommitdiff
path: root/cbd_locked_new.ktr
diff options
context:
space:
mode:
Diffstat (limited to 'cbd_locked_new.ktr')
-rw-r--r--cbd_locked_new.ktr194
1 files changed, 97 insertions, 97 deletions
diff --git a/cbd_locked_new.ktr b/cbd_locked_new.ktr
index df7f4d1..6360bb5 100644
--- a/cbd_locked_new.ktr
+++ b/cbd_locked_new.ktr
@@ -675,6 +675,90 @@
</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>invoice_payment_term_id</name>
+ <rename>previous_pt</rename>
+ </field>
+ <field>
+ <name>partner_id</name>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>400</xloc>
+ <yloc>32</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
+ <name>Update Previous PT &amp; CBD Locked</name>
+ <type>Update</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>erp indoteknik production (localhost)</connection>
+ <skip_lookup>N</skip_lookup>
+ <commit>100</commit>
+ <use_batch>N</use_batch>
+ <error_ignored>Y</error_ignored>
+ <ignore_flag_field/>
+ <lookup>
+ <schema>public</schema>
+ <table>res_partner</table>
+ <key>
+ <name>partner_id</name>
+ <field>id</field>
+ <condition>=</condition>
+ <name2/>
+ </key>
+ <value>
+ <name>previous_payment_term_id</name>
+ <rename>previous_pt</rename>
+ </value>
+ <value>
+ <name>is_cbd_locked</name>
+ <rename>is_cbd_locked</rename>
+ </value>
+ </lookup>
+ <attributes/>
+ <cluster_schema/>
+ <remotesteps>
+ <input>
+ </input>
+ <output>
+ </output>
+ </remotesteps>
+ <GUI>
+ <xloc>752</xloc>
+ <yloc>176</yloc>
+ <draw>Y</draw>
+ </GUI>
+ </step>
+ <step>
<name>Update Value Ref PPT</name>
<type>Update</type>
<description/>
@@ -737,26 +821,27 @@
<schema_name/>
</partitioning>
<connection>erp indoteknik production (localhost)</connection>
- <sql>SELECT
- am.partner_id,
+ <sql>SELECT
+ am.partner_id,
rp.name AS partner_name,
am.id AS invoice_id,
am.name AS invoice_name,
- am.invoice_date_due,
+ am.invoice_date_due,
am.payment_state,
+ am.customer_promise_date,
am.invoice_payment_term_id
FROM account_move am
-JOIN res_partner rp
+JOIN res_partner rp
ON rp.id = am.partner_id
WHERE am.move_type = 'out_invoice'
- AND am.state = 'posted'
- AND am.payment_state NOT IN ('paid', 'in_payment', 'reversed')
- AND am.invoice_date_due IS NOT NULL
- AND am.date_terima_tukar_faktur IS NOT NULL
- AND am.amount_residual is NOT NULL
- AND am.invoice_date_due &lt; (CURRENT_DATE - INTERVAL '30 day')
-order by invoice_payment_term_id;
-</sql>
+ AND am.state = 'posted'
+ AND am.payment_state NOT IN ('paid', 'in_payment', 'reversed')
+ AND am.invoice_date_due IS NOT NULL
+ AND am.date_terima_tukar_faktur IS NOT NULL
+ AND am.amount_residual IS NOT NULL
+ AND am.invoice_date_due &lt; (CURRENT_DATE - INTERVAL '30 day')
+ AND (am.customer_promise_date &lt; CURRENT_DATE OR am.customer_promise_date IS NULL)
+ORDER BY invoice_payment_term_id;</sql>
<limit>0</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
@@ -1054,91 +1139,6 @@ order by apt.id;
<draw>Y</draw>
</GUI>
</step>
- <step>
- <name>Update Previous PT &amp; CBD Locked</name>
- <type>Update</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <connection>erp indoteknik production (localhost)</connection>
- <skip_lookup>N</skip_lookup>
- <commit>100</commit>
- <use_batch>N</use_batch>
- <error_ignored>Y</error_ignored>
- <ignore_flag_field/>
- <lookup>
- <schema>public</schema>
- <table>res_partner</table>
- <key>
- <name>partner_id</name>
- <field>id</field>
- <condition>=</condition>
- <name2/>
- </key>
- <value>
- <name>previous_payment_term_id</name>
- <rename>previous_pt</rename>
- </value>
- <value>
- <name>is_cbd_locked</name>
- <rename>is_cbd_locked</rename>
- </value>
- </lookup>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>752</xloc>
- <yloc>176</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>invoice_payment_term_id</name>
- <rename>previous_pt</rename>
- </field>
- <field>
- <name>partner_id</name>
- <rename/>
- </field>
- <select_unspecified>N</select_unspecified>
- </fields>
- <attributes/>
- <cluster_schema/>
- <remotesteps>
- <input>
- </input>
- <output>
- </output>
- </remotesteps>
- <GUI>
- <xloc>400</xloc>
- <yloc>32</yloc>
- <draw>Y</draw>
- </GUI>
- </step>
<step_error_handling>
</step_error_handling>
<slave-step-copy-partition-distribution>