details:   https://code.openbravo.com/erp/devel/pi/rev/454e7bb1b5cf
changeset: 18131:454e7bb1b5cf
user:      Ioritz Cia <ioritz.cia <at> openbravo.com>
date:      Mon Oct 01 16:54:45 2012 +0200
summary:   Fixes issue 21756: Invoice link not working properly in payment 
report.

details:   https://code.openbravo.com/erp/devel/pi/rev/0adac77c4063
changeset: 18132:0adac77c4063
user:      Ioritz Cia <ioritz.cia <at> openbravo.com>
date:      Wed Oct 03 17:50:26 2012 +0200
summary:   Fixes issue 21821: Prices visible in product does not belong to role.

details:   https://code.openbravo.com/erp/devel/pi/rev/8b5d149fdbdb
changeset: 18133:8b5d149fdbdb
user:      Ioritz Cia <ioritz.cia <at> openbravo.com>
date:      Thu Oct 04 16:37:09 2012 +0200
summary:   Fixes issue 21711: Process failed during execution when post a 
transaction.

diffstat:

 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
 |   4 +-
 src-db/database/sourcedata/AD_CALLOUT.xml                                      
                                                 |  10 +
 src-db/database/sourcedata/AD_COLUMN.xml                                       
                                                 |   1 +
 src-db/database/sourcedata/AD_MODEL_OBJECT.xml                                 
                                                 |  12 +
 src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml                         
                                                 |  10 +
 src/org/openbravo/erpCommon/ad_callouts/SL_ProductPrice_PriceListVersion.java  
                                                 |  79 ++++++++++
 src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java              
                                                 |  39 ++++-
 7 files changed, 149 insertions(+), 6 deletions(-)

diffs (228 lines):

diff -r 575ede56584b -r 8b5d149fdbdb 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
--- 
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
   Fri Oct 05 08:27:15 2012 +0200
+++ 
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
   Thu Oct 04 16:37:09 2012 +0200
@@ -277,9 +277,9 @@
         var myframe = getFrame('LayoutMDI') || top.opener;
         if (myframe) {
             if (isReceipt==='Y') {
-               
myframe.OB.Utilities.openDirectTab('EB0466B2A22343F28773B356D292BC7E', 
recordId);
+               
myframe.OB.Utilities.openDirectTab('60825C9E68644DBC9C530DDCABE05A6E', 
recordId);
             } else {
-               
myframe.OB.Utilities.openDirectTab('A94442B27F664A41BF64735DFA76FB4D', 
recordId);
+               
myframe.OB.Utilities.openDirectTab('7A8D43541F8C49F1BD8A431A0041BF89', 
recordId);
             }
         }
      }
diff -r 575ede56584b -r 8b5d149fdbdb src-db/database/sourcedata/AD_CALLOUT.xml
--- a/src-db/database/sourcedata/AD_CALLOUT.xml Fri Oct 05 08:27:15 2012 +0200
+++ b/src-db/database/sourcedata/AD_CALLOUT.xml Thu Oct 04 16:37:09 2012 +0200
@@ -1072,6 +1072,16 @@
 <!--EA987600B6274A139FC6E72169DBC2D2-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--EA987600B6274A139FC6E72169DBC2D2--></AD_CALLOUT>
 
+<!--EC19112DD95B4BEABFF032BBD9F10821--><AD_CALLOUT>
+<!--EC19112DD95B4BEABFF032BBD9F10821-->  
<AD_CALLOUT_ID><![CDATA[EC19112DD95B4BEABFF032BBD9F10821]]></AD_CALLOUT_ID>
+<!--EC19112DD95B4BEABFF032BBD9F10821-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EC19112DD95B4BEABFF032BBD9F10821-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EC19112DD95B4BEABFF032BBD9F10821-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EC19112DD95B4BEABFF032BBD9F10821-->  
<NAME><![CDATA[SL_ProductPrice_PriceListVersion]]></NAME>
+<!--EC19112DD95B4BEABFF032BBD9F10821-->  <DESCRIPTION><![CDATA[Copies the 
organization of the price list version selected.]]></DESCRIPTION>
+<!--EC19112DD95B4BEABFF032BBD9F10821-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--EC19112DD95B4BEABFF032BBD9F10821--></AD_CALLOUT>
+
 <!--F6E343E77DA249559AEF8651D595E880--><AD_CALLOUT>
 <!--F6E343E77DA249559AEF8651D595E880-->  
<AD_CALLOUT_ID><![CDATA[F6E343E77DA249559AEF8651D595E880]]></AD_CALLOUT_ID>
 <!--F6E343E77DA249559AEF8651D595E880-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 575ede56584b -r 8b5d149fdbdb src-db/database/sourcedata/AD_COLUMN.xml
--- a/src-db/database/sourcedata/AD_COLUMN.xml  Fri Oct 05 08:27:15 2012 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml  Thu Oct 04 16:37:09 2012 +0200
@@ -40688,6 +40688,7 @@
 <!--2760-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
 <!--2760-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--2760-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--2760-->  
