details: https://code.openbravo.com/erp/devel/pi/rev/1f4815271d27
changeset: 14275:1f4815271d27
user: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date: Wed Nov 16 18:50:44 2011 +0100
summary: Fixed issue 19083:
Several improvements added to the payment report:
1. Remove the Subtotal for the grouping criteria because it provides
useless information
2. Remove the sum of trans. amount because it may sum amounts from
different currencies
3. Remove the last grand total line because it provides useless
information
4. Add a balance field when grouping. This balance will show the
difference between the pending credit to be used and the pending
payments. This information is specially useful when grouping by
business partner.
The pending credit to take into account belongs to payments with the
following status: Withdrawn not cleared, Payment Received, Payment
Cleared, Payment Made and Deposited not Clear.
The pending payments to take into account do NOT have the following
status: Withdrawn not cleared, Payment Received, Payment Cleared,
Payment Made, Deposited not Clear and Voided
Apart from that, some minor bugs have been fixed:
- Order by clause orders by invoice payment schedule
- Improved code that prints the asterisks in case of credit payments
- In the PDF report, the group criteria band is now shown only when
the user has selected a grouping criteria
diffstat:
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_TEXTINTERFACES.xml
| 55 +-
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
| 48 +-
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
| 7 +-
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml
| 18 +-
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
| 42 +-
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml
| 2571 ++-------
6 files changed, 755 insertions(+), 1986 deletions(-)
diffs (truncated from 3028 to 300 lines):
diff -r 1f040a883f1c -r 1f4815271d27
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_TEXTINTERFACES.xml
---
a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_TEXTINTERFACES.xml
Wed Nov 16 22:04:56 2011 +0100
+++
b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_TEXTINTERFACES.xml
Wed Nov 16 18:50:44 2011 +0100
@@ -66,17 +66,6 @@
<!--0F3DBFADCE4F42279BA1E29291982E43-->
<AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
<!--0F3DBFADCE4F42279BA1E29291982E43--></AD_TEXTINTERFACES>
-<!--1492946E7BF44E5686A61AFD288E9318--><AD_TEXTINTERFACES>
-<!--1492946E7BF44E5686A61AFD288E9318-->
<AD_TEXTINTERFACES_ID><![CDATA[1492946E7BF44E5686A61AFD288E9318]]></AD_TEXTINTERFACES_ID>
-<!--1492946E7BF44E5686A61AFD288E9318-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--1492946E7BF44E5686A61AFD288E9318--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--1492946E7BF44E5686A61AFD288E9318--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--1492946E7BF44E5686A61AFD288E9318--> <TEXT><![CDATA[Grand Total:]]></TEXT>
-<!--1492946E7BF44E5686A61AFD288E9318-->
<FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml]]></FILENAME>
-<!--1492946E7BF44E5686A61AFD288E9318--> <ISUSED><![CDATA[Y]]></ISUSED>
-<!--1492946E7BF44E5686A61AFD288E9318-->
<AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
-<!--1492946E7BF44E5686A61AFD288E9318--></AD_TEXTINTERFACES>
-
<!--17234C998EAE47188F5E34F1ECF345C3--><AD_TEXTINTERFACES>
<!--17234C998EAE47188F5E34F1ECF345C3-->
<AD_TEXTINTERFACES_ID><![CDATA[17234C998EAE47188F5E34F1ECF345C3]]></AD_TEXTINTERFACES_ID>
<!--17234C998EAE47188F5E34F1ECF345C3-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -275,17 +264,6 @@
<!--3A59F70C2BE548398EEC5134095FA252-->
<AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
<!--3A59F70C2BE548398EEC5134095FA252--></AD_TEXTINTERFACES>
-<!--3D64879E7FD745A1B8749BE8F92FA1AB--><AD_TEXTINTERFACES>
-<!--3D64879E7FD745A1B8749BE8F92FA1AB-->
<AD_TEXTINTERFACES_ID><![CDATA[3D64879E7FD745A1B8749BE8F92FA1AB]]></AD_TEXTINTERFACES_ID>
-<!--3D64879E7FD745A1B8749BE8F92FA1AB-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--3D64879E7FD745A1B8749BE8F92FA1AB--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--3D64879E7FD745A1B8749BE8F92FA1AB--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--3D64879E7FD745A1B8749BE8F92FA1AB--> <TEXT><![CDATA[Sub Total (Grouping
Criteria):]]></TEXT>
-<!--3D64879E7FD745A1B8749BE8F92FA1AB-->
<FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml]]></FILENAME>
-<!--3D64879E7FD745A1B8749BE8F92FA1AB--> <ISUSED><![CDATA[Y]]></ISUSED>
-<!--3D64879E7FD745A1B8749BE8F92FA1AB-->
<AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
-<!--3D64879E7FD745A1B8749BE8F92FA1AB--></AD_TEXTINTERFACES>
-
<!--43C8186236514013ADE1E5C8DB7A043B--><AD_TEXTINTERFACES>
<!--43C8186236514013ADE1E5C8DB7A043B-->
<AD_TEXTINTERFACES_ID><![CDATA[43C8186236514013ADE1E5C8DB7A043B]]></AD_TEXTINTERFACES_ID>
<!--43C8186236514013ADE1E5C8DB7A043B-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -308,6 +286,17 @@
<!--47D05363EA0A431E94988745BA473BD1-->
<AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
<!--47D05363EA0A431E94988745BA473BD1--></AD_TEXTINTERFACES>
+<!--4A2C074C97E74A55858699F7AC03BBE7--><AD_TEXTINTERFACES>
+<!--4A2C074C97E74A55858699F7AC03BBE7-->
<AD_TEXTINTERFACES_ID><![CDATA[4A2C074C97E74A55858699F7AC03BBE7]]></AD_TEXTINTERFACES_ID>
+<!--4A2C074C97E74A55858699F7AC03BBE7-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4A2C074C97E74A55858699F7AC03BBE7--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4A2C074C97E74A55858699F7AC03BBE7--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4A2C074C97E74A55858699F7AC03BBE7--> <TEXT><![CDATA[Balance:]]></TEXT>
+<!--4A2C074C97E74A55858699F7AC03BBE7-->
<FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml]]></FILENAME>
+<!--4A2C074C97E74A55858699F7AC03BBE7--> <ISUSED><![CDATA[Y]]></ISUSED>
+<!--4A2C074C97E74A55858699F7AC03BBE7-->
<AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
+<!--4A2C074C97E74A55858699F7AC03BBE7--></AD_TEXTINTERFACES>
+
<!--4AE673493AE240E5A19DB52BA3FECA21--><AD_TEXTINTERFACES>
<!--4AE673493AE240E5A19DB52BA3FECA21-->
<AD_TEXTINTERFACES_ID><![CDATA[4AE673493AE240E5A19DB52BA3FECA21]]></AD_TEXTINTERFACES_ID>
<!--4AE673493AE240E5A19DB52BA3FECA21-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -440,17 +429,6 @@
<!--8747F91C31704FD0A9EC0C35237158BE-->
<AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
<!--8747F91C31704FD0A9EC0C35237158BE--></AD_TEXTINTERFACES>
-<!--885417437D3B47308536AF8ADF3834B4--><AD_TEXTINTERFACES>
-<!--885417437D3B47308536AF8ADF3834B4-->
<AD_TEXTINTERFACES_ID><![CDATA[885417437D3B47308536AF8ADF3834B4]]></AD_TEXTINTERFACES_ID>
-<!--885417437D3B47308536AF8ADF3834B4-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--885417437D3B47308536AF8ADF3834B4--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--885417437D3B47308536AF8ADF3834B4--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--885417437D3B47308536AF8ADF3834B4--> <TEXT><![CDATA[Grand Total]]></TEXT>
-<!--885417437D3B47308536AF8ADF3834B4-->
<FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html]]></FILENAME>
-<!--885417437D3B47308536AF8ADF3834B4--> <ISUSED><![CDATA[Y]]></ISUSED>
-<!--885417437D3B47308536AF8ADF3834B4-->
<AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
-<!--885417437D3B47308536AF8ADF3834B4--></AD_TEXTINTERFACES>
-
<!--8A613E8D2A304FEF9545C2852FC06EF0--><AD_TEXTINTERFACES>
<!--8A613E8D2A304FEF9545C2852FC06EF0-->
<AD_TEXTINTERFACES_ID><![CDATA[8A613E8D2A304FEF9545C2852FC06EF0]]></AD_TEXTINTERFACES_ID>
<!--8A613E8D2A304FEF9545C2852FC06EF0-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -704,17 +682,6 @@
<!--AFBBE094BB59D031E040007F01013B9F-->
<AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
<!--AFBBE094BB59D031E040007F01013B9F--></AD_TEXTINTERFACES>
-<!--B682A4F7A92C45A4BE2D04E087F45B6D--><AD_TEXTINTERFACES>
-<!--B682A4F7A92C45A4BE2D04E087F45B6D-->
<AD_TEXTINTERFACES_ID><![CDATA[B682A4F7A92C45A4BE2D04E087F45B6D]]></AD_TEXTINTERFACES_ID>
-<!--B682A4F7A92C45A4BE2D04E087F45B6D-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--B682A4F7A92C45A4BE2D04E087F45B6D--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--B682A4F7A92C45A4BE2D04E087F45B6D--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--B682A4F7A92C45A4BE2D04E087F45B6D--> <TEXT><![CDATA[Sub Total (Group
Crit)]]></TEXT>
-<!--B682A4F7A92C45A4BE2D04E087F45B6D-->
<FILENAME><![CDATA[/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html]]></FILENAME>
-<!--B682A4F7A92C45A4BE2D04E087F45B6D--> <ISUSED><![CDATA[Y]]></ISUSED>
-<!--B682A4F7A92C45A4BE2D04E087F45B6D-->
<AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
-<!--B682A4F7A92C45A4BE2D04E087F45B6D--></AD_TEXTINTERFACES>
-
<!--B973837A2C334DC49973CEE4179F43B7--><AD_TEXTINTERFACES>
<!--B973837A2C334DC49973CEE4179F43B7-->
<AD_TEXTINTERFACES_ID><![CDATA[B973837A2C334DC49973CEE4179F43B7]]></AD_TEXTINTERFACES_ID>
<!--B973837A2C334DC49973CEE4179F43B7-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 1f040a883f1c -r 1f4815271d27
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
---
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
Wed Nov 16 22:04:56 2011 +0100
+++
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.html
Wed Nov 16 18:50:44 2011 +0100
@@ -1111,9 +1111,7 @@
</div>
<tr class="DataGrid_Body_Row">
<th width="10%" class="DataGrid_Header_Cell"><span
class="Bold">Sub Total (Status)</span></th>
- <th width="100%"
class="DataGrid_Header_Cell_Amount" colspan="10"></th>
- <th width="10%"
class="DataGrid_Header_Cell_Amount"><span class="Bold"
id="subtotalTransAmount"></span></th>
- <th width="10%" class="DataGrid_Header_Cell"><span
class="Bold" id="fieldTransCurrency"></span></th>
+ <th width="100%"
class="DataGrid_Header_Cell_Amount" colspan="12"></th>
<th width="10%"
class="DataGrid_Header_Cell_Amount"><span class="Bold"
id="subtotalBaseAmount"></span></th>
<th width="10%" class="DataGrid_Header_Cell"><span
class="Bold" id="fieldBaseCurrency"></span></th>
</tr>
@@ -1121,27 +1119,18 @@
<th colspan="15" height="25px"/>
</tr>
</div>
- <div id="sectionTotal">
- <tr>
- <th colspan="15" height="25px"/>
- </tr>
- <tr class="DataGrid_Body_Row">
- <th width="10%" class="DataGrid_Header_Cell"><span
class="Bold">Grand Total</span></th>
- <th width="100%"
class="DataGrid_Header_Cell_Amount" colspan="10"></th>
- <th width="10%"
class="DataGrid_Header_Cell_Amount"><span class="Bold"
id="totalTransAmount"></span></th>
- <th width="10%" class="DataGrid_Header_Cell"><span
class="Bold" id="fieldTransCurrency"></span></th>
- <th width="10%"
class="DataGrid_Header_Cell_Amount"><span class="Bold"
id="totalBaseAmount"></span></th>
- <th width="10%" class="DataGrid_Header_Cell"><span
class="Bold" id="fieldBaseCurrency"></th>
- </tr>
- </div>
</table>
<table cellspacing="0" cellpadding="0" width="90%"
class="DataGrid_Header_Table DataGrid_Body_Table" style="table-layout: auto;">
<div id="sectionGroupCrit">
<tr class="DataGrid_Body_Row">
- <th colspan="15"
class="DataGrid_Header_Cell">Grouping Criteria<span>: </span>
+ <th colspan="12"
class="DataGrid_Header_Cell">Grouping Criteria<span>: </span>
<span
id="fieldGroupCritName">xxGroupCritName</span></th>
+ <!-- <th class="DataGrid_Header_Cell">Balance</th>
+ <th class="DataGrid_Header_Cell_Amount"><span
id="sumBalanceAmount"></span></th>
+ <th class="DataGrid_Header_Cell"><span
id="fieldBaseCurrency2"></span></th> -->
+ <th colspan="3"
class="DataGrid_Header_Cell">Balance<span>: </span><span
id="sumBalanceAmount"></span><span> </span><span
id="fieldBaseCurrency2"></span></th>
</tr>
<div id="sectionStatus2">
<tr class="DataGrid_Body_Row">
@@ -1197,39 +1186,16 @@
</div>
<tr class="DataGrid_Body_Row">
<th width="10%"
class="DataGrid_Header_Cell"><span class="Bold">Sub Total (Status)</span></th>
- <th width="100%"
class="DataGrid_Header_Cell_Amount" colspan="10"></th>
- <th width="10%"
class="DataGrid_Header_Cell_Amount"><span class="Bold"
id="subtotalTransAmountStatus"></span></th>
- <th width="10%"
class="DataGrid_Header_Cell"><span class="Bold"
id="fieldTransCurrency2"></span></th>
+ <th width="100%"
class="DataGrid_Header_Cell_Amount" colspan="12"></th>
<th width="10%"
class="DataGrid_Header_Cell_Amount"><span class="Bold"
id="subtotalBaseAmountStatus"></span></th>
<th width="10%"
class="DataGrid_Header_Cell"><span class="Bold"
id="fieldBaseCurrency2"></span></th>
</tr>
</div>
- <tr class="DataGrid_Body_Row"
id="sectionSubtotalGroupCrit">
- <th width="10%"
class="DataGrid_Header_Cell"><span class="Bold">Sub Total (Group
Crit)</span></th>
- <th width="100%"
class="DataGrid_Header_Cell_Amount" colspan="10"></th>
- <th width="10%"
class="DataGrid_Header_Cell_Amount"><span class="Bold"
id="subtotalTransAmountGroupCrit"></span></th>
- <th width="10%"
class="DataGrid_Header_Cell"><span class="Bold"
id="fieldTransCurrency2"></span></th>
- <th width="10%"
class="DataGrid_Header_Cell_Amount"><span class="Bold"
id="subtotalBaseAmountGroupCrit"></span></th>
- <th width="10%"
class="DataGrid_Header_Cell"><span class="Bold"
id="fieldBaseCurrency2"></span></th>
- </tr>
<tr>
<th colspan="15" style="height:25px"/>
</tr>
</div>
- <div id="sectionTotal2">
- <tr>
- <th colspan="15" style="height:25px"/>
- </tr>
- <tr class="DataGrid_Body_Row">
- <th width="10%"
class="DataGrid_Header_Cell"><span class="Bold">Grand Total</span></th>
- <th width="100%"
class="DataGrid_Header_Cell_Amount" colspan="10"></th>
- <th width="10%"
class="DataGrid_Header_Cell_Amount"><span class="Bold"
id="totalTransAmount2"></span></th>
- <th width="10%"
class="DataGrid_Header_Cell"><span class="Bold"
id="fieldTransCurrency2"></span></th>
- <th width="10%"
class="DataGrid_Header_Cell_Amount"><span class="Bold"
id="totalBaseAmount2"></span></th>
- <th width="10%"
class="DataGrid_Header_Cell"><span class="Bold" id="fieldBaseCurrency2"></th>
- </tr>
- </div>
</table>
</td>
</tr>
diff -r 1f040a883f1c -r 1f4815271d27
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
---
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
Wed Nov 16 22:04:56 2011 +0100
+++
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.java
Wed Nov 16 18:50:44 2011 +0100
@@ -624,9 +624,12 @@
return false;
boolean showAsterisk = false;
for (final FieldProvider fp : data) {
- if (fp.getField("INVOICE_NUMBER") != null &&
!"".equals(fp.getField("INVOICE_NUMBER"))
+ if (fp.getField("INVOICE_NUMBER") != null
+ && !"".equals(fp.getField("INVOICE_NUMBER"))
&& fp.getField("INVOICE_NUMBER").length() >= asterisk.length()
- && asterisk.equals(fp.getField("INVOICE_NUMBER").substring(0,
asterisk.length()))) {
+ && asterisk.equals(fp.getField("INVOICE_NUMBER").substring(0,
asterisk.length()))
+ &&
!"*".equals(fp.getField("INVOICE_NUMBER").substring(asterisk.length(),
+ asterisk.length() + 1))) {
showAsterisk = true;
break;
}
diff -r 1f040a883f1c -r 1f4815271d27
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml
---
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml
Wed Nov 16 22:04:56 2011 +0100
+++
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReport.xml
Wed Nov 16 18:50:44 2011 +0100
@@ -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) 2009 Openbravo SL
+* All portions are Copyright (C) 2009-2011 Openbravo SL
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -147,13 +147,9 @@
<FIELD id="fieldBaseAmount" format="euroInform">BASE_AMOUNT</FIELD>
<FIELD id="fieldBaseCurrency">BASE_CURRENCY</FIELD>
-<!-- Accumulates Transactional Amount and Base Amount columns values -->
- <FUNCTION id="subtotalTransAmount" name="SUM"
format="euroInform">TRANS_AMOUNT</FUNCTION>
+<!-- Accumulates Base Amount columns values -->
<FUNCTION id="subtotalBaseAmount" name="SUM"
format="euroInform">BASE_AMOUNT</FUNCTION>
- <FUNCTION id="totalTransAmount" name="SUM"
format="euroInform">TRANS_AMOUNT</FUNCTION>
- <FUNCTION id="totalBaseAmount" name="SUM"
format="euroInform">BASE_AMOUNT</FUNCTION>
-
<SECTION id="sectionStatus" field="STATUS"/>
<SECTION id="sectionDetail"/>
</structure>
@@ -191,15 +187,9 @@
<FIELD id="fieldGroupCritName">GROUP_CRIT_ID</FIELD>
<FIELD id="fieldGroupCrit">GROUP_CRIT_ID</FIELD>
-<!-- Accumulates Transactional Amount and Base Amount columns values -->
- <FUNCTION id="subtotalTransAmountStatus" name="SUM"
format="euroInform">TRANS_AMOUNT</FUNCTION>
+<!-- Base Amount columns values -->
<FUNCTION id="subtotalBaseAmountStatus" name="SUM"
format="euroInform">BASE_AMOUNT</FUNCTION>
-
- <FUNCTION id="subtotalTransAmountGroupCrit" name="SUM"
format="euroInform">TRANS_AMOUNT</FUNCTION>
- <FUNCTION id="subtotalBaseAmountGroupCrit" name="SUM"
format="euroInform">BASE_AMOUNT</FUNCTION>
-
- <FUNCTION id="totalTransAmount2" name="SUM"
format="euroInform">TRANS_AMOUNT</FUNCTION>
- <FUNCTION id="totalBaseAmount2" name="SUM"
format="euroInform">BASE_AMOUNT</FUNCTION>
+ <FUNCTION id="sumBalanceAmount" name="SUM"
format="euroInform">BALANCE</FUNCTION>
<SECTION id="sectionGroupCrit" field="GROUP_CRIT_ID"/>
<SECTION id="sectionStatus2" field="STATUS"/>
diff -r 1f040a883f1c -r 1f4815271d27
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
---
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
Wed Nov 16 22:04:56 2011 +0100
+++
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
Wed Nov 16 18:50:44 2011 +0100
@@ -380,11 +380,9 @@
}
hsqlScript.append(", fpsd.");
- hsqlScript.append(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS);
+
hsqlScript.append(FIN_PaymentScheduleDetail.PROPERTY_INVOICEPAYMENTSCHEDULE);
hsqlScript.append(".");
- hsqlScript.append(FIN_PaymentDetail.PROPERTY_ID);
- hsqlScript.append(", inv.");
- hsqlScript.append(Invoice.PROPERTY_ID);
+ hsqlScript.append(FIN_PaymentSchedule.PROPERTY_ID);
final OBQuery<FIN_PaymentScheduleDetail> obqPSD =
OBDal.getInstance().createQuery(
FIN_PaymentScheduleDetail.class, hsqlScript.toString(), parameters);
@@ -400,6 +398,7 @@
String previousFPSDInvoiceId = null;
String previousPaymentId = null;
BigDecimal amountSum = BigDecimal.ZERO;
+ BigDecimal balanceSum = BigDecimal.ZERO;
FieldProvider previousRow = null;
ConversionRate previousConvRate = null;
boolean isReceipt = false;
@@ -631,6 +630,37 @@
// baseCurrency
FieldProviderFactory.setField(data[i], "TRANS_CURRENCY",
transCurrency.getISOCode());
+ // Balance
+ String status = "RPAE";
+ try {
+ status =
FIN_PaymentScheduleDetail[i].getPaymentDetails().getFinPayment().getStatus();
+ } catch (NullPointerException e) {
+ }
+ final boolean isCreditPayment =
FIN_PaymentScheduleDetail[i].getInvoicePaymentSchedule() == null
+ &&
FIN_PaymentScheduleDetail[i].getPaymentDetails().getFinPayment() != null;
+
+ BigDecimal balance = BigDecimal.ZERO;
+ if (isCreditPayment && status != null && "PWNC RPR RPPC PPM
RDNC".indexOf(status) >= 0) {
+ balance = FIN_PaymentScheduleDetail[i]
+ .getPaymentDetails()
+ .getFinPayment()
+ .getGeneratedCredit()
+ .subtract(
+
FIN_PaymentScheduleDetail[i].getPaymentDetails().getFinPayment().getUsedCredit());
+ if (isReceipt) {
+ balance = balance.negate();
+ }
+ } else if (!isCreditPayment && status != null
+ && "PWNC RPR RPPC PPM RDNC RPVOID".indexOf(status) == -1) {
+ balance = isReceipt ? transAmount : transAmount.negate();
+ }
+ if (convRate != null) {
+ final int stdPrecission =
convRate.getToCurrency().getStandardPrecision().intValue();
+ balance =
balance.multiply(convRate.getMultipleRateBy()).setScale(stdPrecission,
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits