zhijiezhao 1 năm trước cách đây
mục cha
commit
9f42fa8c04

+ 9 - 1
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -315,6 +315,9 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                     }
                 }
                 so.setBrokerage(brokerage);
+                if ("1".equals(so.getRebateOrder())) {
+                    allServeAmount = allServeAmount + so.getShopPostFee() - so.getSupplierFreight();
+                }
                 so.setAllServeAmount(allServeAmount);
                 so.setNewOrderProducts(orderProductList);
                 so.setWaitPayShop((so.getShouldPayShopAmount() == null ? 0D : so.getShouldPayShopAmount()) - (so.getPayedShopAmount() == null ? 0D : so.getPayedShopAmount()));
@@ -414,7 +417,8 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
     }
 
     public void applyDetail(CmPayShop cmPayShop) {
-        if (StringUtil.isNoneEmpty(cmPayShop.getId())) {  //详情
+        if (StringUtil.isNoneEmpty(cmPayShop.getId())) {
+            //详情
             List<CmPayShopRecord> payRecords = cmPayShopRecordDao.findByPayShopID(cmPayShop.getId());
             cmPayShop.setBankNameType(payRecords.get(0).getBankNameType());
             List<String> ids = payRecords.stream().map(CmPayShopRecord::getShopOrderID).collect(Collectors.toList());
@@ -484,6 +488,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                     }
                 }
                 so.setBrokerage(brokerage);
+                // 返佣订单 最终平台服务费 = 修改后的平台服务费 + 机构运费·供应商运麦
+                if ("1".equals(so.getRebateOrder())) {
+                    allServeAmount = allServeAmount + so.getShopPostFee() - so.getSupplierFreight();
+                }
                 so.setAllServeAmount(allServeAmount);
                 if (so.getShopPostFee() == null) so.setShopPostFee(0D);
                 if (so.getShopTaxFee() == null) so.setShopTaxFee(0D);

+ 105 - 103
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -326,76 +326,76 @@ public class CmPayShopController extends BaseController {
         //子订单的成本方式第一次填写以后就不能修改了
         // 固定成本
         //if ("1".equals(costType)) {
-            // List<CmReturnedPurchaseProduct> rL = cmReturnedPurchaseProductService.findReturnedByShopOrderID(Integer.parseInt(shopOrderID));
-            for (NewOrderProduct product : newOrderProducts) {
-                Integer orderProductID = product.getOrderProductID();
-                Double costPrice = product.getCostPrice() == null ? 0d : product.getCostPrice();
-                Double organizeCostPrice = product.getOrganizeCostPrice() == null ? 0d : product.getOrganizeCostPrice();
-                Double cmCostPrice = product.getCmCostPrice() == null ? 0d : product.getCmCostPrice();
-                if (soZeroCostFlag && costPrice > 0) {
-                    soZeroCostFlag = false;
-                }
-                // 在订单商品含税的情况下, 成本计算税费
-                if ("0".equals(product.getIncludedTax()) && null != product.getSupplierTaxRate() && product.getSupplierTaxRate() > 0d) {
-                    costPrice = MathUtil.add(costPrice, MathUtil.div(MathUtil.mul(costPrice, product.getSupplierTaxRate()), 100)).doubleValue();
-                }
-                // product.setSingleShouldPayTotalTax(MathUtil.div(MathUtil.mul(MathUtil.div(product.getCostPrice(), MathUtil.div(MathUtil.add(product.getTaxRate(), 100),100)), product.getSupplierTaxRate()), 100).doubleValue());
-                Double singleShouldPayTotalTax = product.getSingleShouldPayTotalTax() == null ? 0d : product.getSingleShouldPayTotalTax();
-                Double supplierTaxRate = product.getSupplierTaxRate() == null ? 0d : product.getSupplierTaxRate();
-                // 获取已被退款的商品数量
-                Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(Integer.parseInt(shopOrderID), orderProductID);
-                returnNum = returnNum == null ? 0 : returnNum;
-                NewOrderProduct orderProduct = newOrderProductService.get(String.valueOf(orderProductID));
-                // 修改前
-                if (StringUtils.isEmpty(dbcostType)) {
-                    CmChangePayShopProduct cmChangePayShopProduct = new CmChangePayShopProduct();
-                    cmChangePayShopProduct.setRecondType("1");
-                    cmChangePayShopProduct.setChangeType("1");
-                    cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId));
-                    cmChangePayShopProduct.setOrderProductId(orderProductID);
-                    cmChangePayShopProduct.setOrderProductName(product.getName());
-                    // 同步使用机构税率 作为供应商税率
-                    cmChangePayShopProduct.setSupplierTaxRate(product.getTaxRate());
-                    cmChangePayShopProduct.setCostPrice(orderProduct.getNewCostPrice());
-                    cmChangePayShopProduct.setOrganizeCostPrice(orderProduct.getOrganizeCostPrice());
-                    cmChangePayShopProduct.setCmCostPrice(orderProduct.getCmCostPrice());
-                    cmChangePayShopProduct.setSingleShouldPayTotalTax(orderProduct.getSingleShouldPayTotalTax());
-                    cmChangePayShopProductService.save(cmChangePayShopProduct);
-                }
-                // 成本
-                orderProduct.setCostPrice(costPrice);
-                // 成本 不含税
-                orderProduct.setCostPriceTax(product.getCostPrice() == null ? 0d : product.getCostPrice());
-                orderProduct.setOrganizeCostPrice(organizeCostPrice);
-                orderProduct.setCmCostPrice(cmCostPrice);
-                // 同步使用机构税率 作为供应商税率
-                orderProduct.setSupplierTaxRate(supplierTaxRate);
-                orderProduct.setTaxRate(product.getTaxRate());
-                orderProduct.setSingleShouldPayTotalTax(singleShouldPayTotalTax);
-                orderProducts.add(orderProduct);
-                int num = orderProduct.getNum() == null ? 0 : orderProduct.getNum();
-                int presentNum = orderProduct.getPresentNum() == null ? 0 : orderProduct.getPresentNum();
-                totalCostFee += (num + presentNum - returnNum) * costPrice;
-                orderProduct.setShouldPayTotalTax(singleShouldPayTotalTax * (num + presentNum - returnNum));
-                totalTaxesFee += singleShouldPayTotalTax * (num + presentNum - returnNum);
-                // 修改后
+        // List<CmReturnedPurchaseProduct> rL = cmReturnedPurchaseProductService.findReturnedByShopOrderID(Integer.parseInt(shopOrderID));
+        for (NewOrderProduct product : newOrderProducts) {
+            Integer orderProductID = product.getOrderProductID();
+            Double costPrice = product.getCostPrice() == null ? 0d : product.getCostPrice();
+            Double organizeCostPrice = product.getOrganizeCostPrice() == null ? 0d : product.getOrganizeCostPrice();
+            Double cmCostPrice = product.getCmCostPrice() == null ? 0d : product.getCmCostPrice();
+            if (soZeroCostFlag && costPrice > 0) {
+                soZeroCostFlag = false;
+            }
+            // 在订单商品含税的情况下, 成本计算税费
+            if ("0".equals(product.getIncludedTax()) && null != product.getSupplierTaxRate() && product.getSupplierTaxRate() > 0d) {
+                costPrice = MathUtil.add(costPrice, MathUtil.div(MathUtil.mul(costPrice, product.getSupplierTaxRate()), 100)).doubleValue();
+            }
+            // product.setSingleShouldPayTotalTax(MathUtil.div(MathUtil.mul(MathUtil.div(product.getCostPrice(), MathUtil.div(MathUtil.add(product.getTaxRate(), 100),100)), product.getSupplierTaxRate()), 100).doubleValue());
+            Double singleShouldPayTotalTax = product.getSingleShouldPayTotalTax() == null ? 0d : product.getSingleShouldPayTotalTax();
+            Double supplierTaxRate = product.getSupplierTaxRate() == null ? 0d : product.getSupplierTaxRate();
+            // 获取已被退款的商品数量
+            Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(Integer.parseInt(shopOrderID), orderProductID);
+            returnNum = returnNum == null ? 0 : returnNum;
+            NewOrderProduct orderProduct = newOrderProductService.get(String.valueOf(orderProductID));
+            // 修改前
+            if (StringUtils.isEmpty(dbcostType)) {
                 CmChangePayShopProduct cmChangePayShopProduct = new CmChangePayShopProduct();
-                cmChangePayShopProduct.setRecondType("2");
-                cmChangePayShopProduct.setChangeType(costType);
-                cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId2));
+                cmChangePayShopProduct.setRecondType("1");
+                cmChangePayShopProduct.setChangeType("1");
+                cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId));
                 cmChangePayShopProduct.setOrderProductId(orderProductID);
                 cmChangePayShopProduct.setOrderProductName(product.getName());
