details:   https://code.openbravo.com/erp/devel/pi/rev/b115497583a1
changeset: 29360:b115497583a1
user:      Mark <m.molina <at> nectus.com>
date:      Tue Apr 26 11:30:23 2016 +0200
summary:   Fixes issue 32535: Set organization general ledger as default in 
some reports

Fix following reports:
- Balance Sheet and P&L structure (GeneralAccountingReports)
- General Ledger Report (ReportGeneralLedger)
- Journal Entries Report (ReportGeneralLedgerJournal)
- Trial Balance (ReportTrialBalance)

details:   https://code.openbravo.com/erp/devel/pi/rev/8d0036b1707d
changeset: 29361:8d0036b1707d
user:      Mark <m.molina <at> nectus.com>
date:      Tue Apr 26 17:31:58 2016 +0200
summary:   Related to issue 32535: Set login organization currency as default 
in some reports

Fix following reports:
- Valued Stock Report (ReportValuationStock)

details:   https://code.openbravo.com/erp/devel/pi/rev/e945590dce38
changeset: 29362:e945590dce38
user:      Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
date:      Wed Apr 27 19:45:36 2016 +0200
summary:   Related to issue 32535: Code review improvements

diffstat:

 src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.html   |   37 
++-
 src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java   |   14 
+-
 src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.html        |   33 
++-
 src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java        |   20 
+-
 src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html |   32 
++-
 src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java |   17 
+-
 src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.html         |   31 
++-
 src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java         |   15 
+-
 src/org/openbravo/erpCommon/ad_reports/ReportValuationStock.java       |   12 
+-
 src/org/openbravo/erpCommon/utility/OBLedgerUtils.java                 |  114 
++++++++++
 10 files changed, 299 insertions(+), 26 deletions(-)

diffs (truncated from 620 to 300 lines):

diff -r 1fd07e8b5372 -r e945590dce38 
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.html
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.html      
Wed Apr 27 09:19:33 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.html      
Wed Apr 27 19:45:36 2016 +0200
@@ -13,7 +13,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-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -145,6 +145,35 @@
   return true;
 }
 
+function callbackLedger(paramXMLParticular, XMLHttpRequestObj) {
+    var strText = "";
+    if (getReadyStateHandler(XMLHttpRequestObj)) {
+        try {
+            if (XMLHttpRequestObj.responseText) {
+                strText = XMLHttpRequestObj.responseText;
+                if (strText && 
document.getElementById('inpcAcctSchemaId').value != strText) {
+                    document.getElementById('inpcAcctSchemaId').value = 
strText;
+                    refreshComboReports();
+                }
+                else {
+                    refreshComboYears();
+                }
+            }
+       } catch (e) {
+       }
+    }
+    return true;
+}
+
+function setDefaultLedger() {
+    try {
+        var paramXMLReq = null;
+        return submitXmlHttpRequest(callbackLedger, document.frmMain, 
"LEDGER", "GeneralAccountingReports.html", false, null, paramXMLReq);
+    } catch (e) {
+        alert(e);
+    }
+}
+
 function onloadFunctions() {
 }
 </script>
@@ -173,12 +202,12 @@
        setTabTableParentElement();
        enableShortcuts('edition');
        setBrowserAutoComplete(false);
-       
        resizeArea();
        updateMenuIcon('buttonMenu');
 
        setWindowElementFocus('firstElement');
-       displayLogic();
+       setDefaultLedger();
+       displayLogic();
 }
 
 function onResizeDo(){
@@ -366,7 +395,7 @@
 
                 <tr>
                   <td class="TitleCell"><span 
class="LabelText">Organization</span></td>
-                  <td class="Combo_ContentCell" colspan="2"> <select 
name="inpOrganizacion" id="inpOrganizacion" class="ComboKey 
Combo_TwoCells_width" onchange="refreshComboYears(); logChanges(this); return 
true;">
+                  <td class="Combo_ContentCell" colspan="2"> <select 
name="inpOrganizacion" id="inpOrganizacion" class="ComboKey 
Combo_TwoCells_width" onchange="setDefaultLedger(); logChanges(this); return 
true;">
                       <option value=""></option><div id="reportC_Org_ID"></div>
                     </select></td>
                 </tr>
diff -r 1fd07e8b5372 -r e945590dce38 
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java      
Wed Apr 27 09:19:33 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java      
Wed Apr 27 19:45:36 2016 +0200
@@ -54,6 +54,7 @@
 import org.openbravo.erpCommon.utility.NavigationBar;
 import org.openbravo.erpCommon.utility.OBDateUtils;
 import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.erpCommon.utility.OBLedgerUtils;
 import org.openbravo.erpCommon.utility.ToolBar;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.erpCommon.utility.WindowTreeData;
@@ -127,8 +128,19 @@
       printPagePDF(request, response, vars, strAgno, strAgnoRef, strDateFrom, 
strDateTo,
           strDateFromRef, strDateToRef, strAsDateTo, strAsDateToRef, 
strElementValue,
           strConImporte, strOrg, strLevel, strConCodigo, strcAcctSchemaId, 
strPageNo);
-    } else
+    } else if (vars.commandIn("LEDGER")) {
+      String strOrg = vars
+          .getGlobalVariable("inpOrganizacion", 
"GeneralAccountingReports|Org", "0");
+      String strcAcctSchemaId = OBLedgerUtils.getOrgLedger(strOrg);
+      response.setContentType("text/html; charset=UTF-8");
+      PrintWriter out = response.getWriter();
+      out.print(strcAcctSchemaId);
+      out.close();
+    }
+
+    else {
       pageError(response);
+    }
   }
 
   private void printPagePDF(HttpServletRequest request, HttpServletResponse 
response,
diff -r 1fd07e8b5372 -r e945590dce38 
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.html
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.html   Wed Apr 
27 09:19:33 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.html   Wed Apr 
27 19:45:36 2016 +0200
@@ -13,7 +13,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-2012 Openbravo SLU
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -89,6 +89,32 @@
   return true;
 }
 
