退料接收时,检查结算表拿到待退料数量,防止多退
This commit is contained in:
parent
73ca957a7c
commit
76a98b70ea
|
|
@ -715,7 +715,7 @@
|
||||||
bad.audit_num as preNum,
|
bad.audit_num as preNum,
|
||||||
bad.status as status,
|
bad.status as status,
|
||||||
bad.back_status as backStatus,
|
bad.back_status as backStatus,
|
||||||
IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num,
|
COALESCE(sai.num, 0) as num,
|
||||||
bb.finished_back_num,
|
bb.finished_back_num,
|
||||||
mt.manage_type as manageType,
|
mt.manage_type as manageType,
|
||||||
mt.company_id as companyId,
|
mt.company_id as companyId,
|
||||||
|
|
@ -724,18 +724,9 @@
|
||||||
back_apply_details bad
|
back_apply_details bad
|
||||||
LEFT JOIN back_apply_info bai on bai.id=bad.parent_id
|
LEFT JOIN back_apply_info bai on bai.id=bad.parent_id
|
||||||
LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id
|
LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id
|
||||||
|
LEFT JOIN (select agreement_id, COALESCE(num, 0) as num from slt_agreement_info where 'status'='0') sai on tta.agreement_id=sai.agreement_id
|
||||||
LEFT JOIN ma_type mt on mt.type_id=bad.type_id
|
LEFT JOIN ma_type mt on mt.type_id=bad.type_id
|
||||||
LEFT JOIN ma_type mt2 ON mt2.type_id=mt.parent_id
|
LEFT JOIN ma_type mt2 ON mt2.type_id=mt.parent_id
|
||||||
LEFT JOIN (
|
|
||||||
SELECT
|
|
||||||
type_id as typeId,
|
|
||||||
SUM(IFNULL(back_num,0)) as back_num
|
|
||||||
FROM
|
|
||||||
back_check_details
|
|
||||||
WHERE
|
|
||||||
parent_id=#{id}
|
|
||||||
GROUP BY type_id
|
|
||||||
) aa on aa.typeId=bad.type_id
|
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
type_id as typeId,
|
type_id as typeId,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue