Fixed bug [ 1904136 ] QA-MAS General accounting report - Subordinate combos
authorCarlos Romero <carlos.romero@openbravo.com>
Thu, 06 Mar 2008 17:14:00 +0000
changeset 507 63e98e98d6d1
parent 506 0d5dbfc88635
child 508 a0a710b00ea3
Fixed bug [ 1904136 ] QA-MAS General accounting report - Subordinate combos
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.html
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.xml
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports_data.xsql
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.html	Thu Mar 06 15:15:49 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.html	Thu Mar 06 17:14:00 2008 +0000
@@ -13,7 +13,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) 2001-2006 Openbravo SL
+ * All portions are Copyright (C) 2001-2008 Openbravo SL
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -82,6 +82,13 @@
 	return true;
 }
 
+function refreshAccountingReports() {
+  var cmbAccountSchema = document.frmMain.inpcAcctSchemaId;  
+  var cmbAccountingReports = document.frmMain.inpcElementvalueId;  
+  cambiarListaCombo(cmbAccountingReports, arrAccountingReports, cmbAccountSchema.options[cmbAccountSchema.selectedIndex].value, false);
+  return true;
+}
+
 function onloadFunctions() {
   new TypeAheadCombo("inpOrganizacion");
   new TypeAheadCombo("inpcAcctSchemaId");  
@@ -89,6 +96,12 @@
   new TypeAheadCombo("inpLevel");
 }
 </SCRIPT>
+
+<script language="JavaScript" type="text/javascript" id="paramArrayAccountingReports">
+var arrAccountingReports=null;
+</script>
+
+
 </HEAD>
     <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="resizeArea();updateMenuIcon('buttonMenu');setFocusFirstControl();" onresize="resizeArea();">
       <FORM method="POST" action="GeneralAccountingReports.pdf" name="frmMain" target="_blank" id="form">
@@ -370,7 +383,7 @@
                   </SELECT></TD>
                   <TD class="ContentCell"></TD>
 				  <TD class="TitleCell"> <SPAN class="LabelText">Accounting schema</SPAN></TD>
-                  <TD class="Combo_ContentCell"> <SELECT name="inpcAcctSchemaId" id="inpcAcctSchemaId" class="ComboKey Combo_OneCell_width" onchange="submitCommandForm('DEFAULT',false,null,null,'_self');logChanges(this);return true;">
+                  <TD class="Combo_ContentCell"> <SELECT name="inpcAcctSchemaId" id="inpcAcctSchemaId" class="ComboKey Combo_OneCell_width" onchange="refreshAccountingReports(); logChanges(this); return true;">
                     <OPTION value=""></OPTION><DIV id="reportC_ACCTSCHEMA_ID"></DIV>
                   </SELECT></TD>
                 </TR>
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java	Thu Mar 06 15:15:49 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java	Thu Mar 06 17:14:00 2008 +0000
@@ -11,13 +11,14 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
 package org.openbravo.erpCommon.ad_reports;
 
+import org.openbravo.erpCommon.security.WarehouseData;
 import org.openbravo.erpCommon.utility.*;
 import org.openbravo.erpCommon.ad_forms.AcctServerData;
 import org.openbravo.erpCommon.businessUtility.*;
@@ -274,6 +275,8 @@
 
     xmlDocument.setData("reportAD_ORGID", "liststructure", GeneralAccountingReportsData.selectCombo(this, vars.getRole()));
     xmlDocument.setData("reportC_ElementValue_ID","liststructure", GeneralAccountingReportsData.selectRpt(this, Utility.getContext(this, vars, "#User_Org", "GeneralAccountingReports"), Utility.getContext(this, vars, "#User_Client", "GeneralAccountingReports"), strcAcctSchemaId));
+    
+    xmlDocument.setParameter("accountingReports", arrayDobleEntrada("arrAccountingReports", GeneralAccountingReportsData.selectRptDouble(this)));
     /*try {
       ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Acct_Rpt_ID", "", "", Utility.getContext(this, vars, "#User_Org", "GeneralAccountingReports"), Utility.getContext(this, vars, "#User_Client", "GeneralAccountingReports"), 0);
       Utility.fillSQLParameters(this, vars, null, comboTableData, "GeneralAccountingReports", "");
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.xml	Thu Mar 06 15:15:49 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.xml	Thu Mar 06 17:14:00 2008 +0000
@@ -12,7 +12,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) 2001-2006 Openbravo SL 
+* All portions are Copyright (C) 2001-2008 Openbravo SL 
 * All Rights Reserved. 
 * Contributor(s):  ______________________________________.
 ************************************************************************
@@ -54,7 +54,8 @@
   <PARAMETER id="messageBoxIDTitle" name="messageTitle" default=""/>
   <PARAMETER id="messageBoxIDMessage" name="messageMessage" default=""/>
   <PARAMETER id="paramC_ACCTSCHEMA_ID" name="cAcctschemaId"/>  
-
+  <PARAMETER id="paramArrayAccountingReports" name="accountingReports"/>
+	
   <SUBREPORT id="reportC_ElementValue_ID" name="reportC_ElementValue_ID" report="org/openbravo/erpCommon/reference/List">
     <ARGUMENT name="parameterListSelected" withId="fieldC_ElementValue_ID"/>
   </SUBREPORT>
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports_data.xsql	Thu Mar 06 15:15:49 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports_data.xsql	Thu Mar 06 17:14:00 2008 +0000
@@ -26,7 +26,7 @@
   <SqlMethod name="selectCombo" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql><![CDATA[
-        SELECT A_O.AD_ORG_ID AS ID, A_O.NAME, '' as pagebreak 
+        SELECT A_O.AD_ORG_ID AS ID, A_O.NAME, '' as pagebreak, '' AS PADRE 
         FROM AD_ORG A_O, AD_ROLE_ORGACCESS A_R_O, AD_ROLE R
         WHERE A_R_O.AD_ORG_ID = A_O.AD_ORG_ID 
         AND A_R_O.ISACTIVE = 'Y' 
@@ -52,7 +52,15 @@
 		<Parameter name="client" optional="true" type="replace" after="AND AD_CLIENT_ID IN (" text="'1'"/>      
 		<Parameter name="acctschema" optional="true" after="AND 1=1"><![CDATA[ AND C_ACCT_RPT.C_ACCTSCHEMA_ID = TO_NUMBER(?)]]></Parameter>
    </SqlMethod>
-   
+   <SqlMethod name="selectRptDouble" type="preparedStatement" return="multiple">
+      <SqlMethodComment></SqlMethodComment>
+      <Sql>
+		SELECT C_ACCT_RPT.C_ACCTSCHEMA_ID AS PADRE, C_ACCT_RPT.C_ACCT_RPT_ID AS ID, C_ACCT_RPT.NAME AS NAME 
+		FROM C_ACCT_RPT
+		ORDER BY NAME
+      </Sql>
+   </SqlMethod>
+      
     <SqlMethod name="selectGroups" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql><![CDATA[