Browse Source

面料损耗更新

fenghaifu 2 years ago
parent
commit
5c84df1694

+ 6 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/xml/FabricLossMapper.xml

@@ -109,7 +109,7 @@
 					WHERE
 					a.cbustype = '其他入库'
 				) and
-				d.cinvname <> '杂纱'
+				d.cinvname <> '杂纱' and a.iquantity>0
 		) union all (
 			SELECT
 				a.comcode as cCode,isnull(a.iSQuantity,a.iquantity) as iQuantity,isnull(a.iUnitCost,0) as iPrice,isnull(a.cBatch,'') as cBatch,
@@ -134,7 +134,7 @@
 						RdRecords08 b
 						INNER JOIN rdrecord08 a ON a.id = b.ID
 					WHERE
-					a.cbustype = '其他入库'
+					a.cbustype in ('其他入库','转换入库')
 					)
 				) and
 				a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) not IN (
@@ -146,7 +146,7 @@
 					WHERE
 					a.cbustype = '其他入库'
 				) and
-				d.cinvname <> '杂纱'
+				d.cinvname <> '杂纱'  and a.iquantity>0
 		) union all (
 			SELECT
 				a.comcode as cCode,isnull(a.iSQuantity,a.iquantity) as iQuantity,isnull(a.iUnitCost,0) as iPrice,isnull(a.cBatch,'') as cBatch,'杂纱' as cPlanCode
@@ -157,7 +157,7 @@
 				(a.cbatch is null or a.cbatch='' or a.cbatch <> '期初') and
 				(d.cInvCCode LIKE '01%' or d.cInvCCode LIKE '02%' or d.cInvCCode LIKE '03%' or d.cInvCCode LIKE '04%') and
 				a.comcode LIKE CONCAT(#{code},'%') and
-				d.cinvname='杂纱'
+				d.cinvname='杂纱' and a.iquantity>0
 		)
 	</select>
 	<!-- 来源余纱,找委外订单的材料出库单,获取物料号+批号。如果物料号+批号在形态转换单中,取转换前物料+批号。判断物料+批号,是否在其他采购入库里 -->
@@ -186,7 +186,7 @@
 			or d.cInvCCode LIKE '02%'
 			or d.cInvCCode LIKE '03%'
 			or d.cInvCCode LIKE '04%') and
-			a.comcode LIKE 'SYM738%' and
+			a.comcode LIKE CONCAT(#{code},'%') and
 			d.cInvName &lt;&gt; '杂纱' and
 			a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
 			select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
@@ -756,7 +756,7 @@
 				)
 
 		)
-		and e.iQuantity>0 and f.cbustype='其他入库'
+		and e.iQuantity>0 and f.cbustype in ('其他入库','转换入库')
 	)
 	</select>
 </mapper>