Fixes Issue 31382: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 27842 10ff05690b1a
parent 27841 940048b0ab81
child 27843 797fabffe660
Fixes Issue 31382: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	Fri Nov 06 13:56:58 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;