Ver Fonte

退/付款单改页面

zhijiezhao há 3 anos atrás
pai
commit
a03bd0df31
19 ficheiros alterados com 1640 adições e 869 exclusões
  1. 10 0
      src/main/java/com/caimei/modules/order/entity/CmPayShop.java
  2. 9 0
      src/main/java/com/caimei/modules/order/entity/NewShopOrder.java
  3. 1 0
      src/main/java/com/caimei/modules/order/service/CmPayShopService.java
  4. 6 0
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  5. 1 0
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/refundRecord.jsp
  6. 6 2
      src/main/webapp/WEB-INF/views/modules/order/checkPaymentOrder.jsp
  7. 120 109
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp
  8. 199 169
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp
  9. 187 143
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopEdit.jsp
  10. 95 75
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp
  11. 6 2
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp
  12. 145 89
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp
  13. 523 128
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopPrintDetail.jsp
  14. 3 1
      src/main/webapp/WEB-INF/views/modules/order/cmRefundRecordList.jsp
  15. 161 78
      src/main/webapp/WEB-INF/views/modules/order/cmRefundShopDetail.jsp
  16. 151 68
      src/main/webapp/WEB-INF/views/modules/order/cmRefundShopForm.jsp
  17. 5 1
      src/main/webapp/WEB-INF/views/modules/order/paidShopOrderList.jsp
  18. 6 2
      src/main/webapp/WEB-INF/views/modules/order/payedAndRefundRecordList.jsp
  19. 6 2
      src/main/webapp/WEB-INF/views/modules/order/refundRecord.jsp

+ 10 - 0
src/main/java/com/caimei/modules/order/entity/CmPayShop.java