-                cmChangePayShopProduct.setSupplierTaxRate(supplierTaxRate);
-                cmChangePayShopProduct.setCostPrice(product.getCostPrice());
-                cmChangePayShopProduct.setOrganizeCostPrice(product.getOrganizeCostPrice());
-                cmChangePayShopProduct.setCmCostPrice(product.getCmCostPrice());
-                cmChangePayShopProduct.setSingleShouldPayTotalTax(product.getSingleShouldPayTotalTax());
+                // 同步使用机构税率 作为供应商税率
+                cmChangePayShopProduct.setSupplierTaxRate(product.getTaxRate());
+                cmChangePayShopProduct.setCostPrice(orderProduct.getNewCostPrice());
+                cmChangePayShopProduct.setOrganizeCostPrice(orderProduct.getOrganizeCostPrice());
+                cmChangePayShopProduct.setCmCostPrice(orderProduct.getCmCostPrice());
+                cmChangePayShopProduct.setSingleShouldPayTotalTax(orderProduct.getSingleShouldPayTotalTax());
                 cmChangePayShopProductService.save(cmChangePayShopProduct);
             }
-            //总税费
-            shopOrder.setShopTaxFee(totalTaxesFee);
-            //商品费
-            shopOrder.setShopProductAmount(totalCostFee);
+            // 成本
+            orderProduct.setCostPrice(costPrice);
+            // 成本 不含税
+            orderProduct.setCostPriceTax(product.getCostPrice() == null ? 0d : product.getCostPrice());
+            orderProduct.setOrganizeCostPrice(organizeCostPrice);
+            orderProduct.setCmCostPrice(cmCostPrice);
+            // 同步使用机构税率 作为供应商税率
+            orderProduct.setSupplierTaxRate(supplierTaxRate);
+            orderProduct.setTaxRate(product.getTaxRate());
+            orderProduct.setSingleShouldPayTotalTax(singleShouldPayTotalTax);
+            orderProducts.add(orderProduct);
+            int num = orderProduct.getNum() == null ? 0 : orderProduct.getNum();
+            int presentNum = orderProduct.getPresentNum() == null ? 0 : orderProduct.getPresentNum();
+            totalCostFee += (num + presentNum - returnNum) * costPrice;
+            orderProduct.setShouldPayTotalTax(singleShouldPayTotalTax * (num + presentNum - returnNum));
+            totalTaxesFee += singleShouldPayTotalTax * (num + presentNum - returnNum);
+            // 修改后
+            CmChangePayShopProduct cmChangePayShopProduct = new CmChangePayShopProduct();
+            cmChangePayShopProduct.setRecondType("2");
+            cmChangePayShopProduct.setChangeType(costType);
+            cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId2));
+            cmChangePayShopProduct.setOrderProductId(orderProductID);
+            cmChangePayShopProduct.setOrderProductName(product.getName());
+            cmChangePayShopProduct.setSupplierTaxRate(supplierTaxRate);
+            cmChangePayShopProduct.setCostPrice(product.getCostPrice());
+            cmChangePayShopProduct.setOrganizeCostPrice(product.getOrganizeCostPrice());
+            cmChangePayShopProduct.setCmCostPrice(product.getCmCostPrice());
+            cmChangePayShopProduct.setSingleShouldPayTotalTax(product.getSingleShouldPayTotalTax());
+            cmChangePayShopProductService.save(cmChangePayShopProduct);
+        }
+        //总税费
+        shopOrder.setShopTaxFee(totalTaxesFee);
+        //商品费
+        shopOrder.setShopProductAmount(totalCostFee);
         //}
         // 比例成本
         /*if ("2".equals(costType)) {
@@ -487,53 +487,55 @@ public class CmPayShopController extends BaseController {
 //            shopOrder.setShopProductAmount(productAmount * proportional / 100); //商品费
 
         }*/
