Author: apatel
Date: Thu Aug 13 13:56:42 2009 New Revision: 803886 URL: http://svn.apache.org/viewvc?rev=803886&view=rev Log: Enhancements to commission report enhancements. Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionReport.ftl ofbiz/trunk/applications/accounting/webapp/ap/reports/CommissionReport.fo.ftl Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=803886&r1=803885&r2=803886&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Thu Aug 13 13:56:42 2009 @@ -1571,16 +1571,22 @@ </view-link> </view-entity> - <view-entity entity-name="InvoiceItemAndAssoc" package-name="org.ofbiz.accounting.invoice"> - <member-entity entity-alias="INT" entity-name="InvoiceItem"/> + <view-entity entity-name="InvoiceItemAndAssocProduct" package-name="org.ofbiz.accounting.invoice"> + <member-entity entity-alias="INTM" entity-name="InvoiceItem"/> <member-entity entity-alias="IIA" entity-name="InvoiceItemAssoc"/> - <alias-all entity-alias="INT"/> + <member-entity entity-alias="PROD" entity-name="Product"/> <alias-all entity-alias="IIA"/> <alias name="termAmount" field="amount" entity-alias="IIA"/> - <view-link entity-alias="INT" rel-entity-alias="IIA" rel-optional="false"> + <alias name="productId" entity-alias="PROD"/> + <alias name="productName" entity-alias="PROD"/> + <alias name="amount" entity-alias="INTM"/> + <view-link entity-alias="INTM" rel-entity-alias="IIA" rel-optional="false"> <key-map field-name="invoiceId" rel-field-name="invoiceIdFrom"/> <key-map field-name="invoiceItemSeqId" rel-field-name="invoiceItemSeqIdFrom"/> </view-link> + <view-link entity-alias="INTM" rel-entity-alias="PROD" rel-optional="false"> + <key-map field-name="productId"/> + </view-link> </view-entity> <!-- ========================================================= --> <!-- org.ofbiz.accounting.ledger --> Modified: ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy?rev=803886&r1=803885&r2=803886&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy Thu Aug 13 13:56:42 2009 @@ -41,7 +41,7 @@ invoiceItemAndAssocCond.add(EntityCondition.makeCondition("thruDate", EntityOperator.LESS_THAN_EQUAL_TO, Timestamp.valueOf(thruDate))); } invoiceItemAndAssocList = []; - invoiceItemAndAssocList = delegator.findList("InvoiceItemAndAssoc", EntityCondition.makeCondition(invoiceItemAndAssocCond, EntityOperator.AND), null, null, null, false); + invoiceItemAndAssocList = delegator.findList("InvoiceItemAndAssocProduct", EntityCondition.makeCondition(invoiceItemAndAssocCond, EntityOperator.AND), null, null, null, false); //filtering invoiceItemAndAssocList for each productId with updating quantity, commission amount and number of order which generated sales invoices. totalQuantity = BigDecimal.ZERO; @@ -57,6 +57,7 @@ termAmount = BigDecimal.ZERO; invoiceItemProductAmount = BigDecimal.ZERO; assocProductId = null; + productName = null; commissionReportMap = [:]; salesAgentAndTermAmtMap = [:]; salesInvoiceIds = []; @@ -65,6 +66,7 @@ partyIdTermAmountMap = [:]; partyIdTermAmountKey = null; assocProductId = invoiceItemAndAssoc.productId; + productName = invoiceItemAndAssoc.productName; quantity = quantity.add(invoiceItemAndAssoc.quantity); commissionAmount = commissionAmount.add(invoiceItemAndAssoc.termAmount.multiply(invoiceItemAndAssoc.quantity)); termAmount = termAmount.add(invoiceItemAndAssoc.termAmount); @@ -79,6 +81,7 @@ } } commissionReportMap.productId = assocProductId; + commissionReportMap.productName = productName; commissionReportMap.quantity = quantity; commissionReportMap.salesAgentAndTermAmtMap = salesAgentAndTermAmtMap; commissionReportMap.commissionAmount = commissionAmount; Modified: ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionReport.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionReport.ftl?rev=803886&r1=803885&r2=803886&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionReport.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionReport.ftl Thu Aug 13 13:56:42 2009 @@ -18,7 +18,6 @@ --> <#if commissionReportList?has_content> - <form name="CommissionReport" id="CommissionReport"> <div> <a href="<@ofbizUrl>CommissionReport.pdf?isSearch=Y&productId=${parameters.productId!}&partyId=${parameters.partyId!}&fromDate=${parameters.fromDate!}&thruDate=${parameters.thruDate!}</@ofbizUrl>" class="buttontext">${uiLabelMap.AccountingInvoicePDF}</a> </div> @@ -36,13 +35,15 @@ <#assign alt_row = false> <#list commissionReportList as commissionReport> <tr valign="middle"<#if alt_row> class="alternate-row"</#if>> - <td><a href="/catalog/control/EditProduct?productId=${commissionReport.productId!}">${commissionReport.productId!}</a></td> + <td><a href="/catalog/control/EditProduct?productId=${commissionReport.productId!}">${commissionReport.productName!}</a></td> <td>${commissionReport.quantity!}</td> <td> ${commissionReport.numberOfOrders!} / - <#list commissionReport.salesInvoiceIds as salesInvoiceId> - [<a href="/ap/control/invoiceOverview?invoiceId=${salesInvoiceId!}">${salesInvoiceId!}</a>] - </#list> + <#if commissionReport.salesInvoiceIds?has_content> + <#list commissionReport.salesInvoiceIds as salesInvoiceId> + [<a href="/ap/control/invoiceOverview?invoiceId=${salesInvoiceId!}">${salesInvoiceId!}</a>] + </#list> + </#if> </td> <td><@ofbizCurrency amount = commissionReport.commissionAmount!/></td> <td><@ofbizCurrency amount = commissionReport.netSale!/></td> @@ -72,7 +73,6 @@ <li class="label">${uiLabelMap.AccountingTotalNumberOfOrders} : ${totalNumberOfOrders!}</li> </ul> </div> - </form> <#else> <td colspan='4'><h3>${uiLabelMap.AccountingNoRecordFound}</h3></td> </#if> Modified: ofbiz/trunk/applications/accounting/webapp/ap/reports/CommissionReport.fo.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/reports/CommissionReport.fo.ftl?rev=803886&r1=803885&r2=803886&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ap/reports/CommissionReport.fo.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/ap/reports/CommissionReport.fo.ftl Thu Aug 13 13:56:42 2009 @@ -54,7 +54,7 @@ <#list commissionReportList as commissionReport> <fo:table-row height="14px"> <fo:table-cell> - <fo:block>${commissionReport.productId!}</fo:block> + <fo:block>${commissionReport.productName!}</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>${commissionReport.quantity!}</fo:block> |
Free forum by Nabble | Edit this page |