添加价格获取

This commit is contained in:
admin
2021-01-18 11:38:02 +08:00
parent 2b7346b4b1
commit 275c9967be
7 changed files with 85 additions and 13 deletions

View File

@@ -35,5 +35,25 @@ namespace NX.ERP.Model
public int MinStock { get => minStock; set => minStock = value; } public int MinStock { get => minStock; set => minStock = value; }
public int Aql { get => aql; set => aql = value; } public int Aql { get => aql; set => aql = value; }
public int Invccode { get => invccode; set => invccode = value; } public int Invccode { get => invccode; set => invccode = value; }
public double InvNCost { get; set; }
/// <summary>
/// 参考成本
/// </summary>
public double InvSPrice { get; set; }
/// <summary>
/// 计划单价
/// </summary>
public double InvRCost { get; set; }
public double ImpTaxRate { get; set; }
} }
} }

View File

@@ -426,15 +426,15 @@ namespace U8AppMain
dal.AddVoucher(new NX.ERP.Model.Store.ProductStoreIn() dal.AddVoucher(new NX.ERP.Model.Store.ProductStoreIn()
{ {
Source = "生产订单", Source = "生产订单",
SourceCode = "SCDD210100010", SourceCode = "SCDD200900013",
Date = DateTime.Today, Date = DateTime.Today,
WhCode = "1", WhCode = "1",
Details = new List<NX.ERP.Model.Store.ProductStoreInDetail>() { Details = new List<NX.ERP.Model.Store.ProductStoreInDetail>() {
new NX.ERP.Model.Store.ProductStoreInDetail() new NX.ERP.Model.Store.ProductStoreInDetail()
{ {
Batch="", Batch="",
InvCode="902009", InvCode="904005",
SourceDetailId=1000005568, SourceDetailId=1000003338,
Quantity=1, Quantity=1,
Position="" Position=""
} }

View File

@@ -10,7 +10,7 @@ namespace NX.ERP.U8.Base
{ {
public class BinDAL public class BinDAL
{ {
public IEnumerable<Bin> GetList(string strwhere="",object Params=null) public IEnumerable<Bin> GetList(string strwhere = "", object Params = null)
{ {
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net)) using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{ {
@@ -25,9 +25,13 @@ namespace NX.ERP.U8.Base
} }
public IEnumerable<Bin> GetListByWhCode(string Code) public IEnumerable<Bin> GetListByWhCode(string Code)
{ {
return this.GetList(" cWhCode=@Code", new { Code }); return this.GetList(" cWhCode=@Code", new { Code });
} }
} }
} }

View File

@@ -47,10 +47,10 @@ namespace NX.ERP.U8
bService AS 是否应税劳务, bService AS 是否应税劳务,
bAccessary AS 是否成套件, bAccessary AS 是否成套件,
iTaxRate AS 税率, iTaxRate AS 税率,
iInvRCost AS 计划价或售价, iInvRCost AS InvRCost,
iInvSPrice AS 参考成本, iInvSPrice AS InvSPrice,
iInvLSCost AS 最低售价, iInvLSCost AS 最低售价,
iInvNCost AS 最新成本, iInvNCost AS InvNCost,
iInvAdvance AS 提前期, iInvAdvance AS 提前期,
iInvBatch AS 经济批量, iInvBatch AS 经济批量,
iOverStock AS 积压标准, iOverStock AS 积压标准,
@@ -271,5 +271,55 @@ namespace NX.ERP.U8
return conn.Query<Materiel>(sql, Param); return conn.Query<Materiel>(sql, Param);
} }
} }
public Materiel GetModel(string Code)
{
return this.GetList(" cInvCode=@Code ", new { Code }).FirstOrDefault();
}
/// <summary>
/// 获取成本
/// </summary>
/// <param name="invCode"></param>
/// <returns></returns>
public double GetCost(string invCode, int iInout)
{
var empty = (iInout != 0) ? "cOutPrice" : "cInPrice";
string strSQL = "SELECT cValue FROM Accinformation WITH(NOLOCK) WHERE cSysID = 'ST' AND cName = '" + empty + "'";
string cType;
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
cType = conn.ExecuteScalar<string>(strSQL, null, null, 10, System.Data.CommandType.Text);
}
var inv = this.GetModel(invCode);
switch (cType)
{
case "按计价方式取单价":
return 0;
case "计划单价":
return inv.InvRCost;
case "参考成本":
return inv.InvSPrice;
case "最新成本":
return inv.InvNCost;
default:
{
throw new Exception("取得U8存货档案价格失败!");
}
}
}
} }
} }

View File

@@ -58,6 +58,9 @@ namespace NX.ERP.U8.Store
var detail = storeIn.Details[n]; var detail = storeIn.Details[n];
bodyXml.setAttribute("cinvcode", detail.InvCode); bodyXml.setAttribute("cinvcode", detail.InvCode);
bodyXml.setAttribute("iquantity", detail.Quantity); bodyXml.setAttribute("iquantity", detail.Quantity);
var _cost = new MaterielDAL().GetCost(detail.InvCode, 0);
bodyXml.setAttribute("iunitcost", _cost);
bodyXml.setAttribute("iprice", new NX.ERP.U8.Account.Accinformation().FormatMoney(_cost * detail.Quantity));
bodyXml.setAttribute("irowno", n + 1); bodyXml.setAttribute("irowno", n + 1);
bodyXml.setAttribute("editprop", "A"); bodyXml.setAttribute("editprop", "A");
bodyXml.setAttribute("cbatch", detail.Batch); bodyXml.setAttribute("cbatch", detail.Batch);

View File

@@ -141,11 +141,6 @@
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath> <HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="App_Start\BundleConfig.cs" /> <Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" /> <Compile Include="App_Start\FilterConfig.cs" />

View File

@@ -68,7 +68,7 @@
</runtime> </runtime>
<system.codedom> <system.codedom>
<compilers> <compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" /> <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers> </compilers>
</system.codedom> </system.codedom>