svn commit: r803920 - in /ofbiz/trunk/applications/accounting/webapp/ap: WEB-INF/actions/invoices/CommissionReport.groovy invoices/CommissionReport.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r803920 - in /ofbiz/trunk/applications/accounting/webapp/ap: WEB-INF/actions/invoices/CommissionReport.groovy invoices/CommissionReport.ftl

apatel-2
Author: apatel
Date: Thu Aug 13 15:07:29 2009
New Revision: 803920

URL: http://svn.apache.org/viewvc?rev=803920&view=rev
Log:
No functional changes, only code formating.

Modified:
    ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionReport.groovy
    ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionReport.ftl

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=803920&r1=803919&r2=803920&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 15:07:29 2009
@@ -27,30 +27,30 @@
     thruDate = parameters.thruDate;
     partyId = parameters.partyId;
     productId = parameters.productId;
-    invoiceItemAndAssocCond = [];
+    invoiceItemAndAssocProductCond = [];
     if (productId) {
-        invoiceItemAndAssocCond.add(EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId));
+        invoiceItemAndAssocProductCond.add(EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId));
     }
     if (partyId) {
-        invoiceItemAndAssocCond.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyId));
+        invoiceItemAndAssocProductCond.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyId));
     }
     if (fromDate) {
-        invoiceItemAndAssocCond.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, Timestamp.valueOf(fromDate)));
+        invoiceItemAndAssocProductCond.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, Timestamp.valueOf(fromDate)));
     }
     if (thruDate) {
-        invoiceItemAndAssocCond.add(EntityCondition.makeCondition("thruDate", EntityOperator.LESS_THAN_EQUAL_TO, Timestamp.valueOf(thruDate)));
+        invoiceItemAndAssocProductCond.add(EntityCondition.makeCondition("thruDate", EntityOperator.LESS_THAN_EQUAL_TO, Timestamp.valueOf(thruDate)));
     }
-    invoiceItemAndAssocList = [];
-    invoiceItemAndAssocList = delegator.findList("InvoiceItemAndAssocProduct", EntityCondition.makeCondition(invoiceItemAndAssocCond, EntityOperator.AND), null, null, null, false);
+    invoiceItemAndAssocProductList = [];
+    invoiceItemAndAssocProductList = delegator.findList("InvoiceItemAndAssocProduct", EntityCondition.makeCondition(invoiceItemAndAssocProductCond, EntityOperator.AND), null, null, null, false);
 
-    //filtering invoiceItemAndAssocList for each productId with updating quantity, commission amount and number of order which generated sales invoices.
+    //filtering invoiceItemAndAssocProductList for each productId with updating quantity, commission amount and number of order which generated sales invoices.
     totalQuantity = BigDecimal.ZERO;
     totalNumberOfOrders = BigDecimal.ZERO;
     totalCommissionAmount = BigDecimal.ZERO;
     totalNetSales = BigDecimal.ZERO;
     commissionReportList = [];
