huangzhiguo пре 1 година
родитељ
комит
fe54840706

+ 2 - 0
src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java

@@ -46,6 +46,8 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
 
     List<NewShopOrder> findPayOrderList(NewShopOrder shopOrder);
 
+    List<NewShopOrder> payThirdParties(NewShopOrder shopOrder);
+
     void updatePayShopAmount(NewShopOrder shopOrder);
 
     List<NewShopOrder> findByShopOrderIDs(@Param("shopOrderIDs") List<String> shopOrderIDs);

+ 9 - 0
src/main/java/com/caimei/modules/order/entity/NewShopOrder.java

@@ -71,6 +71,7 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private boolean receiptOrderFlag;// 判断订单中抹平的订单是否是和多个订单一起支付的,
     private Double orderReceivedAmount;//订单已收金额(此收款只计算线上线下收款记录payableAmount表金额)
     private Double returnBalanceAmount;// 退款余额金额
+    private Double allServeAmount;   // 总平台服务费
 
 
 
@@ -674,6 +675,14 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
         this.returnBalanceAmount = returnBalanceAmount;
     }
 
+    public Double getAllServeAmount() {
+        return allServeAmount;
+    }
+
+    public void setAllServeAmount(Double allServeAmount) {
+        this.allServeAmount = allServeAmount;
+    }
+
     public Integer getFreePostageTicketID() {
         return freePostageTicketID;
     }

+ 7 - 0
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -238,11 +238,15 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                  */
 
                 Integer returnNum = 0;
+                // 平台服务费
+                Double allServeAmount = 0d;
                 for (NewOrderProduct p : orderProductList) {
                     returnNum = newOrderProductDao.CountReturnedPurchaseProduct(so.getShopOrderID(), p.getOrderProductID());
                     returnNum = returnNum == null ? 0 : returnNum;
                     p.setReturnedNum(returnNum);
+                    allServeAmount += p.getNum() * p.getCmCostPrice();
                 }
+                so.setAllServeAmount(allServeAmount);
                 so.setNewOrderProducts(orderProductList);
                 so.setWaitPayShop((so.getShouldPayShopAmount() == null ? 0D : so.getShouldPayShopAmount()) - (so.getPayedShopAmount() == null ? 0D : so.getPayedShopAmount()));
                 if (so.getDifferenceType() != null && so.getDifferenceType() == 1) {
@@ -376,11 +380,14 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 List<NewOrderProduct> orderProductList = newOrderProductDao.findByShopOrderID(so.getShopOrderID());
                 /* 退货数量 */
                 Integer count = 0;
+                Double allServeAmount = 0d;
                 for (NewOrderProduct p : orderProductList) {
                     count = newOrderProductDao.CountReturnedPurchaseProduct(so.getShopOrderID(), p.getOrderProductID());
                     count = count == null ? 0 : count;
                     p.setReturnedNum(count);
+                    allServeAmount += p.getNum() * p.getCmCostPrice();
                 }
+                so.setAllServeAmount(allServeAmount);
                 if (so.getShopPostFee() == null) so.setShopPostFee(0D);
                 if (so.getShopTaxFee() == null) so.setShopTaxFee(0D);
                 if (so.getShopOtherFee() == null) so.setShopOtherFee(0D);

+ 14 - 0
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -277,6 +277,20 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
         return page;
     }
 
