添加价格获取
This commit is contained in:
@@ -35,5 +35,25 @@ namespace NX.ERP.Model
|
||||
public int MinStock { get => minStock; set => minStock = value; }
|
||||
public int Aql { get => aql; set => aql = 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; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,15 +426,15 @@ namespace U8AppMain
|
||||
dal.AddVoucher(new NX.ERP.Model.Store.ProductStoreIn()
|
||||
{
|
||||
Source = "生产订单",
|
||||
SourceCode = "SCDD210100010",
|
||||
SourceCode = "SCDD200900013",
|
||||
Date = DateTime.Today,
|
||||
WhCode = "1",
|
||||
Details = new List<NX.ERP.Model.Store.ProductStoreInDetail>() {
|
||||
new NX.ERP.Model.Store.ProductStoreInDetail()
|
||||
{
|
||||
Batch="",
|
||||
InvCode="902009",
|
||||
SourceDetailId=1000005568,
|
||||
InvCode="904005",
|
||||
SourceDetailId=1000003338,
|
||||
Quantity=1,
|
||||
Position=""
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace NX.ERP.U8.Base
|
||||
{
|
||||
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))
|
||||
{
|
||||
@@ -24,10 +24,14 @@ namespace NX.ERP.U8.Base
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IEnumerable<Bin> GetListByWhCode(string Code)
|
||||
{
|
||||
return this.GetList(" cWhCode=@Code", new { Code });
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,10 +47,10 @@ namespace NX.ERP.U8
|
||||
bService AS 是否应税劳务,
|
||||
bAccessary AS 是否成套件,
|
||||
iTaxRate AS 税率,
|
||||
iInvRCost AS 计划价或售价,
|
||||
iInvSPrice AS 参考成本,
|
||||
iInvRCost AS InvRCost,
|
||||
iInvSPrice AS InvSPrice,
|
||||
iInvLSCost AS 最低售价,
|
||||
iInvNCost AS 最新成本,
|
||||
iInvNCost AS InvNCost,
|
||||
iInvAdvance AS 提前期,
|
||||
iInvBatch AS 经济批量,
|
||||
iOverStock AS 积压标准,
|
||||
@@ -271,5 +271,55 @@ namespace NX.ERP.U8
|
||||
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存货档案价格失败!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,9 @@ namespace NX.ERP.U8.Store
|
||||
var detail = storeIn.Details[n];
|
||||
bodyXml.setAttribute("cinvcode", detail.InvCode);
|
||||
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("editprop", "A");
|
||||
bodyXml.setAttribute("cbatch", detail.Batch);
|
||||
|
||||
@@ -141,11 +141,6 @@
|
||||
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
|
||||
</Reference>
|
||||
</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>
|
||||
<Compile Include="App_Start\BundleConfig.cs" />
|
||||
<Compile Include="App_Start\FilterConfig.cs" />
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
</runtime>
|
||||
<system.codedom>
|
||||
<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=\"Web\" /optionInfer+" />
|
||||
</compilers>
|
||||
</system.codedom>
|
||||
|
||||
Reference in New Issue
Block a user