修改金额

This commit is contained in:
admin
2021-01-07 17:01:56 +08:00
parent 7245c08c94
commit fd3fc7af4c
9 changed files with 263 additions and 28 deletions

View File

@@ -28,7 +28,7 @@ namespace NX.ERP.Model.Purchase
public string VenCode { get; set; } public string VenCode { get; set; }
public decimal TaxRate { get; set; } public double TaxRate { get; set; }
public string PTCode { get; set; } public string PTCode { get; set; }

View File

@@ -32,5 +32,13 @@ namespace NX.ERP.Model.Purchase
public string OrderCode { get; set; } public string OrderCode { get; set; }
public int PoId { get; set; } public int PoId { get; set; }
public double oricost { get; set; }
public decimal oritaxcost { get; set; }
public decimal orimoney { get; set; }
public decimal oritaxprice { get; set; }
public decimal orisum { get; set; }
// b.ioricost as oricost,b.ioritaxcost as oritaxcost ,b.iorimoney as orimoney,b.oritaxprice as oritaxprice,b.iorisum as orisum,
} }
} }

View File

@@ -11,14 +11,14 @@ namespace NX.ERP.Model.Store
private int puStoreInId; private int puStoreInId;
private string invcode; private string invcode;
private string unit; private string unit;
private decimal quantity; private double quantity;
public string Batch { get; set; } public string Batch { get; set; }
public int Id { get => id; set => id = value; } public int Id { get => id; set => id = value; }
public int PuStoreInId { get => puStoreInId; set => puStoreInId = value; } public int PuStoreInId { get => puStoreInId; set => puStoreInId = value; }
public string Invcode { get => invcode; set => invcode = value; } public string Invcode { get => invcode; set => invcode = value; }
public string Unit { get => unit; set => unit = value; } public string Unit { get => unit; set => unit = value; }
public decimal Quantity { get => quantity; set => quantity = value; } public double Quantity { get => quantity; set => quantity = value; }
public int SorceDetailId { get; set; } public int SorceDetailId { get; set; }

View File

