Fixes issue 17775: Trial balance Report links are not workin properly.
authorIoritz Cia <ioritz.cia@openbravo.com>
Thu, 28 Jul 2011 10:25:15 +0200
changeset 13355 d2376cd8e19a
parent 13354 a185170cc1bf
child 13356 ef9cf705fa64
Fixes issue 17775: Trial balance Report links are not workin properly.
src-db/database/sourcedata/AD_MODEL_OBJECT.xml
src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
src-db/database/sourcedata/AD_PROCESS.xml
src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.html
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Mon Aug 01 12:02:07 2011 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Thu Jul 28 10:25:15 2011 +0200
@@ -1164,18 +1164,6 @@
 <!--800741-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--800741--></AD_MODEL_OBJECT>
 
-<!--800742--><AD_MODEL_OBJECT>
-<!--800742-->  <AD_MODEL_OBJECT_ID><![CDATA[800742]]></AD_MODEL_OBJECT_ID>
-<!--800742-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--800742-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--800742-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--800742-->  <ACTION><![CDATA[R]]></ACTION>
-<!--800742-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_reports.ReportTrialBalanceDetail]]></CLASSNAME>
-<!--800742-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
-<!--800742-->  <AD_PROCESS_ID><![CDATA[800039]]></AD_PROCESS_ID>
-<!--800742-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
-<!--800742--></AD_MODEL_OBJECT>
-
 <!--800746--><AD_MODEL_OBJECT>
 <!--800746-->  <AD_MODEL_OBJECT_ID><![CDATA[800746]]></AD_MODEL_OBJECT_ID>
 <!--800746-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -4095,4 +4083,16 @@
 <!--F22C501A5088415DBD7D9DC2134D5DA9-->  <NAME><![CDATA[Openbravo Core Context Parameters]]></NAME>
 <!--F22C501A5088415DBD7D9DC2134D5DA9--></AD_MODEL_OBJECT>
 
+<!--FF808181316BE3F001316C15D3D1000D--><AD_MODEL_OBJECT>
+<!--FF808181316BE3F001316C15D3D1000D-->  <AD_MODEL_OBJECT_ID><![CDATA[FF808181316BE3F001316C15D3D1000D]]></AD_MODEL_OBJECT_ID>
+<!--FF808181316BE3F001316C15D3D1000D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF808181316BE3F001316C15D3D1000D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF808181316BE3F001316C15D3D1000D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF808181316BE3F001316C15D3D1000D-->  <ACTION><![CDATA[R]]></ACTION>
+<!--FF808181316BE3F001316C15D3D1000D-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_reports.ReportTrialBalanceDetail]]></CLASSNAME>
+<!--FF808181316BE3F001316C15D3D1000D-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--FF808181316BE3F001316C15D3D1000D-->  <AD_PROCESS_ID><![CDATA[800091]]></AD_PROCESS_ID>
+<!--FF808181316BE3F001316C15D3D1000D-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--FF808181316BE3F001316C15D3D1000D--></AD_MODEL_OBJECT>
+
 </data>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Mon Aug 01 12:02:07 2011 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Thu Jul 28 10:25:15 2011 +0200
@@ -960,16 +960,6 @@
 <!--800947-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
 <!--800947--></AD_MODEL_OBJECT_MAPPING>
 
-<!--800948--><AD_MODEL_OBJECT_MAPPING>
-<!--800948-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[800948]]></AD_MODEL_OBJECT_MAPPING_ID>
-<!--800948-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--800948-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--800948-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--800948-->  <AD_MODEL_OBJECT_ID><![CDATA[800742]]></AD_MODEL_OBJECT_ID>
-<!--800948-->  <MAPPINGNAME><![CDATA[/ad_reports/ReportTrialBalanceDetail.html]]></MAPPINGNAME>
-<!--800948-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
-<!--800948--></AD_MODEL_OBJECT_MAPPING>
-
 <!--800952--><AD_MODEL_OBJECT_MAPPING>
 <!--800952-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[800952]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--800952-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -4350,4 +4340,14 @@
 <!--FF479B8708CB473F8C3D91DF17B68B0B-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
 <!--FF479B8708CB473F8C3D91DF17B68B0B--></AD_MODEL_OBJECT_MAPPING>
 