+
+    @Transactional(readOnly = false)
+    public Page<NewShopOrder> payThirdParties(Page<NewShopOrder> page, NewShopOrder shopOrder) {
+        shopOrder.setPage(page);
+        if (StringUtils.isNotBlank(shopOrder.getPayStatus())) {
+            String[] split = shopOrder.getPayStatus().split(",");
+            shopOrder.setPs(split);
+        }
+        List<NewShopOrder> payOrderList = newShopOrderDao.payThirdParties(shopOrder);
+        page.setList(payOrderList);
+        setValue(payOrderList);
+        return page;
+    }
+
     public void setValue(List<NewShopOrder> payOrderList) {
         for (NewShopOrder so : payOrderList) {
             Integer onlineFlag = newOrderDao.findOnlinePay(so.getOrderID()) > 0 ? 1 : 0;

+ 31 - 0
src/main/java/com/caimei/modules/order/web/CmShopOrderController.java

@@ -88,6 +88,37 @@ public class CmShopOrderController extends BaseController {
         return "modules/order/cmPayShopList";
     }
 
+    /**
+     * 申请付第三方
+     * @param newShopOrder
+     * @param request
+     * @param response
+     * @param model
+     * @return
+     */
+    @RequiresPermissions("order:cmPayShop:view")
+    @RequestMapping("payThirdParties")
+    public String payThirdParties(NewShopOrder newShopOrder, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if (null != newShopOrder.getStartTime() && !"".equals(newShopOrder.getStartTime()) && !newShopOrder.getStartTime().endsWith("00:00:00")) {
+            model.addAttribute("startTime", newShopOrder.getStartTime());
+            newShopOrder.setStartTime(newShopOrder.getStartTime().trim() + " 00:00:00");
+        }
+        if (null != newShopOrder.getEndTime() && !"".equals(newShopOrder.getEndTime()) && !newShopOrder.getEndTime().endsWith("23:59:59")) {
+            model.addAttribute("endTime", newShopOrder.getEndTime());
+            newShopOrder.setEndTime(newShopOrder.getEndTime().trim() + " 23:59:59");
+        }
+        Page<NewShopOrder> page = newShopOrderService.payThirdParties(new Page<>(request, response), newShopOrder);
+
+        //获取组织列表
+        List<CmUserOrganize> cmUserOrganizeList = cmUserOrganizeService.findOrganize();
+        model.addAttribute("cmUserOrganizeList", cmUserOrganizeList);
+        model.addAttribute("page", page);
+        model.addAttribute("operatingMode", newShopOrder.getOperatingMode());
+
+        //申请付第三方
+        return "modules/order/payThirdParties";
+    }
+
     @RequiresPermissions("order:cmPayShop:view")
     @RequestMapping("refundRecordList")
     public String refundRecordList(NewShopOrder newShopOrder, HttpServletRequest request, HttpServletResponse response, Model model) {

+ 6 - 2
src/main/java/com/caimei/modules/product/service/ProductService.java

@@ -350,9 +350,13 @@ public class ProductService extends CrudService<ProductDao, Product> {
                     cmOrganizeProductInfo.setValidFlag(1);
                     cmOrganizeProductInfoMapper.addCmOrganizeProductInfo(cmOrganizeProductInfo);
                 } else {
-                    if (!listMall.contains(s)) {
-                        cmOrganizeProductInfoMapper.updateNotCmOrganizeProductInfos(s, product.getProductID(), cmOrganizeProductInfo.getCostCheckFlag(), 3);
+                    Integer validFlag = 0;
+                    if (!strip.contains(s.toString())) {
+                        validFlag = 3;
+                    } else {
+                        validFlag = 2;
                     }
+                    cmOrganizeProductInfoMapper.updateNotCmOrganizeProductInfos(s, product.getProductID(), cmOrganizeProductInfo.getCostCheckFlag(), validFlag);
                 }
 
             });

+ 2 - 2
src/main/resources/mappings/modules/order/OrderProductMapper.xml

@@ -560,8 +560,8 @@
                cs.organizeId      AS organizeId,
                cs.unit as productUnit,
                cop.costPrice               AS costPrice,
-               cop.organizeCostPrice       AS organizeCostPrice,
-               cop.cmCostPrice             AS cmCostPrice,
+               ifnull(cop.organizeCostPrice, 0)       AS organizeCostPrice,
+               ifnull(cop.cmCostPrice, 0)             AS cmCostPrice,
                cop.shopPercent,
                cop.organizePercent,
                cop.cmPercent,

+ 83 - 0
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -772,6 +772,89 @@
         ORDER BY a.shopOrderID DESC
     </select>
 
+    <select id="payThirdParties" resultType="newShopOrder">
+        select<include refid="shopOrderColumns"/>,
+        co.payTotalFee AS payTotalFee,
+        bou.name AS buyer,
+        s.name AS shopName,
+        c.name AS clubName,
+        cdr.payWay AS payWay
+        from cm_shop_order a
+        left join cm_pay_shop_record cpsr on a.shopOrderID = cpsr.shopOrderID
+        left join bp_order_userinfo bou on bou.orderId = a.orderID
+        left join cm_order co on co.orderID = a.orderID
+        LEFT JOIN cm_receipt_order_relation cror ON cror.orderId = co.orderId
+        LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
+        left join shop s on s.shopID = a.shopID
+        LEFT JOIN club c ON c.userID = a.userID
+        <where>
+            s.name NOT LIKE '%综合供应商%'
+            AND s.AccountOwnership = 1
+            AND cdr.payWay = 2
+            AND a.receiptStatus != 1
+            <if test="startTime != null and startTime != ''">
+                AND (a.orderTime &gt; #{startTime} OR a.orderTime = #{startTime})
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND (a.orderTime &lt; #{endTime} OR a.orderTime = #{endTime})
+            </if>
+            <if test="orderID != null and orderID != ''">
+                AND a.orderID = #{orderID}
+            </if>
+            <if test="organizeID != null and organizeID != 9999">
+                AND co.organizeID = #{organizeID}
+            </if>
+            <if test="organizeID == 9999 ">
+                AND co.orderType = 2
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                AND a.orderNo like concat('%', #{orderNo} ,'%')
+            </if>
+            <if test="ps != null and ps.length>0 ">
+                AND a.payStatus in
+                <foreach item="item" index="index" collection="ps" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="shopName != null and shopName != ''">
+                AND s.name like concat('%', #{shopName} ,'%')
+            </if>
+            <if test="buyer != null and buyer != ''">
+                AND bou.name like concat('%', #{buyer} ,'%')
+            </if>
+            <if test="clubName != null and clubName != ''">
+                AND c.name like concat('%', #{clubName} ,'%')
+            </if>
+            <if test="shopOrderID != null and shopOrderID != ''">
+                AND a.shopOrderID = #{shopOrderID}
+            </if>
+            <if test="shopOrderNo != null and shopOrderNo != ''">
+                AND a.shopOrderNo like concat('%', #{shopOrderNo} ,'%')
+            </if>
+            and (co.confirmFlag = '1' or co.confirmFlag = '2')
+            <if test="operatingMode != null and operatingMode == '1'.toString()">
+                and a.payStatus != 3 and co.status NOT IN (6,7)
+            </if>
+            <if test="operatingMode != null and operatingMode == '2'.toString()">
+                and a.payStatus != 1 and co.status != 6
+            </if>
+            <if test="operatingMode != null and operatingMode == '3'.toString()">
+                and a.payStatus = 3 and co.status NOT IN (6,7)
+            </if>
+            and co.delFlag = 0
+            --              and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
+            and a.delFlag = 0
+            and (a.organizeID!=4 or a.organizeID is null)
+            and a.shopID != 998
+            and co.orderID not in (
+            SELECT orderID FROM cm_order_product WHERE productID IN
+            (6060, 6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069) GROUP BY orderID
+            )
+        </where>
+        group by a.shopOrderID
+        ORDER BY a.shopOrderID DESC
+    </select>
+
     <select id="findPayOrderListByIDs" resultType="newShopOrder">
         select distinct<include refid="shopOrderColumns"/>,
         co.payTotalFee AS payTotalFee,

+ 260 - 225
src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp

@@ -330,96 +330,99 @@
     </div>
     <div class="payment-form-content">
         <%--涛姐遍历下面这个table--%>
-        <c:forEach items="${cmPayShop.shopOrders}" var="s">
-            <table class="table table-striped table-bordered table-condensed pay-table">
-                <tr>
-                    <th>订单编号(ID)</th>
-                    <th colspan="3">客户</th>
-                    <th colspan="2">下单时间</th>
-                    <th>订单金额</th>
-                    <th colspan="3">所有子订单</th>
-                    <th>订单总佣金</th>
-                    <th>机构运费</th>
-                    <th>收款状态</th>
-                    <th colspan="3">收款金额</th>
-                    <th>经理折扣</th>
-                    <th>优惠券</th>
-                <tr/>
-                <tr>
-                    <td> ${s.orderNo}(${s.orderID})</td>
-                    <td colspan="3"> ${s.buyer}</td>
-                    <td colspan="2"> ${s.orderTime}</td>
-                    <td>${s.payTotalFee}</td>
-                    <td colspan="3">
-                        <c:forEach items="${s.shopOrderNos}" var="cs">
-                            ${cs}<br/>
-                        </c:forEach>
-                    </td>
-                    <td>
-                            ${s.income}
-                        <c:if test="${not empty s.rebateFee}">
-                            <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>
-                        </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>
-                        </c:if>
-                        <c:if test="${s.userBeans gt 0}">
-                            (采美豆抵用${s.userBeans})
-                        </c:if>
-                    </td>
-                    <td>
-                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
-                           style="text-decoration: underline">
-                            <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
-                            <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
-                            <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
-                    </td>
-                    <td colspan="3">
-                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
-                           style="text-decoration: underline">${s.receiptTotalFee}</a>
-                    </td>
-                    <td>
-                        <label class="discountFee" style="display: none">
-                            <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.discountTotalFee le s.returnedPurchaseTotalFee}">
-                                ¥0.00
-                            </c:if>
-                            <c:if test="${s.returnedPurchaseTotalFee gt 0}">
+            <c:forEach items="${cmPayShop.shopOrders}" var="s">
+                <table class="table table-striped table-bordered table-condensed pay-table">
+                    <tr>
+                        <th>子订单编号(ID)</th>
+                            <%--                        <th colspan="3">客户</th>--%>
+                        <th colspan="3">下单时间</th>
+                        <th colspan="2">子订单金额</th>
+                            <%--                        <th colspan="3">所有子订单</th>--%>
+                            <%--                        <th>订单总佣金</th>--%>
+                        <th colspan="4">总平台服务费</th>
+                            <%--                        <th>机构运费</th>--%>
+                        <th colspan="2">收款状态</th>
+                        <th colspan="3">收款金额</th>
+                        <th colspan="2">经理折扣</th>
+                        <th colspan="2">优惠券</th>
+                    <tr/>
+                    <tr>
+                            <%--                        <td> ${s.orderNo}(${s.orderID})</td>--%>
+                        <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                            <%--                        <td colspan="3"> ${s.buyer}</td>--%>
+                        <td colspan="3"> ${s.orderTime}</td>
+                        <td colspan="2">${s.totalAmount}</td>
+                            <%--                        <td colspan="3">--%>
+                            <%--                        <c:forEach items="${s.shopOrderNos}" var="cs">--%>
+                            <%--                            ${cs}<br/>--%>
+                            <%--                        </c:forEach>--%>
+                            <%--                        </td>--%>
+                            <%--                        <td>--%>
+                            <%--                                ${s.income}--%>
+                            <%--                            <c:if test="${not empty s.rebateFee}">--%>
+                            <%--                                    <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>--%>
+                            <%--                            </c:if>--%>
+                            <%--                        </td>--%>
+                        <td colspan="4">${s.allServeAmount}</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>
+                                </c:if>
+                                <c:if test="${s.userBeans gt 0}">
+                                    (采美豆抵用${s.userBeans})
+                                </c:if>
+                            </td>--%>
+                        <td colspan="2">
+                            <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
+                               style="text-decoration: underline">
+                                <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></a>
+                        </td>
+                        <td colspan="3">
+                            <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
+                               style="text-decoration: underline">${s.receiptAmount}</a>
+                        </td>
+                        <td colspan="2">
+                            <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.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}">
@@ -429,46 +432,77 @@
                                         <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>
+                        </td>
+                        <td class="couponAmount" colspan="2">${s.couponAmount} </td>
+                        <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
+                    <tr/>
+                    <tr>
+                        <th>客户</th>
+                        <th colspan="3"> 供应商</th>
+                        <th colspan="3">子订单利润</th>
+                        <th colspan="3">商品费</th>
+                        <th>应付税费</th>
+                        <th>机构运费</th>
+                        <th>供应商运费</th>
+                        <th>付款状态</th>
+                        <th colspan="3">付供应商</th>
+                        <th>付第三方</th>
+                        <th>成本类型</th>
+                    </tr>
+                    <tr>
+                        <td> ${s.buyer}</td>
+                        <td colspan="3">${s.shopName}</td>
+                        <c:if test="${empty s.brokerage}"><td colspan="3" class="payCm-t"></td></c:if>
+                        <c:if test="${not empty s.brokerage}"><td colspan="3" class="">${s.brokerage}</td></c:if>
+                            <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
+                        <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
+
+                        <td class="taxes">
+                            <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
+                        </td>
+                        <td>
+                            <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}"/>
+                                    </c:when>
+                                    <c:otherwise>
+                                        <fmt:formatNumber value="0"/>
+                                    </c:otherwise>
+                                </c:choose>
+                            </label>
+                            <c:if test="${s.shopPostFlag == 0}">
+                                包邮
+                            </c:if>
+                            <c:if test="${s.shopPostFlag == 2}">
+                                到付
+                            </c:if>
+                            <c:if test="${s.shopPostFlag == -2}">
+                                仪器到付-产品包邮
+                            </c:if>
+                            <c:if test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2}">
+                                <fmt:formatNumber value="${s.shopPostFee}" type="currency"/>
+                                <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
                             </c:if>
-                        </c:if>
-                        <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
-                    </td>
-                    <td>${s.couponAmount} </td>
-                    <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
-                <tr/>
-                <tr>
-                    <th>子订单编号(ID)</th>
-                    <th colspan="3"> 供应商</th>
-                    <th colspan="3">子订单佣金</th>
-                    <th colspan="3">商品费</th>
-                    <th>应付税费</th>
-                    <th>供应商运费</th>
-                    <th>付款状态</th>
-                    <th colspan="3">付供应商</th>
-                    <th>付第三方</th>
-                    <th>成本类型</th>
-                </tr>
-                <tr>
-                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-                    <td colspan="3">${s.shopName}</td>
-                    <td colspan="3" class="payCm-t">子订单佣金</td>
-                    <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
-                    <td class="taxes">
-                        <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
-                    </td>
-
-                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
-                                                          pattern="#,##0.00"/></td>
-
-                    <td>
-                        <c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
-                                color="red">待付款</font></c:if>
-                        <c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
-                        <c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if>
-                    </td>
-
-                    <td colspan="3" class="supplier-fee">
-                        <div><span class="nowrap">
+                            <c:if test="${s.userBeans gt 0}">
+                                (采美豆抵用${s.userBeans})
+                            </c:if>
+                        </td>
+                        <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                                                              pattern="#,##0.00"/></td>
+
+                        <td>
+                            <c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
+                                    color="red">待付款</font></c:if>
+                            <c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
+                            <c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if>
+                        </td>
+
+                        <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}" type="number" pattern="#,##0.00"/>
                             </c:if>
@@ -479,105 +513,106 @@
                                 <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>
-                        <div><span class="nowrap">待付:<input type="number"
-                                                            value="<fmt:formatNumber value="${s.waitPayShop}" pattern="0.00"/>"
-                                                            class="need-to-pay" data-type="${s.differenceType}"
-                                                            data-difference="${s.differencePrice}"
-                                                            data-pay="${s.shouldPayShopAmount}"
-                                                            data-payed="${s.payedShopAmount}"></span></div>
-                        <input type="hidden" name="payInfo" class="payInfo" data-shoporderid="${s.shopOrderID}"
-                               value="${s.shopOrderID}_${s.waitPayShop}_0">
-                        <label class="wipeBtn"><input class="wipeFee" type="checkbox" value="0"><span>付款抹平:<em
-                                class="red wipeText">¥0.00</em></span></label>
-                    </td>
-
-                    <td class="third-party-fee">${s.shopOtherFee}</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>
-                    <th>规格</th>
-                    <th>数量<%--(赠品)--%></th>
-                    <th>退货</th>
-                    <th colspan="3">单价</th>
-                    <th colspan="3">机构税率 / 单税费 / 总税费</th>
-                    <th>总价</th>
-                    <th>佣金(单)</th>
-                    <th>佣金(总)</th>
-                    <th colspan="3">供应商税率 / 单税费 / 总税费</th>
-                    <th>成本(单)</th>
-                    <th>成本(总)</th>
-                </tr>
-                <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
-                    <tr class="pay-product-item">
-                        <input type="hidden" class="p-copId" value="${p.orderProductID}">
-                        <td style="width:300px;" class="p-name">
-                            <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
-                            <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
-                                ${p.name}
-                        </td>
-                        <td style="width:80px;">${p.unit}</td>
-                        <td class="p-num" data-num="${p.num + p.presentNum}">
-                                ${p.num}
-                            <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
+                                <span class="nowrap">已付:${s.payedShopAmount},</span></div>
+                            <div><span class="nowrap">待付:<input type="number"
+                                                                value="<fmt:formatNumber value="${s.waitPayShop}" pattern="0.00"/>"
+                                                                class="need-to-pay" data-type="${s.differenceType}"
+                                                                data-difference="${s.differencePrice}"
+                                                                data-pay="${s.shouldPayShopAmount}"
+                                                                data-payed="${s.payedShopAmount}"></span></div>
+                            <input type="hidden" name="payInfo" class="payInfo" data-shoporderid="${s.shopOrderID}"
+                                   value="${s.shopOrderID}_${s.waitPayShop}_0">
+                            <label class="wipeBtn"><input class="wipeFee" type="checkbox" value="0"><span>付款抹平:<em
+                                    class="red wipeText">¥0.00</em></span></label>
                         </td>
-                        <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
-                        <td colspan="3"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
-                                                          type="number" pattern="#,##0.00"/>
-                            <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
-                                <label style="color: red">
-                                    (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
-                                </label>
-                            </c:if>
+
+                        <td class="third-party-fee">${s.shopOtherFee}</td>
+
+                        <td>
+                            <c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if>
+                            <c:if test="${s.costType == '2'}">比例成本</c:if>
                         </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><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><fmt:formatNumber
-                                value="${(empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}"
-                                pattern="#,##0.00"/></td>
-
-                        <td class="payCm"><fmt:formatNumber
-                                value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}"
-                                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>
-                            <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.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
-                                        type="number" pattern="#,##0.00"/>
-                            </c:otherwise>
-                        </c:choose></td>
-                        <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
-                                                                  pattern="#,##0.00"/></td>
-                        <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
-                                              type="number" pattern="#,##0.00"/></td>
                     </tr>
-                </c:forEach>
-            </table>
-        </c:forEach>
+                    <tr>
+                        <th>商品名</th>
+                        <th>规格</th>
+                        <th>数量<%--(赠品)--%></th>
+                        <th>退货</th>
+                        <th colspan="2">单价</th>
+                        <th colspan="3">机构税率 / 单税费 / 总税费</th>
+                        <th colspan="2">总价</th>
+                        <th>利润(单)</th>
+                        <th>利润(总)</th>
+                        <th>平台服务费</th>
+                        <th colspan="3">供应商税率 / 单税费 / 总税费</th>
+                        <th>成本(单)</th>
+                        <th>成本(总)</th>
+                    </tr>
+                    <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
+                        <tr class="pay-product-item">
+                            <input type="hidden" class="p-copId" value="${p.orderProductID}">
+                            <td style="width:300px;" class="p-name">
+                                <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
+                                <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
+                                    ${p.name}
+                            </td>
+                            <td style="width:80px;">${p.unit}</td>
+                            <td class="p-num" data-num="${p.num + p.presentNum}">
+                                    ${p.num}
+                                <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
+                            </td>
+                            <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
+                            <td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                                                              type="number" pattern="#,##0.00"/>
+                                <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
+                                    <label style="color: red">
+                                        (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+                                    </label>
+                                </c:if>
+                            </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><fmt:formatNumber
+                                    value="${(empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}"
+                                    pattern="#,##0.00"/></td>
+
+                            <td class="payCm"><fmt:formatNumber
+                                    value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}"
+                                    pattern="#,##0.00"/></td>
+                            <td>${p.cmCostPrice}</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>
+                                <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.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
+                                            type="number" pattern="#,##0.00"/>
+                                </c:otherwise>
+                            </c:choose></td>
+                            <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
+                                                                      pattern="#,##0.00"/></td>
+                            <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
+                                                  type="number" pattern="#,##0.00"/></td>
+                        </tr>
+                    </c:forEach>
+                </table>
+            </c:forEach>
     </div>
     <div class="payment-form-bottom">
         <div>

+ 107 - 68
src/main/webapp/WEB-INF/views/modules/order/cmPayShopEdit.jsp

@@ -83,70 +83,78 @@
             <c:forEach items="${cmPayShop.shopOrders}" var="s">
                 <table class="table table-striped table-bordered table-condensed pay-table">
                     <tr>
-                        <th>订单编号(ID)</th>
-                        <th colspan="3">客户</th>
-                        <th colspan="2">下单时间</th>
-                        <th>订单金额</th>
-                        <th colspan="3">所有子订单</th>
-                        <th>订单总佣金</th>
-                        <th>机构运费</th>
-                        <th>收款状态</th>
+                        <th>子订单编号(ID)</th>
+                            <%--                        <th colspan="3">客户</th>--%>
+                        <th colspan="3">下单时间</th>
+                        <th colspan="2">子订单金额</th>
+                            <%--                        <th colspan="3">所有子订单</th>--%>
+                            <%--                        <th>订单总佣金</th>--%>
+                        <th colspan="4">总平台服务费</th>
+                            <%--                        <th>机构运费</th>--%>
+                        <th colspan="2">收款状态</th>
                         <th colspan="3">收款金额</th>
-                        <th>经理折扣</th>
-                        <th>优惠券</th>
+                        <th colspan="2">经理折扣</th>
+                        <th colspan="2">优惠券</th>
                     <tr/>
                     <tr>
-                        <td> ${s.orderNo}(${s.orderID})</td>
-                        <td colspan="3"> ${s.buyer}</td>
-                        <td colspan="2"> ${s.orderTime}</td>
-                        <td>${s.payTotalFee}</td>
-                        <td colspan="3">
-                        <c:forEach items="${s.shopOrderNos}" var="cs">
-                            ${cs}<br/>
-                        </c:forEach>
-                        </td>
-                        <td>${s.income}</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>
-                            </c:if>
-                            <c:if test="${s.userBeans gt 0}">
-                                (采美豆抵用${s.userBeans})
-                            </c:if>
-                        </td>
-                        <td>
+                            <%--                        <td> ${s.orderNo}(${s.orderID})</td>--%>
+                        <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                            <%--                        <td colspan="3"> ${s.buyer}</td>--%>
+                        <td colspan="3"> ${s.orderTime}</td>
+                        <td colspan="2">${s.totalAmount}</td>
+                            <%--                        <td colspan="3">--%>
+                            <%--                        <c:forEach items="${s.shopOrderNos}" var="cs">--%>
+                            <%--                            ${cs}<br/>--%>
+                            <%--                        </c:forEach>--%>
+                            <%--                        </td>--%>
+                            <%--                        <td>--%>
+                            <%--                                ${s.income}--%>
+                            <%--                            <c:if test="${not empty s.rebateFee}">--%>
+                            <%--                                    <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>--%>
+                            <%--                            </c:if>--%>
+                            <%--                        </td>--%>
+                        <td colspan="4">${s.allServeAmount}</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>
+                                </c:if>
+                                <c:if test="${s.userBeans gt 0}">
+                                    (采美豆抵用${s.userBeans})
+                                </c:if>
+                            </td>--%>
+                        <td colspan="2">
                             <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
                                style="text-decoration: underline">
-                                <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
-                                <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
-                                <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></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></a>
                         </td>
                         <td colspan="3">
                             <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
-                               style="text-decoration: underline">${s.receiptTotalFee}</a>
+                               style="text-decoration: underline">${s.receiptAmount}</a>
                         </td>
-                        <td>
-                            <label class="discountFee"  style="display: none">
+                        <td colspan="2">
+                            <label class="discountFee">
                                 <c:choose>
                                     <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
                                         <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
@@ -178,15 +186,16 @@
                             </c:if>
                             <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                         </td>
-                        <td>${s.couponAmount} </td>
+                        <td class="couponAmount" colspan="2">${s.couponAmount} </td>
                         <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
                     <tr/>
                     <tr>
-                        <th>子订单编号(ID)</th>
+                        <th>客户</th>
                         <th colspan="3"> 供应商</th>
-                        <th colspan="3">子订单佣金</th>
+                        <th colspan="3">子订单利润</th>
                         <th colspan="3">商品费</th>
                         <th>应付税费</th>
+                        <th>机构运费</th>
                         <th>供应商运费</th>
                         <th>付款状态</th>
                         <th colspan="3">付供应商</th>
@@ -194,15 +203,44 @@
                         <th>成本类型</th>
                     </tr>
                     <tr>
-                        <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                        <td> ${s.buyer}</td>
                         <td colspan="3">${s.shopName}</td>
-                        <td colspan="3" class="payCm-t">子订单佣金</td>
+                        <c:if test="${empty s.brokerage}"><td colspan="3" class="payCm-t"></td></c:if>
+                        <c:if test="${not empty s.brokerage}"><td colspan="3" class="">${s.brokerage}</td></c:if>
+                            <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
                         <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
 
                         <td class="taxes">
                             <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
                         </td>
-
+                        <td>
+                            <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}"/>
+                                    </c:when>
+                                    <c:otherwise>
+                                        <fmt:formatNumber value="0"/>
+                                    </c:otherwise>
+                                </c:choose>
+                            </label>
+                            <c:if test="${s.shopPostFlag == 0}">
+                                包邮
+                            </c:if>
+                            <c:if test="${s.shopPostFlag == 2}">
+                                到付
+                            </c:if>
+                            <c:if test="${s.shopPostFlag == -2}">
+                                仪器到付-产品包邮
+                            </c:if>
+                            <c:if test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2}">
+                                <fmt:formatNumber value="${s.shopPostFee}" type="currency"/>
+                                <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
+                            </c:if>
+                            <c:if test="${s.userBeans gt 0}">
+                                (采美豆抵用${s.userBeans})
+                            </c:if>
+                        </td>
                         <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
                                                               pattern="#,##0.00"/></td>
 
@@ -250,11 +288,12 @@
                         <th>规格</th>
                         <th>数量<%--(赠品)--%></th>
                         <th>退货</th>
-                        <th colspan="3">单价</th>
+                        <th colspan="2">单价</th>
                         <th colspan="3">机构税率 / 单税费 / 总税费</th>
-                        <th>总价</th>
-                        <th>佣金(单)</th>
-                        <th>佣金(总)</th>
+                        <th colspan="2">总价</th>
+                        <th>利润(单)</th>
+                        <th>利润(总)</th>
+                        <th>平台服务费</th>
                         <th colspan="3">供应商税率 / 单税费 / 总税费</th>
                         <th>成本(单)</th>
                         <th>成本(总)</th>
@@ -273,7 +312,7 @@
                                 <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
                             </td>
                             <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
-                            <td colspan="3"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                            <td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
                                                               type="number" pattern="#,##0.00"/>
                                 <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
                                     <label style="color: red">
@@ -293,7 +332,7 @@
                                             type="number" pattern="#,##0.00"/>
                                 </c:otherwise>
                             </c:choose></td>
-                            <td><fmt:formatNumber
+                            <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><fmt:formatNumber
@@ -303,7 +342,7 @@
                             <td class="payCm"><fmt:formatNumber
                                     value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}"
                                     pattern="#,##0.00"/></td>
-
+                            <td>${p.cmCostPrice}</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>

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

@@ -445,7 +445,7 @@
 <%--                                    <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>--%>
 <%--                            </c:if>--%>
 <%--                        </td>--%>
-                        <td colspan="4"></td>
+                        <td colspan="4">${s.allServeAmount}</td>
                         <%--<td>
                             <label class="clubFreight"  style="display: none">
                                 <c:choose>
@@ -674,7 +674,7 @@
                             <td class="payCm"><fmt:formatNumber
                                     value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}"
                                     pattern="#,##0.00"/></td>