<AD_CALLOUT_ID><![CDATA[EC19112DD95B4BEABFF032BBD9F10821]]></AD_CALLOUT_ID>
 <!--2760-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--2760-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--2760-->  <POSITION><![CDATA[2]]></POSITION>
diff -r 575ede56584b -r 8b5d149fdbdb 
src-db/database/sourcedata/AD_MODEL_OBJECT.xml
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml    Fri Oct 05 08:27:15 
2012 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml    Thu Oct 04 16:37:09 
2012 +0200
@@ -3699,6 +3699,18 @@
 <!--6E4B444F00A742AD86F4C8E013884933-->  
<OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--6E4B444F00A742AD86F4C8E013884933--></AD_MODEL_OBJECT>
 
+<!--70AAEDDC523E44C6B903E7DAFD3C3228--><AD_MODEL_OBJECT>
+<!--70AAEDDC523E44C6B903E7DAFD3C3228-->  
<AD_MODEL_OBJECT_ID><![CDATA[70AAEDDC523E44C6B903E7DAFD3C3228]]></AD_MODEL_OBJECT_ID>
+<!--70AAEDDC523E44C6B903E7DAFD3C3228-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--70AAEDDC523E44C6B903E7DAFD3C3228-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--70AAEDDC523E44C6B903E7DAFD3C3228-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--70AAEDDC523E44C6B903E7DAFD3C3228-->  <ACTION><![CDATA[C]]></ACTION>
+<!--70AAEDDC523E44C6B903E7DAFD3C3228-->  
<CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.SL_ProductPrice_PriceListVersion]]></CLASSNAME>
+<!--70AAEDDC523E44C6B903E7DAFD3C3228-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--70AAEDDC523E44C6B903E7DAFD3C3228-->  
<AD_CALLOUT_ID><![CDATA[EC19112DD95B4BEABFF032BBD9F10821]]></AD_CALLOUT_ID>
+<!--70AAEDDC523E44C6B903E7DAFD3C3228-->  
<OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--70AAEDDC523E44C6B903E7DAFD3C3228--></AD_MODEL_OBJECT>
+
 <!--76EA6723BB5544D585D9BDC128968F58--><AD_MODEL_OBJECT>
 <!--76EA6723BB5544D585D9BDC128968F58-->  
<AD_MODEL_OBJECT_ID><![CDATA[76EA6723BB5544D585D9BDC128968F58]]></AD_MODEL_OBJECT_ID>
 <!--76EA6723BB5544D585D9BDC128968F58-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 575ede56584b -r 8b5d149fdbdb 
src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml    Fri Oct 05 
08:27:15 2012 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml    Thu Oct 04 
16:37:09 2012 +0200
@@ -4370,6 +4370,16 @@
 <!--BC653C796C7A4F29A400689AC719A977-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
 <!--BC653C796C7A4F29A400689AC719A977--></AD_MODEL_OBJECT_MAPPING>
 