+<!--FF808181316C298101316C3F6E7F0013--><AD_MODEL_OBJECT_MAPPING>
+<!--FF808181316C298101316C3F6E7F0013-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[FF808181316C298101316C3F6E7F0013]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--FF808181316C298101316C3F6E7F0013-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF808181316C298101316C3F6E7F0013-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF808181316C298101316C3F6E7F0013-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF808181316C298101316C3F6E7F0013-->  <AD_MODEL_OBJECT_ID><![CDATA[FF808181316BE3F001316C15D3D1000D]]></AD_MODEL_OBJECT_ID>
+<!--FF808181316C298101316C3F6E7F0013-->  <MAPPINGNAME><![CDATA[/ad_reports/ReportTrialBalanceDetail.html]]></MAPPINGNAME>
+<!--FF808181316C298101316C3F6E7F0013-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--FF808181316C298101316C3F6E7F0013--></AD_MODEL_OBJECT_MAPPING>
+
 </data>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Mon Aug 01 12:02:07 2011 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Thu Jul 28 10:25:15 2011 +0200
@@ -2918,13 +2918,13 @@
 <!--800091-->  <NAME><![CDATA[ReportTrialBalanceDetail]]></NAME>
 <!--800091-->  <DESCRIPTION><![CDATA[ReportTrialBalanceDetail]]></DESCRIPTION>
 <!--800091-->  <HELP><![CDATA[ReportTrialBalanceDetail]]></HELP>
-<!--800091-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--800091-->  <ACCESSLEVEL><![CDATA[1]]></ACCESSLEVEL>
 <!--800091-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
 <!--800091-->  <ISREPORT><![CDATA[Y]]></ISREPORT>
 <!--800091-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
-<!--800091-->  <CLASSNAME><![CDATA[ad_reports/ReportTrialBalanceDetail.html]]></CLASSNAME>
 <!--800091-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
 <!--800091-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--800091-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
 <!--800091-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--800091-->  <UIPATTERN><![CDATA[M]]></UIPATTERN>
 <!--800091--></AD_PROCESS>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.html	Mon Aug 01 12:02:07 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.html	Thu Jul 28 10:25:15 2011 +0200
@@ -251,13 +251,69 @@
 	function onResizeDo(){
 		resizeArea();
 	}