-                            <td>??</td>
+                            <td>${p.cmCostPrice}</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>

+ 256 - 217
src/main/webapp/WEB-INF/views/modules/order/cmPayShopPrintDetail.jsp

@@ -93,92 +93,99 @@
 		</div>
 		<div class="payment-form-content">
             <%--涛姐遍历下面这个table--%>
-			<c:forEach items="${cmPayShop.shopOrders}" var="s">
-				<table class="table table-striped table-bordered table-condensed pay-table">
-					<tr>
-						<th>订单编号(ID)</th>
-						<th colspan="3">客户</th>
-						<th colspan="2">下单时间</th>
-						<th>订单金额</th>
-						<th colspan="3">所有子订单</th>
-<%--						<th>订单总佣金</th>--%>
-						<th>机构运费</th>
-						<th>收款状态</th>
-						<th colspan="3">收款金额</th>
-						<th>经理折扣</th>
-						<th>优惠券</th>
-					<tr/>
-					<tr>
-						<td> ${s.orderNo}(${s.orderID})</td>
-						<td colspan="3"> ${s.buyer}</td>
-						<td colspan="2"> ${s.orderTime}</td>
-						<td>${s.payTotalFee}</td>
-						<td colspan="3">
-						<c:forEach items="${s.shopOrderNos}" var="cs">
-							${cs}<br/>
-						</c:forEach>
-						</td>
-<%--						<td>${s.income}</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>
-							</c:if>
-							<c:if test="${s.userBeans gt 0}">
-								(采美豆抵用${s.userBeans})
-							</c:if>
-						</td>
-						<td>
-<%--							<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"--%>
-<%--							   style="text-decoration: underline">--%>
-								<c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
-								<c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
-								<c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
-						</td>
-						<td colspan="3">
-<%--							<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"--%>
-<%--							   style="text-decoration: underline">--%>
-									${s.receiptTotalFee}</a>
-						</td>
-						<td>
-							<label class="discountFee" style="display: none">
-								<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.discountTotalFee le s.returnedPurchaseTotalFee}">
-									¥0.00
-								</c:if>
-								<c:if test="${s.returnedPurchaseTotalFee gt 0}">
+				<c:forEach items="${cmPayShop.shopOrders}" var="s">
+					<table class="table table-striped table-bordered table-condensed pay-table">
+						<tr>
+							<th>子订单编号(ID)</th>
+								<%--                        <th colspan="3">客户</th>--%>
+							<th colspan="3">下单时间</th>
+							<th colspan="2">子订单金额</th>
+								<%--                        <th colspan="3">所有子订单</th>--%>
+								<%--                        <th>订单总佣金</th>--%>
+							<th colspan="4">总平台服务费</th>
+								<%--                        <th>机构运费</th>--%>
+							<th colspan="2">收款状态</th>
+							<th colspan="3">收款金额</th>
+							<th colspan="2">经理折扣</th>
+							<th colspan="2">优惠券</th>
+						<tr/>
+						<tr>
+								<%--                        <td> ${s.orderNo}(${s.orderID})</td>--%>
+							<td>${s.shopOrderNo}(${s.shopOrderID})</td>
+								<%--                        <td colspan="3"> ${s.buyer}</td>--%>
+							<td colspan="3"> ${s.orderTime}</td>
+							<td colspan="2">${s.totalAmount}</td>
+								<%--                        <td colspan="3">--%>
+								<%--                        <c:forEach items="${s.shopOrderNos}" var="cs">--%>
+								<%--                            ${cs}<br/>--%>
+								<%--                        </c:forEach>--%>
+								<%--                        </td>--%>
+								<%--                        <td>--%>
+								<%--                                ${s.income}--%>
+								<%--                            <c:if test="${not empty s.rebateFee}">--%>
+								<%--                                    <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>--%>
+								<%--                            </c:if>--%>
+								<%--                        </td>--%>
+							<td colspan="4">${s.allServeAmount}</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>
+                                    </c:if>
+                                    <c:if test="${s.userBeans gt 0}">
+                                        (采美豆抵用${s.userBeans})
+                                    </c:if>
+                                </td>--%>
+							<td colspan="2">
+								<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
+								   style="text-decoration: underline">
+									<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></a>
+							</td>
+							<td colspan="3">
+								<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
+								   style="text-decoration: underline">${s.receiptAmount}</a>
+							</td>
+							<td colspan="2">
+								<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.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}">
@@ -188,46 +195,77 @@
 										<fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>
 									</c:if>)
                                 </span>
