增加日期查询条件,显示金额
This commit is contained in:
@@ -22,15 +22,20 @@ namespace NX.ERP.U8.Finance
|
||||
public IEnumerable<object> InventorySNDetail(NX.ERP.Model.Request.SnOrderRequest info1)
|
||||
{
|
||||
string sql = $@"
|
||||
select a.cInvCode,e.cInvName,b.cCode as Cprk, b.dDate as rkrq,c.cWhName,b.cMPoCode,d.cDepName,a.cInvSN,g.cCode as Clck,g.dDate as ckrq,h.cCusAbbName,f.cInvSN as ckcInvSN from ST_SNDetail_PROIN a
|
||||
left join rdrecord10 b on a.iVouchID=b.id
|
||||
left join Warehouse c on b.cWhCode =c.cWhCode
|
||||
left join Department d on b.cDepCode =d.cDepCode
|
||||
left join Inventory e on a.cInvCode=e.cInvCode
|
||||
left join ST_SNDetail_SaleOut f on a.cInvSN= f.cInvSN
|
||||
left join rdrecord32 g on f.iVouchID=g.id
|
||||
left join Customer h on g.cCusCode=h.cCusCode
|
||||
|
||||
select a.cInvCode,e.cInvName,b.cCode as Cprk, b.dDate as rkrq,c.cWhName,
|
||||
b.cMPoCode,d.cDepName,a.cInvSN,k.iUnitCost,
|
||||
g.cCode as Clck,g.dDate as ckrq,h.cCusAbbName,f.cInvSN as ckcInvSN
|
||||
from ST_SNDetail_PROIN a WITH(NOLOCK)
|
||||
left join rdrecord10 b WITH(NOLOCK) on a.iVouchID=b.id
|
||||
left join rdrecords10 k WITH(NOLOCK) on a.iVouchsID=k.autoid
|
||||
left join Warehouse c WITH(NOLOCK) on b.cWhCode =c.cWhCode
|
||||
left join Department d WITH(NOLOCK) on b.cDepCode =d.cDepCode
|
||||
left join Inventory e WITH(NOLOCK) on a.cInvCode=e.cInvCode
|
||||
left join ST_SNDetail_SaleOut f WITH(NOLOCK) on a.cInvSN= f.cInvSN
|
||||
left join rdrecord32 g WITH(NOLOCK) on f.iVouchID=g.id
|
||||
left join Customer h WITH(NOLOCK) on g.cCusCode=h.cCusCode
|
||||
|
||||
|
||||
";
|
||||
|
||||
|
||||
@@ -60,6 +65,12 @@ namespace NX.ERP.U8.Finance
|
||||
|
||||
}
|
||||
|
||||
if (info1.BeginDate2 != null && info1.EndDate2 != null)
|
||||
{
|
||||
where.Add(" g.dDate between @beginDate2 and @endDate2 ");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
var aa = string.Join(" and ", where.ToArray());
|
||||
@@ -71,7 +82,7 @@ namespace NX.ERP.U8.Finance
|
||||
|
||||
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
|
||||
{
|
||||
return conn.Query<object>(sql, new { cInvCode = info1.cInvCodes, Cprk = info1.Cprk, info1.Clck, info1.cInvSN });
|
||||
return conn.Query<object>(sql, new { cInvCode = info1.cInvCodes, Cprk = info1.Cprk, info1.Clck, info1.cInvSN, beginDate=info1.BeginDate, endDate= info1.EndDate, beginDate2 = info1.BeginDate2, endDate2 = info1.EndDate2 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user