@@ -310,18 +310,18 @@ namespace U8AppMain
SupplierCode = "10001", SupplierCode = "10001",
Source = "采购到货单", Source = "采购到货单",
Whcode = "1", Whcode = "1",
SourceCode = "CGDH210100002", SourceCode = "CGDH210100185",
Maker = "222", // Maker = "222",
RdCode = "101", RdCode = "101",
PuStoreInDetails = new List<NX.ERP.Model.Store.PuStoreInDetail>() { PuStoreInDetails = new List<NX.ERP.Model.Store.PuStoreInDetail>() {
new NX.ERP.Model.Store.PuStoreInDetail(){ new NX.ERP.Model.Store.PuStoreInDetail(){
//Batch="001", //Batch="001",
Quantity=2, Quantity=2,
Id=1, Id=1,
Invcode="201001", Invcode="501241",
PuStoreInId=1000021, PuStoreInId=1000021,
SorceDetailId=1000023146, SorceDetailId=1000023622,
} }

View File

@@ -0,0 +1,166 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
namespace NX.ERP.U8.Account
{
public class Accinfo
{
private string name;
private string caption;
private string value;
public string Name { get => name; set => name = value; }
public string Caption { get => caption; set => caption = value; }
public string Value { get => value; set => this.value = value; }
}
public class Accinformation
{
private IDictionary<string, Accinfo> Infos;
private void LoadFormation()
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
var strSql = "SELECT cname as name,ccaption as caption,cvalue as value FROM accinformation WITH(NOLOCK) WHERE cname IN ('iQuanDecDgt','iExchRateDecDgt','iNumDecDgt','iRateDecDgt','iPriceDecDgt','iCurrencyDigits','iStrsPriDecDgt','iStrsQuanDecDgt','iVolumeDecDgt','iWeightDecDgt','iKLPoint','iBillPrice')";
var list = conn.Query<Accinfo>(strSql, null);
this.Infos = new Dictionary<string, Accinfo>();
foreach (var item in list)
{
Infos.Add(item.Name, item);
}
}
}
public int BillPrice
{
get
{
return int.Parse(GetValue("iBillPrice"));
}
}
public int iExchRateDecDgt
{
get
{
return int.Parse(GetValue("iExchRateDecDgt"));
}
}
public int NumDecDgt
{
get
{
return int.Parse(GetValue("iNumDecDgt"));
}
}
public int StrsPriDecDgt
{
get
{
return int.Parse(GetValue("iStrsPriDecDgt"));
}
}
public int StrsQuanDecDgt
{
get
{
return int.Parse(GetValue("iStrsQuanDecDgt"));
}
}
public int VolumeDecDgt
{
get
{
return int.Parse(GetValue("iVolumeDecDgt"));
}
}
public int iWeightDecDgt
{
get
{
return int.Parse(GetValue("iWeightDecDgt"));
}
}
public int iCurrencyDigits
{
get
{
return int.Parse(GetValue("iCurrencyDigits"));
}
}
public int PriceDecDgt
{
get
{
return int.Parse(GetValue("iPriceDecDgt"));
}
}
public int QuanDecDgt
{
get
{
return int.Parse(GetValue("iQuanDecDgt"));
}
}
public int KLPoint
{
get
{
return int.Parse(GetValue("iKLPoint"));
}
}
private string GetValue(string Name)
{
if (this.Infos == null)
{
this.LoadFormation();
}
if (Infos.TryGetValue(Name, out var accinfo))
{
return accinfo.Value;
}
return "";
}
public double FormatMoney(double currMoney)
{
try
{
return Math.Round(currMoney, this.iCurrencyDigits);
}
catch (Exception)
{
throw;
}
}
public decimal FormatMoney(decimal currMoney)
{
try
{
return Math.Round(currMoney, this.iCurrencyDigits);
}
catch (Exception)
{
throw;
}
}
}
}

View File

@@ -46,6 +46,7 @@
<Compile Include="STVocher.cs" /> <Compile Include="STVocher.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Base\SupplierDAL.cs" /> <Compile Include="Base\SupplierDAL.cs" />
<Compile Include="Account\Accinformation.cs" />
<Compile Include="U8LoginContext.cs" /> <Compile Include="U8LoginContext.cs" />
<Compile Include="Base\UnitDAL.cs" /> <Compile Include="Base\UnitDAL.cs" />
<Compile Include="Base\WarehouseDAL.cs" /> <Compile Include="Base\WarehouseDAL.cs" />

View File

@@ -16,7 +16,7 @@ namespace NX.ERP.U8.Purchase
B.Autoid as id,b.ID as ArrivalID, B.Autoid as id,b.ID as ArrivalID,
b.cInvCode AS MaterielCode, b.cInvCode AS MaterielCode,
b.cBatch AS BatchNo, b.cBatch AS BatchNo,
b.cUnitID AS UnitCode, b.cUnitID AS UnitCode,b.ioricost as oricost,b.ioritaxcost as oritaxcost ,b.iorimoney as orimoney,b.ioritaxprice as oritaxprice,b.iorisum as orisum,
B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid from B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid from
pu_ArrHead as a pu_ArrHead as a
left join pu_arrbody as b on a.id=b.id left join pu_arrbody as b on a.id=b.id

View File

