feat: 科室往来出库明细

lh_dev_fifo
chenhc 9 months ago
parent 78e1def83a
commit f150561704

@ -122,12 +122,12 @@
aw.code as fromInvCode,
aw.name as fromInvName,
SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN COALESCE(a2.price,0) * COALESCE(a2.count,0)
WHEN a1.mainAction = 'WareHouseIn' THEN -(COALESCE(a2.price,0) * COALESCE(a2.count,0))
WHEN a1.mainAction = 'WareHouseIn' THEN (COALESCE(a2.price,0) * COALESCE(a2.count,0))
ELSE 0
END) AS amount,
SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN COALESCE(a2.count,0)
WHEN a1.mainAction = 'WareHouseIn' THEN -(COALESCE(a2.count,0))
WHEN a1.mainAction = 'WareHouseIn' THEN (COALESCE(a2.count,0))
ELSE 0
END) AS `count`
@ -176,13 +176,13 @@
SELECT
aw.code as fromInvCode,
aw.name as fromInvName,
bc.name as fromCorpName,
SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN -COALESCE(a2.price,0) * COALESCE(a2.count,0)
IFNULL(bc.name,aw2.name) as fromCorpName,
SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN COALESCE(a2.price,0) * COALESCE(a2.count,0)
WHEN a1.mainAction = 'WareHouseIn' THEN (COALESCE(a2.price,0) * COALESCE(a2.count,0))
ELSE 0
END) AS amount,
SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN -COALESCE(a2.count,0)
SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN COALESCE(a2.count,0)
WHEN a1.mainAction = 'WareHouseIn' THEN (COALESCE(a2.count,0))
ELSE 0
END) AS `count`
@ -192,8 +192,9 @@
LEFT JOIN io_order_detail_result a2 ON a1.billNo = a2.orderIdFk
LEFT JOIN basic_udirel bu on bu.id = a2.bindRlFk
LEFT JOIN basic_corp bc on bc.erpId = a1.fromCorp
LEFT JOIN auth_warehouse aw2 on a1.fromInvCode = aw2.CODE
<where>
a1.status = 7 and a1.fromCorp is not null
a1.status = 7
<if test="invCode != null and invCode != ''">
AND a1.invCode = #{invCode}
</if>

Loading…
Cancel
Save