Fixes issue 36619: Process Generate Invoices is not working with high volumes
authorAtul Gaware <atul.gaware@openbravo.com>
Wed, 09 Aug 2017 11:02:37 +0530
changeset 32550 31583e78ae29
parent 32549 f4ead81d1b88
child 32551 e6738814dcbe
Fixes issue 36619: Process Generate Invoices is not working with high volumes

* Defined and used OBUI Selector Reference based reference for Sales Order parameter in Generate Invoice process.
* Implemented HQL where clause in the selector based on the validation C_Order SO to be invoiced.
src-db/database/sourcedata/AD_PROCESS_PARA.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/OBUISEL_SELECTOR.xml
--- a/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Wed Aug 09 12:45:21 2017 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Wed Aug 09 11:02:37 2017 +0530
@@ -248,8 +248,8 @@
 <!--143-->  <HELP><![CDATA[Unique identifier and a reference to a Sales Order originating from the document sequence defined for this document type.]]></HELP>
 <!--143-->  <AD_PROCESS_ID><![CDATA[119]]></AD_PROCESS_ID>
 <!--143-->  <SEQNO><![CDATA[20]]></SEQNO>
-<!--143-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
-<!--143-->  <AD_VAL_RULE_ID><![CDATA[134]]></AD_VAL_RULE_ID>
+<!--143-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--143-->  <AD_REFERENCE_VALUE_ID><![CDATA[6DA294D48BF14CF691A301ADE4938411]]></AD_REFERENCE_VALUE_ID>
 <!--143-->  <COLUMNNAME><![CDATA[C_Order_ID]]></COLUMNNAME>
 <!--143-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--143-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Wed Aug 09 12:45:21 2017 +0200
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Wed Aug 09 11:02:37 2017 +0530
@@ -5516,6 +5516,18 @@
 <!--6C11958E975D4DF8A38E7F4A119A3077-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--6C11958E975D4DF8A38E7F4A119A3077--></AD_REFERENCE>
 
+<!--6DA294D48BF14CF691A301ADE4938411--><AD_REFERENCE>
+<!--6DA294D48BF14CF691A301ADE4938411-->  <AD_REFERENCE_ID><![CDATA[6DA294D48BF14CF691A301ADE4938411]]></AD_REFERENCE_ID>
+<!--6DA294D48BF14CF691A301ADE4938411-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6DA294D48BF14CF691A301ADE4938411-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6DA294D48BF14CF691A301ADE4938411-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6DA294D48BF14CF691A301ADE4938411-->  <NAME><![CDATA[Order for invoicing]]></NAME>
+<!--6DA294D48BF14CF691A301ADE4938411-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--6DA294D48BF14CF691A301ADE4938411-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--6DA294D48BF14CF691A301ADE4938411-->  <PARENTREFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></PARENTREFERENCE_ID>
+<!--6DA294D48BF14CF691A301ADE4938411-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--6DA294D48BF14CF691A301ADE4938411--></AD_REFERENCE>
+
 <!--7039147A5B49457DA3D13F807EC8E01F--><AD_REFERENCE>
 <!--7039147A5B49457DA3D13F807EC8E01F-->  <AD_REFERENCE_ID><![CDATA[7039147A5B49457DA3D13F807EC8E01F]]></AD_REFERENCE_ID>
 <!--7039147A5B49457DA3D13F807EC8E01F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Wed Aug 09 12:45:21 2017 +0200
+++ b/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Wed Aug 09 11:02:37 2017 +0530
@@ -525,6 +525,22 @@
 <!--784A05D3FE67483A85C8CB77AAEC5910-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--784A05D3FE67483A85C8CB77AAEC5910--></OBUISEL_SELECTOR>
 
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3--><OBUISEL_SELECTOR>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <OBUISEL_SELECTOR_ID><![CDATA[7875FD8CEC604CB3AF3ABDF9D9024CA3]]></OBUISEL_SELECTOR_ID>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <NAME><![CDATA[Order for invoicing]]></NAME>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <AD_REFERENCE_ID><![CDATA[6DA294D48BF14CF691A301ADE4938411]]></AD_REFERENCE_ID>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <AD_TABLE_ID><![CDATA[259]]></AD_TABLE_ID>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <WHERECLAUSE><![CDATA[e.salesTransaction = true and e.documentStatus NOT IN ('DR','IP') AND ((e.invoiceTerms = 'O' AND NOT EXISTS (select 1 from OrderLine where salesOrder.id = e.id and orderedQuantity <> deliveredQuantity) AND EXISTS (select 1 from OrderLine where salesOrder.id = e.id and orderedQuantity <> invoicedQuantity)) OR (e.invoiceTerms = 'D' AND EXISTS (select 1 from OrderLine where salesOrder.id = e.id and orderedQuantity <> invoicedQuantity and invoicedQuantity <> deliveredQuantity)) OR (e.invoiceTerms = 'I' AND EXISTS (select 1 from OrderLine where salesOrder.id = e.id and orderedQuantity <> invoicedQuantity)))]]></WHERECLAUSE>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
+<!--7875FD8CEC604CB3AF3ABDF9D9024CA3--></OBUISEL_SELECTOR>
+
 <!--7B07F521E4804C89B7956E584989CC16--><OBUISEL_SELECTOR>
 <!--7B07F521E4804C89B7956E584989CC16-->  <OBUISEL_SELECTOR_ID><![CDATA[7B07F521E4804C89B7956E584989CC16]]></OBUISEL_SELECTOR_ID>
 <!--7B07F521E4804C89B7956E584989CC16-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>