This commit is contained in:
杰 朱
2022-04-11 13:33:53 +08:00
parent f4b34807a9
commit 480efb7334
2 changed files with 239 additions and 241 deletions

View File

@@ -88,7 +88,7 @@ namespace NX.ERP.U8.Finance
public IEnumerable<object> Voucherror(NX.ERP.Model.Request.VouchererrorRequest info)
{
string sql = $@"
select *from (
select *from (
select c.MoCode,b.SortSeq,b.InvCode,d.cInvName,a.InvCode as InvCode1, t.cInvName as cInvName1,t.cInvStd,a.Qty , a.IssQty ,'超领' as error from mom_moallocate a WITH (NOLOCK)
left join mom_orderdetail b WITH (NOLOCK) on a.MoDId= b.MoDId
left join mom_order c WITH (NOLOCK) on b.MoId= c.MoId
@@ -103,7 +103,16 @@ namespace NX.ERP.U8.Finance
left join Inventory d WITH (NOLOCK) on b.InvCode= d.cInvCode
left join Inventory t WITH (NOLOCK) on a.InvCode= t.cInvCode
where a.IssQty < a.Qty*(b.QualifiedInQty/b.qty)
) mm
union all
select c.MoCode,b.SortSeq,b.InvCode,d.cInvName,a.InvCode as InvCode1, t.cInvName as cInvName1,t.cInvStd,a.Qty , a.IssQty ,'无应领' as error from mom_moallocate a WITH (NOLOCK)
left join mom_orderdetail b WITH (NOLOCK) on a.MoDId= b.MoDId
left join mom_order c WITH (NOLOCK) on b.MoId= c.MoId
left join Inventory d WITH (NOLOCK) on b.InvCode= d.cInvCode
left join Inventory t WITH (NOLOCK) on a.InvCode= t.cInvCode
where a.Qty=0 and b.QualifiedInQty>0
) mm
";