details:   https://code.openbravo.com/erp/devel/pi/rev/0a2625ff68a7
changeset: 27529:0a2625ff68a7
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Thu Sep 03 15:00:55 2015 +0530
summary:   Fixes Issue 30736:Delivery method is not populated from Business 
Partner in
Goods Shipment

Callout on Business Partner in Goods Shipment is modified to set Delivery
Method, Delivery Terms from business partner if exist other than default
values

diffstat:

 src/org/openbravo/erpCommon/ad_callouts/SL_InOut_BPartner.java |  23 +++++++--
 1 files changed, 18 insertions(+), 5 deletions(-)

diffs (63 lines):

diff -r d824566905ac -r 0a2625ff68a7 
src/org/openbravo/erpCommon/ad_callouts/SL_InOut_BPartner.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_BPartner.java    Tue Sep 
01 11:09:05 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_BPartner.java    Thu Sep 
03 15:00:55 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-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2015 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -27,6 +27,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.lang.StringUtils;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
@@ -63,10 +64,12 @@
       String strProjectId = vars.getStringParameter("inpcProjectId");
       String strIsSOTrx = Utility.getContext(this, vars, "isSOTrx", 
strWindowId);
       String strTabId = vars.getStringParameter("inpTabId");
+      String strDeliveryTerms = vars.getStringParameter("inpdeliveryrule");
+      String strDeliveryMethod = vars.getStringParameter("inpdeliveryviarule");
 
       try {
-        printPage(response, vars, strBPartner, strLocation, strContact, 
strWindowId, strProjectId,
-            strIsSOTrx, strTabId);
+        printPage(response, vars, strBPartner, strLocation, strDeliveryTerms, 
strDeliveryMethod,
+            strContact, strWindowId, strProjectId, strIsSOTrx, strTabId);
       } catch (ServletException ex) {
         pageErrorCallOut(response);
       }
@@ -75,8 +78,9 @@
   }
 
   private void printPage(HttpServletResponse response, VariablesSecureApp 
vars, String strBPartner,
-      String strLocation, String strContact, String strWindowId, String 
strProjectId,
-      String strIsSOTrx, String strTabId) throws IOException, ServletException 
{
+      String strLocation, String strDeliveryTerms, String strDeliveryMethod, 
String strContact,
+      String strWindowId, String strProjectId, String strIsSOTrx, String 
strTabId)
+      throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
     XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
@@ -219,6 +223,15 @@
     }
     resultado.append("\n)");
     BusinessPartner bpartner = OBDal.getInstance().get(BusinessPartner.class, 
strBPartner);
+    if (StringUtils.isNotEmpty(bpartner.getDeliveryTerms())
+        && !StringUtils.equals(strDeliveryTerms, bpartner.getDeliveryTerms())) 
{
+      resultado.append(", new Array(\"inpdeliveryrule\", \"" + 
bpartner.getDeliveryTerms() + "\")");
+    }
+    if (StringUtils.isNotEmpty(bpartner.getDeliveryMethod())
+        && !StringUtils.equals(strDeliveryMethod, 
bpartner.getDeliveryMethod())) {
+      resultado.append(", new Array(\"inpdeliveryviarule\", \"" + 
bpartner.getDeliveryMethod()
+          + "\")");
+    }
     final String rtvendorship = "273673D2ED914C399A6C51DB758BE0F9";
     final String rMatReceipt = "123271B9AD60469BAE8A924841456B63";
     String strwindow = vars.getStringParameter("inpwindowId");

------------------------------------------------------------------------------
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to