|
@@ -88,15 +88,14 @@
|
|
|
a.comcode as cCode,isnull(a.iSQuantity,a.iquantity) as iQuantity,a.iUnitCost as iPrice
|
|
a.comcode as cCode,isnull(a.iSQuantity,a.iquantity) as iQuantity,a.iUnitCost as iPrice
|
|
|
FROM
|
|
FROM
|
|
|
rdrecords11 a
|
|
rdrecords11 a
|
|
|
- INNER JOIN OM_MODetails b ON a.iOMoDID = b.MODetailsID
|
|
|
|
|
- INNER JOIN om_momain c ON c.moid = b.moid
|
|
|
|
|
- INNER JOIN Inventory d ON b.cinvcode = d.cinvcode
|
|
|
|
|
|
|
+ INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
|
|
|
WHERE
|
|
WHERE
|
|
|
- (d.cInvCCode LIKE '01%'
|
|
|
|
|
|
|
+ a.cbatch is not null and a.cbatch <>'期初' and
|
|
|
|
|
+ (d.cInvCCode LIKE '01%'
|
|
|
or d.cInvCCode LIKE '02%'
|
|
or d.cInvCCode LIKE '02%'
|
|
|
or d.cInvCCode LIKE '03%'
|
|
or d.cInvCCode LIKE '03%'
|
|
|
or d.cInvCCode LIKE '04%')
|
|
or d.cInvCCode LIKE '04%')
|
|
|
- AND c.cCode LIKE CONCAT(#{code},'%')
|
|
|
|
|
|
|
+ and a.comcode LIKE CONCAT(#{code},'%')
|
|
|
AND (a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) IN (
|
|
AND (a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) IN (
|
|
|
SELECT
|
|
SELECT
|
|
|
b.cInvCode + isnull( b.cFree1, '' ) + isnull( b.cBatch, '' )
|
|
b.cInvCode + isnull( b.cFree1, '' ) + isnull( b.cBatch, '' )
|
|
@@ -135,6 +134,7 @@
|
|
|
or d.cInvCCode LIKE '03%'
|
|
or d.cInvCCode LIKE '03%'
|
|
|
or d.cInvCCode LIKE '04%')
|
|
or d.cInvCCode LIKE '04%')
|
|
|
and a.comcode LIKE CONCAT(#{code},'%')
|
|
and a.comcode LIKE CONCAT(#{code},'%')
|
|
|
|
|
+ and d.cInvName<>'杂纱'
|
|
|
and (
|
|
and (
|
|
|
a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
|
|
a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
|
|
|
select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
@@ -142,6 +142,12 @@
|
|
|
inner join PO_Podetails c on b.iPOsID =c.ID
|
|
inner join PO_Podetails c on b.iPOsID =c.ID
|
|
|
inner join PO_Pomain d on c.POID =d.POID
|
|
inner join PO_Pomain d on c.POID =d.POID
|
|
|
where d.cPOID not like CONCAT(#{code},'%') and a.cbustype='普通采购'
|
|
where d.cPOID not like CONCAT(#{code},'%') and a.cbustype='普通采购'
|
|
|
|
|
+ ) and a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') not in (
|
|
|
|
|
+ select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
|
|
+ inner join RdRecord01 a on a.id=b.id
|
|
|
|
|
+ inner join PO_Podetails c on b.iPOsID =c.ID
|
|
|
|
|
+ inner join PO_Pomain d on c.POID =d.POID
|
|
|
|
|
+ where d.cPOID like CONCAT(#{code},'%') and a.cbustype='普通采购'
|
|
|
)
|
|
)
|
|
|
or a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
|
|
or a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
|
|
|
select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
|
|
select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
|
|
@@ -151,6 +157,12 @@
|
|
|
inner join PO_Podetails c on b.iPOsID =c.ID
|
|
inner join PO_Podetails c on b.iPOsID =c.ID
|
|
|
inner join PO_Pomain d on c.POID =d.POID
|
|
inner join PO_Pomain d on c.POID =d.POID
|
|
|
where d.cPOID not like CONCAT(#{code},'%') and a.cbustype='普通采购')
|
|
where d.cPOID not like CONCAT(#{code},'%') and a.cbustype='普通采购')
|
|
|
|
|
+ and cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') not in (
|
|
|
|
|
+ select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
|
|
+ inner join RdRecord01 a on a.id=b.id
|
|
|
|
|
+ inner join PO_Podetails c on b.iPOsID =c.ID
|
|
|
|
|
+ inner join PO_Pomain d on c.POID =d.POID
|
|
|
|
|
+ where d.cPOID like CONCAT(#{code},'%') and a.cbustype='普通采购')
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
) as t1 group by cCode
|
|
) as t1 group by cCode
|
|
@@ -321,6 +333,7 @@
|
|
|
<select id="getCostAssistList" resultType="org.jeecg.modules.report.entity.FabricCostAssist">
|
|
<select id="getCostAssistList" resultType="org.jeecg.modules.report.entity.FabricCostAssist">
|
|
|
|
|
|
|
|
select * from VIEW_FabricLoss_Cost_Assist where cPoid like CONCAT(#{code},'%')
|
|
select * from VIEW_FabricLoss_Cost_Assist where cPoid like CONCAT(#{code},'%')
|
|
|
|
|
+ and cVenAbbName not in ('宁波森语','马菲羊','森语集团')
|
|
|
order by cAccount,cPoid,cVenAbbName,cInvName,cComUnitName
|
|
order by cAccount,cPoid,cVenAbbName,cInvName,cComUnitName
|
|
|
</select>
|
|
</select>
|
|
|
<!--开票成本-面料-->
|
|
<!--开票成本-面料-->
|
|
@@ -426,4 +439,47 @@
|
|
|
) as t1
|
|
) as t1
|
|
|
group by cCode,cInvCode,cColor
|
|
group by cCode,cInvCode,cColor
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+ <!--委外订单-材料出库详情-->
|
|
|
|
|
+ <select id="getOmOutDetailList" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
|
|
|
|
|
+ select f.cBusType,f.cCode,g.cVenName,g.cVenAbbName,
|
|
|
|
|
+ x.cInvCode as cInvCodeIn,y.cInvName as cInvNameIn,x.cFree1 as cColorIn,x.cBatch as cBatchIn,
|
|
|
|
|
+ d.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,d.cFree1 as cColorOut,d.cBatch as cBatchOut,
|
|
|
|
|
+ x.iProcessFee/x.iQuantity as iProcessPrice, d.iQuantity/x.iQuantity as iRate,
|
|
|
|
|
+ d.iQuantity as iQuantityOut,x.iQuantity as iQuantityIn,
|
|
|
|
|
+ isnull((select sum(iSum)/sum(iPBVQuantity ) from PurBillVouchs x where x.RdsId =e.autoid and f.cbustype='普通采购'),0) as iPurchusePrice
|
|
|
|
|
+ FROM
|
|
|
|
|
+ om_momain a
|
|
|
|
|
+ INNER JOIN OM_MODetails b ON a.moid = b.moid
|
|
|
|
|
+ INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
|
|
+ inner join RdRecords01 x on x.iOMoDID=b.MODetailsID
|
|
|
|
|
+ INNER JOIN Inventory y ON x.cinvcode = y.cinvcode
|
|
|
|
|
+ inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
|
|
|
|
|
+ INNER JOIN Inventory z ON d.cinvcode = z.cinvcode
|
|
|
|
|
+ left join rdrecords01 e on d.cInvCode=e.cInvCode
|
|
|
|
|
+ and isnull(d.cFree1,'')=isnull(e.cFree1,'') and isnull(d.cBatch,'')=isnull(e.cBatch,'')
|
|
|
|
|
+ left join rdrecord01 f on e.id=f.id
|
|
|
|
|
+ left join Vendor g on g.cVenCode=f.cVenCode
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ c.cInvCCode NOT LIKE '19%'
|
|
|
|
|
+ AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <!--委外订单-采购入库详情-->
|
|
|
|
|
+ <select id="getOmInDetailList" resultType="org.jeecg.modules.report.entity.FabricMoOrderRK">
|
|
|
|
|
+ select a.cCode,
|
|
|
|
|
+ x.cInvCode as cInvCode,y.cInvName as cInvName,x.cFree1 as cColor,x.cBatch as cBatch,
|
|
|
|
|
+ isnull(x.iQuantity,0) as iQuantityIn,isnull(x.iProcessFee,0) as iProcessFee,
|
|
|
|
|
+ isnull(x.iSumBillQuantity,0) as iSumBillQuantity,isnull(x.iSQuantity,0) as iSQuantity,
|
|
|
|
|
+ (select sum(isnull(iquantity,0)) as iQuantityOut from rdrecords11 d where d.iOMoDID=b.MODetailsID) as iQuantityOut
|
|
|
|
|
+ FROM
|
|
|
|
|
+ om_momain a
|
|
|
|
|
+ INNER JOIN OM_MODetails b ON a.moid = b.moid
|
|
|
|
|
+ INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
|
|
+ inner join RdRecords01 x on x.iOMoDID=b.MODetailsID
|
|
|
|
|
+ INNER JOIN Inventory y ON x.cinvcode = y.cinvcode
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ c.cInvCCode NOT LIKE '19%'
|
|
|
|
|
+ AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|