Fixed bug 22934 Check if the business partner is empty
authorSandra Huguet <sandra.huguet@openbravo.com>
Wed, 30 Jan 2013 15:47:57 +0100
changeset 19524 841c9df2a9d8
parent 19523 b34d87f25d55
child 19525 388afb7bcd0d
Fixed bug 22934 Check if the business partner is empty
src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java
src/org/openbravo/erpCommon/ad_callouts/SE_Payment_BPartner.java
src/org/openbravo/erpCommon/ad_callouts/SL_InOut_BPartner.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java	Wed Jan 30 14:27:43 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java	Wed Jan 30 15:47:57 2013 +0100
@@ -319,13 +319,16 @@
     final String rtvendor = "C50A8AEE6F044825B5EF54FAAE76826F";
     final String rfcustomer = "FF808081330213E60133021822E40007";
     String strwindow = info.getStringParameter("inpwindowId", null);
+
     if (!(strwindow.equals(rtvendor) || strwindow.equals(rfcustomer))) {
-      if (FIN_Utility.isBlockedBusinessPartner(strBPartner, "Y".equals(strIsSOTrx), 1)) {
+      if ((!strBPartner.equals(""))
+          && (FIN_Utility.isBlockedBusinessPartner(strBPartner, "Y".equals(strIsSOTrx), 1))) {
         // If the Business Partner is blocked for this document, show an information message.
         BusinessPartner bPartner = OBDal.getInstance().get(BusinessPartner.class, strBPartner);
         message.append(OBMessageUtils.messageBD("ThebusinessPartner") + " "
             + bPartner.getIdentifier() + " " + OBMessageUtils.messageBD("BusinessPartnerBlocked"));
       }
+
     } else {
 
       if (data != null && data.length > 0
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_Payment_BPartner.java	Wed Jan 30 14:27:43 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_Payment_BPartner.java	Wed Jan 30 15:47:57 2013 +0100
@@ -45,7 +45,8 @@
     } catch (Exception e) {
       log4j.info("No default info for the selected business partner");
     }
-    if (FIN_Utility.isBlockedBusinessPartner(strcBpartnerId, "Y".equals(strisreceipt), 4)) {
+    if ((!strcBpartnerId.equals(""))
+        && (FIN_Utility.isBlockedBusinessPartner(strcBpartnerId, "Y".equals(strisreceipt), 4))) {
       // If the Business Partner is blocked for this document, show an information message.
       info.addResult("MESSAGE",
           OBMessageUtils.messageBD("ThebusinessPartner") + " " + bpartner.getIdentifier() + " "
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_BPartner.java	Wed Jan 30 14:27:43 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_BPartner.java	Wed Jan 30 15:47:57 2013 +0100
@@ -222,8 +222,9 @@
     final String rtvendorship = "273673D2ED914C399A6C51DB758BE0F9";
     final String rMatReceipt = "123271B9AD60469BAE8A924841456B63";
     String strwindow = vars.getStringParameter("inpwindowId");
-    if (!(strwindow.equals(rtvendorship) || strwindow.equals(rMatReceipt))) {
-      if (FIN_Utility.isBlockedBusinessPartner(strBPartner, "Y".equals(strIsSOTrx), 2)) {
+    if ((!(strwindow.equals(rtvendorship) || strwindow.equals(rMatReceipt)))) {
+      if ((!bpartner.equals(""))
+          && FIN_Utility.isBlockedBusinessPartner(strBPartner, "Y".equals(strIsSOTrx), 2)) {
         // If the Business Partner is blocked for this document, show an information message.
         resultado.append(", new Array('MESSAGE', \""
             + OBMessageUtils.messageBD("ThebusinessPartner") + " " + bpartner.getIdentifier() + " "