-    if (invoiceItemAndAssocList) {
-        productIds = EntityUtil.getFieldListFromEntityList(invoiceItemAndAssocList, "productId", true);
+    if (invoiceItemAndAssocProductList) {
+        productIds = EntityUtil.getFieldListFromEntityList(invoiceItemAndAssocProductList, "productId", true);
         productIds.each { productId ->
             quantity = BigDecimal.ZERO;
             commissionAmount = BigDecimal.ZERO;
@@ -61,23 +61,23 @@
             commissionReportMap = [:];
             salesAgentAndTermAmtMap = [:];
             salesInvoiceIds = [];
-            invoiceItemAndAssocList.each { invoiceItemAndAssoc ->
-                if (productId.equals(invoiceItemAndAssoc.productId)) {
+            invoiceItemAndAssocProductList.each { invoiceItemAndAssocProduct ->
+                if (productId.equals(invoiceItemAndAssocProduct.productId)) {
                     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);
-                    partyIdTermAmountMap.partyId = invoiceItemAndAssoc.partyIdFrom;
-                    partyIdTermAmountMap.termAmount = invoiceItemAndAssoc.termAmount;
-                    partyIdTermAmountKey = invoiceItemAndAssoc.partyIdFrom + invoiceItemAndAssoc.termAmount;
+                    assocProductId = invoiceItemAndAssocProduct.productId;
+                    productName = invoiceItemAndAssocProduct.productName;
+                    quantity = quantity.add(invoiceItemAndAssocProduct.quantity);
+                    commissionAmount = commissionAmount.add(invoiceItemAndAssocProduct.termAmount.multiply(invoiceItemAndAssocProduct.quantity));
+                    termAmount = termAmount.add(invoiceItemAndAssocProduct.termAmount);
+                    partyIdTermAmountMap.partyId = invoiceItemAndAssocProduct.partyIdFrom;
+                    partyIdTermAmountMap.termAmount = invoiceItemAndAssocProduct.termAmount;
+                    partyIdTermAmountKey = invoiceItemAndAssocProduct.partyIdFrom + invoiceItemAndAssocProduct.termAmount;
                     if (!salesAgentAndTermAmtMap.containsKey(partyIdTermAmountKey)) {
                         salesAgentAndTermAmtMap.put(partyIdTermAmountKey, partyIdTermAmountMap);
                     }
-                    salesInvoiceIds.add(invoiceItemAndAssoc.invoiceIdFrom);
-                    invoiceItemProductAmount = invoiceItemAndAssoc.amount;
+                    salesInvoiceIds.add(invoiceItemAndAssocProduct.invoiceIdFrom);
+                    invoiceItemProductAmount = invoiceItemAndAssocProduct.amount;
                 }
             }
             commissionReportMap.productId = assocProductId;

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=803920&r1=803919&r2=803920&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionReport.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionReport.ftl Thu Aug 13 15:07:29 2009
@@ -18,61 +18,61 @@
 -->
 
 <#if commissionReportList?has_content>
-    <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>
-    <table class="basic-table hover-bar" cellspacing="0">
-      <#-- Header Begins -->
-      <tr class="header-row-2">
-        <th>${uiLabelMap.AccountingLicensedProduct}</th>
-        <th>${uiLabelMap.AccountingQuantity}</th>
-        <th>${uiLabelMap.AccountingNumberOfOrders} / ${uiLabelMap.AccountingSalesInvoices}</th>
-        <th>${uiLabelMap.AccountingCommissionAmount}</th>
-        <th>${uiLabelMap.AccountingNetSale}</th>
-        <th>${uiLabelMap.AccountingSalesAgents} / ${uiLabelMap.AccountingTermAmount}</th>
+  <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>
+  <table class="basic-table hover-bar" cellspacing="0">
+    <#-- Header Begins -->
+    <tr class="header-row-2">
+      <th>${uiLabelMap.AccountingLicensedProduct}</th>
+      <th>${uiLabelMap.AccountingQuantity}</th>
+      <th>${uiLabelMap.AccountingNumberOfOrders} / ${uiLabelMap.AccountingSalesInvoices}</th>
+      <th>${uiLabelMap.AccountingCommissionAmount}</th>
+      <th>${uiLabelMap.AccountingNetSale}</th>
+      <th>${uiLabelMap.AccountingSalesAgents} / ${uiLabelMap.AccountingTermAmount}</th>
+    </tr>
+    <#-- Header Ends-->
+    <#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.productName!}</a></td>
+        <td>${commissionReport.quantity!}</td>
+        <td>
+          ${commissionReport.numberOfOrders!} /
+          <#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>
+        <td>
+          <#if commissionReport.salesAgentAndTermAmtMap?has_content>
+            <#list commissionReport.salesAgentAndTermAmtMap.values() as partyIdAndTermAmountMap>
+              <#assign partyName = (delegator.findOne("PartyNameView", {"partyId" : partyIdAndTermAmountMap.partyId}, true))!>
+              <h6>[${(partyName.firstName)!} ${(partyName.lastName)!} ${(partyName.groupName)!}(<a href="/partymgr/control/viewprofile?partyId=${partyIdAndTermAmountMap.partyId!}">${partyIdAndTermAmountMap.partyId!}</a>)]
+                / <@ofbizCurrency amount = (partyIdAndTermAmountMap.termAmount)!/>
+              </h6>
+            </#list>
+          </#if>
+        </td>
       </tr>
-      <#-- Header Ends-->
-      <#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.productName!}</a></td>
-          <td>${commissionReport.quantity!}</td>
-          <td>
-            ${commissionReport.numberOfOrders!} /
-            <#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>
-          <td>
-            <#if commissionReport.salesAgentAndTermAmtMap?has_content>
-              <#list commissionReport.salesAgentAndTermAmtMap.values() as partyIdAndTermAmountMap>
-                <#assign partyName = (delegator.findOne("PartyNameView", {"partyId" : partyIdAndTermAmountMap.partyId}, true))!>
-                <h6>[${(partyName.firstName)!} ${(partyName.lastName)!} ${(partyName.groupName)!}(<a href="/partymgr/control/viewprofile?partyId=${partyIdAndTermAmountMap.partyId!}">${partyIdAndTermAmountMap.partyId!}</a>)]
-                  / <@ofbizCurrency amount = (partyIdAndTermAmountMap.termAmount)!/>
-                </h6>
-              </#list>
-            </#if>
-          </td>
-        </tr>
-        <#-- toggle the row color -->
-        <#assign alt_row = !alt_row>
-      </#list>
-    </table>
-    <div class="screenlet">
-      <ul>
-        <li class="label"></li>
-        <li class="label"><h3>${uiLabelMap.CommonSummary} :</h3></li>
-        <li class="label"></li>
-        <li class="label">${uiLabelMap.ManufacturingTotalQuantity} : ${totalQuantity!}</li>
-        <li class="label">${uiLabelMap.AccountingTotalCommissionAmount} : <@ofbizCurrency amount = totalCommissionAmount!/></li>
-        <li class="label">${uiLabelMap.AccountingTotalNetSales} : <@ofbizCurrency amount = totalNetSales!/></li>
-        <li class="label">${uiLabelMap.AccountingTotalNumberOfOrders} : ${totalNumberOfOrders!}</li>
-      </ul>
-    </div>
+      <#-- toggle the row color -->
+      <#assign alt_row = !alt_row>
+    </#list>
+  </table>
+  <div class="screenlet">
+    <ul>
+      <li class="label"></li>
+      <li class="label"><h3>${uiLabelMap.CommonSummary} :</h3></li>
+      <li class="label"></li>
+      <li class="label">${uiLabelMap.ManufacturingTotalQuantity} : ${totalQuantity!}</li>
+      <li class="label">${uiLabelMap.AccountingTotalCommissionAmount} : <@ofbizCurrency amount = totalCommissionAmount!/></li>
+      <li class="label">${uiLabelMap.AccountingTotalNetSales} : <@ofbizCurrency amount = totalNetSales!/></li>
+      <li class="label">${uiLabelMap.AccountingTotalNumberOfOrders} : ${totalNumberOfOrders!}</li>
+    </ul>
+  </div>
 <#else>
   <td colspan='4'><h3>${uiLabelMap.AccountingNoRecordFound}</h3></td>
 </#if>