Fixes issue 26964 Avoids posting fail when documents are set
authorRafa Roda Palacios <rafa.roda@ubiquads.com>
Thu, 31 Jul 2014 08:46:34 +0200
changeset 24148 2f9dac31e199
parent 24147 69e3ea6e8f8f
child 24149 286896a13002
Fixes issue 26964 Avoids posting fail when documents are set
src/org/openbravo/erpCommon/ad_forms/DocDoubtfulDebt.java
src/org/openbravo/erpCommon/ad_forms/DocFINBankStatement.java
src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java
src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocDoubtfulDebt.java	Thu Jul 31 17:03:13 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/DocDoubtfulDebt.java	Thu Jul 31 08:46:34 2014 +0200
@@ -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) 2013 Openbravo SLU
+ * All portions are Copyright (C) 2013-2014 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -125,7 +125,8 @@
       obqParameters.setNamedParameter("documentType", DocumentType);
       final List<AcctSchemaTableDocType> acctSchemaTableDocTypes = obqParameters.list();
 
-      if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0) {
+      if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0
+          && acctSchemaTableDocTypes.get(0).getCreatefactTemplate() != null) {
         strClassname = acctSchemaTableDocTypes.get(0).getCreatefactTemplate().getClassname();
       }
 
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINBankStatement.java	Thu Jul 31 17:03:13 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINBankStatement.java	Thu Jul 31 08:46:34 2014 +0200
@@ -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) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2014 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -97,8 +97,10 @@
           AcctSchemaTableDocType.class, whereClause.toString());
       final List<AcctSchemaTableDocType> acctSchemaTableDocTypes = obqParameters.list();
 
-      if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0)
+      if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0
+          && acctSchemaTableDocTypes.get(0).getCreatefactTemplate() != null) {
         strClassname = acctSchemaTableDocTypes.get(0).getCreatefactTemplate().getClassname();
+      }
 
       if (strClassname.equals("")) {
         final StringBuilder whereClause2 = new StringBuilder();
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java	Thu Jul 31 17:03:13 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java	Thu Jul 31 08:46:34 2014 +0200
@@ -430,8 +430,10 @@
           AcctSchemaTableDocType.class, whereClause.toString());
       final List<AcctSchemaTableDocType> acctSchemaTableDocTypes = obqParameters.list();
 
-      if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0)
+      if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0
+          && acctSchemaTableDocTypes.get(0).getCreatefactTemplate() != null) {
         strClassname = acctSchemaTableDocTypes.get(0).getCreatefactTemplate().getClassname();
+      }
 
       if (strClassname.equals("")) {
         final StringBuilder whereClause2 = new StringBuilder();
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java	Thu Jul 31 17:03:13 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java	Thu Jul 31 08:46:34 2014 +0200
@@ -336,8 +336,10 @@
           AcctSchemaTableDocType.class, whereClause.toString());
       final List<AcctSchemaTableDocType> acctSchemaTableDocTypes = obqParameters.list();
 
-      if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0)
+      if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0
+          && acctSchemaTableDocTypes.get(0).getCreatefactTemplate() != null) {
         strClassname = acctSchemaTableDocTypes.get(0).getCreatefactTemplate().getClassname();
+      }
 
       if (strClassname.equals("")) {
         final StringBuilder whereClause2 = new StringBuilder();
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java	Thu Jul 31 17:03:13 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java	Thu Jul 31 08:46:34 2014 +0200
@@ -556,8 +556,10 @@
           AcctSchemaTableDocType.class, whereClause.toString());
       final List<AcctSchemaTableDocType> acctSchemaTableDocTypes = obqParameters.list();
 
-      if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0)
+      if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0
+          && acctSchemaTableDocTypes.get(0).getCreatefactTemplate() != null) {
         strClassname = acctSchemaTableDocTypes.get(0).getCreatefactTemplate().getClassname();
+      }
 
       if (strClassname.equals("")) {
         final StringBuilder whereClause2 = new StringBuilder();