+									</c:if>
 								</c:if>
-							</c:if>
-							<c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
-						</td>
-						<td>${s.couponAmount} </td>
-					<tr/>
-					<tr>
-						<th>子订单编号(ID)</th>
-						<th colspan="3"> 供应商</th>
-<%--						<th colspan="3">子订单佣金</th>--%>
-						<th colspan="3">商品费</th>
-						<th>应付税费</th>
-						<th>供应商运费</th>
-						<th>付款状态</th>
-						<th colspan="3">付供应商</th>
-						<th colspan="2">付第三方</th>
-						<th colspan="2">成本类型</th>
-					</tr>
-					<tr>
-						<td>${s.shopOrderNo}(${s.shopOrderID})</td>
-						<td colspan="3">${s.shopName}</td>
-<%--						<td colspan="3" class="payCm-t">子订单佣金</td>--%>
-						<td colspan="3" class="product-fee">${s.shopProductAmount}</td>
-
-						<td class="taxes">
-							<fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
-						</td>
+								<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>
+							<th colspan="3"> 供应商</th>
+							<th colspan="3">子订单利润</th>
+							<th colspan="3">商品费</th>
+							<th>应付税费</th>
+							<th>机构运费</th>
+							<th>供应商运费</th>
+							<th>付款状态</th>
+							<th colspan="3">付供应商</th>
+							<th>付第三方</th>
+							<th>成本类型</th>
+						</tr>
+						<tr>
+							<td> ${s.buyer}</td>
+							<td colspan="3">${s.shopName}</td>
+							<c:if test="${empty s.brokerage}"><td colspan="3" class="payCm-t"></td></c:if>
+							<c:if test="${not empty s.brokerage}"><td colspan="3" class="">${s.brokerage}</td></c:if>
+								<%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
+							<td colspan="3" class="product-fee">${s.shopProductAmount}</td>
 
