@ -17,7 +17,7 @@
c.supplierID AS supplierId,
b.inspector_date,
b.submit_date,
a. order_qty,
d.required_qty as order_qty,
roll_qty,
roll_count,
inspection_result,
@ -102,13 +102,24 @@
</select>
<select id= "getInboundQcResultOtherData" resultType= "PoOrderRollNoOutData" >
select
top 1 b.expiration_day, b.expiration_flag, b.exceed_in_ratio, b.expiration_warning_day,
isnull(a.batch_qualified_qty,0)-isnull((select sum(roll_qty) from po_order_roll_no where site=#{site} and bu_no=#{buNo} and inspection_no=#{orderNo} ),0) as remainingIssuableQty
SELECT
b.expiration_day,
ISNULL(b.expiration_flag ,'N') AS expiration_flag,
b.exceed_in_ratio,
b.expiration_warning_day,
ISNULL(a.batch_qualified_qty, 0) * (1 + ISNULL(b.exceed_in_ratio, 0) / 100.0)
- ISNULL((
SELECT SUM(roll_qty)
FROM po_order_roll_no
WHERE site = #{site}
AND bu_no = #{buNo}
AND inspection_no = #{orderNo}
), 0) AS remainingIssuableQty
from qc_iqc_record a
left join part b on a.site=b.site and a.bu_no=b.bu_No and a.part_no=b.PartNo
and a.inspection_no=#{orderNo} and a.site=#{site} and a.bu_no=#{buNo}
left join part b on a.site = b.site and a.bu_no = b.bu_No and a.part_no = b.PartNo
where a.inspection_no = #{orderNo} and a.site = #{site} and a.bu_no = #{buNo}
</select>
<insert id= "savePoOrderRollNo" >
insert into po_order_roll_no
(site,bu_no,inspection_no,order_no,item_no,roll_no,roll_qty,part_no,part_desc,supplier_id,supplier_name,order_qty,