details:   https://code.openbravo.com/erp/devel/pi/rev/60e70b428ec7
changeset: 25733:60e70b428ec7
user:      Reinaldo Guerra <reinaldo.guerra <at> peoplewalking.com>
date:      Tue Jan 20 18:10:14 2015 +0100
summary:   Fixed bug 28675: AccessibleOrgTree wrongly used in some reports.

Organization combo in some manual reports now includes organizations accessed 
by logged role.
In some cases Utility getContext method when creating organizations combo, was 
changed to use User_Org instead of AccessibleOrgTree. Also for Balance sheet 
and P&L structure report (GeneralAccountingReports java class), organizations 
list was taken from OBContext's role due to the organization's combo, in this 
case, is filled in a different way. For Customer Statement process, a new 
validation was created to obtain organizations accessed by logged role.

diffstat:

 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
 |   6 +-
 src-db/database/sourcedata/AD_PROCESS_PARA.xml                                 
                                                 |   2 +-
 src-db/database/sourcedata/AD_VAL_RULE.xml                                     
                                                 |  19 ++++++++++
 src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java           
                                                 |   6 ++-
 src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java                
                                                 |   4 +-
 src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java         
                                                 |   4 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR.java
                                            |   4 +-
 
src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesJR.java 
                                                |   7 +--
 src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJR.java    
                                                 |   2 +-
 src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java                 
                                                 |   2 +-
 10 files changed, 38 insertions(+), 18 deletions(-)

diffs (198 lines):

diff -r dedb00350e7e -r 60e70b428ec7 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
--- 
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
   Tue Jan 20 17:33:57 2015 +0100
+++ 
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
   Tue Jan 20 18:10:14 2015 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2009-2014 Openbravo SL 
+ * All portions are Copyright (C) 2009-2015 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -477,8 +477,8 @@
     xmlDocument.setParameter("org", strOrg);
     try {
       ComboTableData comboTableData = new ComboTableData(vars, this, 
"TABLEDIR", "AD_Org_ID", "",
-          "", Utility.getContext(this, vars, "#AccessibleOrgTree", 
"PaymentReport"),
-          Utility.getContext(this, vars, "#User_Client", "PaymentReport"), 0);
+          "", Utility.getContext(this, vars, "#User_Org", "PaymentReport"), 
Utility.getContext(
+              this, vars, "#User_Client", "PaymentReport"), 0);
       Utility.fillSQLParameters(this, vars, null, comboTableData, 
"PaymentReport", strOrg);
       xmlDocument.setData("reportAD_Org_ID", "liststructure", 
comboTableData.select(false));
       comboTableData = null;
diff -r dedb00350e7e -r 60e70b428ec7 
src-db/database/sourcedata/AD_PROCESS_PARA.xml
--- a/src-db/database/sourcedata/AD_PROCESS_PARA.xml    Tue Jan 20 17:33:57 
2015 +0100
+++ b/src-db/database/sourcedata/AD_PROCESS_PARA.xml    Tue Jan 20 18:10:14 
2015 +0100
@@ -4389,7 +4389,7 @@
 <!--7DB2B69C38D34885B71030245668674E-->  
<AD_PROCESS_ID><![CDATA[D234AE084F7040DCB66E281A4237FF99]]></AD_PROCESS_ID>
 <!--7DB2B69C38D34885B71030245668674E-->  <SEQNO><![CDATA[20]]></SEQNO>
 <!--7DB2B69C38D34885B71030245668674E-->  
<AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
-<!--7DB2B69C38D34885B71030245668674E-->  
<AD_VAL_RULE_ID><![CDATA[0C754881EAD94243A161111916E9B9C6]]></AD_VAL_RULE_ID>
+<!--7DB2B69C38D34885B71030245668674E-->  
<AD_VAL_RULE_ID><![CDATA[D9463AFD77E44F619D396C19BF9E6A15]]></AD_VAL_RULE_ID>
 <!--7DB2B69C38D34885B71030245668674E-->  
<COLUMNNAME><![CDATA[AD_Org_ID]]></COLUMNNAME>
 <!--7DB2B69C38D34885B71030245668674E-->  
<ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--7DB2B69C38D34885B71030245668674E-->  
<FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
diff -r dedb00350e7e -r 60e70b428ec7 src-db/database/sourcedata/AD_VAL_RULE.xml
--- a/src-db/database/sourcedata/AD_VAL_RULE.xml        Tue Jan 20 17:33:57 
2015 +0100
+++ b/src-db/database/sourcedata/AD_VAL_RULE.xml        Tue Jan 20 18:10:14 
2015 +0100
@@ -2224,6 +2224,25 @@
 <!--D69C01B4BDF84E6CBB368B012C99A2B8-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--D69C01B4BDF84E6CBB368B012C99A2B8--></AD_VAL_RULE>
 