-        shopOrder.setPayStatus(soZeroCostFlag ? "3" : "1");
-        shopOrder.setZeroCostFlag(soZeroCostFlag ? 1 : 0);
-        //当子订单0成本时,若主订单中其他子订单(除了运费子订单)都为0成本,设主订单为已付款,否则设为部分付款
-        NewOrder newOrder = newOrderService.get(shopOrder.getOrderID().toString());
-        if (soZeroCostFlag) {
-            AtomicReference<Boolean> zeroCostFlag = new AtomicReference<>(true);
-            AtomicReference<Boolean> freightFlag = new AtomicReference<>(false);
-            newOrder.getNewShopOrders().forEach(item -> {
-                if (item.getShopID().equals(998)) {
-                    freightFlag.set(true);
-                } else if (!item.getShopOrderID().equals(shopOrder.getShopOrderID()) && 0 == item.getZeroCostFlag()) {
-                    zeroCostFlag.set(false);
-                }
-            });
-            //如果含有运费子订单且其他子订单都为0成本,将运费子订单置为已付款
-            if (freightFlag.get() && zeroCostFlag.get()) {
-                newOrder.getNewShopOrders().forEach(item -> {
-                    if (item.getShopID().equals(998)) {
-                        item.setPayStatus("3");
-                        //更新运费子订单
-                        newShopOrderService.updatePayStatus(item);
-                        cmPayShopService.payFreightShopOrder(item);
-
-                    }
-                });
-            }
-            if (zeroCostFlag.get()) {
-                newOrder.setPayStatus("3");
-                newOrder.setZeroCostFlag(1);
-            } else {
-                newOrder.setPayStatus("2");
-                newOrder.setZeroCostFlag(0);
-            }
-            newOrderService.updatePayStatus(newOrder);
-        }
+//        shopOrder.setPayStatus(soZeroCostFlag ? "3" : "1");
+//        shopOrder.setZeroCostFlag(soZeroCostFlag ? 1 : 0);
+//        //当子订单0成本时,若主订单中其他子订单(除了运费子订单)都为0成本,设主订单为已付款,否则设为部分付款
+//        NewOrder newOrder = newOrderService.get(shopOrder.getOrderID().toString());
+//        if (soZeroCostFlag) {
+//            AtomicReference<Boolean> zeroCostFlag = new AtomicReference<>(true);
+//            AtomicReference<Boolean> freightFlag = new AtomicReference<>(false);
+//            newOrder.getNewShopOrders().forEach(item -> {
+//                if (item.getShopID().equals(998)) {
+//                    freightFlag.set(true);
+//                } else if (!item.getShopOrderID().equals(shopOrder.getShopOrderID()) && 0 == item.getZeroCostFlag()) {
+//                    zeroCostFlag.set(false);
+//                }
+//            });
+//            //如果含有运费子订单且其他子订单都为0成本,将运费子订单置为已付款
+//            if (freightFlag.get() && zeroCostFlag.get()) {
+//                newOrder.getNewShopOrders().forEach(item -> {
+//                    if (item.getShopID().equals(998)) {
+//                        item.setPayStatus("3");
+//                        //更新运费子订单
+//                        newShopOrderService.updatePayStatus(item);
+//                        cmPayShopService.payFreightShopOrder(item);
+//
+//                    }
+//                });
+//            }
+//            if (zeroCostFlag.get()) {
+//                newOrder.setPayStatus("3");
+//                newOrder.setZeroCostFlag(1);
+//            } else {
+//                newOrder.setPayStatus("2");
+//                newOrder.setZeroCostFlag(0);
+//            }
+//            newOrderService.updatePayStatus(newOrder);
+//        }
+        shopOrder.setRebateFee(newShopOrder.getRebateOrder());
         shopOrder.setSupplierFreight(freight); //运费
         shopOrder.setShopOtherFee(thirdPartyFee); //付第三方
         shopOrder.setCostType(costType);
         shopOrder.setModifyShouldPayNote(modifyShouldPayNote);  //备注
         shopOrder.setModifyShouldPayUserID(UserUtils.getUser().getId());  //修改人的用户id
         shopOrder.setModifyShouldPayDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));  //修改时间
-        double shouldPayShopAmount = shopOrder.getShopProductAmount() + shopOrder.getSupplierFreight(); // + shopOrder.getShopTaxFee();
+        double supplierFreight = null == shopOrder.getSupplierFreight() ? 0 : shopOrder.getSupplierFreight();
+        double shouldPayShopAmount = shopOrder.getShopProductAmount() + supplierFreight; // + shopOrder.getShopTaxFee();
         if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount()) {
             shopOrder.setPayStatus("3");
         }
         // 付供应商 - 优惠券 - 促销满减优惠
-        shopOrder.setShouldPayShopAmount(MathUtil.sub(shouldPayShopAmount , MathUtil.add(shopOrder.getCouponAmount(), shopOrder.getPromotionFullReduction())).doubleValue());
+        shopOrder.setShouldPayShopAmount(MathUtil.sub(shouldPayShopAmount, MathUtil.add(shopOrder.getCouponAmount(), shopOrder.getPromotionFullReduction())).doubleValue());
         newShopOrderService.modifyPayShopAmount(shopOrder, orderProducts);
         return "redirect:" + Global.getAdminPath() + "/shopOrder/payOrderList";
     }
