Author: apatel
Date: Mon Jul 20 16:47:31 2009 New Revision: 795910 URL: http://svn.apache.org/viewvc?rev=795910&view=rev Log: GL Account Name (to the right of the "GL Account Id" field). Total of Current Fiscal Period (to the right of the "Total Amount" field): this is computed considering all the transactions posted to the account from the beginning of the Fiscal Period to the thruDate set by the user. Added to the search for at the top of the screen an optional "Month" drop down field: it contains all the 12 months of the year; if a value (e.g. January) in this drop down is selected and the from/thru date are left empty then the system will compute the from/thru dates for the report considering the beginning and end of the selected month. Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml 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/config/AccountingUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=795910&r1=795909&r2=795910&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Mon Jul 20 16:47:31 2009 @@ -10256,6 +10256,9 @@ <value xml:lang="fr">Montant total</value> <value xml:lang="it">Importo Totale</value> </property> + <property key="FormFieldTitle_totalOfCurrentFiscalPeriod"> + <value xml:lang="en">Total of Current Fiscal Period</value> + </property> <property key="FormFieldTitle_transCodeEnumId"> <value xml:lang="en">Trans Code Enum Id</value> <value xml:lang="es">Id Enum Código de Trans</value> Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=795910&r1=795909&r2=795910&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Mon Jul 20 16:47:31 2009 @@ -878,6 +878,8 @@ </simple-method> <simple-method method-name="prepareIncomeStatement" short-description="Prepare data for the Income Statement"> + <property-to-field resource="arithmetic" property="ledger.decimals" field="ledgerDecimals"/> + <property-to-field resource="arithmetic" property="ledger.rounding" field="roundingMode"/> <entity-one entity-name="GlAccountClass" value-field="expenseGlAccountClass"> <field-map field-name="glAccountClassId" value="EXPENSE"/> </entity-one> @@ -913,6 +915,19 @@ <order-by field-name="acctgTransId"/> <order-by field-name="acctgTransEntrySeqId"/> </entity-condition> + + <set field="findCustomTimePeriodsMap.findDate" from-field="parameters.fromDate" type="Timestamp"/> + <set field="findCustomTimePeriodsMap.organizationPartyId" from-field="parameters.organizationPartyId"/> + <call-service service-name="findCustomTimePeriods" in-map-name="findCustomTimePeriodsMap"> + <result-to-field result-name="customTimePeriodList"/> + </call-service> + <first-from-list list="customTimePeriodList" entry="customTimePeriod"/> + + <set field="acctgTransEntriesAndTransTotalMap.isPosted" value="Y"/> + <set field="acctgTransEntriesAndTransTotalMap.organizationPartyId" from-field="parameters.organizationPartyId"/> + <set field="acctgTransEntriesAndTransTotalMap.customTimePeriodStartDate" from-field="customTimePeriod.fromDate" type="Timestamp"/> + <set field="acctgTransEntriesAndTransTotalMap.customTimePeriodEndDate" from-field="parameters.thruDate" type="Timestamp"/> + <set field="totalNetIncome" value="0.0" type="BigDecimal"/> <iterate list="acctgTransAndEntries" entry="acctgTransAndEntry"> <get-related-one value-field="acctgTransAndEntry" relation-name="GlAccount" to-value-field="glAccount"/> @@ -974,12 +989,32 @@ <clear-field field="glAccountTotalMap"/> <set field="glAccountTotalMap.glAccountId" from-field="glAccountId"/> <set field="glAccountTotalMap.totalAmount" from-field="totalAmount"/> + <set field="acctgTransEntriesAndTransTotalMap.glAccountId" from-field="glAccountId"/> + <call-service service-name="getAcctgTransEntriesAndTransTotal" in-map-name="acctgTransEntriesAndTransTotalMap"> + <result-to-field result-name="debitTotal"/> + <result-to-field result-name="creditTotal"/> + </call-service> + <set field="totalOfCurrentFiscalPeriod" value="${debitTotal - creditTotal}" type="BigDecimal"/> + <calculate field="totalOfCurrentFiscalPeriod" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}"> + <calcop operator="get" field="totalOfCurrentFiscalPeriod"/> + </calculate> + <set field="glAccountTotalMap.totalOfCurrentFiscalPeriod" from-field="totalOfCurrentFiscalPeriod" type="BigDecimal"/> <set field="glAccountTotalsList[]" from-field="glAccountTotalMap"/> </iterate-map> <iterate-map map="glAccountTotalsExpenseMap" key="glAccountId" value="totalAmount"> <clear-field field="glAccountTotalMap"/> <set field="glAccountTotalMap.glAccountId" from-field="glAccountId"/> <set field="glAccountTotalMap.totalAmount" from-field="totalAmount"/> + <set field="acctgTransEntriesAndTransTotalMap.glAccountId" from-field="glAccountId"/> + <call-service service-name="getAcctgTransEntriesAndTransTotal" in-map-name="acctgTransEntriesAndTransTotalMap"> + <result-to-field result-name="debitTotal"/> + <result-to-field result-name="creditTotal"/> + </call-service> + <set field="totalOfCurrentFiscalPeriod" value="${debitTotal - creditTotal}" type="BigDecimal"/> + <calculate field="totalOfCurrentFiscalPeriod" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}"> + <calcop operator="get" field="totalOfCurrentFiscalPeriod"/> + </calculate> + <set field="glAccountTotalMap.totalOfCurrentFiscalPeriod" from-field="totalOfCurrentFiscalPeriod" type="BigDecimal"/> <set field="glAccountTotalsList[]" from-field="glAccountTotalMap"/> </iterate-map> 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=795910&r1=795909&r2=795910&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 Mon Jul 20 16:47:31 2009 @@ -22,16 +22,33 @@ import org.ofbiz.entity.util.EntityUtil; 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 = new Integer(parameters.selectedMonth); - context.selectedMonth = 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]); @@ -53,4 +70,4 @@ context.financialYearFromDate = customTimePeriodFromDate; } } -} \ No newline at end of file +} Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml?rev=795910&r1=795909&r2=795910&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml Mon Jul 20 16:47:31 2009 @@ -110,11 +110,16 @@ <field name="credit" use-when="showTotals" widget-style="tabletextright"><display description="${parameters.creditTotal}" type="currency" currency="${currencyUomId}"/></field> </form> - <form name="IncomeStatementParameters" type="single" target="prepareIncomeStatement" - header-row-style="header-row" default-table-style="basic-table"> - <field name="organizationPartyId"><hidden/></field> - <field name="fromDate"><date-time/></field> - <field name="thruDate"><date-time/></field> + <form name="IncomeStatementParameters" type="single" header-row-style="header-row" default-table-style="basic-table"> + <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> + <field name="fromDate" required-field="false"><date-time type="timestamp"/></field> + <field name="thruDate" required-field="false"><date-time type="timestamp"/></field> <field name="glFiscalTypeId"> <drop-down> <entity-options entity-name="GlFiscalType" description="${description}"> @@ -122,24 +127,26 @@ </entity-options> </drop-down> </field> - <field name="submitButton" widget-style="smallSubmit" tooltip="Please enter From and Thru date in fields above"><submit button-type="button"/></field> + <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit" tooltip="Please enter From and Thru date in fields above"><submit button-type="button"/></field> </form> <form name="IncomeStatementList" type="list" list-name="glAccountTotalsList" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <row-actions> <entity-one entity-name="GlAccount" value-field="glAccount"> - <field-map field-name="glAccountId"/> + <field-map field-name="glAccountId" from-field="glAccountId"/> </entity-one> </row-actions> <field name="glAccountId" use-when="isPdf != true"> - <hyperlink target="FindAcctgTransEntries" description="[${glAccountId}] [${glAccount.accountCode}] ${glAccount.accountName}"> + <hyperlink target="FindAcctgTransEntries" description="${glAccountId}"> <parameter param-name="glAccountId"/> <parameter param-name="organizationPartyId"/> </hyperlink> </field> - <field name="glAccountId" use-when="isPdf == true"><display description="[${glAccountId}] [${glAccount.accountCode}] ${glAccount.accountName}"/></field> + <field name="glAccountId" use-when="isPdf == true"><display description="${glAccountId}"/></field> + <field name="accountName"><display description="${glAccount.accountName}"/></field> <field name="totalAmount"><display type="currency" currency="${currencyUomId}"/></field> + <field name="totalOfCurrentFiscalPeriod"><display type="currency" currency="${currencyUomId}"/></field> </form> <form name="BalanceSheetParameters" type="single" target="prepareBalanceSheet" @@ -312,20 +319,23 @@ <field name="credit"><display type="currency" currency="${currencyUomId}"/></field> <field name="quot5" title="""><display description="""/></field> </form> - <form name="IncomeStatementListCsv" type="list" list-name="glAccountTotalsList" view-size="99999"> <row-actions> - <entity-one entity-name="GlAccount" value-field="glAccount" auto-field-map="true"/> - <set field="totalAmount" from-field="${totalAmount}"/> + <entity-one entity-name="GlAccount" value-field="glAccount"/> </row-actions> <field name="quot0" title="""><display description="""/></field> - <field name="glAccountId"><display description="[${glAccountId}] [${glAccount.accountCode}] ${glAccount.accountName}"/></field> + <field name="glAccountId"><display description="${glAccountId}"/></field> <field name="quot1" title="""><display description="""/></field> <field name="seprator0" title=","><display description=","/></field> - + <field name="glAccountName"><display description="${glAccount.accountName}"/></field> + <field name="seprator1" title=","><display description=","/></field> <field name="quot2" title="""><display description="""/></field> <field name="totalAmount"><display type="currency" currency="${currencyUomId}"/></field> <field name="quot3" title="""><display description="""/></field> + <field name="seprator2" title=","><display description=","/></field> + <field name="quot4" title="""><display description="""/></field> + <field name="totalOfCurrentFiscalPeriod"><display type="currency" currency="${currencyUomId}"/></field> + <field name="quot5" title="""><display description="""/></field> </form> <form name="BalanceSheetAssetListCsv" type="list" list-name="assetBalancesList" view-size="99999"> @@ -413,8 +423,8 @@ <entity-and entity-name="CustomTimePeriod" list="customTimePeriods"> <field-map field-name="organizationPartyId"/> <field-map field-name="periodTypeId" value="FISCAL_YEAR"/> - <order-by field-name="fromDate"/> </entity-and> + </actions> <field name="organizationPartyId"><hidden/></field> <field name="glAccountId" title="${uiLabelMap.AccountingGlAccountId}"> @@ -475,10 +485,10 @@ <field name="openingBalanceDebit" title="${uiLabelMap.AccountingOpeningBalanceDebit}"> <display description="${openingBalanceDebit}" type="currency" currency="${currencyUomId}"/> </field> - <field name="monthlyBalanceCredit" title="${uiLabelMap.AccountingMonthlyBalanceCredit}"> + <field name="monthAmountCredit"> <display description="${credit}" type="currency" currency="${currencyUomId}"/> </field> - <field name="monthlyBalanceDebit" title="${uiLabelMap.AccountingMonthlyBalanceDebit}"> + <field name="monthAmountDebit"> <display description="${debit}" type="currency" currency="${currencyUomId}"/> </field> <field name="closingBalanceCredit" title="${uiLabelMap.AccountingClosingBalanceCredit}"> @@ -506,4 +516,4 @@ extends="MonthlyPostedTransactionList" extends-resource="component://accounting/widget/ReportFinancialSummaryForms.xml"> <field name="isPosted" field-name="parameters.isPosted"><hidden/></field> </form> -</forms> \ No newline at end of file +</forms> Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml?rev=795910&r1=795909&r2=795910&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml Mon Jul 20 16:47:31 2009 @@ -335,7 +335,7 @@ </service> <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/> <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> - <set field="glAccountTotalsList" from-field="parameters.glAccountTotalsList"/> + <script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy"/> </actions> <widgets> <decorator-screen name="CommonOrganizationAccountingReportsDecorator" location="${parameters.mainDecoratorLocation}"> @@ -352,7 +352,7 @@ </container> <section> <condition> - <not><if-empty field="parameters.totalNetIncome"/></not> + <not><if-empty field="totalNetIncome"/></not> </condition> <widgets> <container style="screenlet"> @@ -365,18 +365,22 @@ <link text="${uiLabelMap.AccountingExportAsCsv}" style="button" target="IncomeStatementListCsv.csv"> <parameter param-name="fromDate" from-field="parameters.fromDate"/> <parameter param-name="thruDate" from-field="parameters.thruDate"/> + <parameter param-name="isIncomeStatement" value="true"/> + <parameter param-name="selectedMonth" from-field="parameters.selectedMonth"/> <parameter param-name="organizationPartyId" from-field="parameters.organizationPartyId"/> <parameter param-name="glFiscalTypeId" from-field="parameters.glFiscalTypeId"/> </link> <link text="${uiLabelMap.AccountingExportAsPdf}" style="button" target="IncomeStatementListPdf.pdf"> <parameter param-name="fromDate" from-field="parameters.fromDate"/> <parameter param-name="thruDate" from-field="parameters.thruDate"/> + <parameter param-name="isIncomeStatement" value="true"/> + <parameter param-name="selectedMonth" from-field="parameters.selectedMonth"/> <parameter param-name="organizationPartyId" from-field="parameters.organizationPartyId"/> <parameter param-name="glFiscalTypeId" from-field="parameters.glFiscalTypeId"/> </link> <include-form name="IncomeStatementList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> <container> - <label style="h3" text="${uiLabelMap.AccountingNetIncome}: ${parameters.totalNetIncome}"/> + <label style="h3" text="${uiLabelMap.AccountingNetIncome}: ${totalNetIncome}"/> </container> </container> </container> @@ -686,15 +690,9 @@ <section> <actions> <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/> - <set field="fromDate" from-field="parameters.fromDate" type="Timestamp"/> - <set field="thruDate" from-field="parameters.thruDate" type="Timestamp"/> <set field="organizationPartyId" from-field="parameters.organizationPartyId"/> - <set field="glFiscalTypeId" from-field="parameters.glFiscalTypeId"/> - - <service service-name="prepareIncomeStatement" result-map="result" auto-field-map="true"/> - <set field="glAccountTotalsList" from-field="result.glAccountTotalsList"/> - <set field="totalNetIncome" from-field="result.totalNetIncome"/> <set field="isPdf" value="true" type="Boolean"/> + <script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy"/> </actions> <widgets> <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml"> @@ -713,14 +711,8 @@ <section> <actions> <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/> - <set field="fromDate" from-field="parameters.fromDate" type="Timestamp"/> - <set field="thruDate" from-field="parameters.thruDate" type="Timestamp"/> <set field="organizationPartyId" from-field="parameters.organizationPartyId"/> - <set field="glFiscalTypeId" from-field="parameters.glFiscalTypeId"/> - - <service service-name="prepareIncomeStatement" result-map="result" auto-field-map="true"/> - <set field="glAccountTotalsList" from-field="result.glAccountTotalsList"/> - <set field="totalNetIncome" from-field="result.totalNetIncome"/> + <script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy"/> </actions> <widgets> <include-form name="IncomeStatementListCsv" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> |
Free forum by Nabble | Edit this page |