|  | @@ -15,9 +15,9 @@
 | 
	
		
			
				|  |  |  		and
 | 
	
		
			
				|  |  |  		exists (select x.cVenCode from Vendor x where x.cVenCode=om_momain.cVenCode and x.cVCCode='0105')
 | 
	
		
			
				|  |  |  		and cCode like CONCAT(#{code},'%')
 | 
	
		
			
				|  |  | -		and (cCloser is null or cCloser='asuser')
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  	<!-- 制单人 103的委外发票制单人 -->
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getMakingPeople" resultType="java.lang.String">
 | 
	
		
			
				|  |  |  		select distinct cpbvmaker From PurBillVouch where cInCode in (
 | 
	
		
			
				|  |  |  		select cCode From  RdRecord01 where cOrderCode in (
 | 
	
	
		
			
				|  | @@ -29,7 +29,7 @@
 | 
	
		
			
				|  |  |  			and (cCloser is null or cCloser='asuser')
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  |  	<!-- 排单数量 -->
 | 
	
		
			
				|  |  |  	<select id="getNumber" resultType="java.lang.String">
 | 
	
		
			
				|  |  |  		select sum(isnull(iQuantity,0))as 'iQuantity'  from VIEW_OM_MOMain_ALL_Clothes
 | 
	
	
		
			
				|  | @@ -40,6 +40,7 @@
 | 
	
		
			
				|  |  |  		select isnull(sum(iQuantity),0) as 'iQuantity' from VIEW_FabricLoss_Head_Clothes_SaleOut_Sum where
 | 
	
		
			
				|  |  |  		cCode like CONCAT(#{code},'%')
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getPrice" resultType="java.lang.String">
 | 
	
		
			
				|  |  |  		select isnull(sum(a.count)/sum(b.iquantity),0) as 'price' from (
 | 
	
		
			
				|  |  |  		select sum((isnull(c.iQuantity,0)*isnull(b.iunitcost,0))+(isnull(c.iQuantity,0)*isnull(b.iprocesscost,0))) as 'count' ,a.cordercode as 'cordercode'     from rdrecord01 a left join rdrecords01 b on a.id=b.id
 | 
	
	
		
			
				|  | @@ -53,14 +54,15 @@
 | 
	
		
			
				|  |  |  		and	b.csoordercode=#{code}
 | 
	
		
			
				|  |  |  		</if>
 | 
	
		
			
				|  |  |  		GROUP BY b.csoordercode
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getOrderCode" resultType="java.lang.String">
 | 
	
		
			
				|  |  |  		select distinct a.cpoid as 'cpoid' from PO_Pomain a left join PO_Podetails b on a.POID=b.POID
 | 
	
		
			
				|  |  |  		where a.cVenCode='T020001'
 | 
	
		
			
				|  |  |  		<if test="code!=null and ''!=code">
 | 
	
		
			
				|  |  |  			and b.csoordercode=#{code}
 | 
	
		
			
				|  |  |  		</if>
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	<!--获取采购订单,物料名为物料名+颜色-->
 | 
	
		
			
				|  |  |  	<select id="getPurchaseList" resultType="org.jeecg.modules.report.entity.FabricPoOrder">
 | 
	
	
		
			
				|  | @@ -287,7 +289,7 @@
 | 
	
		
			
				|  |  |  	</select>-->
 | 
	
		
			
				|  |  |  	<!--获取所有委外订单 cComUnitCode : 计量单位,02(PCS)根,04(M)米-->
 | 
	
		
			
				|  |  |  	<select id="getOmOrderListAll" resultType="org.jeecg.modules.report.entity.FabricOMOrder">
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +		select * from (
 | 
	
		
			
				|  |  |  			SELECT b.MODetailsID,e.cVCName,d.cVenName ,d.cVenAbbName ,a.cVenCode ,c.cInvCode,c.cInvName,c.cComUnitCode,
 | 
	
		
			
				|  |  |  				isnull(b.cFree1,'') as cColor,
 | 
	
		
			
				|  |  |  				isnull((select sum(iQuantity) from rdrecords11 x where x.iOMoDID=b.MODetailsID),0) as iQuantityOut,
 | 
	
	
		
			
				|  | @@ -302,7 +304,8 @@
 | 
	
		
			
				|  |  |  			WHERE
 | 
	
		
			
				|  |  |  				c.cInvCCode NOT LIKE '19%'
 | 
	
		
			
				|  |  |  				AND a.cCode LIKE CONCAT(#{code},'%')
 | 
	
		
			
				|  |  | -			order by e.cVCName,d.cVenName,c.cInvCode,c.cInvName,c.cComUnitCode,b.cFree1,b.cdefine30
 | 
	
		
			
				|  |  | +		) as t1 where (iQuantityOut>0 or iQuantityIn>0)
 | 
	
		
			
				|  |  | +		order by cVCName,cVenName,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  	<!--获取销售出库委外订单行id-->
 | 
	
	
		
			
				|  | @@ -324,6 +327,7 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  	<!--获取本次采购入库的委外材料出库单,已核销的取核销数量-->
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getOmOutList" resultType="map">
 | 
	
		
			
				|  |  |  		SELECT
 | 
	
		
			
				|  |  |  			g.cVenName,
 | 
	
	
		
			
				|  | @@ -364,8 +368,9 @@
 | 
	
		
			
				|  |  |  				)
 | 
	
		
			
				|  |  |  			)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  |  	<!--获取本次采购入库的形态转换-->
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getAssemVouchList" resultType="map">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		select * from VIEW_FabricLoss_AssemVouchs where
 | 
	
	
		
			
				|  | @@ -376,7 +381,7 @@
 | 
	
		
			
				|  |  |  			and a.cPOID like CONCAT(#{code},'%')
 | 
	
		
			
				|  |  |  			)
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  |  	<!--获取本次采购入库单,含发票和结算数据-->
 | 
	
		
			
				|  |  |  	<select id="getPurchaseInList" resultType="org.jeecg.modules.report.entity.FabricPoOrderIn">
 | 
	
		
			
				|  |  |  		select a.cCode,a.cBusType,b.cInvCode,isnull(b.cFree1,'') as cColor,isnull(b.cBatch,'') as cBatch,b.iQuantity,e.cInvName,
 | 
	
	
		
			
				|  | @@ -474,7 +479,7 @@
 | 
	
		
			
				|  |  |  		order by cVenName,cSBVCode,cInvName
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  	<!--获取委外入库物料被其他委外订单使用的金额 -->
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getOmInToOtherMoney" resultType="java.lang.String">
 | 
	
		
			
				|  |  |  		select isnull(sum(b.iprice),0) as iPrice from rdrecords11 b
 | 
	
		
			
				|  |  |  		inner join OM_MODetails c on b.iOMoDID=c.MODetailsID
 | 
	
	
		
			
				|  | @@ -498,7 +503,7 @@
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  |  		and d.ccode not like CONCAT(#{code},'%')
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  |  	<!--获取使用其他委外入库物料的金额 -->
 | 
	
		
			
				|  |  |  	<!--
 | 
	
		
			
				|  |  |  	<select id="getOmOtherToCurMoney" resultType="java.lang.String">
 | 
	
	
		
			
				|  | @@ -643,6 +648,7 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	</select>-->
 | 
	
		
			
				|  |  |  	<!-- 获取委外订单行id,入库物料编号+颜色,处理费用,入库数量 -->
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getOmRowInfoList" resultType="map">
 | 
	
		
			
				|  |  |  		select b.MODetailsID,
 | 
	
		
			
				|  |  |  			 b.cinvcode+isnull(b.cfree1,'') as cInvCodeColorIn,
 | 
	
	
		
			
				|  | @@ -656,8 +662,7 @@
 | 
	
		
			
				|  |  |  		WHERE
 | 
	
		
			
				|  |  |  		c.cInvCCode NOT LIKE '19%'
 | 
	
		
			
				|  |  |  		AND a.cCode LIKE CONCAT(#{code},'%')
 | 
	
		
			
				|  |  | -		<!--and exists (select * from  rdrecords01 x where x.iOMoDID=b.MODetailsID)-->
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  |  	<!-- 获取委外订单行id,出库物料信息,出库数量 -->
 | 
	
		
			
				|  |  |  	<select id="getOmRowOutList" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
 | 
	
		
			
				|  |  |  		select b.MODetailsID,
 | 
	
	
		
			
				|  | @@ -680,6 +685,7 @@
 | 
	
		
			
				|  |  |  			 having sum(d.iQuantity)>0
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  	<!-- 获取委外订单出库物料的入库物料信息:包含采购入库、委外入库 -->
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getOmRowInList" resultType="map">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			select f.cBusType,f.cCode,g.cVenName,g.cVenAbbName,
 | 
	
	
		
			
				|  | @@ -708,8 +714,9 @@
 | 
	
		
			
				|  |  |  					AND a.cCode like CONCAT(#{code},'%')
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  				) and e.iQuantity>0
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  |  	<!-- 获取委外订单出库物料的入库物料信息:包含其他入库 -->
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getOmRowInList2" resultType="map">
 | 
	
		
			
				|  |  |  		select f.cBusType,f.cCode,'' as cVenName,'' as cVenAbbName,
 | 
	
		
			
				|  |  |  			e.cInvCode,isnull(e.cFree1,'') as cColor,isnull(e.cBatch,'') as cBatch,
 | 
	
	
		
			
				|  | @@ -734,8 +741,9 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		)  and e.iQuantity>0 order by e.autoid desc
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  |  	<!-- 根据形态转换物料获取采购入库 -->
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getOmRowInListWithAV" resultType="map">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	select e.autoid,f.cBusType,f.cCode,g.cVenName,g.cVenAbbName,
 | 
	
	
		
			
				|  | @@ -782,8 +790,9 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  |  		and e.iQuantity>0
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  |  	<!-- 根据形态转换物料获取其他入库信息 -->
 | 
	
		
			
				|  |  | +	<!--
 | 
	
		
			
				|  |  |  	<select id="getOmRowInListWithAV2" resultType="map">
 | 
	
		
			
				|  |  |  	select e.autoid,f.cBusType,f.cCode,'' as cVenName,'' as cVenAbbName,
 | 
	
		
			
				|  |  |  		e.cInvCode,isnull(e.cFree1,'') as cColor,isnull(e.cBatch,'') as cBatch,
 | 
	
	
		
			
				|  | @@ -823,7 +832,7 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  |  		and e.iQuantity>0 and f.cbustype in ('其他入库','转换入库') order by e.autoid desc
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +	</select>-->
 | 
	
		
			
				|  |  |  	<!-- 获取销售订单附件 -->
 | 
	
		
			
				|  |  |  	<select id="getSoAccList" resultType="org.jeecg.modules.report.entity.AccessorItem">
 | 
	
		
			
				|  |  |  		select distinct cFileId,Filename from VIEW_ACC_LIST_SO where cSoCode=#{cSoCode}
 | 
	
	
		
			
				|  | @@ -1017,7 +1026,7 @@
 | 
	
		
			
				|  |  |  		select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
 | 
	
		
			
				|  |  |  		INNER JOIN OM_MODetails e on b.iOMoDID=e.MODetailsID
 | 
	
		
			
				|  |  |  		inner join om_momain f on f.moid = e.moid
 | 
	
		
			
				|  |  | -		where f.cCode like CONCAT(#{code},'%') and (f.cCloser is null or f.cCloser='asuser')
 | 
	
		
			
				|  |  | +		where f.cCode like CONCAT(#{code},'%')
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  |  		or cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
 | 
	
		
			
				|  |  |  		select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
 | 
	
	
		
			
				|  | @@ -1025,7 +1034,7 @@
 | 
	
		
			
				|  |  |  		select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
 | 
	
		
			
				|  |  |  		INNER JOIN OM_MODetails e on b.iOMoDID=e.MODetailsID
 | 
	
		
			
				|  |  |  		inner join om_momain f on f.moid = e.moid
 | 
	
		
			
				|  |  | -		where f.cCode like CONCAT(#{code},'%') and (f.cCloser is null or f.cCloser='asuser')
 | 
	
		
			
				|  |  | +		where f.cCode like CONCAT(#{code},'%')
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  |  		)
 | 
	
	
		
			
				|  | @@ -1044,7 +1053,7 @@
 | 
	
		
			
				|  |  |  				inner join OM_MODetails p on o.moid  =p.moid
 | 
	
		
			
				|  |  |  				inner join Inventory q on p.cInvCode=q.cInvCode
 | 
	
		
			
				|  |  |  				inner join RdRecords01 r on r.iOMoDID=p.MODetailsID
 | 
	
		
			
				|  |  | -				where o.cCode like CONCAT(#{code},'%') and (o.cCloser is null or o.cCloser='asuser')
 | 
	
		
			
				|  |  | +				where o.cCode like CONCAT(#{code},'%')
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  	<!--获取本次委外入库的形态转换-->
 | 
	
	
		
			
				|  | @@ -1055,7 +1064,7 @@
 | 
	
		
			
				|  |  |  			select cInvCode+isnull(cBatch,'')+isnull(cFree1,'')  from RdRecords01
 | 
	
		
			
				|  |  |  			where iOMoDID in (
 | 
	
		
			
				|  |  |  			select b.MODetailsID from om_momain a inner join OM_MODetails b on a.moid  =b.moid
 | 
	
		
			
				|  |  | -			and a.cCode like CONCAT(#{code},'%') and (a.cCloser is null or a.cCloser='asuser')
 | 
	
		
			
				|  |  | +			and a.cCode like CONCAT(#{code},'%')
 | 
	
		
			
				|  |  |  			)
 | 
	
		
			
				|  |  |  		)
 | 
	
		
			
				|  |  |  	</select>
 |