@@ -688,7 +690,7 @@ public class CmPayShopController extends BaseController {
         int weekIdx = instance.get(Calendar.DAY_OF_WEEK) - 1;
         String format = new SimpleDateFormat("HH:mm:ss").format(new Date());
         Integer substring = Integer.valueOf(format.substring(0, 2));
-        ids.forEach(i->{
+        ids.forEach(i -> {
             //当前时间周五下午到周日都返回1不能结算,其他时间看够不够24小时
             if ((5 == weekIdx && substring > 14) || 6 == weekIdx || 7 == weekIdx) {
                 flag.set(1);

+ 6 - 1
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -747,7 +747,7 @@
         select<include refid="shopOrderColumns"/>,
         co.payTotalFee AS payTotalFee,
         a.supplierFreight as supplierFreight,
-        a.rebateOrder as rebateOrder,
+        ifnull(a.rebateOrder,0) as rebateOrder,
         bou.name AS buyer,
         s.name AS shopName,
         c.name AS clubName,
@@ -765,6 +765,7 @@
         <where>
             (s.shopId = 1161 OR s.AccountOwnership = 0 OR a.splitCode = 'E1807059160' or a.ordertype = 2)
             and a.shopStatus not in (4, 5)
+            and IFNULL(cdr.receiptType,0) not in (10,11)
             <if test="startTime != null and startTime != ''">
                 AND (a.orderTime &gt; #{startTime} OR a.orderTime = #{startTime})
             </if>
@@ -1037,6 +1038,8 @@
         co.payTotalFee AS payTotalFee,
         co.promotionFullReduction,
         bou.name AS buyer,
+        ifnull(a.supplierFreight,0) as supplierFreight,
+        ifnull(a.rebateOrder,0) as rebateOrder,
         s.name AS shopName,
         (select sum((num+presentNum)*cmCostPrice) from cm_order_product where shopOrderId = a.shopOrderId) as
         allServeAmount
@@ -1113,6 +1116,8 @@
         a.onlinePayWays,
         ifnull(a.cmAccountType,0) as cmAccountType,
         ifnull(a.cmShopOtherFee,0) as cmShopOtherFee,
+        ifnull(a.supplierFreight,0) as supplierFreight,
+        ifnull(a.rebateOrder,0) as rebateOrder,
         bou.name AS buyer,
         s.name AS shopName,
         c.name AS clubName

+ 59 - 38
src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp

@@ -289,10 +289,10 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <c:if test="${cmPayShop.redirectType == 2}" >
+    <c:if test="${cmPayShop.redirectType == 2}">
         <li><a href="${ctx}/order/cmPayShop/payList">付款管理</a></li>
     </c:if>
-    <c:if test="${cmPayShop.redirectType != 2}" >
+    <c:if test="${cmPayShop.redirectType != 2}">
         <li><a href="${ctx}/order/cmPayShop/">付款管理</a></li>
     </c:if>
     <li class="active"><a href="${ctx}/order/cmPayShop/toCheck?id=${cmPayShop.id}">付款审核</a></li>
@@ -346,31 +346,39 @@
                     </c:if>
                     <c:if test="${not empty s.brokerage}">
                     <td class="">
-                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                            <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
-                        </c:if>
-                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                            <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
-                                              pattern="#,##0.00"/>
-                        </c:if>
-                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                            <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
-                                              pattern="#,##0.00"/>
-                        </c:if>
+                        <c:choose>
+                            <c:when test="${s.cmAccountType eq 1}">
+                                0
+                            </c:when>
+                            <c:otherwise>
+                                <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                                    <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
+                                </c:if>
+                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                                    <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
+                                                      pattern="#,##0.00"/>
+                                </c:if>
+                                <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                                    <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
+                                                      pattern="#,##0.00"/>
+                                </c:if>
+                            </c:otherwise>
+
+                        </c:choose>
                     </td>
                     </c:if>
                     <td>
                         <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount}" type="number"
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.cmShopOtherFee}" type="number"
                                               pattern="#,##0.00"/>
                         </c:if>
                         <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice}"
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice - s.cmShopOtherFee}"
                                               type="number"
                                               pattern="#,##0.00"/>
                         </c:if>
                         <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice}"
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice - s.cmShopOtherFee}"
                                               type="number"
                                               pattern="#,##0.00"/>
                         </c:if>
@@ -440,7 +448,7 @@
                         <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
                     </td>
                     <td>
-                        <label class="clubFreight"  style="display: none">
+                        <label class="clubFreight" style="display: none">
                             <c:choose>
                                 <c:when test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2 && s.returnedFreightFlag ne true}">
                                     <fmt:formatNumber value="${s.shopPostFee}"/>
@@ -467,7 +475,8 @@
                             (采美豆抵用${s.userBeans})
                         </c:if>
                     </td>
-                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                    <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}"
+                                                          type="number"
                                                           pattern="#,##0.00"/></td>
 
                     <td>
@@ -480,13 +489,16 @@
                     <td colspan="3" class="supplier-fee">
                         <div><span class="nowrap">
                             <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                                应付:<fmt:formatNumber value="${s.shouldPayShopAmount-s.shopOtherFee}" type="number" pattern="#,##0.00"/>
+                                应付:<fmt:formatNumber value="${s.shouldPayShopAmount-s.shopOtherFee}" type="number"
+                                                     pattern="#,##0.00"/>
                             </c:if>
 							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount+s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
+                                <font color="black"><fmt:formatNumber
+                                        value="${s.shouldPayShopAmount+s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
                             </c:if>
 							<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                                <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount-s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
+                                <font color="black"><fmt:formatNumber
+                                        value="${s.shouldPayShopAmount-s.differencePrice}"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
                             </c:if>
 							,</span>
                             <span class="nowrap">已付:${s.payedShopAmount},</span></div>
@@ -543,22 +555,28 @@
                         </td>
                         <td>${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.taxRate?0.0:p.taxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
                         <td>${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.addedValueTax ?0.00:p.addedValueTax}</td>
-                        <td><c:choose>
-                            <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
-                                ---
-                            </c:when>
-                            <c:otherwise>
-                                <fmt:formatNumber
-                                        value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}"
-                                        type="number" pattern="#,##0.00"/>
-                            </c:otherwise>
-                        </c:choose></td>
-                        <td colspan="2"><fmt:formatNumber
-                                value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
-                                type="number" pattern="#,##0.00"/></td>
+                        <td>
+                            <c:choose>
+                                <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
+                                    ---
+                                </c:when>
+                                <c:otherwise>
+                                    <fmt:formatNumber
+                                            value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}"
+                                            type="number" pattern="#,##0.00"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </td>
+                        <td colspan="2">
+                            <fmt:formatNumber
+                                    value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
+                                    type="number" pattern="#,##0.00"/>
+                        </td>
                         <td>
                             <c:if test="${p.productType == 0}">
-                                <fmt:formatNumber value="${p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)}" pattern="#,##0.00"/>
+                                <fmt:formatNumber
+                                        value="${p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)}"
+                                        pattern="#,##0.00"/>
                             </c:if>
                             <c:if test="${p.productType != 0}">
                                 0.00
@@ -567,13 +585,16 @@
 
                         <td class="payCm">
                             <c:if test="${p.productType == 0}">