@@ -15,6 +15,7 @@ import java.util.List;
 public class CmPayShop extends DataEntity<CmPayShop> {
 
     private static final long serialVersionUID = 1L;
+
     private String organizeID;//组织ID
     private String shopID;        // 供应商Id
     private String name;        // 付款单名称
@@ -50,6 +51,7 @@ public class CmPayShop extends DataEntity<CmPayShop> {
     private Double ableRebateAmount;//供应商可用余额
     private Double rebateAmount;//供应商余额
     private List<NewShopOrder> shopOrders;  //付款单关联的子订单
+    private List<String> shopOrderNos;      //主订单下所有子订单
     private String reApply;  // 审核不通过  重新修改发起申请
 
     private String shopOrderNo;// 子订单编号
@@ -66,6 +68,14 @@ public class CmPayShop extends DataEntity<CmPayShop> {
     //  付款账号的类型 0公账, 1私账
     private String typeStr;
 
+    public List<String> getShopOrderNos() {
+        return shopOrderNos;
+    }
+
+    public void setShopOrderNos(List<String> shopOrderNos) {
+        this.shopOrderNos = shopOrderNos;
+    }
+
     public String getPayBank() {
         return payBank;
     }

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

@@ -14,6 +14,7 @@ import java.util.List;
  * @description 子订单表
  */
 public class NewShopOrder extends DataEntity<NewShopOrder> {
+    private Double couponAmount;   //母订单使用优惠券金额
     private Integer shopOrderID;//        int(11) not null auto_increment comment '子订单ID',
     private Integer organizeID;//        组织Id
     private String shopOrderNo;//       varchar(30) comment '子订单编号',
@@ -142,6 +143,14 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
 
     private boolean payShopOtherFee = true; //是否可以付第三方申请
 
+    public Double getCouponAmount() {
+        return couponAmount;
+    }
+
+    public void setCouponAmount(Double couponAmount) {
+        this.couponAmount = couponAmount;
+    }
+
     public Integer getOrderPromotionsId() {
         return orderPromotionsId;
     }

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

@@ -264,6 +264,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             cmPayShop.setApplicantName(currentUser.getName());
             cmPayShop.setStatus("0");
             cmPayShop.setShopOrders(payOrderList);
+//            newCmShopDao.find
         } else {
             applyDetail(cmPayShop);
         }

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

@@ -3,6 +3,7 @@
 <mapper namespace="com.caimei.modules.order.dao.NewShopOrderDao">
 
 	<sql id="shopOrderColumns">
+			co.couponAmount as couponAmount,
 			a.shopOrderID AS shopOrderID,
 			a.orderID AS orderID,
 			a.organizeID AS organizeID,
@@ -75,6 +76,7 @@
 	<select id="get" resultType="NewShopOrder" useCache="false" flushCache="true">
 		select <include refid="shopOrderColumns"/>
 		from cm_shop_order a
+		left join cm_order co on co.orderID = a.orderID
 		where a.shopOrderID = #{shopOrderID}
 	</select>
 
@@ -195,6 +197,7 @@
 	<select id="findByShopOrderID" resultType="newShopOrder">
 		select <include refid="shopOrderColumns"/>
 		from cm_shop_order a
+		left join cm_order co on co.orderID = a.orderID
 		where a.shopOrderID = #{shopOrderID}
 	</select>
 
@@ -202,6 +205,7 @@
 		SELECT
 		<include refid="shopOrderColumns"/>
 		FROM cm_shop_order a
+		left join cm_order co on co.orderID = a.orderID
 		<where>
 			<if test="shopOrderNo != null and itemCount != ''" >
 				AND a.shopOrderNo = #{shopOrderNo}
@@ -237,6 +241,7 @@
         b.commercialCode as commercialCode,
 	    oa.id as orderArchiveId
 		FROM cm_shop_order a left join shop b on a.shopID = b.shopID left join cm_order_archive oa on a.shopOrderID = oa.shopOrderId
+		left join cm_order co on co.orderID = a.orderID
 		WHERE a.orderID = #{orderID} ORDER BY a.shopOrderNo DESC
 	</select>
 
@@ -921,6 +926,7 @@
 	<select id="findSiblingPostFeeOrder" resultType="newShopOrder">
 		select <include refid="shopOrderColumns"/>
 		from cm_shop_order a
+		left join cm_order co on co.orderID = a.orderID
 		where  a.orderID = #{orderID} and a.shopID = 998
 	</select>
 

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/bulkpurchase/refundRecord.jsp

@@ -225,6 +225,7 @@
         </td>
     </tr>
     <tr>
+        <td>优惠券:${order.couponAmount}</td>
         <td>退款总额:¥${refundFee}</td>
         <td COLSPAN="3">
 

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

@@ -415,7 +415,8 @@
                     <th>已付金额</th>
                     <th>退款状态</th>
                     <th>退款金额</th>
-                    <th colspan="3">机构</th>
+                    <th colspan="2">机构</th>
+                    <th>优惠券</th>
                     <th>经理折扣</th>
                     <th>机构运费</th>
                     <th>是否返佣</th>
@@ -499,7 +500,7 @@
                         </c:if>
                     </td>
                     <td><fmt:formatNumber value="${s.returnValue}" type="number" pattern="#,##0.00"/></td>
-                    <td colspan="3">
+                    <td colspan="2">
                         <c:if test="${s.organizeID == '1'}">
                             <span class="org-note">星范</span>
                         </c:if>
@@ -511,6 +512,9 @@
 
                         </c:if>
                     </td>
+                    <td>
+                            ${s.couponAmount}
+                    </td>
                     <td><fmt:formatNumber value="${s.discountFee}" type="number" pattern="#,##0.00"/></td>
                     <td>
                         <c:if test="${s.freight == 0}">

+ 120 - 109
src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp

@@ -315,30 +315,66 @@
             <%--涛姐遍历下面这个table--%>
             <table class="table table-striped table-bordered table-condensed pay-table">
                 <tr>
-                    <th>子订单编号(ID)</th>
-                    <th colspan="3">订单编号(ID)</th>
-                    <th colspan="2">订单金额</th>
-                    <th colspan="3">下单时间</th>
+                    <th>订单编号(ID)</th>
+                    <th colspan="3">客户</th>
+                    <th colspan="2">下单时间</th>
+                    <th>订单金额</th>
+                    <th colspan="3">主订单下所有子订单</th>
+                    <th>订单总佣金</th>
+                    <th>机构运费</th>
                     <th>收款状态</th>
-                    <th>收款金额</th>
-                    <th colspan="2">经理折扣</th>
-                    <th colspan="3">成本类型</th>
-                    <th colspan="2">付第三方</th>
-                </tr>
+                    <th colspan="3">收款金额</th>
+                    <th>经理折扣</th>
+                    <th>优惠券</th>
+                <tr/>
                 <tr>
-                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-                    <td colspan="3">${s.orderNo}(${s.orderID})</td>
-                    <td colspan="2">${s.payTotalFee}</td>
-                    <td colspan="3">${s.orderTime}</td>
-                        <%--此处对应订单列表收款状态--%>
-                    <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
+                    <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="${cmPayShop.shopOrders}" var="cs">
+                ${cs.shopOrderNo}(${s.shopOrderID})
+            </c:forEach>
+                    </td>
+                    <td>订单总佣金</td>
+                    <td>
+                        <label class="clubFreight">
+                            <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>
+                    </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="2">
+                            <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">
                             <c:choose>
                                 <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
@@ -371,87 +407,70 @@
                         </c:if>
                         <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                     </td>
-                    <td colspan="3"><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
-                            test="${s.costType == '2'}">比例成本</c:if></td>
-                    <td colspan="2" class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number"
-                                                                              pattern="#,##0.00"/></td>
-                </tr>
+                    <td>${s.couponAmount} </td>
+                <tr/>
                 <tr>
-                    <th>供应商</th>
-                    <th colspan="3">机构</th>
-                    <th>机构运费</th>
-                    <th>供应商运费</th>
+                    <th>子订单编号(ID)</th>
+                    <th colspan="3"> 供应商</th>
+                    <th colspan="3">子订单佣金</th>
                     <th colspan="3">商品费</th>
-                    <th colspan="2">付款状态</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>
                 <tr>
-                    <td>${s.shopName}</td>
-                    <td colspan="3">${s.buyer}<c:if test="${s.organizeID == 3}"></c:if></td>
-                    <td>
-                        <label class="clubFreight">
-                            <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>
+                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                    <td colspan="3">${s.shopName}</td>
+                    <td colspan="3">子订单佣金</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 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>
+
+                    <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="2" class="payCm-t"></td>
-                    <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number"
-                                                                    pattern="#,##0.00"/></td>
-                    <td colspan="2" class="supplier-fee">
-                        <div>
-                            <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">应付:<fmt:formatNumber
-                                    value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
+
+                    <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>
-                            <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
                                 <font color="black">${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}">
+							<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
                                 <font color="black">${s.shouldPayShopAmount-s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
                             </c:if>
-                            , 已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
-                        </div>
-                        <div>
-                            <c:if test="${s.refundAmount > 0}">
-                                <span style="color:red">退款:<fmt:formatNumber value="${s.refundAmount}" type="number"
-                                                                             pattern="#,##0.00"/></span>,
-                            </c:if>
-                            待付: <fmt:formatNumber value="${s.waitPayShop}" type="number" pattern="#,##0.00"/>
-                        </div>
-                        <c:if test="${s.wipePayment > 0}">
-                            <div>
-                                付款抹平:<fmt:formatNumber value="${s.wipePayment}" type="number" pattern="#,##0.00"/>
-                            </div>
-                        </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>
@@ -459,9 +478,9 @@
                     <th>规格</th>
                     <th>数量<%--(赠品)--%></th>
                     <th>退货</th>
-                    <th colspan="2">单价</th>
+                    <th colspan="3">单价</th>
                     <th colspan="3">机构税率 / 单税费 / 总税费</th>
-                    <th colspan="2">总价</th>
+                    <th>总价</th>
                     <th>佣金(单)</th>
                     <th>佣金(总)</th>
                     <th colspan="3">供应商税率 / 单税费 / 总税费</th>
@@ -482,12 +501,12 @@
                             <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}"
+                        <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}">
-                                <font color="red">
+                                <label style="color: red">
                                     (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
-                                </font>
+                                </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>
@@ -502,25 +521,17 @@
                                         type="number" pattern="#,##0.00"/>
                             </c:otherwise>
                         </c:choose></td>
-                        <td colspan="2"><fmt:formatNumber
+                        <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>
-                        <c:if test="${empty p.touchPrice}">
-                            <td><fmt:formatNumber
-                                    value="${p.discountPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}"
-                                    pattern="#,##0.00"/></td>
-                            <td class="payCm"><fmt:formatNumber
-                                    value="${(p.discountPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}"
-                                    pattern="#,##0.00"/></td>
-                        </c:if>
-                        <c:if test="${!empty p.touchPrice}">
-                            <td><fmt:formatNumber
-                                    value="${p.touchPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}"
-                                    pattern="#,##0.00"/></td>
-                            <td class="payCm"><fmt:formatNumber
-                                    value="${(p.touchPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}"
-                                    pattern="#,##0.00"/></td>
-                        </c:if>
+                        <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>

+ 199 - 169
src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp

@@ -93,47 +93,82 @@
             <%--涛姐遍历下面这个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">订单编号(ID)</th>
-					<th colspan="2">订单金额</th>
-					<th colspan="3">下单时间</th>
-					<th>收款状态</th>
-					<th>收款金额</th>
-					<th colspan="2">经理折扣</th>
-					<th colspan="3">成本类型</th>
-					<th colspan="2">付第三方</th>
-				</tr>
-				<tr>
-					<td>${s.shopOrderNo}(${s.shopOrderID})</td>
-					<td colspan="3">${s.orderNo}(${s.orderID})</td>
-					<td colspan="2">${s.payTotalFee}</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="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"/>
+					<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"> 所有子订单</td>
+						<td>订单总佣金</td>
+						<td>
+							<label class="clubFreight">
+								<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.discountTotalFee le s.returnedPurchaseTotalFee}">
-								¥0.00
+							<c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
+								<fmt:formatNumber value="${s.freight}" type="currency"/>
+								<c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
 							</c:if>
-							<c:if test="${s.returnedPurchaseTotalFee gt 0}">
+						</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">
+								<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}">
@@ -143,158 +178,153 @@
 										<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 colspan="3"><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if test="${s.costType == '2'}">比例成本</c:if></td>
-					<td colspan="2" class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number" pattern="#,##0.00"/></td>
-				</tr>
-				<tr>
-					<th>供应商</th>
-					<th colspan="3">机构</th>
-					<th>机构运费</th>
-					<th>供应商运费</th>
-					<th colspan="3">商品费</th>
-					<th colspan="2">付款状态</th>
-					<th colspan="2">采美佣金</th>
-					<th colspan="3">应付税费</th>
-					<th colspan="2">付供应商</th>
-				</tr>
-				<tr>
-					<td>${s.shopName}</td>
-					<td colspan="3">
-							${s.clubName}
-						<c:if test="${s.orderType eq 2}"><font color="red">(呵呵商城)</font></c:if>
-						<c:if test="${s.organizeID == 3}"></c:if>
-					</td>
-					<td>
-						<label class="clubFreight">
-							<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>
-                    </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="2" class="payCm-t"></td>
-					<td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
-					<td colspan="2" class="supplier-fee">
-						<div>
-							<c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
+							<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>付第三方</th>
+						<th>成本类型</th>
+					</tr>
+					<tr>
+						<td>${s.shopOrderNo}(${s.shopOrderID})</td>
+						<td colspan="3">${s.shopName}</td>
+						<td colspan="3">子订单佣金</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.differenceType ne 1 && s.differenceType ne 2}">
 								应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
 							</c:if>
 							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
 								<font color="black">${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">${s.shouldPayShopAmount-s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
-							</c:if>
-							, 已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
-						</div>
-						<div>
-							<c:if test="${s.refundAmount > 0}">
-								<span style="color:red">退款:<fmt:formatNumber value="${s.refundAmount}" type="number" pattern="#,##0.00"/></span>,
+								<font color="black">${s.shouldPayShopAmount-s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
 							</c:if>
-							待付: <fmt:formatNumber value="${s.wipePayment > 0 ? 0 : (s.differenceType eq 1 ? (s.differencePrice + s.waitPayShop):(s.waitPayShop - s.differencePrice))}" type="number" pattern="#,##0.00"/>
-						</div>
-						<c:if test="${s.wipePayment > 0}">
-							<div>
-								付款抹平:<fmt:formatNumber value="${s.wipePayment}" type="number" pattern="#,##0.00"/>
-							</div>
-						</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 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>
+								<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="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}">
-								<font color="red">
-									(${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
-								</font>
-							</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>
+					</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>
+							</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"/>
+									<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>
-						<c:if test="${empty p.touchPrice}">
-							<td><fmt:formatNumber value="${p.discountPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}" pattern="#,##0.00"/></td>
-							<td class="payCm"><fmt:formatNumber value="${(p.discountPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}" pattern="#,##0.00"/></td>
-						</c:if>
-						<c:if test="${!empty p.touchPrice}">
-							<td><fmt:formatNumber value="${p.touchPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}" pattern="#,##0.00"/></td>
-							<td class="payCm"><fmt:formatNumber value="${(p.touchPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}" pattern="#,##0.00"/></td>
-						</c:if>
-                        <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>
+							<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"/>
+									<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>
+							<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>

+ 187 - 143
src/main/webapp/WEB-INF/views/modules/order/cmPayShopEdit.jsp

@@ -83,28 +83,62 @@
             <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">订单编号(ID)</th>
-                        <th colspan="2">订单金额</th>
-                        <th colspan="3">下单时间</th>
+                        <th>订单编号(ID)</th>
+                        <th colspan="3">客户</th>
+                        <th colspan="2">下单时间</th>
+                        <th>订单金额</th>
+                        <th colspan="3">主订单下所有子订单</th>
+                        <th>订单总佣金</th>
+                        <th>机构运费</th>
                         <th>收款状态</th>
-                        <th>收款金额</th>
-                        <th colspan="2">经理折扣</th>
-                        <th colspan="3">成本类型</th>
-                        <th colspan="2">付第三方</th>
-                    </tr>
+                        <th colspan="3">收款金额</th>
+                        <th>经理折扣</th>
+                        <th>优惠券</th>
+                    <tr/>
                     <tr>
-                        <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-                        <td colspan="3">${s.orderNo}(${s.orderID})</td>
-                        <td colspan="2">${s.payTotalFee}</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="2">
+                        <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"> 所有子订单</td>
+                        <td>订单总佣金</td>
+                        <td>
+                            <label class="clubFreight">
+                                <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>
+                        </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">
                                 <c:choose>
                                     <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
@@ -117,7 +151,8 @@
                             </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"/>
+                                    <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
+                                                      type="currency"/>
                                 </c:if>
                                 <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
                                     ¥0.00
@@ -136,140 +171,149 @@
                             </c:if>
                             <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                         </td>
-                        <td colspan="3"><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if test="${s.costType == '2'}">比例成本</c:if></td>
-                        <td colspan="2" class="third-party-fee">${s.shopOtherFee}</td>
-                    </tr>
+                        <td>${s.couponAmount} </td>
+                    <tr/>
                     <tr>
-                        <th>供应商</th>
-                        <th colspan="3">客户</th>
-                        <th>机构运费</th>
-                        <th>供应商运费</th>
+                        <th>子订单编号(ID)</th>
+                        <th colspan="3"> 供应商</th>
+                        <th colspan="3">子订单佣金</th>
                         <th colspan="3">商品费</th>
-                        <th colspan="2">付款状态</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>
                     <tr>
-                        <td>${s.shopName}</td>
-                        <td colspan="3">${s.buyer}<c:if test="${s.organizeID == 3}"></c:if></td>
-                        <td>
-                        <label class="clubFreight">
-                            <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>
-                    </td>
-                        <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number" pattern="#,##0.00"/></td>
+                        <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                        <td colspan="3">${s.shopName}</td>
+                        <td colspan="3">子订单佣金</td>
                         <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
-                        <td colspan="2"><c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font color="red">待付款</font></c:if>
+
+                        <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="2" class="payCm-t"></td>
-                        <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
-                        <td colspan="2" class="supplier-fee">
-                            <div>
-                                <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
-                                    应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
-                                </c:if>
-                                <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
-                                    <font color="black">${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">${s.shouldPayShopAmount-s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
-                                </c:if>
-                                ,已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
-                            </div>
-                            <div>待付:<fmt:formatNumber value="${s.wipePayment>0 ? 0 : s.waitPayShop}" type="number" pattern="#,##0.00"/></div>
-							<c:if test="${s.wipePayment > 0}">
-								<div>
-									付款抹平:<fmt:formatNumber value="${s.wipePayment}" type="number" pattern="#,##0.00"/>
-								</div>
-							</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 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}">
-                                <font color="red">
-                                    (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
-                                </font>
+
+                        <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>
+							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                                <font color="black">${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">${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>${(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="${p.discountPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}" pattern="#,##0.00"/></td>
-						<td class="payCm"><fmt:formatNumber value="${(p.discountPrice + 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><fmt:formatNumber value="${p.costPrice}" type="number" pattern="#,##0.00"/></td>
-                        <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}" pattern="#,##0.00"/></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>
-				</c:forEach>
+                    <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>
+                            </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="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>

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

@@ -368,8 +368,13 @@
             border-radius: 2px
         }
 
-        .clubFreight{display: none}
-        .discountFee{display: none}
+        .clubFreight {
+            display: none
+        }
+
+        .discountFee {
+            display: none
+        }
     </style>
 </head>
 <body>
@@ -410,32 +415,62 @@
             <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">订单编号(ID)</th>
-                        <th colspan="2">订单金额</th>
-                        <th colspan="3">下单时间</th>
+                        <th>订单编号(ID)</th>
+                        <th colspan="3">客户</th>
+                        <th colspan="2">下单时间</th>
+                        <th>订单金额</th>
+                        <th colspan="3">主订单下所有子订单</th>
+                        <th>订单总佣金</th>
+                        <th>机构运费</th>
                         <th>收款状态</th>
-                        <th>收款金额</th>
-                        <th colspan="2">经理折扣</th>
-                        <th colspan="3">成本类型</th>
-                        <th colspan="2">付第三方</th>
-                    </tr>
+                        <th colspan="3">收款金额</th>
+                        <th>经理折扣</th>
+                        <th>优惠券</th>
+                    <tr/>
                     <tr>
-                        <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-                        <td colspan="3">${s.orderNo}(${s.orderID})</td>
-                        <td colspan="2">${s.payTotalFee}</td>
-                        <td colspan="3">${s.orderTime}</td>
-                            <%--此处对应订单列表收款状态--%>
+                        <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"> 所有子订单</td>
+                        <td>订单总佣金</td>
+                        <td>
+                            <label class="clubFreight">
+                                <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>
+                        </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>
+                                <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 colspan="2">
+                               style="text-decoration: underline">${s.receiptTotalFee}</a>
+                        </td>
+                        <td>
                             <label class="discountFee">
                                 <c:choose>
                                     <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
@@ -468,64 +503,41 @@
                             </c:if>
                             <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                         </td>
-                        <td colspan="3"><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
-                                test="${s.costType == '2'}">比例成本</c:if></td>
-                        <td colspan="2" class="third-party-fee">${s.shopOtherFee}</td>
-                    </tr>
+                        <td>${s.couponAmount} </td>
+                    <tr/>
                     <tr>
-                        <th>供应商</th>
-                        <th colspan="3">客户</th>
-                        <th>机构运费</th>
-                        <th>供应商运费</th>
+                        <th>子订单编号(ID)</th>
+                        <th colspan="3"> 供应商</th>
+                        <th colspan="3">子订单佣金</th>
                         <th colspan="3">商品费</th>
-                        <th colspan="2">付款状态</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>
                     <tr>
-                        <td>${s.shopName}</td>
-                        <td colspan="3">
-                                ${s.buyer}
-                            <c:if test="${s.orderType eq 2}"><font color="red">(呵呵商城)</font></c:if>
-                            <c:if test="${s.organizeID == 3}"></c:if></td>
-                        <td>
-                            <label class="clubFreight">
-                                <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>
+                        <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                        <td colspan="3">${s.shopName}</td>
+                        <td colspan="3">子订单佣金</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 colspan="3" class="product-fee">${s.shopProductAmount}</td>
-                        <td colspan="2"><c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
-                                color="red">待付款</font></c:if>
+
+                        <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="2" class="payCm-t"></td>
-                        <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number"
-                                                                        pattern="#,##0.00"/></td>
-                        <td colspan="2" class="supplier-fee">
+
+                        <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"/>
@@ -549,16 +561,22 @@
                             <label class="wipeBtn"><input class="wipeFee" type="checkbox" value="0"><span>付款抹平:<em
                                     class="red wipeText">¥0.00</em></span></label>
                         </td>
-                        <input type="hidden" class="payedShopAmount" value="${s.payedShopAmount}">
+
+                        <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="2">单价</th>
+                        <th colspan="3">单价</th>
                         <th colspan="3">机构税率 / 单税费 / 总税费</th>
-                        <th colspan="2">总价</th>
+                        <th>总价</th>
                         <th>佣金(单)</th>
                         <th>佣金(总)</th>
                         <th colspan="3">供应商税率 / 单税费 / 总税费</th>
@@ -579,7 +597,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="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                            <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">
@@ -599,15 +617,17 @@
                                             type="number" pattern="#,##0.00"/>
                                 </c:otherwise>
                             </c:choose></td>
-                            <td colspan="2"><fmt:formatNumber
+                            <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>
@@ -915,8 +935,8 @@
                 comissionEle = thisEle.find('.payCm-t'),
                 thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',', ''),
                 freightVal = thisEle.find('.freight').text().replace(',', ''),
-                clubFreight = Number(thisEle.find('.clubFreight').text().replace(',','')),
-                discountFee = Number(thisEle.find('.discountFee').text().replace(',',''));
+                clubFreight = Number(thisEle.find('.clubFreight').text().replace(',', '')),
+                discountFee = Number(thisEle.find('.discountFee').text().replace(',', ''));
             totalComissionEle.each(function () {
                 totalComissionVal += Number($(this).text().replace(',', ''));
             })

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

@@ -399,7 +399,8 @@
                     <th>收款状态</th>
                     <th>收款金额</th>
                     <th colspan="3">经理折扣</th>
-                    <th colspan="2">成本类型</th>
+                    <th>优惠券</th>
+                    <th>成本类型</th>
                 </tr>
                 <tr>
                     <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></td>
@@ -436,7 +437,10 @@
                         </c:if>
                         <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                     </td>
-                    <td colspan="2"><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
+                    <td>
+                            ${s.couponAmount}
+                    </td>
+                    <td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
                             test="${s.costType == '2'}">比例成本</c:if></td>
                 </tr>
                 <tr>

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

@@ -338,31 +338,77 @@
             <%--涛姐遍历下面这个table--%>
             <table class="table table-striped table-bordered table-condensed pay-table">
                 <tr>
-                    <th>子订单编号(ID)</th>
-                    <th colspan="3">订单编号(ID)</th>
-                    <th colspan="2">订单金额</th>
-                    <th colspan="3">下单时间</th>
+                    <th>订单编号(ID)</th>
+                    <th colspan="3">客户</th>
+                    <th colspan="2">下单时间</th>
+                    <th>订单金额</th>
+                    <th colspan="3">主订单下所有子订单</th>
+                    <th>订单总佣金</th>
+                    <th>机构运费</th>
                     <th>收款状态</th>
-                    <th>收款金额</th>
-                    <th colspan="2">经理折扣</th>
-                    <th colspan="3">成本类型</th>
-                    <th colspan="2">付第三方</th>
-                </tr>
+                    <th colspan="3">收款金额</th>
+                    <th>经理折扣</th>
+                    <th>优惠券</th>
+                <tr/>
                 <tr>
-                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-                    <td colspan="3">${s.orderNo}(${s.orderID})</td>
-                    <td colspan="2">${s.payTotalFee}</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="2">
+                    <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"> 所有子订单
+                    </td>
+                    <td>订单总佣金</td>
+                    <td>
+                        <label class="clubFreight">
+                            <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>
+                    </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">
+                            <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"/>
+                                <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
+                                                  type="currency"/>
                             </c:if>
                             <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
                                 ¥0.00
@@ -381,69 +427,70 @@
                         </c:if>
                         <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                     </td>
-                    <td colspan="3"><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if test="${s.costType == '2'}">比例成本</c:if></td>
-                    <td colspan="2" class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number" pattern="#,##0.00"/></td>
-                </tr>
+                    <td>${s.couponAmount} </td>
+                <tr/>
                 <tr>
-                    <th>供应商</th>
-                    <th colspan="3">机构</th>
-                    <th>机构运费</th>
-                    <th>供应商运费</th>
+                    <th>子订单编号(ID)</th>
+                    <th colspan="3"> 供应商</th>
+                    <th colspan="3">子订单佣金</th>
                     <th colspan="3">商品费</th>
-                    <th colspan="2">付款状态</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>
                 <tr>
-                    <td>${s.shopName}</td>
-                    <td colspan="3">${s.buyer}<c:if test="${s.organizeID == 3}"></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>
+                    <td>${s.shopOrderNo}(${s.shopOrderID})</td>
+                    <td colspan="3">${s.shopName}</td>
+                    <td colspan="3">子订单佣金</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 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>
+
+                    <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="2" class="payCm-t"></td>
-                    <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
-                    <td colspan="2" class="supplier-fee">
-                        <div>
-                            <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
+
+                    <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>
-                            <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
                                 <font color="black">${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}">
+							<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
                                 <font color="black">${s.shouldPayShopAmount-s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
                             </c:if>
-                            , 已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
-                        </div>
-                        <div>
-                            <c:if test="${s.refundAmount > 0}">
-                                <span style="color:red">退款:<fmt:formatNumber value="${s.refundAmount}" type="number" pattern="#,##0.00"/></span>,
-                            </c:if>
-                            待付: <fmt:formatNumber value="${s.waitPayShop}" type="number" pattern="#,##0.00"/>
-                        </div>
-                        <c:if test="${s.wipePayment > 0}">
-                            <div>
-                                付款抹平:<fmt:formatNumber value="${s.wipePayment}" type="number" pattern="#,##0.00"/>
-                            </div>
-                        </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>
@@ -451,9 +498,9 @@
                     <th>规格</th>
                     <th>数量<%--(赠品)--%></th>
                     <th>退货</th>
-                    <th colspan="2">单价</th>
+                    <th colspan="3">单价</th>
                     <th colspan="3">机构税率 / 单税费 / 总税费</th>
-                    <th colspan="2">总价</th>
+                    <th>总价</th>
                     <th>佣金(单)</th>
                     <th>佣金(总)</th>
                     <th colspan="3">供应商税率 / 单税费 / 总税费</th>
@@ -474,11 +521,12 @@
                             <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"/>
+                        <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}">
-                                <font color="red">
+                                <label style="color: red">
                                     (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
-                                </font>
+                                </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>
@@ -488,18 +536,22 @@
                                 ---
                             </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"/>
+                                <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>
-                        <c:if test="${empty p.touchPrice}">
-                            <td><fmt:formatNumber value="${p.discountPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}" pattern="#,##0.00"/></td>
-                            <td class="payCm"><fmt:formatNumber value="${(p.discountPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}" pattern="#,##0.00"/></td>
-                        </c:if>
-                        <c:if test="${!empty p.touchPrice}">
-                            <td><fmt:formatNumber value="${p.touchPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}" pattern="#,##0.00"/></td>
-                            <td class="payCm"><fmt:formatNumber value="${(p.touchPrice + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}" pattern="#,##0.00"/></td>
-                        </c:if>
+                        <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>
@@ -507,11 +559,15 @@
                                 ---
                             </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"/>
+                                <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>
+                        <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>

+ 523 - 128
src/main/webapp/WEB-INF/views/modules/order/cmPayShopPrintDetail.jsp

@@ -95,29 +95,82 @@
             <%--涛姐遍历下面这个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">订单编号(ID)</th>
-					<th>订单金额</th>
-					<th>下单时间</th>
-					<th colspan="2">经理折扣</th>
-					<th>成本类型</th>
-					<th>付第三方</th>
-				</tr>
-				<tr>
-					<td>${s.shopOrderNo}(${s.shopOrderID})</td>
-					<td colspan="3">${s.orderNo}(${s.orderID})</td>
-					<td>${s.payTotalFee}</td>
-					<td>${s.orderTime}</td>
-					<td colspan="2">
-						<c:if test="${s.discountTotalFee gt 0}">
-							<c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
-								<fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}" type="currency"/>
+					<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"> 所有子订单</td>
+						<td>订单总佣金</td>
+						<td>
+							<label class="clubFreight">
+								<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.discountTotalFee le s.returnedPurchaseTotalFee}">
-								¥0.00
+							<c:if test="${s.freight == -1}">
+								到付
 							</c:if>
-							<c:if test="${s.returnedPurchaseTotalFee gt 0}">
+							<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>
+						</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">
+								<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}">
@@ -127,51 +180,48 @@
 										<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><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if test="${s.costType == '2'}">比例成本</c:if></td>
-					<td class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number" pattern="#,##0.00"/></td>
-				</tr>
-				<tr>
-					<th>供应商</th>
-					<th colspan="3">客户</th>
-					<th>机构运费</th>
-					<th>供应商运费</th>
-					<th>商品费</th>
-					<th>付款状态</th>
-					<th>应付税费</th>
-					<th colspan="2">付供应商</th>
-				</tr>
-				<tr>
-					<td>${s.shopName}</td>
-					<td colspan="3">${s.buyer}<c:if test="${s.organizeID == 3}"></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>
-                    </td>
-					<td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number" pattern="#,##0.00"/></td>
-					<td class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number" pattern="#,##0.00"/>
-					<td><c:if test="${s.payStatus == 1}"><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 class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
-					<td class="supplier-fee">
-						<div>
-							<c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">应付:<fmt:formatNumber
-									value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
+							<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>付第三方</th>
+						<th>成本类型</th>
+					</tr>
+					<tr>
+						<td>${s.shopOrderNo}(${s.shopOrderID})</td>
+						<td colspan="3">${s.shopName}</td>
+						<td colspan="3">子订单佣金</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.differenceType ne 1 && s.differenceType ne 2}">
+								应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
 							</c:if>
 							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
 								<font color="black">${s.shouldPayShopAmount+s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
@@ -179,60 +229,104 @@
 							<c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
 								<font color="black">${s.shouldPayShopAmount-s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
 							</c:if>
-							,已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
-						</div>
-						<div>
-							<c:if test="${s.refundAmount > 0}">
-								<span style="color:red">退款:<fmt:formatNumber value="${s.refundAmount}" type="number" pattern="#,##0.00"/></span>,
-							</c:if>
-							待付:<fmt:formatNumber value="${s.wipePayment>0 ? 0 : s.waitPayShop}" type="number" pattern="#,##0.00"/>
-						</div>
-						<c:if test="${s.wipePayment > 0}">
-							<div>
-								付款抹平:<fmt:formatNumber value="${s.wipePayment}" type="number" pattern="#,##0.00"/>
-							</div>
-						</c:if>
-					</td>
-				</tr>
-				<tr>
-					<th>商品名</th>
-					<th>规格</th>
-					<th>数量<%--(赠品数)--%></th>
-                    <th>退货<%--数量--%></th>
-					<th>供应商税率</th>
-                    <th>供应商税费(单)</th>
-                    <th colspan="2">供应商税费(总)</th>
-                    <th>成本(单)</th>
-					<th>成本(总)</th>
-				</tr>
-				<c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
-					<tr class="pay-product-item">
-						<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}
+							,</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 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 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><font color="${p.returnedNum>0?'red':''}">${empty p.returnedNum?0:p.returnedNum}</font></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 colspan="2" class="p-taxes-t"><c:choose>
+					</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>
+							</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.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}" type="number" pattern="#,##0.00"/>
+									<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><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>
+							<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>
 		</div>
