Fixed issue 33460: code review improvements
authorVíctor Martínez Romanos <victor.martinez@openbravo.com>
Tue, 09 Aug 2016 09:50:55 +0200
changeset 30081 72acd4fea07e
parent 30080 87c9f038283f
child 30082 036a261e3b6f
Fixed issue 33460: code review improvements

Avoid NullPointerException in non-compartive mode
In JasperReport:
* Band height for details restored to 15, so we have the same number of lines as before the change
* Period N-1 label only shown in comparative mode
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReportsPDF.jrxml
src/org/openbravo/erpCommon/businessUtility/AccountTree_data.xsql
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java	Mon Jul 11 22:13:15 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java	Tue Aug 09 09:50:55 2016 +0200
@@ -265,7 +265,7 @@
               strcAcctSchemaId, Tree.getMembers(this, strTreeOrg, strOrg),
               "'" + year.getFiscalYear() + "'" + strYearsToClose, openingEntryOwner, strCompareTo,
               localStrDateFromRef, DateTimeData.nDaysAfter(this, localStrDateToRef, "1"), "'"
-                  + yearRef.getFiscalYear() + "'" + strYearsToCloseRef, openingEntryOwnerRef);
+                  + yrRef + "'" + strYearsToCloseRef, openingEntryOwnerRef);
           {
             if (log4j.isDebugEnabled())
               log4j.debug("*********** strIncomeSummaryAccount: " + strIncomeSummaryAccount);
@@ -326,7 +326,7 @@
         parameters.put("period", localStrDateFrom + " - " + localStrDateTo);
         parameters.put("periodRef", localStrDateFromRef + " - " + localStrDateToRef);
         parameters.put("agnoInitial", year.getFiscalYear());
-        parameters.put("agnoRef", yearRef.getFiscalYear());
+        parameters.put("agnoRef", yrRef);
         parameters.put("compareTo", (strCompareTo.equals("Y") ? "Y" : "N"));
         parameters.put(
             "principalTitle",
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReportsPDF.jrxml	Mon Jul 11 22:13:15 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReportsPDF.jrxml	Tue Aug 09 09:50:55 2016 +0200
@@ -150,7 +150,7 @@
 				<textElement markup="none">
 					<font fontName="DejaVu Sans" size="9" isBold="false"/>
 				</textElement>
-				<textFieldExpression class="java.lang.String"><![CDATA["Period:" + $P{period} + "   Period N-1"+ $P{periodRef}]]></textFieldExpression>
+				<textFieldExpression class="java.lang.String"><![CDATA["Period:" + $P{period} + (($P{compareTo}.equals("Y")) ? "   Period N-1: "+ $P{periodRef}:"")]]></textFieldExpression>
 			</textField>
 			<staticText>
 				<reportElement key="staticText-7" x="0" y="39" width="62" height="14"/>
@@ -229,7 +229,7 @@
 		<band splitType="Stretch"/>
 	</columnHeader>
 	<detail>
-		<band height="17" splitType="Stretch">
+		<band height="15" splitType="Stretch">
 			<textField>
 				<reportElement key="staticText-7" style="CustSatIndexMarkup" x="0" y="0" width="376" height="14"/>
 				<textElement markup="none">
--- a/src/org/openbravo/erpCommon/businessUtility/AccountTree_data.xsql	Mon Jul 11 22:13:15 2016 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/AccountTree_data.xsql	Tue Aug 09 09:50:55 2016 +0200
@@ -12,7 +12,7 @@
  * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
  * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
  * Contributor(s): Openbravo SLU
- * Contributions are Copyright (C) 2001-2013 Openbravo S.L.U.
+ * Contributions are Copyright (C) 2001-2016 Openbravo S.L.U.
  ******************************************************************************
 -->