-                                <fmt:formatNumber value="${(p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)) * (p.num + p.presentNum - p.returnedNum)}" pattern="#,##0.00"/>
+                                <fmt:formatNumber
+                                        value="${(p.oldDiscountPrice - (p.costPrice + p.cmCostPrice + p.organizeCostPrice)) * (p.num + p.presentNum - p.returnedNum)}"
+                                        pattern="#,##0.00"/>
                             </c:if>
                             <c:if test="${p.productType != 0}">
                                 0.00
                             </c:if>
                         </td>
-                        <td><fmt:formatNumber value="${p.returnedNum == p.num ? 0.00 : p.cmCostPrice}" type="number" pattern="#,##0.00"/></td>
+                        <td><fmt:formatNumber value="${p.returnedNum == p.num ? 0.00 : p.cmCostPrice}" type="number"
+                                              pattern="#,##0.00"/></td>
                         <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
                         <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
                         <td class="p-taxes-t"><c:choose>
@@ -633,7 +654,7 @@
             <label>付款银行:</label><span>
 					<select name="payType" class="input-medium required" style="width: 200px">
                         <option value="">请选择</option>
-                        <c:forEach  items="${offlineCollections}" var="offlineCollections" varStatus="index">
+                        <c:forEach items="${offlineCollections}" var="offlineCollections" varStatus="index">
                             <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
                         </c:forEach>
 <%--						<option value="1">建设银行7297</option>--%>

+ 24 - 16
src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp

@@ -351,7 +351,7 @@
                 <tr/>
                 <tr>
                     <td>${s.shopOrderNo}(${s.shopOrderID})
-                        <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font
+                        <c:if test="${s.cmAccountType eq 1}"><font
                                 color="red">(采美私账订单)</font></c:if></td>
                     <td colspan="3"> ${s.orderTime}</td>
                     <td colspan="2">${s.totalAmount}</td>
@@ -361,31 +361,38 @@
                     </c:if>
                     <c:if test="${not empty s.brokerage}">
                     <td class="">
-                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                            <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
-                        </c:if>
-                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                            <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
-                                              pattern="#,##0.00"/>
-                        </c:if>
-                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                            <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
-                                              pattern="#,##0.00"/>
-                        </c:if>
+                        <c:choose>
+                            <c:when test="${s.cmAccountType eq 1}">
+                                0
+                            </c:when>
+                            <c:otherwise>
+                                <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                                    <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
+                                </c:if>
+                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                                    <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
+                                                      pattern="#,##0.00"/>
+                                </c:if>
+                                <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                                    <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
+                                                      pattern="#,##0.00"/>
+                                </c:if>
+                            </c:otherwise>
+                        </c:choose>
                     </td>
                     </c:if>
                     <td>
                         <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount}" type="number"
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.cmShopOtherFee}" type="number"
                                               pattern="#,##0.00"/>
                         </c:if>
                         <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice}"
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice - s.cmShopOtherFee}"
                                               type="number"
                                               pattern="#,##0.00"/>
                         </c:if>
                         <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice}"
+                            <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice - s.cmShopOtherFee}"
                                               type="number"
                                               pattern="#,##0.00"/>
                         </c:if>
@@ -452,7 +459,8 @@
                             (采美豆抵用${s.userBeans})
                         </c:if>
                     </td>
-                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                    <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}"
+                                                          type="number"
                                                           pattern="#,##0.00"/></td>
 
                     <td>

+ 106 - 98
src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp

@@ -455,115 +455,122 @@
                         <td colspan="4">${s.allServeAmount}</td>
                         <c:if test="${empty s.brokerage}">
                         <td class="payCm-t"></td>
+                        </c:if>
+                        <c:if test="${not empty s.brokerage}">
+                        <td class="">
+                            <c:choose>
+                                <c:when test="${s.cmAccountType eq 1}">
+                                    0
+                                </c:when>
+                                <c:otherwise>
+                                    <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                                        <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
+                                    </c:if>
+                                    <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                                        <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
+                                                          pattern="#,##0.00"/>
+                                    </c:if>
+                                    <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                                        <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
+                                                          pattern="#,##0.00"/>
+                                    </c:if>
+                                </c:otherwise>
+                            </c:choose>
+                        </td>
+                        </c:if>
+                        <td>
+                            <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+                                <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.cmShopOtherFee}" type="number"
+                                                  pattern="#,##0.00"/>
                             </c:if>
-                            <c:if test="${not empty s.brokerage}">
-                            <td class="">
-                                <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                                    <fmt:formatNumber value="${s.brokerage}" type="number" pattern="#,##0.00"/>
-                                </c:if>
-                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                    <fmt:formatNumber value="${s.brokerage-s.differencePrice}" type="number"
-                                                      pattern="#,##0.00"/>
+                            <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                                <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice - s.cmShopOtherFee}"
+                                                  type="number"
+                                                  pattern="#,##0.00"/>
+                            </c:if>
+                            <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                                <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice - s.cmShopOtherFee}"
+                                                  type="number"
+                                                  pattern="#,##0.00"/>
+                            </c:if>
+                        </td>
+                            <%--<td>
+                                <label class="clubFreight"  style="display: none">
+                                    <c:choose>
+                                        <c:when test="${s.freight != -1 && s.freight != 0 && s.freight != -2 && s.returnedFreightFlag ne true}">
+                                            <fmt:formatNumber value="${s.freight}"/>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <fmt:formatNumber value="0"/>
+                                        </c:otherwise>
+                                    </c:choose>
+                                </label>
+                                <c:if test="${s.freight == 0}">
+                                    包邮
                                 </c:if>
-                                <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                                    <fmt:formatNumber value="${s.brokerage+s.differencePrice}" type="number"
-                                                      pattern="#,##0.00"/>
+                                <c:if test="${s.freight == -1}">
+                                    到付
                                 </c:if>
-                            </td>
-                            </c:if>
-                            <td>
-                                <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                                    <fmt:formatNumber value="${s.brokerage + s.allServeAmount}" type="number"
-                                                      pattern="#,##0.00"/>
+                                <c:if test="${s.freight == -2}">
+                                    仪器到付-产品包邮
                                 </c:if>
-                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                    <fmt:formatNumber value="${s.brokerage + s.allServeAmount - s.differencePrice}"
-                                                      type="number"
-                                                      pattern="#,##0.00"/>
+                                <c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
+                                    <fmt:formatNumber value="${s.freight}" type="currency"/>
+                                    <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
                                 </c:if>
