Explorar o código

修改成本优惠计算

huangzhiguo hai 1 ano
pai
achega
88ba62b09e

+ 4 - 3
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -394,8 +394,8 @@ public class CmPayShopController extends BaseController {
             }
             //总税费
             shopOrder.setShopTaxFee(totalTaxesFee);
-            //商品费 - 优惠券 - 促销满减优惠
-            shopOrder.setShopProductAmount(MathUtil.sub(totalCostFee , MathUtil.add(shopOrder.getCouponAmount(), shopOrder.getPromotionFullReduction())).doubleValue());
+            //商品费
+            shopOrder.setShopProductAmount(totalCostFee);
         //}
         // 比例成本
         /*if ("2".equals(costType)) {
@@ -535,7 +535,8 @@ public class CmPayShopController extends BaseController {
         double shouldPayShopAmount = shopOrder.getShopProductAmount() + shopOrder.getShopPostFee(); // + shopOrder.getShopTaxFee();
         if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount())
             shopOrder.setPayStatus("3");
-        shopOrder.setShouldPayShopAmount(shouldPayShopAmount);
+        // 付供应商 - 优惠券 - 促销满减优惠
+        shopOrder.setShouldPayShopAmount(MathUtil.sub(shouldPayShopAmount , MathUtil.add(shopOrder.getCouponAmount(), shopOrder.getPromotionFullReduction())).doubleValue());
         newShopOrderService.modifyPayShopAmount(shopOrder, orderProducts);
 
         /*if(shopOrder.getShopReceiptStatus()==1){

+ 10 - 0
src/main/webapp/WEB-INF/views/modules/order/cmPayShopChange.jsp

@@ -210,6 +210,8 @@
                 <input id="shopOrderID" type="hidden" name="shopOrderID" value="${newShopOrder.shopOrderID}">
                 <input id="orderID" type="hidden" name="orderID" value="${newShopOrder.orderID}">
                 <input id="productAmount" type="hidden" name="productAmount" value="${newShopOrder.productAmount}">
+                <input id="couponAmount" type="hidden" name="couponAmount" value="${newShopOrder.couponAmount}">
+                <input id="promotionFullReduction" type="hidden" name="promotionFullReduction" value="${newShopOrder.promotionFullReduction}">
                 <label style="color:red">注意:计算成本时请注意,含税商品的成本包括税费,无需另外计算税费</label>
                 <table class="table table-striped table-bordered table-condensed" style="width: 70%">
                     <tr>
@@ -471,6 +473,8 @@
             obj.value = 0;
         }
         var of = $("#shopOtherFee").val();
+        var couponAmount = $("#couponAmount").val();
+        var promotionFullReduction = $("#promotionFullReduction").val();
         console.log("of----------------" + of);
         if (of > 0) {
             var totalAmount = 0;
@@ -510,6 +514,8 @@
             console.log("shopPostFee----------" + shopPostFee);
             totalAmount += Number(shopPostFee);
             totalAmount -= Number(of);
+            totalAmount -= Number(couponAmount);
+            totalAmount -= Number(promotionFullReduction);
             $("#div-supplier-fee").text(totalAmount);
         }
     }
@@ -548,6 +554,8 @@
         //获取供应商层信息
         var shopPostFee = $("#shopPostFee").val();
         var shopOtherFee = $("#shopOtherFee").val();
+        var couponAmount = $("#couponAmount").val();
+        var promotionFullReduction = $("#promotionFullReduction").val();
         if (null == shopPostFee) shopPostFee = 0;
         // if(null == shopOtherFee)shopOtherFee = 0;
         /*var n = parseFloat(that.value);
@@ -586,6 +594,8 @@
         var of = $("#shopOtherFee").val();
         totalAmount += Number(shopPostFee);
         totalAmount -= Number(of);
+        totalAmount -= Number(couponAmount);
+        totalAmount -= Number(promotionFullReduction);
         // 四舍五入
         var s = totalAmount.toFixed(2);
         $("#div-supplier-fee").text(s);