This commit is contained in:
杰 朱
2022-05-20 14:26:02 +08:00
parent a997975bb9
commit 615368f90e
2 changed files with 51 additions and 13 deletions

View File

@@ -19,6 +19,18 @@ namespace NX.ERP.U8
}
public string ApVouchGetNumber(string Seed)
{
var strSql = " select top(1) right(cVouchID,5) from AP_ApVouch with (ROWLOCK) where CONVERT(varchar(6), dVouchDate,112) =@Seed order by cVouchID desc ";
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
{
return conn.ExecuteScalar<string>(strSql, new { Seed }, null, 30, System.Data.CommandType.Text);
}
}
public void IncNumber(string CardNumber, string Content, string Seed)
{
@@ -34,6 +46,22 @@ namespace NX.ERP.U8
conn.Execute(strSql, new { CardNumber, Content, Seed }, null, 30, System.Data.CommandType.Text);
}
}
public void ApVouchIncNumber(string Maxnumber, string Seed)
{
var strSql = @"IF NOT EXISTS(select cNumber as Maxnumber From VoucherHistory with (XLOCK) Where CardNumber='P0' and cContent='单据日期' and cSeed=@Seed)
Insert into VoucherHistory(CardNumber,cContent,cContentRule,cSeed,cNumber) values ('P0','单据日期','月',@Seed,'1')
else
update VoucherHistory set cNumber=@Maxnumber Where CardNumber='P0' and cContent='单据日期' and cSeed=@Seed";
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
{
conn.Execute(strSql, new { Maxnumber, Seed }, null, 30, System.Data.CommandType.Text);
}
}
}