-                                <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                                    <fmt:formatNumber value="${s.brokerage + s.allServeAmount + s.differencePrice}"
-                                                      type="number"
-                                                      pattern="#,##0.00"/>
+                                <c:if test="${s.userBeans gt 0}">
+                                    (采美豆抵用${s.userBeans})
                                 </c:if>
-                            </td>
-                                <%--<td>
-                                    <label class="clubFreight"  style="display: none">
-                                        <c:choose>
-                                            <c:when test="${s.freight != -1 && s.freight != 0 && s.freight != -2 && s.returnedFreightFlag ne true}">
-                                                <fmt:formatNumber value="${s.freight}"/>
-                                            </c:when>
-                                            <c:otherwise>
-                                                <fmt:formatNumber value="0"/>
-                                            </c:otherwise>
-                                        </c:choose>
-                                    </label>
-                                    <c:if test="${s.freight == 0}">
-                                        包邮
-                                    </c:if>
-                                    <c:if test="${s.freight == -1}">
-                                        到付
-                                    </c:if>
-                                    <c:if test="${s.freight == -2}">
-                                        仪器到付-产品包邮
-                                    </c:if>
-                                    <c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
-                                        <fmt:formatNumber value="${s.freight}" type="currency"/>
-                                        <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
+                            </td>--%>
+                        <td colspan="2">
+                                <%--<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
+                                   style="text-decoration: underline">
+                                    </a>--%>
+                            <c:if test="${s.shopReceiptStatus == 1}"><font color="red">待收款</font></c:if>
+                            <c:if test="${s.shopReceiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
+                            <c:if test="${s.shopReceiptStatus == 3}"><font color="green">已收款</font></c:if>
+                        </td>
+                        <td colspan="3">
+                                <%--<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline"></a>--%>
+                                ${s.receiptAmount}
+                            <c:if test="${s.accountAmount>0}">(余额抵扣 ¥${s.accountAmount})</c:if>
+                        </td>
+                        <td colspan="2">
+                            <fmt:formatNumber value="${s.promotionFullReduction}" type="number" pattern="#,##0.00"/>
+                                <%--<label class="discountFee">
+                                    <c:choose>
+                                        <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
+                                            <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
+                                        </c:when>
+                                        <c:otherwise>
+                                            0
+                                        </c:otherwise>
+                                    </c:choose>
+                                </label>
+                                <c:if test="${s.discountTotalFee gt 0}">
+                                    <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
+                                        <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
+                                                          type="currency"/>
                                     </c:if>
-                                    <c:if test="${s.userBeans gt 0}">
-                                        (采美豆抵用${s.userBeans})
+                                    <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
+                                        ¥0.00
                                     </c:if>
-                                </td>--%>
-                            <td colspan="2">
-                                    <%--<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
-                                       style="text-decoration: underline">
-                                        </a>--%>
-                                <c:if test="${s.shopReceiptStatus == 1}"><font color="red">待收款</font></c:if>
-                                <c:if test="${s.shopReceiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
-                                <c:if test="${s.shopReceiptStatus == 3}"><font color="green">已收款</font></c:if>
-                            </td>
-                            <td colspan="3">
-                                    <%--<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline"></a>--%>
-                                    ${s.receiptAmount}
-                                <c:if test="${s.accountAmount>0}">(余额抵扣 ¥${s.accountAmount})</c:if>
-                            </td>
-                            <td colspan="2">
-                                <fmt:formatNumber value="${s.promotionFullReduction}" type="number" pattern="#,##0.00"/>
-                                    <%--<label class="discountFee">
-                                        <c:choose>
-                                            <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
-                                                <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
-                                            </c:when>
-                                            <c:otherwise>
-                                                0
-                                            </c:otherwise>
-                                        </c:choose>
-                                    </label>
-                                    <c:if test="${s.discountTotalFee gt 0}">
+                                    <c:if test="${s.returnedPurchaseTotalFee gt 0}">
+                                    <span style="color: red">
+                                        (原<fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>,因退货折扣取消
                                         <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
-                                            <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
-                                                              type="currency"/>
+                                            <fmt:formatNumber value="${s.returnedPurchaseTotalFee}" type="currency"/>
                                         </c:if>
                                         <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
-                                            ¥0.00
-                                        </c:if>
-                                        <c:if test="${s.returnedPurchaseTotalFee gt 0}">
-                                        <span style="color: red">
-                                            (原<fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>,因退货折扣取消
-                                            <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
-                                                <fmt:formatNumber value="${s.returnedPurchaseTotalFee}" type="currency"/>
-                                            </c:if>
-                                            <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
-                                                <fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>
-                                            </c:if>)
-                                        </span>
-                                        </c:if>
+                                            <fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>
+                                        </c:if>)
+                                    </span>
                                     </c:if>
-                                    <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>--%>
-                            </td>
-                            <td class="couponAmount" colspan="2">${s.couponAmount} </td>
-                            <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
+                                </c:if>
+                                <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>--%>
+                        </td>
+                        <td class="couponAmount" colspan="2">${s.couponAmount} </td>
+                        <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
                     <tr/>
                     <tr>
                         <th>客户</th>
@@ -614,7 +621,8 @@
                                 (采美豆抵用${s.userBeans})
                             </c:if>
                         </td>
-                        <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                        <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}"
+                                                              type="number"
                                                               pattern="#,##0.00"/></td>
 
                         <td>

+ 70 - 55
src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp

@@ -278,7 +278,16 @@
             margin-left: 10px
         }
 
-        .weishaIcon {background:darkorange;color:white;margin:0 0px;padding:0 3px;font-style:normal;font-size: 12px; display:inline-block;border-radius:2px}
+        .weishaIcon {
+            background: darkorange;
+            color: white;
+            margin: 0 0px;
+            padding: 0 3px;
+            font-style: normal;
+            font-size: 12px;
+            display: inline-block;
+            border-radius: 2px
+        }
 
     </style>
     <script type="text/javascript">
@@ -363,7 +372,7 @@
     <button id="select-all" style="color:white;background-color:#2F6FAB">全选</button>
     <c:if test="${operatingMode == '1'}">
         <button id="apply" class="t-btn" style="color:white;background-color:#2F6FAB">付款申请</button>
-<%--        <button id="applyShopOtherFee" class="t-btn" style="color:white;background-color:#2F6FAB">付第三方申请</button>--%>
+        <%--        <button id="applyShopOtherFee" class="t-btn" style="color:white;background-color:#2F6FAB">付第三方申请</button>--%>
     </c:if>
     <c:if test="${operatingMode == '2'}">
         <button id="refund" class="t-btn">已付退款</button>