+
+function callbackLedger(paramXMLParticular, XMLHttpRequestObj) {
+    var strText = "";
+    if (getReadyStateHandler(XMLHttpRequestObj)) {
+        try {
+            if (XMLHttpRequestObj.responseText) {
+                strText = XMLHttpRequestObj.responseText;
+                if (strText) {
+                    document.getElementById('inpcAcctSchemaId').value = 
strText;
+                }
+            }
+       } catch (e) {
+       }
+    }
+    return true;
+}
+
+function setDefaultLedger() {
+    try {
+        var paramXMLReq = null;
+        return submitXmlHttpRequest(callbackLedger, document.frmMain, 
"LEDGER", "ReportGeneralLedger.html", false, null, paramXMLReq);
+    } catch (e) {
+        alert(e);
+    }
+}
+
 function onloadFunctions() {
   keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, 
null, '../info/AccountElementValue.html', 'SELECTOR_ACCOUNTELEMENTVALUE', 
false, 'frmMain', 'inpcElementValueIdFrom', 'inpElementValueIdFrom_DES', 
document.frmMain.inpElementValueIdFrom_DES.value, 'inpcAcctSchemaId', 
document.frmMain.inpcAcctSchemaId.value, 'Command', 'KEY');", 
"inpElementValueIdFrom_DES", "null");
   keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, 
null, '../info/AccountElementValue.html', 'SELECTOR_ACCOUNTELEMENTVALUE', 
false, 'frmMain', 'inpcElementValueIdTo', 'inpElementValueIdTo_DES', 
document.frmMain.inpElementValueIdTo_DES.value, 'inpcAcctSchemaId', 
document.frmMain.inpcAcctSchemaId.value, 'Command', 'KEY');", 
"inpElementValueIdTo_DES", "null");
@@ -123,11 +149,14 @@
     updateMenuIcon('buttonMenu');
 
     setWindowElementFocus('firstElement');
+    setDefaultLedger();
+
   }
 
   function onResizeDo(){
     resizeArea();
   }