@@ -85,7 +85,7 @@ namespace NX.ERP.U8.Store
iXMLDOMElement.setAttribute("cvouchtype", "01");//DomHead[0]["cvouchtype"] = ""; //单据类型,string类型 iXMLDOMElement.setAttribute("cvouchtype", "01");//DomHead[0]["cvouchtype"] = ""; //单据类型,string类型
iXMLDOMElement.setAttribute("brdflag", 1); //DomHead[0]["brdflag"] = ""; //收发标志,int类型 iXMLDOMElement.setAttribute("brdflag", 1); //DomHead[0]["brdflag"] = ""; //收发标志,int类型
iXMLDOMElement.setAttribute("csource", puStoreIn.Source); //DomHead[0]["csource"] = ""; //单据来源,int类型 iXMLDOMElement.setAttribute("csource", puStoreIn.Source); //DomHead[0]["csource"] = ""; //单据来源,int类型
iXMLDOMElement.setAttribute("cmaker", puStoreIn.Maker);//DomHead[0]["cmaker"] = ""; //制单人,string类型 iXMLDOMElement.setAttribute("cmaker", U8LoginContext.Instance.LoginUserName);//DomHead[0]["cmaker"] = ""; //制单人,string类型
iXMLDOMElement.setAttribute("vt_id", "27"); iXMLDOMElement.setAttribute("vt_id", "27");
iXMLDOMElement.setAttribute("editprop", "A"); iXMLDOMElement.setAttribute("editprop", "A");
iXMLDOMElement.setAttribute("cdepcode", puStoreIn.Depcode); iXMLDOMElement.setAttribute("cdepcode", puStoreIn.Depcode);
@@ -112,7 +112,7 @@ namespace NX.ERP.U8.Store
iXMLDOMElement.setAttribute("ipurarriveid", Arrival.Id); iXMLDOMElement.setAttribute("ipurarriveid", Arrival.Id);
iXMLDOMElement.setAttribute("darvdate", Arrival.Date); iXMLDOMElement.setAttribute("darvdate", Arrival.Date);
iXMLDOMElement.setAttribute("itaxrate", Arrival.TaxRate); iXMLDOMElement.setAttribute("itaxrate", Arrival.TaxRate);
iXMLDOMElement.setAttribute("itaxrate", Arrival.TaxRate);
iXMLDOMElement.setAttribute("cptcode", Arrival.PTCode); iXMLDOMElement.setAttribute("cptcode", Arrival.PTCode);
domHead.selectSingleNode("//rs:data").appendChild(iXMLDOMElement); domHead.selectSingleNode("//rs:data").appendChild(iXMLDOMElement);
@@ -129,13 +129,33 @@ namespace NX.ERP.U8.Store
iXMLDOMElement.setAttribute("iquantity", detail.Quantity); iXMLDOMElement.setAttribute("iquantity", detail.Quantity);
iXMLDOMElement.setAttribute("irowno", n); iXMLDOMElement.setAttribute("irowno", n);
iXMLDOMElement.setAttribute("cbvencode", "10001"); iXMLDOMElement.setAttribute("cbvencode", "10001");
iXMLDOMElement.setAttribute("cbatch", detail.Batch); iXMLDOMElement.setAttribute("cbatch", detail.Batch);
iXMLDOMElement.setAttribute("carvcode", "2"); iXMLDOMElement.setAttribute("carvcode", Arrival.ArrivalCode);
iXMLDOMElement.setAttribute("ipurarriveid", "222"); iXMLDOMElement.setAttribute("cbarvcode", Arrival.ArrivalCode);
iXMLDOMElement.setAttribute("ipurarriveid", Arrival.Id);
iXMLDOMElement.setAttribute("iarrsid", detail.SorceDetailId);
iXMLDOMElement.setAttribute("darvdate", DateTime.Today.ToShortDateString()); iXMLDOMElement.setAttribute("darvdate", DateTime.Today.ToShortDateString());
iXMLDOMElement.setAttribute("editprop", "A"); iXMLDOMElement.setAttribute("editprop", "A");
iXMLDOMElement.setAttribute("cpoid", arrivalDetail.OrderCode); iXMLDOMElement.setAttribute("cpoid", arrivalDetail.OrderCode);
iXMLDOMElement.setAttribute("iposid", arrivalDetail.posId); iXMLDOMElement.setAttribute("iposid", arrivalDetail.posId);
var info = new NX.ERP.U8.Account.Accinformation();
//iorimoney = FormatMoney(iunitcost * iQuan);
//ioritaxprice = FormatMoney(iunitcost * iQuan * (itaxrate / 100.0));
//iorisum = FormatMoney(iunitcost * (1.0 + itaxrate / 100.0) * iQuan);
//itaxcost = FormatUPrice(iunitcost * (1.0 + itaxrate / 100.0));
var iorisum = info.FormatMoney(arrivalDetail.oricost * (1.00 + (Arrival.TaxRate / 100.0)) * detail.Quantity);
var ioritaxprice = info.FormatMoney(arrivalDetail.oricost * (Arrival.TaxRate / 100.0) * detail.Quantity);
var iorimoney = info.FormatMoney(arrivalDetail.oricost * detail.Quantity);
var oritaxcost = info.FormatMoney(arrivalDetail.oricost * (1.00 + (Arrival.TaxRate / 100.0)));
iXMLDOMElement.setAttribute("ioricost", arrivalDetail.oricost);
iXMLDOMElement.setAttribute("ioritaxcost", oritaxcost);
iXMLDOMElement.setAttribute("iorimoney", iorimoney);
iXMLDOMElement.setAttribute("ioritaxprice", ioritaxprice);
iXMLDOMElement.setAttribute("iorisum", iorisum);
domBody.selectSingleNode("//rs:data").appendChild(iXMLDOMElement); domBody.selectSingleNode("//rs:data").appendChild(iXMLDOMElement);
} }