@@ -384,24 +393,25 @@
                             </c:if>
                             <c:if test="${s.paying ne '1' && s.payStatus ne '3' }">
                                 <input type="checkbox" ${s.status eq 7 ?'disabled':''}
-                                       data-shoporderid="${s.shopOrderID}" data-shopid="${s.shopID}" data-isPayShopOtherFee="${s.payShopOtherFee}"/>
-                            </c:if>
-                        </c:if>
-<%--                        <c:if test="${operatingMode == '2'}">
-                            <c:if test="${s.refunding == '1'}">
-                                退款中
-                            </c:if>
-                            <c:if test="${empty s.payStatus || s.payStatus == '1'}">
-                                待付款
-                            </c:if>
-                            <c:if test="${s.refunding ne '1' && s.payStatus ne '1' && not empty s.payStatus}">
-                                <input type="checkbox" data-shoporderid="${s.shopOrderID}" data-shopid="${s.shopID}"
-                                       data-receiptStatus="${s.receiptStatus}" data-modifyPayable="${s.modifyPayable}" data-isPayShopOtherFee="${s.isPayShopOtherFee}"/>
+                                       data-shoporderid="${s.shopOrderID}" data-shopid="${s.shopID}"
+                                       data-isPayShopOtherFee="${s.payShopOtherFee}"/>
                             </c:if>
                         </c:if>
-                        <c:if test="${operatingMode == '3'}">
-                            ${sIndex.index + 1}
-                        </c:if>--%>
+                            <%--                        <c:if test="${operatingMode == '2'}">
+                                                        <c:if test="${s.refunding == '1'}">
+                                                            退款中
+                                                        </c:if>
+                                                        <c:if test="${empty s.payStatus || s.payStatus == '1'}">
+                                                            待付款
+                                                        </c:if>
+                                                        <c:if test="${s.refunding ne '1' && s.payStatus ne '1' && not empty s.payStatus}">
+                                                            <input type="checkbox" data-shoporderid="${s.shopOrderID}" data-shopid="${s.shopID}"
+                                                                   data-receiptStatus="${s.receiptStatus}" data-modifyPayable="${s.modifyPayable}" data-isPayShopOtherFee="${s.isPayShopOtherFee}"/>
+                                                        </c:if>
+                                                    </c:if>
+                                                    <c:if test="${operatingMode == '3'}">
+                                                        ${sIndex.index + 1}
+                                                    </c:if>--%>
                     </th>
                     <th>子订单编号(ID)</th>
                     <th colspan="3">订单编号(ID)</th>
@@ -411,11 +421,12 @@
                     <th>收款金额</th>
                     <th colspan="3">促销满减</th>
                     <th colspan="2">优惠券</th>
-<%--                    <th>成本类型</th>--%>
+                        <%--                    <th>成本类型</th>--%>
                 </tr>
                 <tr>
                     <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a>
-                        <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font color="red">(采美私账订单)</font></c:if>
+                        <c:if test="${s.cmAccountType eq 1}"><font
+                                color="red">(采美私账订单)</font></c:if>
                     </td>
                     <td colspan="3"><a href="${ctx}/order/detail?id=${s.orderID}">${s.orderNo}(${s.orderID})</a></td>
                     <td colspan="2"><fmt:formatNumber value="${s.totalAmount}" type="number" pattern="#,##0.00"/></td>
@@ -427,37 +438,37 @@
                         <c:if test="${s.shopReceiptStatus == 3}"><font color="green">已收款</font></c:if>
                     </td>
                     <td><%--<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline"></a></td>--%>
-                        ${s.receiptAmount}
+                            ${s.receiptAmount}
                         <c:if test="${s.accountAmount>0}">(余额抵扣 ¥${s.accountAmount})</c:if>
                     <td colspan="3">
                         <fmt:formatNumber value="${s.promotionFullReduction}" type="number" pattern="#,##0.00"/>
-                        <%--<c:if test="${s.discountTotalFee gt 0}">
-                            <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
-                                <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
-                                                  type="currency"/>
+                            <%--<c:if test="${s.discountTotalFee gt 0}">
+                                <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
+                                    <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
+                                                      type="currency"/>
+                                </c:if>
+                                <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
+                                    ¥0.00
+                                </c:if>
+                                <c:if test="${s.returnedPurchaseTotalFee gt 0}">
+                                    <span style="color: red">
+                                        (原<fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>,因退货折扣取消
+                                        <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
+                                            <fmt:formatNumber value="${s.returnedPurchaseTotalFee}" type="currency"/>
+                                        </c:if>
+                                        <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
+                                            <fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>
+                                        </c:if>)
+                                    </span>
+                                </c:if>
                             </c:if>
-                            <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
-                                ¥0.00
-                            </c:if>
-                            <c:if test="${s.returnedPurchaseTotalFee gt 0}">
-                                <span style="color: red">
-                                    (原<fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>,因退货折扣取消
-                                    <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
-                                        <fmt:formatNumber value="${s.returnedPurchaseTotalFee}" type="currency"/>
-                                    </c:if>
-                                    <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
-                                        <fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>
-                                    </c:if>)
-                                </span>
-                            </c:if>
-                        </c:if>
-                        <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>--%>
+                            <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>--%>
                     </td>
                     <td colspan="2">
                             ${s.couponAmount}
                     </td>
-                    <%--<td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
-                            test="${s.costType == '2'}">比例成本</c:if></td>--%>
+                        <%--<td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
+                                test="${s.costType == '2'}">比例成本</c:if></td>--%>
                 </tr>
                 <tr>
                     <th>供应商</th>
@@ -496,7 +507,8 @@
                             <br><font color="red">(采美豆抵用:${s.userBeans})</font>
                         </c:if>
                     </td>
-                    <td class="freight"><fmt:formatNumber value="${s.supplierFreight}" type="number"
+                    <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}"
+                                                          type="number"
                                                           pattern="#,##0.00"/></td>
                     <td colspan="3" class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number"
                                                                           pattern="#,##0.00"/></td>
@@ -509,12 +521,14 @@
                     <td class="supplier-fee">
                         <c:if test="${s.differenceType ne 1 && s.differenceType ne 2 }">
                             <span color="#E15616">
