|
@@ -14,29 +14,29 @@
|
|
|
END AS refundStatusNew,
|
|
|
(t1.amount - t1.settledAmount) as unsettledAmount
|
|
|
FROM (SELECT t1.*,
|
|
|
- c.name customerName,
|
|
|
- us.nick_name salesmanName,
|
|
|
- us.user_id salesmanId,
|
|
|
+ c.name customerName,
|
|
|
+-- us.nick_name salesmanName,
|
|
|
+-- us.user_id salesmanId,
|
|
|
(SELECT IFNULL(SUM(cc.contract_money), 0)
|
|
|
FROM claim_contract cc
|
|
|
JOIN claim cl ON cc.claim_id = cl.id
|
|
|
WHERE cl.confirm_status = 1
|
|
|
- and cc.contract_id = t1.id) AS sumClaimMoney,
|
|
|
+ and cc.contract_id = t1.id) AS sumClaimMoney,
|
|
|
po.produce_status,
|
|
|
- IFNULL(t3.quantity, 0) AS waitStockQuantity,
|
|
|
- IFNULL(t3.receipt_quantity, 0) AS receiptStockQuantity,
|
|
|
+ IFNULL(t3.quantity, 0) AS waitStockQuantity,
|
|
|
+ IFNULL(t3.receipt_quantity, 0) AS receiptStockQuantity,
|
|
|
IFNULL(
|
|
|
(SELECT sum(pod.finish_quantity * cp.price)
|
|
|
FROM contract_product cp
|
|
|
JOIN production_order_detail pod ON pod.contract_detail_id = cp.id
|
|
|
WHERE cp.contract_id = t1.id)
|
|
|
- , 0) AS settledAmount,
|
|
|
- po.delivery_period as prodDeliveryPeriod,
|
|
|
- IFNULL(t4.deliverQuantity, 0) as deliverQuantity,
|
|
|
+ , 0) AS settledAmount,
|
|
|
+ po.delivery_period as prodDeliveryPeriod,
|
|
|
+ IFNULL(t4.deliverQuantity, 0) as deliverQuantity,
|
|
|
IFNULL(t4.notDeliverQuantity, 0) as notDeliverQuantity
|
|
|
FROM contract t1
|
|
|
left join customer c on t1.buy_corporation_id = c.id
|
|
|
- left join sys_user us on c.user_id = us.user_id
|
|
|
+-- left join sys_user us on c.user_id = us.user_id
|
|
|
LEFT JOIN production_order po ON po.contract_id = t1.id
|
|
|
LEFT JOIN (SELECT pod.contract_id,
|
|
|
IFNULL(sum(swd.quantity), 0) AS quantity,
|