View File

@@ -5,7 +5,7 @@ using System.Text;
using U8Login; using U8Login;
using UFIDA.U8.U8APIFramework; using UFIDA.U8.U8APIFramework;
using UFIDA.U8.U8MOMAPIFramework; using UFIDA.U8.U8MOMAPIFramework;
using Dapper;
namespace NX.ERP.U8 namespace NX.ERP.U8
{ {
public class U8LoginContext : IDisposable public class U8LoginContext : IDisposable
@@ -49,6 +49,31 @@ namespace NX.ERP.U8
} }
} }
//public int GetDefaultPoTaxRate()
//{
// try
// {
// string strSQL = "Select cValue from AccInformation Where cSysID=N'PU' and cName=N'iDefaultZHBVRate'";
// using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
// {
// return conn.ExecuteScalar<int>(strSQL, null, null, 0, System.Data.CommandType.Text);
// }
// }
// catch (Exception)
// {
// throw;
// }
// finally
// {
// }
//}
public void Dispose() public void Dispose()
{ {
if (uiLogin != null) if (uiLogin != null)
@@ -77,6 +102,21 @@ namespace NX.ERP.U8
return this.ClsLogin.UFDataConnstringForNet; return this.ClsLogin.UFDataConnstringForNet;
} }
} }
public string LoginUserName
{
get
{
return this.ClsLogin.cUserName;
}
}
public string LoginUserId
{
get
{
return this.ClsLogin.cUserId;
}
}
/// <summary> /// <summary>
/// ADO的链接字符串 /// ADO的链接字符串
/// </summary> /// </summary>
@@ -135,12 +175,12 @@ namespace NX.ERP.U8
} }
public void AddRdVoucher(string URL,VoucherParameter para) public void AddRdVoucher(string URL, VoucherParameter para)
{ {
try try
{ {
U8EnvContext u8EnvContext = new U8EnvContext(); U8EnvContext u8EnvContext = new U8EnvContext();
u8EnvContext.U8Login =this.ClsLogin; u8EnvContext.U8Login = this.ClsLogin;
U8ApiAddress apiAddress = new U8ApiAddress(URL); U8ApiAddress apiAddress = new U8ApiAddress(URL);
U8ApiBroker u8ApiBroker = new U8ApiBroker(apiAddress, u8EnvContext); U8ApiBroker u8ApiBroker = new U8ApiBroker(apiAddress, u8EnvContext);