+<!--D9463AFD77E44F619D396C19BF9E6A15--><AD_VAL_RULE>
+<!--D9463AFD77E44F619D396C19BF9E6A15-->  
<AD_VAL_RULE_ID><![CDATA[D9463AFD77E44F619D396C19BF9E6A15]]></AD_VAL_RULE_ID>
+<!--D9463AFD77E44F619D396C19BF9E6A15-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D9463AFD77E44F619D396C19BF9E6A15-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D9463AFD77E44F619D396C19BF9E6A15-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D9463AFD77E44F619D396C19BF9E6A15-->  <NAME><![CDATA[AD_Org of logged 
Role]]></NAME>
+<!--D9463AFD77E44F619D396C19BF9E6A15-->  <DESCRIPTION><![CDATA[Filter 
Organization by logged Role]]></DESCRIPTION>
+<!--D9463AFD77E44F619D396C19BF9E6A15-->  <TYPE><![CDATA[S]]></TYPE>
+<!--D9463AFD77E44F619D396C19BF9E6A15-->  <CODE><![CDATA[EXISTS (SELECT 1 FROM 
AD_ROLE_ORGACCESS A_R_O, ad_role r
+        WHERE A_R_O.AD_ORG_ID = AD_ORG.AD_Org_ID
+        AND A_R_O.ISACTIVE = 'Y'
+        AND A_R_O.AD_ROLE_ID = R.AD_ROLE_ID
+        and r.ad_role_id = @#AD_Role_ID@
+        AND R.ISACTIVE = 'Y'
+        AND (LPAD(TO_CHAR(R.USERLEVEL), 1, '1')='S' OR AD_ORG.AD_ORG_ID <> '0')
+        AND A_R_O.AD_ROLE_ID = @#AD_Role_ID@)]]></CODE>
+<!--D9463AFD77E44F619D396C19BF9E6A15-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D9463AFD77E44F619D396C19BF9E6A15--></AD_VAL_RULE>
+
 <!--DB85A30739C3487988921CE3FFFD3BAD--><AD_VAL_RULE>
 <!--DB85A30739C3487988921CE3FFFD3BAD-->  
<AD_VAL_RULE_ID><![CDATA[DB85A30739C3487988921CE3FFFD3BAD]]></AD_VAL_RULE_ID>
 <!--DB85A30739C3487988921CE3FFFD3BAD-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r dedb00350e7e -r 60e70b428ec7 
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java      
Tue Jan 20 17:33:57 2015 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java      
Tue Jan 20 18:10:14 2015 +0100
@@ -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):  ______________________________________.
  ************************************************************************
@@ -549,7 +549,9 @@
     }
 
     String strOrgList = "";
-    String[] orgList = OBContext.getOBContext().getReadableOrganizations();
+    OBContext.setAdminMode();
+    String[] orgList = 
OBContext.getOBContext().getRole().getOrganizationList().split(",");
+    OBContext.restorePreviousMode();
     int i = 0;
     for (String org : orgList) {
       if (i == 0) {
diff -r dedb00350e7e -r 60e70b428ec7 
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java   Tue Jan 
20 17:33:57 2015 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java   Tue Jan 
20 18:10:14 2015 +0100
@@ -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):  ______________________________________.
  ************************************************************************
@@ -462,7 +462,7 @@
 
     try {
       ComboTableData comboTableData = new ComboTableData(vars, this, 
"TABLEDIR", "AD_ORG_ID", "",
-          "", Utility.getContext(this, vars, "#AccessibleOrgTree", 
"ReportGeneralLedger"),
+          "", Utility.getContext(this, vars, "#User_Org", 
"ReportGeneralLedger"),
           Utility.getContext(this, vars, "#User_Client", 
"ReportGeneralLedger"), '*');
       comboTableData.fillParameters(null, "ReportGeneralLedger", "");
       xmlDocument.setData("reportAD_ORGID", "liststructure", 
comboTableData.select(false));
diff -r dedb00350e7e -r 60e70b428ec7 
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java    
Tue Jan 20 17:33:57 2015 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java    
Tue Jan 20 18:10:14 2015 +0100
@@ -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):  ______________________________________.
  ************************************************************************
@@ -583,7 +583,7 @@
 
     try {
       ComboTableData comboTableData = new ComboTableData(vars, this, 
"TABLEDIR", "AD_ORG_ID", "",
-          "", Utility.getContext(this, vars, "#AccessibleOrgTree", 
"ReportGeneralLedgerJournal"),
+          "", Utility.getContext(this, vars, "#User_Org", 
"ReportGeneralLedgerJournal"),
           Utility.getContext(this, vars, "#User_Client", 
"ReportGeneralLedgerJournal"), '*');
       comboTableData.fillParameters(null, "ReportGeneralLedgerJournal", "");
       xmlDocument.setData("reportAD_ORGID", "liststructure", 
comboTableData.select(false));
diff -r dedb00350e7e -r 60e70b428ec7 
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR.java
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR.java
      Tue Jan 20 17:33:57 2015 +0100
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR.java
      Tue Jan 20 18:10:14 2015 +0100
@@ -8,7 +8,7 @@
  * 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) 2001-2014 Openbravo SLU All Rights Reserved.
+ * portions are Copyright (C) 2001-2015 Openbravo SLU All Rights Reserved.
  * Contributor(s): ______________________________________.
  */
 
@@ -306,7 +306,7 @@
     }
     try {
       ComboTableData comboTableData = new ComboTableData(vars, this, 
"TABLEDIR", "AD_Org_ID", "",
-          "", Utility.getContext(this, vars, "#AccessibleOrgTree",
+          "", Utility.getContext(this, vars, "#User_Org",
               "ReportInvoiceVendorDimensionalAnalysesJR"), 
Utility.getContext(this, vars,
               "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJR"), 0);
       Utility.fillSQLParameters(this, vars, null, comboTableData,
diff -r dedb00350e7e -r 60e70b428ec7 
src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesJR.java
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesJR.java
   Tue Jan 20 17:33:57 2015 +0100
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesJR.java
   Tue Jan 20 18:10:14 2015 +0100
@@ -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-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2015 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -283,9 +283,8 @@
     }
     try {
       ComboTableData comboTableData = new ComboTableData(vars, this, 
"TABLEDIR", "AD_Org_ID", "",
-          "", Utility.getContext(this, vars, "#AccessibleOrgTree",
-              "ReportPurchaseDimensionalAnalysesJR"), Utility.getContext(this, 
vars,
-              "#User_Client", "ReportPurchaseDimensionalAnalysesJR"), 0);
+          "", Utility.getContext(this, vars, "#User_Org", 
"ReportPurchaseDimensionalAnalysesJR"),
+          Utility.getContext(this, vars, "#User_Client", 
"ReportPurchaseDimensionalAnalysesJR"), 0);
       Utility.fillSQLParameters(this, vars, null, comboTableData,
           "ReportPurchaseDimensionalAnalysesJR", strOrg);
       xmlDocument.setData("reportAD_ORGID", "liststructure", 
comboTableData.select(false));
diff -r dedb00350e7e -r 60e70b428ec7 
src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJR.java
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJR.java   
    Tue Jan 20 17:33:57 2015 +0100
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJR.java   
    Tue Jan 20 18:10:14 2015 +0100
@@ -317,7 +317,7 @@
     }
     try {
       ComboTableData comboTableData = new ComboTableData(vars, this, 
"TABLEDIR", "AD_Org_ID", "",
-          "", Utility.getContext(this, vars, "#AccessibleOrgTree",
+          "", Utility.getContext(this, vars, "#User_Org",
               "ReportSalesDimensionalAnalyzeJR"), Utility.getContext(this, 
vars, "#User_Client",
               "ReportSalesDimensionalAnalyzeJR"), 0);
       Utility.fillSQLParameters(this, vars, null, comboTableData,
diff -r dedb00350e7e -r 60e70b428ec7 
src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java    Tue Jan 
20 17:33:57 2015 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java    Tue Jan 
20 18:10:14 2015 +0100
@@ -396,7 +396,7 @@
 
     try {
       ComboTableData comboTableData = new ComboTableData(vars, this, 
"TABLEDIR", "AD_ORG_ID", "",
-          "", Utility.getContext(this, vars, "#AccessibleOrgTree", 
"ReportTrialBalance"),
+          "", Utility.getContext(this, vars, "#User_Org", 
"ReportTrialBalance"),
           Utility.getContext(this, vars, "#User_Client", 
"ReportTrialBalance"), '*');
       comboTableData.fillParameters(null, "ReportTrialBalance", "");
       xmlDocument.setData("reportAD_ORGID", "liststructure", 
comboTableData.select(false));

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to