-                                <fmt:formatNumber value="${s.shouldPayShopAmount-s.shopOtherFee}" type="number" pattern="#,##0.00"/>
+                                <fmt:formatNumber value="${s.shouldPayShopAmount-s.shopOtherFee}" type="number"
+                                                  pattern="#,##0.00"/>
                             </span>
                         </c:if>
                         <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
                             <span color="black">
-                                <fmt:formatNumber value="${s.shouldPayShopAmount+(s.differencePrice-s.shopOtherFee)}" type="number" pattern="#,##0.00"/>
+                                <fmt:formatNumber value="${s.shouldPayShopAmount+(s.differencePrice-s.shopOtherFee)}"
+                                                  type="number" pattern="#,##0.00"/>
                             </span>
                             <font color="red">
                                 (原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})
@@ -522,7 +536,8 @@
                         </c:if>
                         <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
                             <span color="black">
-                                <fmt:formatNumber value="${s.shouldPayShopAmount-(s.differencePrice+s.shopOtherFee)}" type="number" pattern="#,##0.00"/>
+                                <fmt:formatNumber value="${s.shouldPayShopAmount-(s.differencePrice+s.shopOtherFee)}"
+                                                  type="number" pattern="#,##0.00"/>
                             </span>
                             <font color="red">
                                 (原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})
@@ -610,10 +625,12 @@
                 </c:forEach>
             </table>
             <div class="pay-more-func">
-                <a id="applyShopOtherFee" href="${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=${s.shopOrderID}&payType=1">付第三方申请</a>
+                <a id="applyShopOtherFee"
+                   href="${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=${s.shopOrderID}&payType=1">付第三方申请</a>
                 <c:if test="${s.paying ne '1' and s.payStatus eq '1' and !s.modifyPayable}">
                     <shiro:hasPermission name="order:cmPayShop:modifyPay">
-                        <a onclick="applypayWay(${s.shopReceiptStatus},${s.payWay})"  href="${ctx}/shopOrder/toChangePayShopAmount?shopOrderID=${s.shopOrderID}">修改成本</a>
+                        <a onclick="applypayWay(${s.shopReceiptStatus},${s.payWay})"
+                           href="${ctx}/shopOrder/toChangePayShopAmount?shopOrderID=${s.shopOrderID}">修改成本</a>
                     </shiro:hasPermission>
                 </c:if>
                 <c:if test="${(s.modifyPayable and s.paying ne '1') || s.payStatus eq '2'}">
@@ -715,12 +732,12 @@
 
 <script>
     //线上支付的子订单不能直接修改成本
-    function applypayWay(shopReceiptStatus,payWay) {
+    function applypayWay(shopReceiptStatus, payWay) {
         console.log(payWay);
         console.log(shopReceiptStatus);
-        if (payWay == 1 && shopReceiptStatus==2) {
+        if (payWay == 1 && shopReceiptStatus == 2) {
             alertx('线上支付的子订单不能直接修改成本!');
-            window.event.returnValue=false;
+            window.event.returnValue = false;
             // return false;
         }
     }
@@ -932,9 +949,7 @@
         });
 
 
-
-
-            $('#applyShopOtherFee').on('click', function () {
+        $('#applyShopOtherFee').on('click', function () {
             if (checked.length > 1) {
                 alertx('每次只能选择一个子订单进行付第三方申请');
                 return false;

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp

@@ -574,7 +574,7 @@
                 <tr/>
                 <tr>
                     <td>${s.shopOrderNo}(${s.shopOrderID})
-                        <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font
+                        <c:if test="${s.cmAccountType eq 1}"><font
                                 color="red">(采美私账订单)</font></c:if></td>
                     <td colspan="3"> ${s.buyer}</td>
                     <td colspan="2"> ${s.orderTime}</td>
@@ -682,7 +682,7 @@
                         <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
                     </td>
 
-                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                    <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}" type="number"
                                                           pattern="#,##0.00"/></td>
 
                     <td>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetail.jsp

@@ -489,7 +489,7 @@
                 </tr>
                 <tr>
                     <td>${s.shopOrderNo}(${s.shopOrderID})
-                        <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font
+                        <c:if test="${s.cmAccountType eq 1}"><font
                                 color="red">(采美私账订单)</font></c:if>
                     </td>
                     <td colspan="3"> ${s.orderTime}</td>
@@ -566,7 +566,7 @@
                             (采美豆抵用${s.userBeans})
                         </c:if>
                     </td>
-                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                    <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}" type="number"
                                                           pattern="#,##0.00"/></td>
                     <td colspan="3" class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number"
                                                                           pattern="#,##0.00"/></td>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherPrintDetails.jsp

@@ -341,7 +341,7 @@
                 </tr>
                 <tr>
                     <td>${s.shopOrderNo}(${s.shopOrderID})
-                        <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font
+                        <c:if test="${s.cmAccountType eq 1}"><font
                                 color="red">(采美私账订单)</font></c:if></td>
                     <td colspan="3">${s.orderNo}(${s.orderID})</td>
                     <td>${s.payTotalFee}</td>
@@ -426,7 +426,7 @@
                             (采美豆抵用${s.userBeans})
                         </c:if>
                     </td>
-                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                    <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}" type="number"
                                                           pattern="#,##0.00"/></td>
                     <td class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number"
                                                               pattern="#,##0.00"/>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/order/paidShopOrderList.jsp

@@ -398,7 +398,7 @@
                             <br><font color="red">(采美豆抵用:${s.userBeans})</font>
                         </c:if>
                     </td>
-                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                    <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}" type="number"
                                                           pattern="#,##0.00"/></td>
                     <td colspan="3" class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number"
                                                                           pattern="#,##0.00"/></td>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/order/payedAndRefundRecordList.jsp

@@ -117,7 +117,7 @@
     </tr>
     <tr>
         <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a>
-            <c:if test="${empty s.onlinePayWays and s.cmAccountType eq 1}"><font color="red">(采美私账订单)</font></c:if></td>
+            <c:if test="${s.cmAccountType eq 1}"><font color="red">(采美私账订单)</font></c:if></td>
         <td colspan="3"><a href="${ctx}/order/detail?id=${s.orderID}">${s.orderNo}(${s.orderID})</a></td>
         <td colspan="2">${s.payTotalFee}</td>
         <td colspan="3">${s.orderTime}</td>