-						<td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
-															  pattern="#,##0.00"/></td>
+							<td class="taxes">
+								<fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
+							</td>
+							<td>
+								<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}"/>
+										</c:when>
+										<c:otherwise>
+											<fmt:formatNumber value="0"/>
+										</c:otherwise>
+									</c:choose>
+								</label>
+								<c:if test="${s.shopPostFlag == 0}">
+									包邮
+								</c:if>
+								<c:if test="${s.shopPostFlag == 2}">
+									到付
+								</c:if>
+								<c:if test="${s.shopPostFlag == -2}">
+									仪器到付-产品包邮
+								</c:if>
+								<c:if test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2}">
+									<fmt:formatNumber value="${s.shopPostFee}" type="currency"/>
+									<c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
+								</c:if>
+								<c:if test="${s.userBeans gt 0}">
+									(采美豆抵用${s.userBeans})
+								</c:if>
+							</td>
+							<td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+																  pattern="#,##0.00"/></td>
 
-						<td>
-							<c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
-									color="red">待付款</font></c:if>
-							<c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
-							<c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if>
-						</td>
+							<td>
+								<c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
+										color="red">待付款</font></c:if>
+								<c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
+								<c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if>
+							</td>
 
-						<td colspan="3" class="supplier-fee">
-							<div><span class="nowrap">
+							<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}" type="number" pattern="#,##0.00"/>
 							</c:if>