-	function submitCommandWithMarkChecked(elementValue){
-	    var frm = document.frmMain;
-	    markCheckedAllElements(frm.inpcBPartnerId_IN);
-	    markCheckedAllElements(frm.inpcProjectId_IN);
-	    markCheckedAllElements(frm.inpmProductId_IN);
-	    submitCommandFormParameter('FIND', frm.inpcElementValueIdFrom, elementValue,false, frm, 'ReportGeneralLedger.html', '_self', false, true);
+
+	function openTabToGeneralLedgerReport(procId, recordId){
+		var frm = document.frmMain;
+		markCheckedAllElements(frm.inpcBPartnerId_IN);
+		markCheckedAllElements(frm.inpcProjectId_IN);
+		markCheckedAllElements(frm.inpmProductId_IN);
+
+		var myframe = getFrame('LayoutMDI') || top.opener;
+	    if (myframe) {      
+	        myframe.OB.RemoteCallManager.call('org.openbravo.client.application.ComputeTranslatedNameActionHandler', {}, {'processId': procId}, 
+	        function(response, data, request){
+	            myframe.OB.Layout.ViewManager.openView('OBClassicWindow', {
+	                command: 'FIND',
+	                icon: '[SKINIMG]../../org.openbravo.client.application/images/application-menu/iconReport.png',
+	                id: procId,
+	                obManualURL: '/ad_reports/ReportGeneralLedger.html?inpDateFrom=' + frm.inpDateFrom.value 
+	                		+ '&inpDateTo=' + frm.inpDateTo.value + '&inpOrg=' + frm.inpOrg.value + '&inpcAcctSchemaId=' 
+	                		+ frm.inpcAcctSchemaId.value + '&inpcElementValueIdFrom=' + recordId + '&inpcElementValueIdTo=' + frm.inpcElementValueIdTo.value,
+	                processId: procId,
+	                tabTitle: data.processTitle,
+	                type: 'report',
+	                viewId: 'OBClassicWindow'
+	            });                        
+	        });
+	    }
 	}
+	function openTabToReportTrialBalanceDetails(procId, recordId){
+        var frm = document.frmMain;
+        var bPartner = frm.inpcBPartnerId_IN.value, mProduct = frm.inpmProductId_IN.value, c_Project = frm.inpcProjectId_IN.value;
+        markCheckedAllElements(frm.inpcBPartnerId_IN);
+        markCheckedAllElements(frm.inpcProjectId_IN);
+        markCheckedAllElements(frm.inpmProductId_IN);
+        
+        var manualURL = '/ad_reports/ReportTrialBalanceDetail.html?inpDateFrom=' + frm.inpDateFrom.value 
+        + '&inpDateTo=' + frm.inpDateTo.value + '&inpOrg=' + frm.inpOrg.value + '&inpLevel=' + frm.inpLevel.value
+        + '&inpcAccountId=' + recordId + '&inpcAcctSchemaId=' + frm.inpcAcctSchemaId.value;
+        if (bPartner.length == 0){
+        	manualURL.concat('&inpcBPartnerId_IN=' + bPartner);
+        }
+        if (mProduct.length == 0){
+            manualURL.concat('&inpcBPartnerId_IN=' + mProduct);
+        }
+        if (c_Project.length == 0){
+            manualURL.concat('&inpcBPartnerId_IN=' + c_Project);
+        }
+
+        var myframe = getFrame('LayoutMDI') || top.opener;
+        if (myframe) {      
+            myframe.OB.RemoteCallManager.call('org.openbravo.client.application.ComputeTranslatedNameActionHandler', {}, {'processId': procId}, 
+            function(response, data, request){
+                myframe.OB.Layout.ViewManager.openView('OBClassicWindow', {
+                    command: 'DEFAULT',
+                    icon: '[SKINIMG]../../org.openbravo.client.application/images/application-menu/iconReport.png',
+                    id: procId,
+                    obManualURL: manualURL,
+                    processId: procId,
+                    tabTitle: data.processTitle,
+                    type: 'report',
+                    viewId: 'OBClassicWindow'
+                });                        
+            });
+        }
+    }
 	
 </script>
 </head>
@@ -931,7 +987,7 @@
                             <span id="showExpand" style="display: table-cell; display: -moz-inline-box;"><a href="#" onclick="updateData('OPEN', 'hhqq');return false;" onMouseOver="window.status='Open';return true;" onMouseOut="window.status='';return true;" id="expandButton">
                               <span id="buttonTreemmm" class="datawarehouseclose"></span>
                             </a></span>
-                            <a href="#" onclick="submitCommandWithMarkChecked('xx');return false;" onmouseover="window.status='General Ledger';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldId1">
+                            <a href="#" onclick="openTabToGeneralLedgerReport('800001', 'xx');return false;" onmouseover="window.status='General Ledger';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldId1">
                               <span id="fieldAccount">xx70000</span>
                             </a>
                             <span id="fieldDescAccount">xx600</span>
@@ -942,7 +998,7 @@
                         <td width="105" id="fieldAmtacctcr" class="DataGrid_Body_Cell_Amount">xx14500.34</td>
                         <td width="105" id="fieldSaldoFinal" class="DataGrid_Body_Cell_Amount">xx14500.34</td>
                         <td width="70" class="DataGrid_Body_Cell">
-                          <a href="#" onclick="validate(); submitCommandFormParameter('DEFAULT', document.frmMain.inpcAccountId, 'xx', false, document.frmMain, 'ReportTrialBalanceDetail.html', '_self', false, true);return false;" onmouseover="window.status='General Ledger';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldId2">Detail</a>
+                          <a href="#" onclick="validate(); openTabToReportTrialBalanceDetails('800091', 'xx');return false;" onmouseover="window.status='General Ledger';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldId2">Detail</a>
                         </td>
                       </tr>
                     </div>