svn commit: r1668270 - in /ofbiz/trunk/applications/order/webapp/ordermgr: WEB-INF/actions/entry/ShowCart.groovy entry/cart/showcartitems.ftl

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

svn commit: r1668270 - in /ofbiz/trunk/applications/order/webapp/ordermgr: WEB-INF/actions/entry/ShowCart.groovy entry/cart/showcartitems.ftl

Deepak Dixit-5
Author: deepak
Date: Sat Mar 21 13:54:01 2015
New Revision: 1668270

URL: http://svn.apache.org/r1668270
Log:
Applied patch from jira issue OFBIZ-6200 - Order Adjustment details are hidden on order Item section of order entry page.

Thanks  Arun Patidar for reporting the issue and thanks Yashwant for providing the patch.

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy
    ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy?rev=1668270&r1=1668269&r2=1668270&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy Sat Mar 21 13:54:01 2015
@@ -20,6 +20,7 @@
 import org.ofbiz.service.*;
 import org.ofbiz.entity.*;
 import org.ofbiz.base.util.*;
+import org.ofbiz.order.order.OrderReadHelper;
 import org.ofbiz.order.shoppingcart.*;
 import org.ofbiz.party.party.PartyWorker;
 import org.ofbiz.product.catalog.CatalogWorker;
@@ -52,6 +53,25 @@ context.shoppingCart = shoppingCart;
 context.currencyUomId = shoppingCart.getCurrency();
 context.orderType = shoppingCart.getOrderType();
 
+orderItems = shoppingCart.makeOrderItems();
+orderAdjustments = shoppingCart.makeAllAdjustments();
+orderItemShipGroupInfo = shoppingCart.makeAllShipGroupInfos();
+if (orderItemShipGroupInfo) {
+    orderItemShipGroupInfo.each { osiInfo ->
+        if ("OrderAdjustment".equals(osiInfo.getEntityName())) {
+            // shipping / tax adjustment(s)
+            orderAdjustments.add(osiInfo);
+        }
+    }
+}
+orderHeaderAdjustments = OrderReadHelper.getOrderHeaderAdjustments(orderAdjustments, null);
+orderSubTotal = OrderReadHelper.getOrderItemsSubTotal(orderItems, orderAdjustments);
+shippingAmount = OrderReadHelper.getAllOrderItemsAdjustmentsTotal(orderItems, orderAdjustments, false, false, true);
+shippingAmount = shippingAmount.add(OrderReadHelper.calcOrderAdjustments(orderHeaderAdjustments, orderSubTotal, false, false, true));
+context.orderShippingTotal = shippingAmount;
+taxAmount = OrderReadHelper.getOrderTaxByTaxAuthGeoAndParty(orderAdjustments).taxGrandTotal;
+context.orderTaxTotal = taxAmount;
+
 // get all the possible gift wrap options
 allgiftWraps = from("ProductFeature").where("productFeatureTypeId", "GIFT_WRAP").orderBy("defaultSequenceNum").queryList();
 context.allgiftWraps = allgiftWraps;

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl?rev=1668270&r1=1668269&r2=1668270&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl Sat Mar 21 13:54:01 2015
@@ -306,17 +306,31 @@ under the License.
               </tr>
             <#list shoppingCart.getAdjustments() as cartAdjustment>
               <#assign adjustmentType = cartAdjustment.getRelatedOne("OrderAdjustmentType", true)>
+              <#if adjustmentType.get("orderAdjustmentTypeId",locale) != 'SHIPPING_CHARGES'>
+                <tr>
+                  <td colspan="4" nowrap="nowrap" align="right">
+                    <div>
+                      <i>${uiLabelMap.OrderAdjustment}</i> - ${adjustmentType.get("description",locale)!}
+                      <#if cartAdjustment.productPromoId?has_content><a href="<@ofbizUrl>showPromotionDetails?productPromoId=${cartAdjustment.productPromoId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonDetails}</a></#if>:
+                    </div>
+                  </td>
+                  <td nowrap="nowrap" align="right"><div><@ofbizCurrency amount=Static["org.ofbiz.order.order.OrderReadHelper"].calcOrderAdjustment(cartAdjustment, shoppingCart.getSubTotal()) isoCode=currencyUomId/></div></td>
+                  <td>&nbsp;</td>
+                </tr>
+              </#if>
+            </#list>
+            <#if orderShippingTotal != 0>
               <tr>
-                <td colspan="4" nowrap="nowrap" align="right">
-                  <div>
-                    <i>${uiLabelMap.OrderAdjustment}</i> - ${adjustmentType.get("description",locale)!}
-                    <#if cartAdjustment.productPromoId?has_content><a href="<@ofbizUrl>showPromotionDetails?productPromoId=${cartAdjustment.productPromoId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonDetails}</a></#if>:
-                  </div>
-                </td>
-                <td nowrap="nowrap" align="right"><div><@ofbizCurrency amount=Static["org.ofbiz.order.order.OrderReadHelper"].calcOrderAdjustment(cartAdjustment, shoppingCart.getSubTotal()) isoCode=currencyUomId/></div></td>
-                <td>&nbsp;</td>
+                <td align="right" colspan="4"><div>${uiLabelMap.FacilityShippingAndHandling}</div></td>
+                <td align="right" nowrap="nowrap"><div><@ofbizCurrency amount=orderShippingTotal isoCode=currencyUomId/></div></td>
               </tr>
-            </#list>
+            </#if>
+            <#if orderTaxTotal != 0>
+              <tr>
+                <td align="right" colspan="4"><div>${uiLabelMap.OrderSalesTax}</div></td>
+                <td align="right" nowrap="nowrap"><div><@ofbizCurrency amount=orderTaxTotal isoCode=currencyUomId/></div></td>
+              </tr>
+            </#if>
         </#if>
 
         <tr>