@@ -238,105 +276,106 @@
 								<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>
-							<div><span class="nowrap">待付:<input type="number"
-																value="<fmt:formatNumber value="${s.waitPayShop}" pattern="0.00"/>"
-																class="need-to-pay" data-type="${s.differenceType}"
-																data-difference="${s.differencePrice}"
-																data-pay="${s.shouldPayShopAmount}"
-																data-payed="${s.payedShopAmount}"></span></div>
-							<input type="hidden" name="payInfo" class="payInfo" data-shoporderid="${s.shopOrderID}"
-								   value="${s.shopOrderID}_${s.waitPayShop}_0">
-							<label class="wipeBtn"><input class="wipeFee" type="checkbox" value="0"><span>付款抹平:<em
-									class="red wipeText">¥0.00</em></span></label>
-						</td>
-
-						<td colspan="2" class="third-party-fee">${s.shopOtherFee}</td>
-
-						<td colspan="2">
-							<c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if>
-							<c:if test="${s.costType == '2'}">比例成本</c:if>
-						</td>
-					</tr>
-					<tr>
-						<th>商品名</th>
-						<th>规格</th>
-						<th>数量<%--(赠品)--%></th>
-						<th>退货</th>
-<%--						<th colspan="3">单价</th>--%>
-<%--						<th colspan="3">机构税率 / 单税费 / 总税费</th>--%>
-<%--						<th>总价</th>--%>
-<%--						<th>佣金(单)</th>--%>
-<%--						<th>佣金(总)</th>--%>
-						<th colspan="6">供应商税率 / 单税费 / 总税费</th>
-						<th colspan="3">成本(单)</th>
-						<th colspan="4">成本(总)</th>
-					</tr>
-					<c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
-						<tr class="pay-product-item">
-							<input type="hidden" class="p-copId" value="${p.orderProductID}">
-							<td style="width:300px;" class="p-name">
-								<c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
-								<c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
-									${p.name}
-							</td>
-							<td style="width:80px;">${p.unit}</td>
-							<td class="p-num" data-num="${p.num + p.presentNum}">
-									${p.num}
-								<c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
+									<span class="nowrap">已付:${s.payedShopAmount},</span></div>
+								<div><span class="nowrap">待付:<input type="number"
+																	value="<fmt:formatNumber value="${s.waitPayShop}" pattern="0.00"/>"
+																	class="need-to-pay" data-type="${s.differenceType}"
+																	data-difference="${s.differencePrice}"
+																	data-pay="${s.shouldPayShopAmount}"
+																	data-payed="${s.payedShopAmount}"></span></div>
+								<input type="hidden" name="payInfo" class="payInfo" data-shoporderid="${s.shopOrderID}"
+									   value="${s.shopOrderID}_${s.waitPayShop}_0">
+								<label class="wipeBtn"><input class="wipeFee" type="checkbox" value="0"><span>付款抹平:<em
+										class="red wipeText">¥0.00</em></span></label>
 							</td>
-							<td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
-<%--							<td colspan="3"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"--%>
-<%--															  type="number" pattern="#,##0.00"/>--%>
-<%--								<c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">--%>
-<%--									<label style="color: red">--%>
-<%--										(${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})--%>
-<%--									</label>--%>
-<%--								</c:if>--%>
-<%--							</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><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><fmt:formatNumber--%>
-<%--									value="${(empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}"--%>
-<%--									pattern="#,##0.00"/></td>--%>
 
-<%--							<td class="payCm"><fmt:formatNumber--%>
-<%--									value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}"--%>
-<%--									pattern="#,##0.00"/></td>--%>
+							<td class="third-party-fee">${s.shopOtherFee}</td>
 
-							<td colspan="2" 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 colspan="2" 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 colspan="2" class="p-taxes-t"><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.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
-											type="number" pattern="#,##0.00"/>
-								</c:otherwise>
-							</c:choose></td>
-							<td colspan="3" class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
-																	  pattern="#,##0.00"/></td>
-							<td colspan="4"><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
-												  type="number" pattern="#,##0.00"/></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>
+							<th>规格</th>
+							<th>数量<%--(赠品)--%></th>
+							<th>退货</th>
+							<th colspan="2">单价</th>
+							<th colspan="3">机构税率 / 单税费 / 总税费</th>
+							<th colspan="2">总价</th>
+							<th>利润(单)</th>
+							<th>利润(总)</th>
+							<th>平台服务费</th>
+							<th colspan="3">供应商税率 / 单税费 / 总税费</th>
+							<th>成本(单)</th>
+							<th>成本(总)</th>
 						</tr>
