Fixes Issue 31403:Purchase Order and Goods Receipt not shown in Invoice's
authorAtul Gaware <atul.gaware@openbravo.com>
Fri, 06 Nov 2015 16:42:23 +0530
changeset 28102 bba4162b09e1
parent 28101 239c6606f978
child 28103 9e87509d3090
Fixes Issue 31403:Purchase Order and Goods Receipt not shown in Invoice's
Create Lines From if the Customer Invoice Terms are Do Not Invoice

In case of purchase flow Immediate (I) is set as default value for
Invoice Rule.
src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java	Thu Nov 05 16:44:29 2015 +0100
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java	Fri Nov 06 16:42:23 2015 +0530
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2014 Openbravo SLU
+ * All portions are Copyright (C) 2001-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -62,9 +62,11 @@
       if (docTypeData != null && docTypeData.length > 0) {
         docSubTypeSO = docTypeData[0].docsubtypeso;
       }
-      strInvoiceRule = (docSubTypeSO.equals("PR") || docSubTypeSO.equals("WI")
-          || data[0].invoicerule.equals("") ? info.vars.getStringParameter("inpinvoicerule")
-          : data[0].invoicerule);
+      // Incase of purchase flow set Invoice Rule as "I":Immediate
+      strInvoiceRule = strIsSOTrx.equals("Y") ? (docSubTypeSO.equals("PR")
+          || docSubTypeSO.equals("WI") || data[0].invoicerule.equals("") ? info.vars
+          .getStringParameter("inpinvoicerule") : data[0].invoicerule) : "I";
+
       strPaymentrule = (strIsSOTrx.equals("Y") ? data[0].paymentrule : data[0].paymentrulepo);
       strPaymentrule = strPaymentrule.equals("") ? info.vars.getStringParameter("inppaymentrule")
           : strPaymentrule;