Author: arunpatidar
Date: Fri Jul 1 13:28:42 2016 New Revision: 1750925 URL: http://svn.apache.org/viewvc?rev=1750925&view=rev Log: Applied patch from jira issue - OFBIZ-7514 - Income Statement PDF export fails. Thanks Rohit Koushal for your contribution. Modified: ofbiz/trunk/applications/accounting/groovyScripts/reports/IncomeStatement.groovy ofbiz/trunk/specialpurpose/birt/groovyScripts/accounting/IncomeStatementParameters.groovy ofbiz/trunk/specialpurpose/birt/webapp/accounting/reports/IncomeStatement.rptdesign Modified: ofbiz/trunk/applications/accounting/groovyScripts/reports/IncomeStatement.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/groovyScripts/reports/IncomeStatement.groovy?rev=1750925&r1=1750924&r2=1750925&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/groovyScripts/reports/IncomeStatement.groovy (original) +++ ofbiz/trunk/applications/accounting/groovyScripts/reports/IncomeStatement.groovy Fri Jul 1 13:28:42 2016 @@ -34,10 +34,16 @@ if (!thruDate) { if (!glFiscalTypeId) { return; } +organizationPartyId =null +if(context.organizationPartyId) { + organizationPartyId = context.organizationPartyId; +} else { + organizationPartyId = parameters.get('ApplicationDecorator|organizationPartyId') +} // Setup the divisions for which the report is executed -List partyIds = PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, parameters.get('ApplicationDecorator|organizationPartyId'), 'GROUP_ROLLUP'); -partyIds.add(parameters.get('ApplicationDecorator|organizationPartyId')); +List partyIds = PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP'); +partyIds.add(organizationPartyId); // Get the group of account classes that will be used to position accounts in the proper section of the financial statement GenericValue revenueGlAccountClass = from("GlAccountClass").where("glAccountClassId", "REVENUE").cache(true).queryOne(); Modified: ofbiz/trunk/specialpurpose/birt/groovyScripts/accounting/IncomeStatementParameters.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/birt/groovyScripts/accounting/IncomeStatementParameters.groovy?rev=1750925&r1=1750924&r2=1750925&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/birt/groovyScripts/accounting/IncomeStatementParameters.groovy (original) +++ ofbiz/trunk/specialpurpose/birt/groovyScripts/accounting/IncomeStatementParameters.groovy Fri Jul 1 13:28:42 2016 @@ -17,6 +17,9 @@ * under the License. */ +import java.sql.Timestamp; +import org.ofbiz.base.util.Debug; + def module = "IncomeStatementParameters.groovy"; try { Modified: ofbiz/trunk/specialpurpose/birt/webapp/accounting/reports/IncomeStatement.rptdesign URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/birt/webapp/accounting/reports/IncomeStatement.rptdesign?rev=1750925&r1=1750924&r2=1750925&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/birt/webapp/accounting/reports/IncomeStatement.rptdesign (original) +++ ofbiz/trunk/specialpurpose/birt/webapp/accounting/reports/IncomeStatement.rptdesign Fri Jul 1 13:28:42 2016 @@ -23,6 +23,7 @@ under the License. <method name="initialize"><![CDATA[ importPackage(Packages.org.ofbiz.base.util) importPackage(Packages.org.ofbiz.entity.util) +importPackage(Packages.java.util) module = "IncomeStatement.rptdesign"; dateFormatter = new java.text.SimpleDateFormat("dd MMMMM yyyy"); @@ -54,13 +55,13 @@ if (params["fromDate"].value) { fromDate = params["fromDate"].value; } -if (!params["thruDate"].value) { +if (params["thruDate"].value) { thruDate = params["thruDate"].value; } else { thruDate = UtilDateTime.nowTimestamp(); } -if (!params["glFiscalTypeId"].value) { +if (params["glFiscalTypeId"].value) { glFiscalTypeId = params["glFiscalTypeId"].value; } else { glFiscalTypeId = "ACTUAL"; @@ -68,6 +69,7 @@ if (!params["glFiscalTypeId"].value) { // call IncomeStatement.groovy script context = new HashMap(); +context.put("parameters", new HashMap()); context.put("organizationPartyId", organizationPartyId); context.put("fromDate", fromDate); context.put("thruDate", thruDate); @@ -75,7 +77,7 @@ context.put("glFiscalTypeId", glFiscalTy context.put("delegator", delegator); context.put("dispatcher", dispatcher); context.put("userLogin", userLogin); -GroovyUtil.runScriptAtLocation("component://accounting/groovyScripts/reports/IncomeStatement.groovy", context); +GroovyUtil.runScriptAtLocation("component://accounting/groovyScripts/reports/IncomeStatement.groovy", null, context); // prepare data source lists revenueAccountBalanceList = context.get("revenueAccountBalanceList"); |
Free forum by Nabble | Edit this page |