-					</c:forEach>
-			</table>
-			</c:forEach>
+						<c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
+							<tr class="pay-product-item">
+								<input type="hidden" class="p-copId" value="${p.orderProductID}">
+								<td style="width:300px;" class="p-name">
+									<c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
+									<c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
+										${p.name}
+								</td>
+								<td style="width:80px;">${p.unit}</td>
+								<td class="p-num" data-num="${p.num + p.presentNum}">
+										${p.num}
+									<c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
+								</td>
+								<td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
+								<td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+																  type="number" pattern="#,##0.00"/>
+									<c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
+										<label style="color: red">
+											(${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+										</label>
+									</c:if>
+								</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><fmt:formatNumber
+										value="${(empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}"
+										pattern="#,##0.00"/></td>
+
+								<td class="payCm"><fmt:formatNumber
+										value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}"
+										pattern="#,##0.00"/></td>
+								<td>${p.cmCostPrice}</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>
+									<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.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
+												type="number" pattern="#,##0.00"/>
+									</c:otherwise>
+								</c:choose></td>
+								<td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
+																		  pattern="#,##0.00"/></td>
+								<td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
+													  type="number" pattern="#,##0.00"/></td>
+							</tr>
+						</c:forEach>
+					</table>
+				</c:forEach>
 		</div>
 		<div class="payment-form-bottom">
 			<div>

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

@@ -292,9 +292,10 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
+    <%--<li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
-    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
+    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>--%>
+    <li><a href="${ctx}/shopOrder/payThirdParties">申请付第三方</a></li>
     <shiro:hasPermission name="order:cmPayShop:split">
         <li><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
     </shiro:hasPermission>

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

@@ -292,9 +292,10 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-     <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
+     <%--<li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
      <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
-     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
+     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>--%>
+     <li><a href="${ctx}/shopOrder/payThirdParties">申请付第三方</a></li>
      <shiro:hasPermission name="order:cmPayShop:split">
          <li class="active tab-li"><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
      </shiro:hasPermission>

+ 594 - 0
src/main/webapp/WEB-INF/views/modules/order/payThirdParties.jsp

@@ -0,0 +1,594 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>申请付款</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        .pay-wrapper {
+            padding: 0 10px
+        }
+
+        .pay-list-item {
+            margin-bottom: 30px
+        }
+
+        .pay-table th {
+            background: #f9f9f9
+        }
+
+        .pay-table tr:first-child th {
+            background: #eee !important
+        }
+
+        .pay-table td {
+            background: #fff !important
+        }
+
+        input[type="checkbox"]::before {
+            content: '\a0';
+            display: inline-block;
+            vertical-align: .2em;
+            width: .8em;
+            height: .8em;
+            margin-right: .2em;
+            border-radius: .2em;
+            text-indent: .15em;
+            line-height: .65
+        }
+
+        .t-btn {
+            width: 120px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            background: #fff;
+            border: 1px solid #ddd;
+            margin-bottom: 10px
+        }
+
+        #select-all {
+            width: 70px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            background: #fff;
+            border: 1px solid #ddd;
+            margin-bottom: 10px
+        }
+
+        #select-all:active {
+            background: #3daae9;
+            color: #fff
+        }
+
+        .pay-more-func {
+            float: right;
+            color: #2fa4e7;
+            cursor: pointer
+        }
+
+        .pay-more-func span:first-child {
+            margin-right: 6px
+        }
+
+        .pay-more-func span:hover {
+            color: #7aa9c3
+        }
+
+        .mask {
+            width: 100%;
+            height: 100%;
+            position: fixed;
+            top: 0;
+            background: rgba(0, 0, 0, 0.7);
+            display: none
+        }
+
+        .revise-popup-content, .tips-popup-content {
+            width: 40%;
+            height: auto;
+            padding-bottom: 30px;
+            background: #fff;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%)
+        }
+
+        .revise-popup-content {
+            width: 450px;
+            height: 360px;
+            overflow-y: scroll;
+            padding: 0 15px 30px 15px
+        }
+
+        .tips-popup-content {
+            width: 30%
+        }
+
+        .tips-popup-content p {
+            text-align: center;
+            padding: 80px;
+            font-size: 20px
+        }
+
+        .revise-popup-content h4, .tips-popup-content h4 {
+            padding-left: 10px;
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px solid #eee;
+            margin-bottom: 20px
+        }
+
+        .revise-popup-content div {
+            margin-top: 7px;
+            text-align: center
+        }
+
+        .revise-popup-content label {
+            width: 70px;
+            text-align: right;
+            vertical-align: text-bottom
+        }
+
+        .revise-popup-content button {
+            width: 80px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:first-child {
+            margin-left: -104px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:last-child {
+            margin-left: 30px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span span {
+            margin-left: 10px
+        }
+
+        .revise-popup-content > div:last-child {
+            text-align: center;
+            margin-top: 20px
+        }
+
+        .revise-popup-content input {
+            width: 100px;
+            margin-bottom: 0px
+        }
+
+        .tips-input-wrapper {
+            width: 100px
+        }
+
+        .pay-status {
+            height: 40px;
+            line-height: 40px;
+            display: block
+        }
+
+        .form-search label {
+            width: 80px;
+            text-align: left;
+            margin-top: 12px
+        }
+
+        .remark-textarea {
+            width: 95%;
+            height: 100px;
+            resize: none
+        }
+
+        .remark-title {
+            text-align: left !important
+        }
+
+        .remark-title span {
+            color: red
+        }
+
+        .ul-form {
+            white-space: nowrap;
+            margin-left: -10px !important
+        }
+
+        .ul-form label {
+            width: 90px;
+            text-align: left;
+            margin-top: 15px
+        }
+
+        .time-space-symbols {
+            width: 100px;
+            display: inline-block;
+            text-align: center
+        }
+
+        #btnSubmit {
+            width: 128px;
+            margin-left: 165px
+        }
+
+        .pay-status label {
+            margin-left: 0
+        }
+
+        .pay-status label:first-child {
+            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}
+
+    </style>
+    <script type="text/javascript">
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li class="active tab-li"><a href="${ctx}/shopOrder/payThirdParties">申请付第三方</a></li>
+    <shiro:hasPermission name="order:cmPayShop:split">
+        <li><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
+    </shiro:hasPermission>
+    <li><a href="${ctx}/shopOrder/settlement">子订单手动结算</a></li>
+</ul>
+<form:form id="searchForm" onsubmit="submitFunc()" modelAttribute="newShopOrder"
+           action="${ctx}/shopOrder/payOrderList?operatingMode=${operatingMode
+}" method="post" class="breadcrumb form-search">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <div class="ul-form">
+        <label>子订单ID:</label>
+        <form:input path="shopOrderID" htmlEscape="false" onkeyup="onlynum(this)" maxlength="8" class="input-medium"/>
+        <label>子订单编号:</label>
+        <form:input path="shopOrderNo" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label>订单ID:</label>
+        <form:input path="orderID" htmlEscape="false" onkeyup="onlynum(this)" maxlength="8" class="input-medium"/>
+        <label>订单编号:</label>
+        <form:input path="orderNo" htmlEscape="false" maxlength="20" class="input-medium"/><br>
+        <label>供应商:</label>
+        <form:input path="shopName" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label>机构:</label>
+        <form:input path="clubName" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label class="control-label">下单时间:</label>
+        <form:input path="startTime" type="text" maxlength="10" class="input-medium Wdate" value="${startTime}"
+                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+        <span class="time-space-symbols">至</span>
+        <form:input path="endTime" type="text" maxlength="10" class="input-medium Wdate" value="${endTime}"
+                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+        <div class="pay-status">
+            <label>组织:</label>
+            <form:select path="organizeID" class="input-medium">
+                <form:option value="" label="请选择"/>
+                <form:option value="0" label="采美"/>
+                <form:option value="9999" label="呵呵商城"/>
+                <c:forEach items="${cmUserOrganizeList}" var="organize">
+                    <c:if test="${organize.id!=4}">
+                        <form:option value="${organize.id}" label="${organize.organizeName}"/>
+                    </c:if>
+                </c:forEach>
+            </form:select>
+            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<div class="pay-wrapper">
+    <button id="applyShopOtherFee" class="t-btn" style="color:white;background-color:#2F6FAB">付第三方申请</button>
+    <c:forEach items="${page.list}" var="s" varStatus="sIndex">
+        <div class="pay-list-item">
+            <table class="table table-striped table-bordered table-condensed pay-table">
+                <tr>
+                    <th style="width:20px;">
+                        <input type="checkbox" ${s.status eq 7 ?'disabled':''} data-shoporderid="${s.shopOrderID}" data-shopid="${s.shopID}" data-isPayShopOtherFee="${s.payShopOtherFee}"/>
+                    </th>
+                    <th>子订单编号(ID)</th>
+                    <th colspan="3">订单编号(ID)</th>
+                    <th colspan="2">订单金额</th>
+                    <th colspan="3">下单时间</th>
+                    <th>收款状态</th>
+                    <th>收款金额</th>
+                    <th colspan="3">经理折扣</th>
+                    <th>优惠券</th>
+                    <th>成本类型</th>
+                </tr>
+                <tr>
+                    <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></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.payTotalFee}" type="number" pattern="#,##0.00"/></td>
+                    <td colspan="3">${s.orderTime}</td>
+                        <%--此处对应订单列表收款状态--%>
+                    <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">
+                        <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
+                        <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
+                        <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
+                    </td>
+                    <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">${s.receiptTotalFee}</a></td>
+                    <td colspan="3">
+                        <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 0}">¥0.00</c:if>
+                    </td>
+                    <td>
+                            ${s.couponAmount}
+                    </td>
+                    <td colspan="2"><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
+                            test="${s.costType == '2'}">比例成本</c:if></td>
+                </tr>
+                <tr>
+                    <th>供应商</th>
+                    <th colspan="3">机构</th>
+                    <th>机构运费</th>
+                    <th>供应商运费</th>
+                    <th colspan="3">商品费</th>
+                    <th colspan="2">付款状态</th>
+                    <th colspan="3">应付税费</th>
+                    <th>付供应商</th>
+                    <th>付第三方</th>
+                </tr>
+                <tr>
+                    <td>${s.shopName}</td>
+                    <td colspan="3">
+                        <c:if test="${s.organizeID eq 1}"><span class="org-note">星范</span></c:if>
+                            ${s.clubName}
+                        <c:if test="${s.orderType eq 2}"><font color="red">(呵呵商城)</font></c:if>
+                        <c:if test="${s.organizeID == 3}"><em class="weishaIcon">维沙</em></c:if>
+                    </td>
+                    <td>
+                        <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>
+                        </c:if>
+                        <c:if test="${s.userBeans > 0}">
+                            <br><font color="red">(采美豆抵用:${s.userBeans})</font>
+                        </c:if>
+                    </td>
+                    <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
+                                                          pattern="#,##0.00"/></td>
+                    <td colspan="3" class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number"
+                                                                          pattern="#,##0.00"/></td>
+                    <td colspan="2"><c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
+                            color="red">待付款</font></c:if>
+                        <c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
+                        <c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if></td>
+                    <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number"
+                                                                    pattern="#,##0.00"/></td>
+                    <td class="supplier-fee">
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2 }">
+                            <font color="#E15616"><fmt:formatNumber value="${s.shouldPayShopAmount}" type="number"
+                                                                    pattern="#,##0.00"/></font>
+                        </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>
+                        </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>
+                        </c:if>
+                    </td>
+                    <input type="hidden" class="payedShopAmount" value="${s.payedShopAmount}">
+                    <input type="hidden" class="productAmount" value="${s.productAmount}">
+                    <input type="hidden" class="costType" value="${s.costType}">
+                    <input type="hidden" class="proportional" value="${s.proportional}">
+                    <input type="hidden" class="modifyShouldPayNote" value="${s.modifyShouldPayNote}">
+                    <td class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number"
+                                                                  pattern="#,##0.00"/></td>
+                </tr>
+                <tr>
+                    <th>商品名</th>
+                    <th>规格</th>
+                    <th>数量<%--(赠品)--%></th>
+                    <th>退货</th>
+                    <th colspan="2">单价</th>
+                    <th colspan="3">机构税率 / 单税费 / 总税费</th>
+                    <th colspan="2">总价</th>
+                    <th colspan="3">供应商税率 / 单税费 / 总税费</th>
+                    <th>成本(单)</th>
+                    <th>成本(总)</th>
+                </tr>
+                <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
+                    <tr class="pay-product-item">
+                        <input type="hidden" class="p-copId" value="${p.orderProductID}">
+                        <td style="width:300px;" class="p-name">
+                            <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
+                            <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
+                                ${p.name}
+                        </td>
+                        <td style="width:80px;">${p.unit}</td>
+                        <td class="p-num" data-num="${p.num + p.presentNum}">
+                                ${p.num}
+                            <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
+                        </td>
+                        <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
+                        <td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                                                          type="number" pattern="#,##0.00"/>
+                            <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
+                                <label style="color: red">
+                                    (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+                                </label>
+                            </c:if>
+                        </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 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>
+                                <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.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
+                                            type="number" pattern="#,##0.00"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </td>
+                        <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
+                                                                  pattern="#,##0.00"/></td>
+                        <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
+                                              type="number" pattern="#,##0.00"/></td>
+                    </tr>
+                </c:forEach>
+            </table>
+            <div class="pay-more-func">
+                <a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${s.shopOrderID}">应付备注</a>
+                <a href="${ctx}/shopOrder/payedAndRefundRecordList?shopOrderID=${s.shopOrderID}&operatingMode=${operatingMode}">退/付款记录</a>
+            </div>
+        </div>
+    </c:forEach>
+</div>
+<div class="pagination">${page}</div>
+
+<script>
+    (function () {
+        var payTableEle = $('.pay-table'),
+            payProductEle = $('.pay-product-item');
+        payTableEle.each(function (i, l) {
+            var leftLength = $(this).find('tr').length,
+                productLength = $(this).find('.pay-product-item').length;
+            // 左侧栏合并单元格
+            $(this).find('tr:first-child th:first-child').attr('rowspan', leftLength);
+        });
+
+        $('.tab-li').on('click', function () {
+            if (getCheckedArr) {
+                sessionStorage.removeItem('checkedIndexArr');
+            }
+        });
+
+        //付第三方
+        $('#applyShopOtherFee').on('click', function () {
+            var checked = $('.pay-wrapper input[type=checkbox]:checked');
+            if (checked.length < 1) {
+                alertx('请选择一个子订单');
+                return false;
+            }
+            if (checked.length > 1) {
+                alertx('每次只能选择一个子订单进行付第三方申请');
+                return false;
+            }
+            var isPayShopOtherFee = $(checked[0]).attr('data-isPayShopOtherFee');
+            if ("false" == isPayShopOtherFee) {
+                alertx("付第三方处于待审核状态,暂不能操作");
+                return false;
+            }
+            var shopOrderId = $(checked[0]).attr('data-shoporderid');
+            window.location.href = '${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=' + shopOrderId+'payType=2';
+        });
+
+        //供应商差价申请
+        $('#applyDifferencePrice').on('click', function () {
+            var checked = $('.pay-wrapper input[type=checkbox]:checked');
+            if (checked.length < 1) {
+                alertx('请选择一个子订单');
+                return false;
+            }
+            if (checked.length > 1){
+                alertx('每次只能选择一个子订单进行供应商差价申请');
+                return false;
+            }
+            var shopOrderId = $(checked[0]).attr('data-shoporderid');
+            window.location.href = '${ctx}/order/cmPayShop/differencePriceForm?shopOrderId=' + shopOrderId;
+        });
+
+    })();
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字
+     */
+    function onlynum(obj) {
+        obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+    }
+
+    function submitFunc() {
+        var checkedArr = [];
+        $('.pay-checkbox').each(function (index) {
+            var thisStatus = $(this).prop('checked');
+            if (thisStatus) {
+                checkedArr.push(index);
+            }
+        })
+        if (checkedArr.length > 0) {
+            sessionStorage.setItem('checkedIndexArr', JSON.stringify(checkedArr));
+        } else {
+            sessionStorage.setItem('checkedIndexArr', []);
+        }
+    }
+
+    function inputnum(obj, val) {
+        obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
+        obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
+        obj.value = obj.value.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
+        obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+        obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
+    }
+</script>
+</body>
+</html>

+ 0 - 1
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -1195,7 +1195,6 @@
                             flag = false;
                         }
                         const num = costPrice*1 + organizeCostPrice*1 + cmCostPrice*1
-                        debugger
                         if (shopId != 11070 ) {
                             if (num != price) {
                                 alertx("采美国定成本和需为机构价")