Author: apatel
Date: Tue Jul 21 09:54:20 2009 New Revision: 796224 URL: http://svn.apache.org/viewvc?rev=796224&view=rev Log: Code cleanup. No functional change. Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy?rev=796224&r1=796223&r2=796224&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy Tue Jul 21 09:54:20 2009 @@ -23,51 +23,53 @@ import org.ofbiz.service.calendar.ExpressionUiHelper; -context.monthList = ExpressionUiHelper.getMonthValueList(locale); -context.month = (ExpressionUiHelper.getMonthValueList(locale)).get(UtilDateTime.getMonth(UtilDateTime.nowTimestamp(), timeZone, locale)); -if (organizationPartyId && parameters.selectedMonth) { - - selectedMonth = Integer.valueOf(parameters.selectedMonth); - selectedMonthDate = UtilDateTime.toTimestamp((selectedMonth + 1), 1, UtilDateTime.getYear(UtilDateTime.nowTimestamp(), timeZone, locale), 0, 0, 0); - - selectedMonthStartDate = UtilDateTime.getMonthStart(selectedMonthDate, timeZone, locale); - selectedMonthEndDate = UtilDateTime.getMonthEnd(selectedMonthDate, timeZone, locale); - if (parameters.isIncomeStatement) { - Timestamp incomeStatementFromDate = null; - Timestamp incomeStatementThruDate = null; - if (parameters.fromDate && parameters.thruDate) { - incomeStatementFromDate = Timestamp.valueOf(parameters.fromDate); - incomeStatementThruDate = Timestamp.valueOf(parameters.thruDate); - } else { - incomeStatementFromDate = selectedMonthStartDate; - incomeStatementThruDate = selectedMonthEndDate; - } - prepareIncomeStatement = dispatcher.runSync("prepareIncomeStatement", - [fromDate : incomeStatementFromDate, thruDate : incomeStatementThruDate, organizationPartyId : organizationPartyId, glFiscalTypeId : parameters.glFiscalTypeId, userLogin : userLogin]); - if (prepareIncomeStatement) { - context.glAccountTotalsList = prepareIncomeStatement.glAccountTotalsList; - context.totalNetIncome = prepareIncomeStatement.totalNetIncome; - } - } - onlyIncludePeriodTypeIdList = []; - onlyIncludePeriodTypeIdList.add("FISCAL_YEAR"); - customTimePeriodResult = dispatcher.runSync("findCustomTimePeriods", [findDate : selectedMonthDate, organizationPartyId : organizationPartyId, onlyIncludePeriodTypeIdList : onlyIncludePeriodTypeIdList, userLogin : userLogin]); - - if (customTimePeriodResult) { - customTimePeriod = EntityUtil.getFirst(customTimePeriodResult.customTimePeriodList); - if (customTimePeriod) { - fromDate = new Timestamp((customTimePeriod.fromDate).getTime()); - thruDate = new Timestamp((customTimePeriod.thruDate).getTime()); - customTimePeriodFromDate = new Timestamp((customTimePeriod.fromDate).getTime()); - if (selectedMonthStartDate.compareTo(fromDate) > 0) { - fromDate = selectedMonthStartDate; - } - if (selectedMonthEndDate.compareTo(thruDate) < 0) { - thruDate = selectedMonthEndDate; - } - context.monthlyTrialBalanceFromDate = fromDate; - context.monthlyTrialBalanceThruDate = thruDate; - context.financialYearFromDate = customTimePeriodFromDate; - } - } +fromDate=null; +thruDate=null; + +if (parameters.fromDate && parameters.thruDate) { + fromDate = Timestamp.valueOf(parameters.fromDate); + thruDate = Timestamp.valueOf(parameters.thruDate); +} else if (parameters.selectedMonth) { + selectedMonth = Integer.valueOf(parameters.selectedMonth); + selectedMonthDate = UtilDateTime.toTimestamp((selectedMonth + 1), 1, UtilDateTime.getYear(UtilDateTime.nowTimestamp(), timeZone, locale), 0, 0, 0); + fromDate = UtilDateTime.getMonthStart(selectedMonthDate, timeZone, locale); + thruDate = UtilDateTime.getMonthEnd(selectedMonthDate, timeZone, locale); +} else { + context.selectedMonth = UtilDateTime.getMonth(UtilDateTime.nowTimestamp(), timeZone, locale); +} + +if(fromDate && thruDate && organizationPartyId) { + + onlyIncludePeriodTypeIdList = []; + onlyIncludePeriodTypeIdList.add("FISCAL_YEAR"); + customTimePeriodResult = dispatcher.runSync("findCustomTimePeriods", [findDate : thruDate, organizationPartyId : organizationPartyId, onlyIncludePeriodTypeIdList : onlyIncludePeriodTypeIdList, userLogin : userLogin]); + + if (customTimePeriodResult) { + customTimePeriod = EntityUtil.getFirst(customTimePeriodResult.customTimePeriodList); + if (customTimePeriod) { + customTimePeriodFromDate = new Timestamp((customTimePeriod.fromDate).getTime()); + customTimePeriodThruDate = new Timestamp((customTimePeriod.thruDate).getTime()); + + if (customTimePeriodFromDate.compareTo(fromDate) > 0) { + + fromDate = customTimePeriodFromDate; + } + if (customTimePeriodThruDate.compareTo(thruDate) < 0) { + thruDate = customTimePeriodThruDate; + } + context.financialYearFromDate = customTimePeriodFromDate; + } + } + + + if (parameters.isIncomeStatement) { + prepareIncomeStatement = dispatcher.runSync("prepareIncomeStatement", + [fromDate : fromDate, thruDate : thruDate, organizationPartyId : organizationPartyId, glFiscalTypeId : parameters.glFiscalTypeId, userLogin : userLogin]); + context.glAccountTotalsList = prepareIncomeStatement.glAccountTotalsList; + context.totalNetIncome = prepareIncomeStatement.totalNetIncome; + } } + +context.fromDate = fromDate; +context.thruDate = thruDate; +context.monthList = ExpressionUiHelper.getMonthValueList(locale); Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml?rev=796224&r1=796223&r2=796224&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml Tue Jul 21 09:54:20 2009 @@ -114,7 +114,6 @@ <field name="isIncomeStatement"><hidden value="true"/></field> <field name="selectedMonth" title="${uiLabelMap.CommonMonth}"> <drop-down> - <option key="${month.value}" description="${month.description}"/> <list-options list-name="monthList" key-name="value" description="${description}"/> </drop-down> </field> Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml?rev=796224&r1=796223&r2=796224&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml Tue Jul 21 09:54:20 2009 @@ -914,8 +914,6 @@ <set field="tabButtonItem2" value="MonthlyTrialBalance"/> <set field="organizationPartyId" from-field="parameters.organizationPartyId" type="String"/> <script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy"/> - <set field="fromDate" from-field="monthlyTrialBalanceFromDate" type="Timestamp"/> - <set field="thruDate" from-field="monthlyTrialBalanceThruDate" type="Timestamp"/> <set field="financialYearFromDate" from-field="financialYearFromDate" type="Timestamp"/> <script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy"/> </actions> |
Free forum by Nabble | Edit this page |