+  
 
   function openGeneralLedgerJournal(recordid) {
       
@@ -370,7 +399,7 @@
             </tr>
             <tr>
               <td class="TitleCell"><span 
class="LabelText">Organization</span></td>
-              <td class="Combo_ContentCell" colspan="2"> <select name="inpOrg" 
id="inpOrg" class="Combo Combo_TwoCells_width">
+              <td class="Combo_ContentCell" colspan="2"> <select name="inpOrg" 
id="inpOrg" class="Combo Combo_TwoCells_width" onChange="setDefaultLedger();">
                   <div id="reportAD_ORGID"></div>
                 </select>
               </td>              
diff -r 1fd07e8b5372 -r e945590dce38 
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java   Wed Apr 
27 09:19:33 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java   Wed Apr 
27 19:45:36 2016 +0200
@@ -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-2015 Openbravo SLU
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -46,6 +46,7 @@
 import org.openbravo.erpCommon.utility.LimitRowsScrollableFieldProviderFilter;
 import org.openbravo.erpCommon.utility.NavigationBar;
 import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.erpCommon.utility.OBLedgerUtils;
 import org.openbravo.erpCommon.utility.ToolBar;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.xmlEngine.XmlDocument;
@@ -192,16 +193,27 @@
       String strGroupBy = vars
           .getRequestGlobalVariable("inpGroupBy", 
"ReportGeneralLedger|GroupBy");
       String strPageNo = vars.getGlobalVariable("inpPageNo", 
"ReportGeneralLedger|PageNo", "1");
-      if (vars.commandIn("PDF"))
+      if (vars.commandIn("PDF")) {
         printPageDataPDF(request, response, vars, strDateFrom, strDateTo, 
strAmtFrom, strAmtTo,
             strcelementvaluefrom, strcelementvalueto, strOrg, strcBpartnerId, 
strmProductId,
             strcProjectId, strGroupBy, strcAcctSchemaId, strPageNo, 
strShowOpenBalances);
-      else
+      } else {
         printPageDataXLS(request, response, vars, strDateFrom, strDateTo, 
strAmtFrom, strAmtTo,
             strcelementvaluefrom, strcelementvalueto, strOrg, strcBpartnerId, 
strmProductId,
             strcProjectId, strGroupBy, strcAcctSchemaId, strShowOpenBalances);
-    } else
+      }
+    } else if (vars.commandIn("LEDGER")) {
+      String strOrg = vars.getGlobalVariable("inpOrg", 
"ReportGeneralLedger|Org", "0");
+      String strcAcctSchemaId = OBLedgerUtils.getOrgLedger(strOrg);
+      response.setContentType("text/html; charset=UTF-8");
+      PrintWriter out = response.getWriter();
+      out.print(strcAcctSchemaId);
+      out.close();
+    }
+
+    else {
       pageError(response);
+    }
   }
 
   private void printPageDataSheet(HttpServletResponse response, 
VariablesSecureApp vars,
diff -r 1fd07e8b5372 -r e945590dce38 
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html    
Wed Apr 27 09:19:33 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html    
Wed Apr 27 19:45:36 2016 +0200
@@ -13,7 +13,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-2015 Openbravo SLU
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -89,6 +89,33 @@
     return true;
 }
 
+
+function callbackLedger(paramXMLParticular, XMLHttpRequestObj) {
+    var strText = "";
+    if (getReadyStateHandler(XMLHttpRequestObj)) {
+        try {
+            if (XMLHttpRequestObj.responseText) {
+                strText = XMLHttpRequestObj.responseText;
+                if (strText && 
document.getElementById('inpcAcctSchemaId').value != strText) {
+                    document.getElementById('inpcAcctSchemaId').value = 
strText;
+                    selectDocument();
+                }
+            }
+       } catch (e) {
+       }
+    }
+    return true;
+}
+
+function setDefaultLedger() {
+    try {
+        var paramXMLReq = null;
+        return submitXmlHttpRequest(callbackLedger, document.frmMain, 
"LEDGER", "ReportGeneralLedgerJournal.html", false, null, paramXMLReq);
+    } catch (e) {
+        alert(e);
+    }
+}
+
 function onloadFunctions() {
   keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, 
null, '../info/AccountElementValue.html', 'SELECTOR_ACCOUNTELEMENTVALUE', 
false, 'frmMain', 'inpcElementValueIdFrom', 'inpElementValueIdFrom_DES', 
document.frmMain.inpElementValueIdFrom_DES.value, 'inpcAcctSchemaId', 
document.frmMain.inpcAcctSchemaId.value, 'Command', 'KEY');", 
"inpElementValueIdFrom_DES", "null");
   keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, 
null, '../info/AccountElementValue.html', 'SELECTOR_ACCOUNTELEMENTVALUE', 
false, 'frmMain', 'inpcElementValueIdTo', 'inpElementValueIdTo_DES', 
document.frmMain.inpElementValueIdTo_DES.value, 'inpcAcctSchemaId', 
document.frmMain.inpcAcctSchemaId.value, 'Command', 'KEY');", 
"inpElementValueIdTo_DES", "null");
@@ -289,6 +316,7 @@
         updateMenuIcon('buttonMenu');
 
         setWindowElementFocus('firstElement');
+        setDefaultLedger();
         displayDocumentNo();
         displayAdvancedFilters();
         selectDocument();
@@ -514,7 +542,7 @@
             </tr>
             <tr>
               <td class="TitleCell"><span 
class="LabelText">Organization</span></td>
-              <td class="Combo_ContentCell" colspan="2"> <select  
name="inpOrg" id="inpOrg" class="ComboKey Combo_TwoCells_width required 
Combo_focus" required="true" onchange="selectDocument();">
+              <td class="Combo_ContentCell" colspan="2"> <select  
name="inpOrg" id="inpOrg" class="ComboKey Combo_TwoCells_width required 
Combo_focus" required="true" onchange="setDefaultLedger();">
                  <div id="reportAD_ORGID"></div>
                 </select></td>
               <td class="TitleCell"> <span class="LabelText">General 
Ledger</span></td>
diff -r 1fd07e8b5372 -r e945590dce38 
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java    
Wed Apr 27 09:19:33 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java    
Wed Apr 27 19:45:36 2016 +0200
@@ -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-2015 Openbravo SLU
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -55,6 +55,7 @@

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to