Fixed bug 26677: wrong format in balance sheet and P&L structure report
authorSandra Huguet <sandra.huguet@openbravo.com>
Fri, 23 May 2014 14:18:49 +0200
changeset 23508 c6129853e0cd
parent 23507 9a7fa5b162f7
child 23509 34fddf330780
Fixed bug 26677: wrong format in balance sheet and P&L structure report
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReportsPDF.jrxml
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java	Mon May 26 10:42:33 2014 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java	Fri May 23 14:18:49 2014 +0200
@@ -291,25 +291,24 @@
         parameters.put("pageNo", strPageNo);
 
         AccountTreeData[][] trees = new AccountTreeData[strGroups.length][];
-
         for (int i = 0; i < strGroups.length; i++)
           trees[i] = acct[i].getAccounts();
 
         List<HashMap<String, String>> hashMapList = new ArrayList<HashMap<String, String>>();
 
         for (int i = 0; i < trees.length; i++) {
-
           for (int j = 0; j < trees[i].length; j++) {
             HashMap<String, String> hashMap = new HashMap<String, String>();
             hashMap.put("elementLevel", trees[i][j].elementLevel);
             hashMap.put("name", trees[i][j].name);
             hashMap.put("qty", trees[i][j].qty);
             hashMap.put("qtyRef", trees[i][j].qtyRef);
+            hashMap.put("groupname", strGroups[i].name);
+            hashMap.put("pagebreak", strGroups[i].pagebreak);
+
             hashMapList.add(hashMap);
           }
-
         }
-
         FieldProvider[] data = FieldProviderFactory.getFieldProviderArray(hashMapList);
         renderJR(vars, response, strReportName, "pdf", parameters, data, null);
 
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReportsPDF.jrxml	Mon May 26 10:42:33 2014 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReportsPDF.jrxml	Fri May 23 14:18:49 2014 +0200
@@ -22,7 +22,7 @@
 			<style fontSize="10" isBold="false"/>
 		</conditionalStyle>
 		<conditionalStyle>
-			<conditionExpression><![CDATA[new Boolean($F{elementLevel} <= 4)]]></conditionExpression>
+			<conditionExpression><![CDATA[new Boolean($F{elementLevel} >= 4)]]></conditionExpression>
 			<style fontSize="9" isBold="false"/>
 		</conditionalStyle>
 	</style>
@@ -53,6 +53,17 @@
 	<field name="qty" class="java.math.BigDecimal"/>
 	<field name="qtyRef" class="java.math.BigDecimal"/>
 	<field name="elementLevel" class="java.lang.Integer"/>
+	<field name="groupname" class="java.lang.String"/>
+	<field name="pagebreak" class="java.lang.String"/>
+	<group name="group" isStartNewPage="true">
+		<groupExpression><![CDATA[$F{groupname}]]></groupExpression>
+		<groupHeader>
+			<band/>
+		</groupHeader>
+		<groupFooter>
+			<band/>
+		</groupFooter>
+	</group>
 	<background>
 		<band splitType="Stretch"/>
 	</background>
@@ -162,13 +173,6 @@
 				<textFieldExpression class="java.lang.String"><![CDATA["Client N-1: "+ $P{companyName}+ " " +$P{agnoRef}]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement key="staticText-7" x="0" y="74" width="112" height="12"/>
-				<textElement markup="none">
-					<font fontName="DejaVu Sans" size="9" isBold="false"/>
-				</textElement>
-				<textFieldExpression class="java.lang.String"><![CDATA[$P{principalTitle}]]></textFieldExpression>
-			</textField>
-			<textField>
 				<reportElement key="staticText-7" x="211" y="84" width="112" height="11"/>
 				<textElement markup="none">
 					<font fontName="DejaVu Sans" size="9" isBold="true"/>
@@ -196,19 +200,26 @@
 				</textElement>
 				<textFieldExpression class="java.lang.String"><![CDATA[$P{columnRef}]]></textFieldExpression>
 			</textField>
+			<textField>
+				<reportElement key="staticText-7" x="0" y="74" width="229" height="12"/>
+				<textElement markup="none">
+					<font fontName="DejaVu Sans" size="9" isBold="false"/>
+				</textElement>
+				<textFieldExpression class="java.lang.String"><![CDATA[$F{groupname}]]></textFieldExpression>
+			</textField>
 		</band>
 	</pageHeader>
 	<columnHeader>
 		<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">
 					<font fontName="DejaVu Sans"/>
 				</textElement>
-				<textFieldExpression class="java.lang.String"><![CDATA[$F{elementLevel}==4 ? "      " + $F{name}: $F{elementLevel}==3 ? "     " + $F{name}: $F{elementLevel}==2 ? "  " + $F{name}:$F{name}]]></textFieldExpression>
+				<textFieldExpression class="java.lang.String"><![CDATA[$F{elementLevel}>=4 ? "      " + $F{name}: $F{elementLevel}==3 ? "     " + $F{name}: $F{elementLevel}==2 ? "  " + $F{name}:$F{name}]]></textFieldExpression>
 			</textField>
 			<textField isBlankWhenNull="true">
 				<reportElement key="staticText-7" x="376" y="0" width="80" height="14"/>