Author: deepak
Date: Sat May 21 08:33:51 2016
New Revision: 1744873

URL: http://svn.apache.org/viewvc?rev=1744873&view=rev
Log:
(OFBIZ-7089) Applied patch from jira issue
============================================================
Cash Flow Statement report is broken
============================================================

Thanks Nameet Jain for reporting and providing the patch.

Modified:
    ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml
    
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java
    
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy
    
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy
    
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy

Modified: ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml?rev=1744873&r1=1744872&r2=1744873&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml 
(original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml Sat May 
21 08:33:51 2016
@@ -564,7 +564,7 @@ under the License.
             If no findDate is given, then use the current moment 
(nowTimestamp).
         </description>
         <attribute name="organizationPartyId" type="String" mode="IN" 
optional="true"/>
-        <attribute name="findDate" type="java.sql.Date" mode="IN" 
optional="true"/>
+        <attribute name="findDate" type="Timestamp" mode="IN" optional="true"/>
         <attribute name="periodTypeId" type="String" mode="IN" 
optional="true"/>
         <attribute name="lastClosedDate" type="Timestamp" mode="OUT" 
optional="true"/>
         <attribute name="lastClosedTimePeriod" 
type="org.ofbiz.entity.GenericValue" mode="OUT" optional="true"/>

Modified: 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java?rev=1744873&r1=1744872&r2=1744873&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java
 (original)
+++ 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java
 Sat May 21 08:33:51 2016
@@ -50,12 +50,12 @@ public class PeriodServices {
         Delegator delegator = dctx.getDelegator();
         String organizationPartyId = (String) 
context.get("organizationPartyId"); // input parameters
         String periodTypeId = (String) context.get("periodTypeId");
-        Date findDate = (Date) context.get("findDate");
+        Timestamp findDate = (Timestamp) context.get("findDate");
         Locale locale = (Locale) context.get("locale");
 
         // default findDate to now
         if (findDate == null) {
-            findDate = new Date(UtilDateTime.nowTimestamp().getTime());
+            findDate = UtilDateTime.nowTimestamp();
         }
 
         Timestamp lastClosedDate = null;          // return parameters

Modified: 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy?rev=1744873&r1=1744872&r2=1744873&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy
 (original)
+++ 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy
 Sat May 21 08:33:51 2016
@@ -63,7 +63,7 @@ GenericValue accumAmortizationGlAccountC
 List accumAmortizationAccountClassIds = 
UtilAccounting.getDescendantGlAccountClassIds(accumAmortizationGlAccountClass);
 
 // Find the last closed time period to get the fromDate for the transactions 
in the current period and the ending balances of the last closed period
-Map lastClosedTimePeriodResult = runService('findLastClosedDate', 
["organizationPartyId": 
parameters.get('ApplicationDecorator|organizationPartyId'), "findDate": new 
Date(thruDate.getTime()),"userLogin": userLogin]);
+Map lastClosedTimePeriodResult = runService('findLastClosedDate', 
["organizationPartyId": 
parameters.get('ApplicationDecorator|organizationPartyId'), "findDate": 
thruDate,"userLogin": userLogin]);
 Timestamp fromDate = (Timestamp)lastClosedTimePeriodResult.lastClosedDate;
 if (!fromDate) {
     return;

Modified: 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy?rev=1744873&r1=1744872&r2=1744873&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy
 (original)
+++ 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy
 Sat May 21 08:33:51 2016
@@ -53,7 +53,7 @@ List glAccountClassIds = UtilAccounting.
 List cashFlowBalanceTotalList = [];
 
 // Find the last closed time period to get the fromDate for the transactions 
in the current period and the ending balances of the last closed period 
-Map lastClosedTimePeriodResult = runService('findLastClosedDate', 
["organizationPartyId":parameters.get('ApplicationDecorator|organizationPartyId'),
 "findDate":new Date(parametersFromDate.getTime()),"userLogin":userLogin]);
+Map lastClosedTimePeriodResult = runService('findLastClosedDate', 
["organizationPartyId":parameters.get('ApplicationDecorator|organizationPartyId'),
 "findDate": parametersFromDate,"userLogin":userLogin]);
 Timestamp periodClosingFromDate = 
(Timestamp)lastClosedTimePeriodResult.lastClosedDate;
 if (!periodClosingFromDate) {
     return;

Modified: 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy?rev=1744873&r1=1744872&r2=1744873&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy
 (original)
+++ 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy
 Sat May 21 08:33:51 2016
@@ -41,7 +41,7 @@ if (!glFiscalTypeId) {
 }
 
 // Find the last closed time period to get the fromDate for the transactions 
in the current period and the ending balances of the last closed period
-Map lastClosedTimePeriodResult = runService('findLastClosedDate', 
["organizationPartyId": 
parameters.get('ApplicationDecorator|organizationPartyId'), "findDate": new 
Date(fromDate.getTime()),"userLogin": userLogin]);
+Map lastClosedTimePeriodResult = runService('findLastClosedDate', 
["organizationPartyId": 
parameters.get('ApplicationDecorator|organizationPartyId'), "findDate": 
fromDate,"userLogin": userLogin]);
 Timestamp lastClosedDate = 
(Timestamp)lastClosedTimePeriodResult.lastClosedDate;
 GenericValue lastClosedTimePeriod = null; 
 if (lastClosedDate) {


Reply via email to