@@ -330,15 +424,44 @@
 		</div>
 	</div>
 	<script>
-		(function(){
-			var payTableEle = $('.pay-table'),
-					payProductEle = $('.pay-product-item');
-			payTableEle.each(function (i,l) {
-				var productLength = $(this).find('.pay-product-item').length;
-				// 商品列表合并单元格
-				$(this).find('.mergeRows').attr('rowspan',productLength);
-			});
+		// (function(){
+		// 	var payTableEle = $('.pay-table'),
+		// 			payProductEle = $('.pay-product-item');
+		// 	payTableEle.each(function (i,l) {
+		// 		var productLength = $(this).find('.pay-product-item').length;
+		// 		// 商品列表合并单元格
+		// 		$(this).find('.mergeRows').attr('rowspan',productLength);
+		// 	});
+		// 	var payCm = 0;
+		// 	$('.payCm').each(function () {
+		// 		payCm += Number($(this).text().replace(',', ''));
+		// 	});
+		// 	$('.freight,.taxes').each(function () {
+		// 		payCm -= Number($(this).text().replace(',', ''));
+		// 	});
+		// 	$('.payCm-t').text(payCm.toFixed(2).toLocaleString());
+		//
+		// 	$('.tips-cancel-btn, #close-btn1').on('click',function() {
+		// 		$('.tips-popup').hide();
+		// 	})
+		// 	$('.tips-cfm-directly').on('click',function() {
+		// 		if($('.tips-cfm-btn').hasClass('tips-cfm-directly')) {
+		// 			$('.tips-popup').hide();
+		// 		}
+		// 	})
+		//
+		// 	$('.export').on('click',function() {
+		// 		window.print();
+		// 	})
+		//
+		// 	function showTips(title,text) {
+		// 		$('.tips-popup h4').text(title);
+		// 		$('.tips-popup p').text(text);
+		// 		$('.tips-popup').show();
+		// 	}
+		// })();
 
+		(function () {
 			var payCm = 0;
 			$('.payCm').each(function () {
 				payCm += Number($(this).text().replace(',', ''));
@@ -346,27 +469,299 @@
 			$('.freight,.taxes').each(function () {
 				payCm -= Number($(this).text().replace(',', ''));
 			});
+			$('.export').on('click',function() {
+				window.print();
+			})
 			$('.payCm-t').text(payCm.toFixed(2).toLocaleString());
 
-			$('.tips-cancel-btn, #close-btn1').on('click',function() {
+			var payTableEle = $('.pay-table'),
+					listenClickNumStatus = true,
+					payProductEle = $('.pay-product-item');
+			payTableEle.each(function (i, l) {
+				var productLength = $(this).find('.pay-product-item').length;
+				// 商品列表合并单元格
+				$(this).find('.mergeRows').attr('rowspan',productLength);
+			});
+			$(window).on("load", function () {
+				$('.need-to-pay').each(function (index, ele) {
+					<%--if ($(this).val() <= 0) {--%>
+					<%--	alertx("待付金额为负数,不能操作付款抹平。请先去操作供应商退款,使数据恢复正常", function () {--%>
+					<%--		window.location.href = "${ctx}/shopOrder/refundRecordList?operatingMode=2"--%>
+					<%--	});--%>
+					<%--}--%>
+					var thisEle = $(this),
+							wrapper = thisEle.parents(".supplier-fee"),
+							shouldPay = thisEle.attr('data-pay') * 1,
+							differencePrice = thisEle.attr('data-difference') * 1,
+							differenceType = thisEle.attr('data-type'),
+							alreadyPaid = thisEle.attr('data-payed') * 1;
+					if (thisEle.val().length > 8) {
+						thisEle.val(thisEle.val().slice(0, 8));
+					}
+					if (differenceType == 2) {
+						differencePrice = -differencePrice;
+					}
+					if ((thisEle.val() > shouldPay - alreadyPaid + differencePrice) || thisEle.val() < 0) {
+						thisEle.val((shouldPay - alreadyPaid + differencePrice).toFixed(2));
+					}
+					var wipe = parseFloat((shouldPay - alreadyPaid - thisEle.val() + differencePrice).toFixed(12));
+					if (wipe > 0) {
+						wrapper.find('.wipeBtn').show();
+					} else {
+						wrapper.find('.wipeBtn').hide();
+						wrapper.find('.wipeFee').prop("checked", false);
+					}
+					wrapper.find('.wipeFee').val(wipe);
+					wrapper.find('.wipeText').text('¥' + wipe.toFixed(2));
+				});
+			});
+			$('.tips-cancel-btn, #close-btn1').on('click', function () {
 				$('.tips-popup').hide();
-			})
-			$('.tips-cfm-directly').on('click',function() {
-				if($('.tips-cfm-btn').hasClass('tips-cfm-directly')) {
+			});
+			$('.tips-cfm-directly').on('click', function () {
+				if ($('.tips-cfm-btn').hasClass('tips-cfm-directly')) {
 					$('.tips-popup').hide();
+				} else {
+					if (listenClickNumStatus) {
+						$('#form').submit();
+						listenClickNumStatus = false;
+					}
 				}
 			})
 
-			$('.export').on('click',function() {
-				window.print();
-			})
-
-			function showTips(title,text) {
+			function showTips(title, text) {
 				$('.tips-popup h4').text(title);
 				$('.tips-popup p').text(text);
 				$('.tips-popup').show();
 			}
-		})()
+
+			$('body').on('keyup', '#wipeRemarks', function () {
+				$('#remarkLen').text($(this).val().length);
+			});
+			$('body').on('change', '.wipeBtn input', function () {
+				var wrapper = $(this).parents(".supplier-fee");
+				wrapper.find('.need-to-pay').trigger("input");
+				wrapper.find('.need-to-pay').trigger("propertychange");
+			});
+			//  待付<=应付-已付
+			$('body').on('input propertychange', '.need-to-pay', function () {
+				var thisEle = $(this),
+						wrapper = thisEle.parents(".supplier-fee"),
+						shouldPay = thisEle.attr('data-pay') * 1,
+						differencePrice = thisEle.attr('data-difference') * 1,
+						differenceType = thisEle.attr('data-type'),
+						alreadyPaid = thisEle.attr('data-payed') * 1;
+				if (thisEle.val().length > 8) {
+					thisEle.val(thisEle.val().slice(0, 8));
+				}
+				if (differenceType == 2) {
+					differencePrice = -differencePrice;
+				}
+				if ((thisEle.val() > shouldPay - alreadyPaid + differencePrice) || thisEle.val() < 0) {
+					thisEle.val((shouldPay - alreadyPaid + differencePrice).toFixed(2));
+				}
+				var wipe = parseFloat((shouldPay - alreadyPaid - thisEle.val() + differencePrice).toFixed(12));
+				if (wipe > 0) {
+					wrapper.find('.wipeBtn').show();
+				} else {
+					wrapper.find('.wipeBtn').hide();
+					wrapper.find('.wipeFee').prop("checked", false);
+				}
+				wrapper.find('.wipeFee').val(wipe);
+				wrapper.find('.wipeText').text('¥' + wipe.toFixed(2));
+				var totalAmount = 0, wipeTotalFee = 0;
+				$('.need-to-pay').each(function (index, ele) {
+					totalAmount += Number($(this).val());
+				});
+				$('.wipeFee:checked').each(function (index, ele) {
+					wipeTotalFee += Number($(this).val());
+				});
+				totalAmount = totalAmount.toFixed(2);
+				wipeTotalFee = wipeTotalFee.toFixed(2);
+				if (Number(wipeTotalFee) > 0) {
+					$('.wipeVisible').show();
+					$('#wipePayment').val(wipeTotalFee);
+					$('.wipeTotalFee').text('¥' + wipeTotalFee);
+				} else {
+					$('.wipeVisible').hide();
+					$('#wipePayment').val(0);
+					$('.wipeTotalFee').text('¥0.00');
+				}
+				$('#totalAmount').text(totalAmount);
+				$('#totalAmount-hidden').val(totalAmount);
+				$('#transferPayFee').text(totalAmount);
+				$('#transferPayFee-hidden').val(totalAmount);
+				$('#ableRebateAmount').text($('#ableRebateAmount-hidden').val());
+				$('#remainingBalance').text($('#ableRebateAmount-hidden').val());
+				$('.used-amount').val(0);
+				var payInfo = wrapper.find('.payInfo');
+				var checkedWipe = wrapper.find('.wipeFee:checked').length > 0 ? wrapper.find('.wipeFee:checked').val() : 0;
+				payInfo.val(payInfo.attr('data-shoporderid') + '_' + thisEle.val() + '_' + checkedWipe);
+			});
+
+//			使用余额<总余额
+			$('body').on('input propertychange', '.used-amount', function () {
+				var thisEle = $(this),
+						thisVal = Number(thisEle.val()),
+						//totalAmount = Number($('#totalAmount').text()),
+						totalAmount = ${cmPayShop.totalAmount},
+						rebateAmount = Number($('#rebateAmount-hidden').val()),
+						ableRebateAmount = Number($('#ableRebateAmount-hidden').val());
+
+				if ((thisVal > ableRebateAmount) || thisVal < 0 || thisVal > totalAmount) {
+					thisEle.val(0);
+					$('#transferPayFee').text(totalAmount);
+					$('#transferPayFee-hidden').val(totalAmount);
+					$('#ableRebateAmount').text($('#ableRebateAmount-hidden').val());
+					$('#remainingBalance').text(rebateAmount);
+				} else {
+					$('#transferPayFee').text((totalAmount - thisVal).toFixed(2));
+					$('#transferPayFee-hidden').val((totalAmount - thisVal).toFixed(2));
+					$('#ableRebateAmount').text((ableRebateAmount - thisVal).toFixed(2));
+					$('#remainingBalance').text((rebateAmount - thisVal).toFixed(2));
+				}
+			});
+
+			$('.pay-table').each(function () {
+				var thisEle = $(this),
+						totalComissionVal = 0,
+						resVal = '';
+				totalComissionEle = thisEle.find('.payCm'),
+						comissionEle = thisEle.find('.payCm-t'),
+						thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',', ''),
+						freightVal = thisEle.find('.freight').text().replace(',', ''),
+						clubFreight = Number(thisEle.find('.clubFreight').text().replace(',', '')),
+						discountFee = Number(thisEle.find('.discountFee').text().replace(',', ''));
+				totalComissionEle.each(function () {
+					totalComissionVal += Number($(this).text().replace(',', ''));
+				})
+				resVal = (totalComissionVal + clubFreight - discountFee - thirdPartyVal - freightVal).toFixed(2);
+				comissionEle.text(resVal);
+			})
+
+			$('.apply-btn').on('click', function () {
+				var payNameVal = $('#payment-form-name').val(),
+						accountNameVal = $('#account-name').val(),
+						accountNoVal = $('#account-no').val(),
+						accountBankVal = $('#account-bank').val();
+
+				if (!payNameVal.trim()) {
+					alertx("付款单名称不能为空");
+					return false;
+				}
+				if (!accountNameVal.trim()) {
+					alertx("户名不能为空");
+					return false;
+				}
+				if (!accountNoVal.trim()) {
+					alertx("账号不能为空");
+					return false;
+				}
+				if (!accountBankVal.trim()) {
+					alertx("开户行不能为空");
+					return false;
+				}
+				if ($('#wipePayment').val() * 1 > 0) {
+					if (!$('#wipeRemarks').val().trim()) {
+						alertx("抹平备注不能为空");
+						return false;
+					}
+					var imgArr = [];
+					if ($('#image1').val()) {
+						imgArr.push($('#image1').val());
+					}
+					if ($('#image2').val()) {
+						imgArr.push($('#image2').val());
+					}
+					if ($('#image3').val()) {
+						imgArr.push($('#image3').val());
+					}
+					if ($('#image4').val()) {
+						imgArr.push($('#image4').val());
+					}
+					if ($('#image5').val()) {
+						imgArr.push($('#image5').val());
+					}
+					if (imgArr.length > 0) {
+						$('#wipeRemarkImages').val(imgArr.join("##"));
+					} else {
+						$('#wipeRemarkImages').val('');
+					}
+					$('.tips-cfm-btn').removeClass('tips-cfm-directly');
+					$('.tips-cancel-btn').show();
+					showTips('确认提示', '本次付款存在付款抹平行为,付款抹平总额为¥' + $('#wipePayment').val() + ',确认无误后,请点击确定按钮提交付款申请!');
+				} else {
+					$('#wipePayment').val(0);
+					$('#wipeRemarks').val('');
+					$('#wipeRemarkImages').val('');
+					$('.tips-cfm-btn').removeClass('tips-cfm-directly');
+					$('.tips-cancel-btn').show();
+					showTips('确认提示', '确定要提交申请吗?');
+				}
+			})
+		})();
+
+		//图片初始化
+		$(function () {
+			$('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+			$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
+			$('.upload-content .conList').find('.cancel-upload').hide();
+			var observeEle = document.getElementsByClassName('upload-content')[0];
+			var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
+			var MutationObserverConfig = {
+				childList: true,
+				subtree: true,
+				characterData: true
+			};
+			var observer = new MutationObserver(function (mutations) {
+				$.each(mutations, function (index, item) {
+					if (item.type === 'childList') {
+						// 在创建新的 element 时调用
+						var target = $(item.target),
+								thisWrapper = target.closest('.conList'),
+								nextEle = thisWrapper.next();
+						thisWrapper.find('li').css('z-index', 99);
+						thisWrapper.find('.cancel-upload').show();
+						if (nextEle.hasClass('hide-pic')) {
+							nextEle.removeClass('hide-pic');
+						}
+					}
+				})
+			});
+			observer.observe(observeEle, MutationObserverConfig);
+
+			$('body').on('click', '.cancel-upload', function () {
+				var wrapper = $(this).closest('.conList');
+				wrapper.find('li').css('z-index', '-1');
+				wrapper.find('input').val('');
+				$(this).hide();
+				if ($('.cancel-upload:visible').length < 9) {
+					wrapper.addClass("hide-pic");
+				} else {
+					wrapper.removeClass("hide-pic");
+				}
+				wrapper.parent().append(wrapper.clone());
+				wrapper.remove();
+				$(".conList").each(function (i, ele) {
+					if ($(ele).find("input.imagesInput").val()) {
+						$(ele).next().removeClass("hide-pic")
+					}
+				})
+			});
+			$(window).on("load", function () {
+				setTimeout(function () {
+					$("#wipeImageBox").find("input.imagesInput").each(function (i, ele) {
+						if ($(ele).val()) {
+							$(ele).next().find("li").css("z-index", "99");
+							$(ele).parents(".conList").find(".cancel-upload").show();
+							$(ele).parents(".conList").next().removeClass("hide-pic")
+						}
+					})
+				}, 500);
+			});
+		});
+
+
 	</script>
 </body>
 </html>

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

@@ -178,7 +178,8 @@
 					<th>收款状态</th>
 					<th>收款金额</th>
 					<th colspan="3">经理折扣</th>
-					<th colspan="3">成本类型</th>
+					<th>优惠券</th>
+					<th colspan="2">成本类型</th>
 				</tr>
 				<tr>
 					<td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></td>
@@ -213,6 +214,7 @@
 						</c:if>
 						<c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
 					</td>
+					<td>${s.couponAmount}</td>
 					<td colspan="3"><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if test="${s.costType == '2'}">比例成本</c:if></td>
 				</tr>
 				<tr>

+ 161 - 78
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopDetail.jsp

@@ -85,30 +85,76 @@
 				<c:forEach items="${cmRefundShop.shopOrders}" var="s">
 					<table class="table table-striped table-bordered table-condensed pay-table">
 						<tr>
-							<th>子订单编号(ID)</th>
-							<th colspan="3">订单编号(ID)</th>
-							<th colspan="2">订单金额</th>
-							<th colspan="3">下单时间</th>
+							<th>订单编号(ID)</th>
+							<th colspan="3">客户</th>
+							<th colspan="2">下单时间</th>
+							<th>订单金额</th>
+							<th colspan="3">主订单下所有子订单</th>
+							<th>订单总佣金</th>
+							<th>机构运费</th>
 							<th>收款状态</th>
-							<th>收款金额</th>
-							<th colspan="3">经理折扣</th>
-							<th>成本类型</th>
-							<th>付第三方</th>
-						</tr>
+							<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">${s.payTotalFee}</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> ${s.orderNo}(${s.orderID})</td>
+							<td colspan="3"> ${s.buyer}</td>
+							<td colspan="2"> ${s.orderTime}</td>
+							<td>${s.payTotalFee}</td>
+							<td colspan="3"> 所有子订单</td>
+							<td>订单总佣金</td>
+							<td>
+								<label class="clubFreight">
+									<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>
+							</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">
+									<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"/>
+										<fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
+														  type="currency"/>
 									</c:if>
 									<c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
 										¥0.00
@@ -127,52 +173,70 @@
 								</c:if>
 								<c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
 							</td>
-							<td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if test="${s.costType == '2'}">比例成本</c:if></td>
-							<td class="third-party-fee">${s.shopOtherFee}</td>
-						</tr>
+							<td>${s.couponAmount} </td>
+						<tr/>
 						<tr>
-							<th>供应商</th>
-							<th colspan="3">客户</th>
-							<th>机构运费</th>
-							<th>供应商运费</th>
+							<th>子订单编号(ID)</th>
+							<th colspan="3"> 供应商</th>
+							<th colspan="3">子订单佣金</th>
 							<th colspan="3">商品费</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>
 						<tr>
-							<td>${s.shopName}</td>
-							<td colspan="3">
-								<c:if test="${s.organizeID == 1}"><span class="org-note">星范</span></c:if>
-									${s.buyer}<c:if test="${s.organizeID == 3}"></c:if>
+							<td>${s.shopOrderNo}(${s.shopOrderID})</td>
+							<td colspan="3">${s.shopName}</td>
+							<td colspan="3">子订单佣金</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.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>
-							</td>
-							<td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number" pattern="#,##0.00"/></td>
-							<td colspan="3" class="product-fee">${s.shopProductAmount}</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 == 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 colspan="2" class="supplier-fee">
-								<div>应付:${s.shouldPayShopAmount}, 已付:<span class="payed">${s.payedShopAmount}</span>
-									<c:if test="${s.wipePayment > 0}"><font color="red">(付款抹平¥${s.wipePayment})</font></c:if>
-								</div>
-								<div>退款:${s.refundAmount}</div>
+
+							<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>
+							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+								<font color="black">${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">${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>
@@ -180,9 +244,11 @@
 							<th>规格</th>
 							<th>数量<%--(赠品)--%></th>
 							<th>退货</th>
-							<th colspan="2">单价</th>
+							<th colspan="3">单价</th>
 							<th colspan="3">机构税率 / 单税费 / 总税费</th>
-							<th colspan="2">总价</th>
+							<th>总价</th>
+							<th>佣金(单)</th>
+							<th>佣金(总)</th>
 							<th colspan="3">供应商税率 / 单税费 / 总税费</th>
 							<th>成本(单)</th>
 							<th>成本(总)</th>
@@ -193,15 +259,16 @@
 								<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}
+										${p.name}
 								</td>
 								<td style="width:80px;">${p.unit}</td>
 								<td class="p-num" data-num="${p.num + p.presentNum}">
-									${p.num}
+										${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">${empty p.touchPrice?p.discountPrice:p.touchPrice }
+								<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)?'不含税-能开票':'不含税-不能开票'})
@@ -211,26 +278,42 @@
 								<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>
+									<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>
+									<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>

+ 151 - 68
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopForm.jsp

@@ -90,30 +90,76 @@
 				<c:forEach items="${cmRefundShop.shopOrders}" var="s">
 				<table class="table table-striped table-bordered table-condensed pay-table">
 					<tr>
-						<th>子订单编号(ID)</th>
-						<th colspan="3">订单编号(ID)</th>
-						<th colspan="2">订单金额</th>
-						<th colspan="3">下单时间</th>
+						<th>订单编号(ID)</th>
+						<th colspan="3">客户</th>
+						<th colspan="2">下单时间</th>
+						<th>订单金额</th>
+						<th colspan="3">主订单下所有子订单</th>
+						<th>订单总佣金</th>
+						<th>机构运费</th>
 						<th>收款状态</th>
-						<th>收款金额</th>
-						<th colspan="3">经理折扣</th>
-						<th>成本类型</th>
-						<th>付第三方</th>
-					</tr>
+						<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">${s.payTotalFee}</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> ${s.orderNo}(${s.orderID})</td>
+						<td colspan="3"> ${s.buyer}</td>
+						<td colspan="2"> ${s.orderTime}</td>
+						<td>${s.payTotalFee}</td>
+						<td colspan="3"> 所有子订单</td>
+						<td>订单总佣金</td>
+						<td>
+							<label class="clubFreight">
+								<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>
+						</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">
+								<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"/>
+									<fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
+													  type="currency"/>
 								</c:if>
 								<c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
 									¥0.00
@@ -132,52 +178,70 @@
 							</c:if>
 							<c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
 						</td>
-						<td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if test="${s.costType == '2'}">比例成本</c:if></td>
-						<td class="third-party-fee">${s.shopOtherFee}</td>
-					</tr>
+						<td>${s.couponAmount} </td>
+					<tr/>
 					<tr>
-						<th>供应商</th>
-						<th colspan="3">客户</th>
-						<th>机构运费</th>
-						<th>供应商运费</th>
+						<th>子订单编号(ID)</th>
+						<th colspan="3"> 供应商</th>
+						<th colspan="3">子订单佣金</th>
 						<th colspan="3">商品费</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>
 					<tr>
-						<td>${s.shopName}</td>
-						<td colspan="3">${s.buyer}<c:if test="${s.organizeID == 3}"></c:if></td>
+						<td>${s.shopOrderNo}(${s.shopOrderID})</td>
+						<td colspan="3">${s.shopName}</td>
+						<td colspan="3">子订单佣金</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.freight == 0}">
-								包邮
+							<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>
-							<c:if test="${s.freight == -1}">
-								到付
+							<c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+								<font color="black">${s.shouldPayShopAmount+s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
 							</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 test="${s.differenceType eq 2 && s.differencePrice > 0}">
+								<font color="black">${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="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number" pattern="#,##0.00"/></td>
-						<td colspan="3" class="product-fee">${s.shopProductAmount}</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 colspan="2" class="supplier-fee">
-							<div>应付:${s.shouldPayShopAmount}, 已付:${s.payedShopAmount}
-								<c:if test="${s.wipePayment > 0}"><font color="red">(付款抹平¥${s.wipePayment})</font></c:if>
-							</div>
-							<div>已退:${s.refundsAmount}<%--, 待退:<span class="need-refund"><fmt:formatNumber value="${s.payedShopAmount-s.refundsAmount-s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/></span>--%></div>
-							<div>退款:<input type="number" value="0" class="refund refundMoneyInput" ></div>
-							<input type="hidden" data-shoporderid="${s.shopOrderID}" name="refundInfo" class="refundInfo" value="${s.shopOrderID}_${s.payedShopAmount-s.refundsAmount-s.shouldPayShopAmount}">
-							<input type="hidden" class="need-refund" value="${s.payedShopAmount-s.refundsAmount}">
+
+						<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>
@@ -185,9 +249,11 @@
 						<th>规格</th>
 						<th>数量<%--(赠品)--%></th>
 						<th>退货</th>
-						<th colspan="2">单价</th>
+						<th colspan="3">单价</th>
 						<th colspan="3">机构税率 / 单税费 / 总税费</th>
-						<th colspan="2">总价</th>
+						<th>总价</th>
+						<th>佣金(单)</th>
+						<th>佣金(总)</th>
 						<th colspan="3">供应商税率 / 单税费 / 总税费</th>
 						<th>成本(单)</th>
 						<th>成本(总)</th>
@@ -198,19 +264,20 @@
 							<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}
+									${p.name}
 							</td>
 							<td style="width:80px;">${p.unit}</td>
 							<td class="p-num" data-num="${p.num + p.presentNum}">
-								${p.num}
+									${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"/>
+							<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}">
-									<font color="red">
+									<label style="color: red">
 										(${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
-									</font>
+									</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>
@@ -220,10 +287,22 @@
 									---
 								</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"/>
+									<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.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>
@@ -231,11 +310,15 @@
 									---
 								</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"/>
+									<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>
+							<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>

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

@@ -308,7 +308,8 @@
                     <th>收款状态</th>
                     <th>收款金额</th>
                     <th colspan="3">经理折扣</th>
-                    <th colspan="2">成本类型</th>
+                    <th>优惠券</th>
+                    <th>成本类型</th>
                 </tr>
                 <tr>
                     <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></td>
@@ -345,6 +346,9 @@
                         </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>

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

@@ -110,7 +110,8 @@
         <th colspan="3">下单时间</th>
         <th>收款状态</th>
         <th>收款金额</th>
-        <th colspan="3">经理折扣</th>
+        <th colspan="2">经理折扣</th>
+        <th>优惠券</th>
         <th>成本类型</th>
         <th>付第三方</th>
     </tr>
@@ -126,7 +127,7 @@
             <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">
+        <td colspan="2">
             <c:if test="${s.discountTotalFee gt 0}">
                 <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
                     <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}" type="currency"/>
@@ -148,6 +149,9 @@
             </c:if>
             <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
         </td>
+        <td>
+            ${s.couponAmount}
+        </td>
         <td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
                 test="${s.costType == '2'}">比例成本</c:if></td>
         <td class="third-party-fee">${s.shopOtherFee}</td>

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

@@ -107,7 +107,8 @@
                 <th>已付金额</th>
                 <th>退款状态</th>
                 <th>退款金额</th>
-                <th colspan="3">机构</th>
+                <th colspan="2">机构</th>
+                <th>优惠券</th>
                 <th>经理折扣</th>
                 <th>机构运费</th>
                 <th>是否返佣</th>
@@ -187,12 +188,15 @@
                     </c:if>
                 </td>
                 <td><fmt:formatNumber value="${order.returnValue}" type="number" pattern="#,##0.00"/></td>
-                <td colspan="3">
+                <td colspan="2">
                     <c:if test="${order.organizeID == '1'}">
                         <span class="org-note">星范</span>
                     </c:if>
                         ${order.buyer}<c:if test="${order.organizeID == 3}"></c:if>
                 </td>
+                <td>
+                    ${order.couponAmount}
+                </td>
                 <td><fmt:formatNumber value="${order.discountFee}" type="number" pattern="#,##0.00"/></td>
                 <td>
                     <c:if test="${order.freight == 0}">