|
Author: jacopoc
Date: Tue Dec 1 10:07:09 2009 New Revision: 885712 URL: http://svn.apache.org/viewvc?rev=885712&view=rev Log: Completely reimplemented the "Transaction Totals" financial report because the existing one had a series of issues: 1) the bottom list was missing the last record 2) the grand totals were not computed 3) a bad selection strategy was a problem with big record sets 4) the code in general was messed up 5) improved the layout of the PDF export 6) meaningful default from and thru dates are pre set 7) misc enhancements Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=885712&r1=885711&r2=885712&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Tue Dec 1 10:07:09 2009 @@ -1834,27 +1834,28 @@ <key-map field-name="glJournalId"/> </relation> </view-entity> - <view-entity entity-name="AcctgTransEntryProdSums" + <view-entity entity-name="AcctgTransEntrySums" package-name="org.ofbiz.accounting.ledger" - title="Sum of AcctgTransEntry entity amounts, grouped by glAccountId, productId, debitCreditFlag"> + title="Sum of AcctgTransEntry entity amounts grouped by glAccountId, debitCreditFlag"> <member-entity entity-alias="ATE" entity-name="AcctgTransEntry"/> <member-entity entity-alias="ACT" entity-name="AcctgTrans"/> <member-entity entity-alias="GLA" entity-name="GlAccount"/> - <alias entity-alias="ATE" name="organizationPartyId" group-by="true"/> - <alias entity-alias="ATE" name="productId" group-by="true"/> + <alias entity-alias="ATE" name="glAccountId" group-by="true"/> + <alias entity-alias="GLA" name="glAccountTypeId" group-by="true"/> + <alias entity-alias="GLA" name="accountName" group-by="true"/> + <alias entity-alias="GLA" name="accountCode" group-by="true"/> + <alias entity-alias="ACT" name="glFiscalTypeId" group-by="true"/> <alias entity-alias="ATE" name="debitCreditFlag" group-by="true"/> <alias entity-alias="ATE" name="amount" function="sum"/> - <alias entity-alias="ATE" name="glAccountId" group-by="false"/> - <alias entity-alias="GLA" name="glAccountTypeId" group-by="true"/> <!-- so we can select by type of account --> - <alias entity-alias="ACT" name="isPosted" group-by="false"/> <!-- so we can select by posted status --> - <alias entity-alias="ACT" name="glFiscalTypeId" group-by="true"/> + <alias entity-alias="ATE" name="organizationPartyId" group-by="false"/> + <alias entity-alias="ACT" name="isPosted" group-by="false"/> <alias entity-alias="ACT" name="transactionDate" group-by="false"/> <!-- so we can select the sum by date --> - <view-link entity-alias="ATE" rel-entity-alias="GLA"> - <key-map field-name="glAccountId"/> - </view-link> <view-link entity-alias="ATE" rel-entity-alias="ACT"> <key-map field-name="acctgTransId"/> </view-link> + <view-link entity-alias="ATE" rel-entity-alias="GLA"> + <key-map field-name="glAccountId"/> + </view-link> </view-entity> <entity entity-name="AcctgTransEntryType" package-name="org.ofbiz.accounting.ledger" 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=885712&r1=885711&r2=885712&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 Tue Dec 1 10:07:09 2009 @@ -18,141 +18,192 @@ */ import org.ofbiz.base.util.UtilDateTime; +import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilNumber; import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.condition.EntityConditionList; import org.ofbiz.entity.condition.EntityOperator; -import org.ofbiz.entity.Delegator; import org.ofbiz.entity.util.EntityUtil; import javolution.util.FastList; import javolution.util.FastMap; -debitTotal = BigDecimal.ZERO; -creditTotal = BigDecimal.ZERO; -openingBalanceCredit = BigDecimal.ZERO; -openingBalanceDebit = BigDecimal.ZERO; - -decimals = UtilNumber.getBigDecimalScale("ledger.decimals"); -rounding = UtilNumber.getBigDecimalRoundingMode("ledger.rounding"); -exprs = [EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)]; -if (fromDate) { - exprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); -} else return; - +if (!fromDate) { + return; +} if (!thruDate) { thruDate = UtilDateTime.nowTimestamp(); } -exprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); -exprList = FastList.newInstance(); -orExprs = new ArrayList(); -orExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y")); -orExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "N")); -orCond = EntityCondition.makeCondition(orExprs, EntityOperator.OR); - -exprList.add(orCond); -exprList.addAll(exprs); - -fieldsToSelect = ["glAccountId", "debitCreditFlag", "totalAmount", "isPosted"] as Set; -orderBy = ["glAccountId"]; - -postedTransTotalList = FastList.newInstance(); -unpostedTransTotalList = FastList.newInstance(); -postedAndUnpostedTransTotalList = FastList.newInstance(); -tempValueMap = [:]; -tempValueMap.isPosted = ""; -tempValueMap.glAccountId = "000"; -tempValueMap.debitCreditFlag = "X"; -tempValueMap.totalAmount = 0.00; - -allTrans = delegator.findList("GlAccOrgAndAcctgTransAndEntry", EntityCondition.makeCondition(exprList, EntityOperator.AND), fieldsToSelect, orderBy, null, false); -if (allTrans) { - //PostedTransaction Section - allPostedTrans = EntityUtil.filterByCondition(allTrans, EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y")); - if (allPostedTrans) - getPostedTrans(0, (allPostedTrans.get(0)).glAccountId); - - //UnPostedTransaction Section - allUnPostedTrans = EntityUtil.filterByCondition(allTrans, EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "N")); - if (allUnPostedTrans) - getUnpostedTrans(0, (allUnPostedTrans.get(0)).glAccountId); - - //PostedAndUnPostedTransaction Section - getPostedAndUnpostedTrans(0, (allTrans.get(0)).glAccountId); -} - -private void addTransToList(List transectionList, String prevGlAccountId, Map value) { - if (!prevGlAccountId.equals(value.glAccountId)) { - if (parameters.selectedMonth){ - resultMap = dispatcher.runSync("calculateGlAccountTrialBalance", - [fromDate : financialYearFromDate, thruDate : fromDate , glAccountId : prevGlAccountId, isPosted : value.isPosted, userLogin : userLogin]); - - openingBalanceCredit = resultMap.openingBalanceCredit; - openingBalanceDebit = resultMap.openingBalanceDebit; +// POSTED +// Posted transactions totals and grand totals +postedTotals = []; +postedTotalDebit = BigDecimal.ZERO; +postedTotalCredit = BigDecimal.ZERO; +andExprs = FastList.newInstance(); +andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); +andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y")); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); +andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); +List postedTransactionTotals = delegator.findList("AcctgTransEntrySums", andCond, UtilMisc.toSet("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount"), UtilMisc.toList("glAccountId"), null, false); +if (postedTransactionTotals) { + Map postedTransactionTotalsMap = [:] + postedTransactionTotals.each { postedTransactionTotal -> + Map accountMap = (Map)postedTransactionTotalsMap.get(postedTransactionTotal.glAccountId); + if (!accountMap) { + accountMap = UtilMisc.makeMapWritable(postedTransactionTotal); + accountMap.put("D", BigDecimal.ZERO); + accountMap.put("C", BigDecimal.ZERO); + } + UtilMisc.addToBigDecimalInMap(accountMap, postedTransactionTotal.debitCreditFlag, postedTransactionTotal.amount); + postedTransactionTotalsMap.put(postedTransactionTotal.glAccountId, accountMap); + } + postedTotals = postedTransactionTotalsMap.values().asList(); +} +// Posted grand total for Debits +andExprs = FastList.newInstance(); +andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); +andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y")); +andExprs.add(EntityCondition.makeCondition("debitCreditFlag", EntityOperator.EQUALS, "D")); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); +andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); +List postedDebitTransactionTotals = delegator.findList("AcctgTransEntrySums", andCond, UtilMisc.toSet("amount"), null, null, false); +if (postedDebitTransactionTotals) { + postedDebitTransactionTotal = EntityUtil.getFirst(postedDebitTransactionTotals); + if (postedDebitTransactionTotal && postedDebitTransactionTotal.amount) { + postedTotalDebit = postedDebitTransactionTotal.amount; + } +} +// Posted grand total for Credits +andExprs = FastList.newInstance(); +andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); +andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y")); +andExprs.add(EntityCondition.makeCondition("debitCreditFlag", EntityOperator.EQUALS, "C")); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); +andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); +List postedCreditTransactionTotals = delegator.findList("AcctgTransEntrySums", andCond, UtilMisc.toSet("amount"), null, null, false); +if (postedCreditTransactionTotals) { + postedCreditTransactionTotal = EntityUtil.getFirst(postedCreditTransactionTotals); + if (postedCreditTransactionTotal && postedCreditTransactionTotal.amount) { + postedTotalCredit = postedCreditTransactionTotal.amount; + } +} +postedTotals.add(["D":postedTotalDebit, "C":postedTotalCredit]); +context.postedTransactionTotals = postedTotals; + +// UNPOSTED +// Unposted transactions totals and grand totals +unpostedTotals = []; +unpostedTotalDebit = BigDecimal.ZERO; +unpostedTotalCredit = BigDecimal.ZERO; +andExprs = FastList.newInstance(); +andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); +andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "N")); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); +andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); +List unpostedTransactionTotals = delegator.findList("AcctgTransEntrySums", andCond, UtilMisc.toSet("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount"), UtilMisc.toList("glAccountId"), null, false); +if (unpostedTransactionTotals) { + Map unpostedTransactionTotalsMap = [:] + unpostedTransactionTotals.each { unpostedTransactionTotal -> + Map accountMap = (Map)unpostedTransactionTotalsMap.get(unpostedTransactionTotal.glAccountId); + if (!accountMap) { + accountMap = UtilMisc.makeMapWritable(unpostedTransactionTotal); + accountMap.put("D", BigDecimal.ZERO); + accountMap.put("C", BigDecimal.ZERO); + } + UtilMisc.addToBigDecimalInMap(accountMap, unpostedTransactionTotal.debitCreditFlag, unpostedTransactionTotal.amount); + unpostedTransactionTotalsMap.put(unpostedTransactionTotal.glAccountId, accountMap); + } + unpostedTotals = unpostedTransactionTotalsMap.values().asList(); +} +// Unposted grand total for Debits +andExprs = FastList.newInstance(); +andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); +andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "N")); +andExprs.add(EntityCondition.makeCondition("debitCreditFlag", EntityOperator.EQUALS, "D")); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); +andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); +List unpostedDebitTransactionTotals = delegator.findList("AcctgTransEntrySums", andCond, UtilMisc.toSet("amount"), null, null, false); +if (unpostedDebitTransactionTotals) { + unpostedDebitTransactionTotal = EntityUtil.getFirst(unpostedDebitTransactionTotals); + if (unpostedDebitTransactionTotal && unpostedDebitTransactionTotal.amount) { + unpostedTotalDebit = unpostedDebitTransactionTotal.amount; + } +} +// Unposted grand total for Credits +andExprs = FastList.newInstance(); +andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); +andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "N")); +andExprs.add(EntityCondition.makeCondition("debitCreditFlag", EntityOperator.EQUALS, "C")); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); +andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); +List unpostedCreditTransactionTotals = delegator.findList("AcctgTransEntrySums", andCond, UtilMisc.toSet("amount"), null, null, false); +if (unpostedCreditTransactionTotals) { + unpostedCreditTransactionTotal = EntityUtil.getFirst(unpostedCreditTransactionTotals); + if (unpostedCreditTransactionTotal && unpostedCreditTransactionTotal.amount) { + unpostedTotalCredit = unpostedCreditTransactionTotal.amount; + } +} +unpostedTotals.add(["D":unpostedTotalDebit, "C":unpostedTotalCredit]); +context.unpostedTransactionTotals = unpostedTotals; + +// POSTED AND UNPOSTED +// Posted and unposted transactions totals and grand totals +allTotals = []; +allTotalDebit = BigDecimal.ZERO; +allTotalCredit = BigDecimal.ZERO; +andExprs = FastList.newInstance(); +andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); +andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); +List allTransactionTotals = delegator.findList("AcctgTransEntrySums", andCond, UtilMisc.toSet("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount"), UtilMisc.toList("glAccountId"), null, false); +if (allTransactionTotals) { + Map allTransactionTotalsMap = [:] + allTransactionTotals.each { allTransactionTotal -> + Map accountMap = (Map)allTransactionTotalsMap.get(allTransactionTotal.glAccountId); + if (!accountMap) { + accountMap = UtilMisc.makeMapWritable(allTransactionTotal); + accountMap.put("D", BigDecimal.ZERO); + accountMap.put("C", BigDecimal.ZERO); } - postedAndUnpostedMap = FastMap.newInstance(); - postedAndUnpostedMap.glAccountId = prevGlAccountId; - postedAndUnpostedMap.credit = creditTotal.setScale(decimals, rounding); - postedAndUnpostedMap.debit = debitTotal.setScale(decimals, rounding); - postedAndUnpostedMap.openingBalanceCredit = openingBalanceCredit.setScale(decimals, rounding); - postedAndUnpostedMap.openingBalanceDebit = openingBalanceDebit.setScale(decimals, rounding); - transectionList.add(postedAndUnpostedMap); - debitTotal = BigDecimal.ZERO; - creditTotal = BigDecimal.ZERO; - } - if ("C".equals(value.debitCreditFlag)) - creditTotal += value.getBigDecimal("totalAmount"); - if ("D".equals(value.debitCreditFlag)) - debitTotal += value.getBigDecimal("totalAmount"); -} - -private void getPostedTrans(int index, String prevGlAccountId) { - if (index < allPostedTrans.size()) - value = allPostedTrans.get(index); - else { - tempValueMap.isPosted = "Y"; - value = tempValueMap; - } - if("Y".equals(value.isPosted)) { - addTransToList(postedTransTotalList, prevGlAccountId, value); - } - if (index < allPostedTrans.size()) { - index++; - getPostedTrans(index, value.glAccountId); - } - else return; -} - -private void getUnpostedTrans(int index, String prevGlAccountId) { - if (index != allUnPostedTrans.size()) - value = allUnPostedTrans.get(index); - else { - tempValueMap.isPosted = "N"; - value = tempValueMap; - } - - if("N".equals(value.isPosted)) { - addTransToList(unpostedTransTotalList, prevGlAccountId, value); - } - if (index < allUnPostedTrans.size()) { - index++; - getUnpostedTrans(index, value.glAccountId); - } - else return; -} - -private void getPostedAndUnpostedTrans(int index, String prevGlAccountId) { - if (index != allTrans.size()) - value = allTrans.get(index); - value.isPosted = ""; - addTransToList(postedAndUnpostedTransTotalList, prevGlAccountId, value); - if (index < allTrans.size()) { - index++; - getPostedAndUnpostedTrans(index, value.glAccountId); - } - else return; -} -context.postedTransTotalList = postedTransTotalList; -context.unpostedTransTotalList = unpostedTransTotalList; -context.postedAndUnpostedTransTotalList = postedAndUnpostedTransTotalList; \ No newline at end of file + UtilMisc.addToBigDecimalInMap(accountMap, allTransactionTotal.debitCreditFlag, allTransactionTotal.amount); + allTransactionTotalsMap.put(allTransactionTotal.glAccountId, accountMap); + } + allTotals = allTransactionTotalsMap.values().asList(); +} +// Posted and unposted grand total for Debits +andExprs = FastList.newInstance(); +andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); +andExprs.add(EntityCondition.makeCondition("debitCreditFlag", EntityOperator.EQUALS, "D")); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); +andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); +List allDebitTransactionTotals = delegator.findList("AcctgTransEntrySums", andCond, UtilMisc.toSet("amount"), null, null, false); +if (allDebitTransactionTotals) { + allDebitTransactionTotal = EntityUtil.getFirst(allDebitTransactionTotals); + if (allDebitTransactionTotal && allDebitTransactionTotal.amount) { + allTotalDebit = allDebitTransactionTotal.amount; + } +} +// Posted and unposted grand total for Credits +andExprs = FastList.newInstance(); +andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); +andExprs.add(EntityCondition.makeCondition("debitCreditFlag", EntityOperator.EQUALS, "C")); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); +andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); +andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); +List allCreditTransactionTotals = delegator.findList("AcctgTransEntrySums", andCond, UtilMisc.toSet("amount"), null, null, false); +if (allCreditTransactionTotals) { + allCreditTransactionTotal = EntityUtil.getFirst(allCreditTransactionTotals); + if (allCreditTransactionTotal && allCreditTransactionTotal.amount) { + allTotalCredit = allCreditTransactionTotal.amount; + } +} +allTotals.add(["D":allTotalDebit, "C":allTotalCredit]); +context.allTransactionTotals = allTotals; Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml?rev=885712&r1=885711&r2=885712&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml Tue Dec 1 10:07:09 2009 @@ -227,60 +227,38 @@ <field name="thruDate"><date-time/></field> <field name="submitButton" widget-style="smallSubmit"><submit button-type="button"/></field> </form> - <form name="PostedTransactionTotalList" type="list" list-name="postedTransTotalList" + <form name="PostedTransactionTotalList" type="list" list-name="postedTransactionTotals" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <field name="glAccountId"> <hyperlink target="GlAccountNavigate" description="${glAccountId}"> <parameter param-name="glAccountId"/> </hyperlink> </field> - <field name="accountName" entry-name="glAccountId"><display-entity entity-name="GlAccount" key-field-name="glAccountId" description="${accountName}"/></field> - <field name="debit"><display type="currency" currency="${currencyUomId}"/></field> - <field name="credit"><display type="currency" currency="${currencyUomId}"/></field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="D" title="${uiLabelMap.AccountingDebitFlag}" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + <field name="C" title="${uiLabelMap.AccountingCreditFlag}" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> </form> - - <form name="UnpostedTransactionTotalList" type="list" list-name="unpostedTransTotalList" + <form name="UnpostedTransactionTotalList" type="list" list-name="unpostedTransactionTotals" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <field name="glAccountId"> <hyperlink target="GlAccountNavigate" description="${glAccountId}"> <parameter param-name="glAccountId"/> </hyperlink> </field> - <field name="accountName" entry-name="glAccountId"><display-entity entity-name="GlAccount" key-field-name="glAccountId" description="${accountName}"/></field> - <field name="debit"><display type="currency" currency="${currencyUomId}"/></field> - <field name="credit"><display type="currency" currency="${currencyUomId}"/></field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="D" title="${uiLabelMap.AccountingDebitFlag}" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + <field name="C" title="${uiLabelMap.AccountingCreditFlag}" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> </form> - <form name="PostedAndUnpostedTransactionTotalList" type="list" list-name="postedAndUnpostedTransTotalList" + <form name="PostedAndUnpostedTransactionTotalList" type="list" list-name="allTransactionTotals" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <field name="glAccountId"> <hyperlink target="GlAccountNavigate" description="${glAccountId}"> <parameter param-name="glAccountId"/> </hyperlink> </field> - <field name="accountName" entry-name="glAccountId"><display-entity entity-name="GlAccount" key-field-name="glAccountId" description="${accountName}"/></field> - <field name="debit"><display type="currency" currency="${currencyUomId}"/></field> - <field name="credit"><display type="currency" currency="${currencyUomId}"/></field> - </form> - - <form name="PostedTransactionTotalListCsv" type="list" list-name="postedTransTotalList" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> - <field name="glAccountId"><display/></field> - <field name="accountName" entry-name="glAccountId"><display-entity entity-name="GlAccount" key-field-name="glAccountId" description="${accountName}"/></field> - <field name="debit"><display type="currency" currency="${currencyUomId}"/></field> - <field name="credit"><display type="currency" currency="${currencyUomId}"/></field> - </form> - - <form name="UnpostedTransactionTotalListCsv" type="list" list-name="unpostedTransTotalList" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> - <field name="glAccountId"><display/></field> - <field name="accountName" entry-name="glAccountId"><display-entity entity-name="GlAccount" key-field-name="glAccountId" description="${accountName}"/></field> - <field name="debit"><display type="currency" currency="${currencyUomId}"/></field> - <field name="credit"><display type="currency" currency="${currencyUomId}"/></field> - </form> - - <form name="PostedAndUnpostedTransactionTotalListCsv" type="list" list-name="postedAndUnpostedTransTotalList" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> - <field name="glAccountId"><display/></field> - <field name="accountName" entry-name="glAccountId"><display-entity entity-name="GlAccount" key-field-name="glAccountId" description="${accountName}"/></field> - <field name="debit"><display type="currency" currency="${currencyUomId}"/></field> - <field name="credit"><display type="currency" currency="${currencyUomId}"/></field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="D" title="${uiLabelMap.AccountingDebitFlag}" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + <field name="C" title="${uiLabelMap.AccountingCreditFlag}" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> </form> <form name="IncomeStatementListCsv" type="list" list-name="glAccountIncomeList" view-size="99999"> Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml?rev=885712&r1=885711&r2=885712&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml Tue Dec 1 10:07:09 2009 @@ -437,7 +437,6 @@ </section> </screen> - <!-- TODO: this is just a placeholder: the report is not still implemented --> <screen name="TransactionTotals"> <section> <actions> @@ -451,8 +450,72 @@ <service service-name="getPartyAccountingPreferences" result-map="result" auto-field-map="true"/> <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/> <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> - <set field="fromDate" from-field="parameters.fromDate" type="Timestamp"/> - <set field="thruDate" from-field="parameters.thruDate" type="Timestamp"/> + <!-- Get a default fromDate --> + <set field="findLastClosedDateInMap.organizationPartyId" from-field="organizationPartyId"/> + <service service-name="findLastClosedDate" in-map-name="findLastClosedDateInMap"> + <result-to-field result-name="lastClosedDate"/> + <result-to-field result-name="lastClosedTimePeriod"/> + </service> + <set field="fromDate" from-field="parameters.fromDate" type="Timestamp" default-value="${lastClosedDate}"/> + <set field="thruDate" from-field="parameters.thruDate" type="Timestamp" default-value="${nowTimestamp}"/> + <script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy"/> + </actions> + <widgets> + <decorator-screen name="CommonOrganizationAccountingReportsDecorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <screenlet title="${uiLabelMap.AccountingTransactionTotals}"> + <include-form name="FindTransactionTotals" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> + </screenlet> + <section> + <condition> + <and> + <not><if-empty field="fromDate"/></not> + <not><if-empty field="thruDate"/></not> + <not><if-empty field="organizationPartyId"/></not> + </and> + </condition> + <widgets> + <link text="${uiLabelMap.AccountingExportAsCsv}" style="button" target="TransactionTotalsCsv.csv"> + <parameter param-name="fromDate"/> + <parameter param-name="thruDate"/> + <parameter param-name="organizationPartyId"/> + </link> + <link text="${uiLabelMap.AccountingExportAsPdf}" style="button" target="TransactionTotalsPdf.pdf"> + <parameter param-name="fromDate"/> + <parameter param-name="thruDate"/> + <parameter param-name="organizationPartyId"/> + </link> + <screenlet title="${uiLabelMap.AccountingPostedTransactionTotals}"> + <include-form name="PostedTransactionTotalList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> + </screenlet> + <screenlet title="${uiLabelMap.AccountingUnPostedTransactionTotals}"> + <include-form name="UnpostedTransactionTotalList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> + </screenlet> + <screenlet title="${uiLabelMap.AccountingPostedAndUnpostedTransactionTotals}"> + <include-form name="PostedAndUnpostedTransactionTotalList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> + </screenlet> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="TransactionTotalsOrig"> + <section> + <actions> + <set field="titleProperty" value="AccountingTransactionTotals"/> + <set field="labelTitleProperty" value="AccountingTransactionTotals"/> + <set field="tabButtonItem" value="OrganizationAccountingReports"/> + <set field="tabButtonItem2" value="TransactionTotals"/> + <set field="organizationPartyId" from-field="parameters.organizationPartyId"/> + <set field="partyIds" value="${groovy:org.ofbiz.party.party.PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP')}" type="List"/> + <set field="partyIds[]" from-field="organizationPartyId"/> + <service service-name="getPartyAccountingPreferences" result-map="result" auto-field-map="true"/> + <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/> + <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> + <set field="fromDate" from-field="parameters.fromDate" type="Timestamp" default-value="${nowTimestamp}"/> + <set field="thruDate" from-field="parameters.thruDate" type="Timestamp" default-value="${nowTimestamp}"/> <script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy"/> </actions> <widgets> @@ -464,9 +527,9 @@ <section> <condition> <or> - <not><if-empty field="postedTransTotalList"/></not> - <not><if-empty field="unpostedTransTotalList"/></not> - <not><if-empty field="postedAndUnpostedTransTotalList"/></not> + <not><if-empty field="postedTransactionTotals"/></not> + <not><if-empty field="unpostedTransactionTotals"/></not> + <not><if-empty field="allTransactionTotals"/></not> </or> </condition> <widgets> @@ -489,7 +552,7 @@ <include-form name="UnpostedTransactionTotalList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> </screenlet> <screenlet title="${uiLabelMap.AccountingPostedAndUnpostedTransactionTotals}"> - <include-form name="PostedAndUnpostedTransactionTotalList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> + <include-form name="PostedAndUnpostedTransactionTotalList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> </screenlet> </decorator-section> </decorator-screen> @@ -501,17 +564,25 @@ <section> <actions> <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/> + <set field="titleProperty" value="AccountingTransactionTotals"/> + <set field="labelTitleProperty" value="AccountingTransactionTotals"/> + <set field="tabButtonItem" value="OrganizationAccountingReports"/> + <set field="tabButtonItem2" value="TransactionTotals"/> <set field="organizationPartyId" from-field="parameters.organizationPartyId"/> <set field="partyIds" value="${groovy:org.ofbiz.party.party.PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP')}" type="List"/> <set field="partyIds[]" from-field="organizationPartyId"/> - <set field="fromDate" from-field="parameters.fromDate" type="Timestamp"/> - <set field="thruDate" from-field="parameters.thruDate" type="Timestamp"/> + <service service-name="getPartyAccountingPreferences" result-map="result" auto-field-map="true"/> + <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/> + <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> + <set field="fromDate" from-field="parameters.fromDate" type="Timestamp" default-value="${nowTimestamp}"/> + <set field="thruDate" from-field="parameters.thruDate" type="Timestamp" default-value="${nowTimestamp}"/> <script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy"/> </actions> <widgets> <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml"> <decorator-section name="body"> <container> + <include-form name="FindTransactionTotals" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> <label text="${uiLabelMap.AccountingPostedTransactionTotals}"/> <include-form name="PostedTransactionTotalList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> <label text="${uiLabelMap.AccountingUnPostedTransactionTotals}"/> @@ -529,20 +600,27 @@ <section> <actions> <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/> + <set field="titleProperty" value="AccountingTransactionTotals"/> + <set field="labelTitleProperty" value="AccountingTransactionTotals"/> + <set field="tabButtonItem" value="OrganizationAccountingReports"/> + <set field="tabButtonItem2" value="TransactionTotals"/> <set field="organizationPartyId" from-field="parameters.organizationPartyId"/> <set field="partyIds" value="${groovy:org.ofbiz.party.party.PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP')}" type="List"/> <set field="partyIds[]" from-field="organizationPartyId"/> - <set field="fromDate" from-field="parameters.fromDate" type="Timestamp"/> - <set field="thruDate" from-field="parameters.thruDate" type="Timestamp"/> + <service service-name="getPartyAccountingPreferences" result-map="result" auto-field-map="true"/> + <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/> + <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/> + <set field="fromDate" from-field="parameters.fromDate" type="Timestamp" default-value="${nowTimestamp}"/> + <set field="thruDate" from-field="parameters.thruDate" type="Timestamp" default-value="${nowTimestamp}"/> <script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy"/> </actions> <widgets> <label text="${uiLabelMap.AccountingPostedTransactionTotals}"/> - <include-form name="PostedTransactionTotalListCsv" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> + <include-form name="PostedTransactionTotalList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> <label text="${uiLabelMap.AccountingPostedTransactionTotals}"/> - <include-form name="UnpostedTransactionTotalListCsv" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> + <include-form name="UnpostedTransactionTotalList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> <label text="${uiLabelMap.AccountingPostedTransactionTotals}"/> - <include-form name="PostedAndUnpostedTransactionTotalListCsv" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> + <include-form name="PostedAndUnpostedTransactionTotalList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/> </widgets> </section> </screen> |
| Free forum by Nabble | Edit this page |
