Author: deepak
Date: Sat Mar 21 14:02:04 2015
New Revision: 1668272

URL: http://svn.apache.org/r1668272
Log:
Applied fix from trunk r#1668270
============================================================
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/branches/release13.07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy
    
ofbiz/branches/release13.07/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl

Modified: 
ofbiz/branches/release13.07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy?rev=1668272&r1=1668271&r2=1668272&view=diff
==============================================================================
--- 
ofbiz/branches/release13.07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy
 (original)
+++ 
ofbiz/branches/release13.07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy
 Sat Mar 21 14:02:04 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 = delegator.findByAnd("ProductFeature", [productFeatureTypeId : 
"GIFT_WRAP"], ["defaultSequenceNum"], false);
 context.allgiftWraps = allgiftWraps;

Modified: 
ofbiz/branches/release13.07/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl?rev=1668272&r1=1668271&r2=1668272&view=diff
==============================================================================
--- 
ofbiz/branches/release13.07/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl
 (original)
+++ 
ofbiz/branches/release13.07/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl
 Sat Mar 21 14:02:04 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_exists}
-                    <#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>


Reply via email to