+<!--C14D82211F9F4337B6928257BDD7FD66--><AD_MODEL_OBJECT_MAPPING>
+<!--C14D82211F9F4337B6928257BDD7FD66-->  
<AD_MODEL_OBJECT_MAPPING_ID><![CDATA[C14D82211F9F4337B6928257BDD7FD66]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--C14D82211F9F4337B6928257BDD7FD66-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C14D82211F9F4337B6928257BDD7FD66-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C14D82211F9F4337B6928257BDD7FD66-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C14D82211F9F4337B6928257BDD7FD66-->  
<AD_MODEL_OBJECT_ID><![CDATA[70AAEDDC523E44C6B903E7DAFD3C3228]]></AD_MODEL_OBJECT_ID>
+<!--C14D82211F9F4337B6928257BDD7FD66-->  
<MAPPINGNAME><![CDATA[/ad_callouts/SL_ProductPrice_PriceListVersion.html]]></MAPPINGNAME>
+<!--C14D82211F9F4337B6928257BDD7FD66-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--C14D82211F9F4337B6928257BDD7FD66--></AD_MODEL_OBJECT_MAPPING>
+
 <!--C33AB5EA264C42F1AD34B83C8278E9B3--><AD_MODEL_OBJECT_MAPPING>
 <!--C33AB5EA264C42F1AD34B83C8278E9B3-->  
<AD_MODEL_OBJECT_MAPPING_ID><![CDATA[C33AB5EA264C42F1AD34B83C8278E9B3]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--C33AB5EA264C42F1AD34B83C8278E9B3-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 575ede56584b -r 8b5d149fdbdb 
src/org/openbravo/erpCommon/ad_callouts/SL_ProductPrice_PriceListVersion.java
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ 
b/src/org/openbravo/erpCommon/ad_callouts/SL_ProductPrice_PriceListVersion.java 
    Thu Oct 04 16:37:09 2012 +0200
@@ -0,0 +1,79 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html 
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License. 
+ * The Original Code is Openbravo ERP. 
+ * The Initial Developer of the Original Code is Openbravo SLU 
+ * All portions are Copyright (C) 2012 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.erpCommon.ad_callouts;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.openbravo.base.secureApp.HttpSecureAppServlet;
+import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.model.ad.access.Role;
+import org.openbravo.model.pricing.pricelist.PriceListVersion;
+import org.openbravo.xmlEngine.XmlDocument;
+
+public class SL_ProductPrice_PriceListVersion extends HttpSecureAppServlet {
+  private static final long serialVersionUID = 1L;
+
+  public void init(ServletConfig config) {
+    super.init(config);
+    boolHist = false;
+  }
+
+  public void doPost(HttpServletRequest request, HttpServletResponse response) 
throws IOException,
+      ServletException {
+    VariablesSecureApp vars = new VariablesSecureApp(request);
+    if (vars.commandIn("DEFAULT")) {
+      String strPriceListV = vars.getStringParameter("inpmPricelistVersionId");
+      String strOrg = vars.getStringParameter("inpadOrgId");
+      printPage(response, vars, strPriceListV, strOrg);
+    }
+  }
+
+  private void printPage(HttpServletResponse response, VariablesSecureApp vars,
+      String strPriceListV, String strOrg) throws IOException, 
ServletException {
+    if (log4j.isDebugEnabled())
+      log4j.debug("Output: dataSheet");
+    XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
+        "org/openbravo/erpCommon/ad_callouts/CallOut").createXmlDocument();
+
+    StringBuilder resultado = new StringBuilder();
+    boolean hasAccessTo = false;
+
+    PriceListVersion plv = OBDal.getInstance().get(PriceListVersion.class, 
strPriceListV);
+    Role role = OBDal.getInstance().get(Role.class, vars.getRole());
+    hasAccessTo = 
role.getOrganizationList().indexOf(plv.getOrganization().getId()) > 0;
+
+    resultado.append("var 
calloutName='SL_ProductPrice_PriceListVersion';\n\n");
+    resultado.append("var respuesta = new Array(");
+    resultado.append("new Array(\"inpadOrgId\", \""
+        + ((hasAccessTo) ? plv.getOrganization().getId() : strOrg) + "\"));");
+    xmlDocument.setParameter("array", resultado.toString());
+    xmlDocument.setParameter("frameName", "appFrame");
+    response.setContentType("text/html; charset=UTF-8");
+    PrintWriter out = response.getWriter();
+    out.println(xmlDocument.print());
+    out.close();
+  }
+}
diff -r 575ede56584b -r 8b5d149fdbdb 
src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java Fri Oct 
05 08:27:15 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java Thu Oct 
04 16:37:09 2012 +0200
@@ -23,7 +23,9 @@
 import java.sql.Connection;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.servlet.ServletException;
 
@@ -967,10 +969,39 @@
           account = getAccount(conn, lines.get(0).getUponWithdrawalUse(), 
accountList.get(0),
               bIsReceipt);
       } else {
-        if (bIsReceipt)
-          account = new Account(conn, 
accountList.get(0).getDepositAccount().getId());
-        else
-          account = new Account(conn, 
accountList.get(0).getWithdrawalAccount().getId());
+        if (bIsReceipt) {
+          if (accountList.get(0).getDepositAccount() != null) {
+            account = new Account(conn, 
accountList.get(0).getDepositAccount().getId());
+          } else {
+            Map<String, String> parameters = new HashMap<String, String>();
+            parameters.put("Account", "@DepositAccount@");
+            parameters.put("Entity", finAccount.getName());
+            parameters.put(
+                "AccountingSchema",
+                OBDal
+                    .getInstance()
+                    
.get(org.openbravo.model.financialmgmt.accounting.coa.AcctSchema.class,
+                        as.getC_AcctSchema_ID()).getIdentifier());
+            setMessageResult(conn, STATUS_InvalidAccount, "error", parameters);
+            throw new IllegalStateException();
+          }
+        } else {
+          if (accountList.get(0).getWithdrawalAccount() != null) {
+            account = new Account(conn, 
accountList.get(0).getWithdrawalAccount().getId());
+          } else {
+            Map<String, String> parameters = new HashMap<String, String>();
+            parameters.put("Account", "@WithdrawalAccount@");
+            parameters.put("Entity", finAccount.getName());
+            parameters.put(
+                "AccountingSchema",
+                OBDal
+                    .getInstance()
+                    
.get(org.openbravo.model.financialmgmt.accounting.coa.AcctSchema.class,
+                        as.getC_AcctSchema_ID()).getIdentifier());
+            setMessageResult(conn, STATUS_InvalidAccount, "error", parameters);
+            throw new IllegalStateException();
+          }
+        }
       }
     } finally {
       OBContext.restorePreviousMode();

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to