修改金额

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 decimal TaxRate { get; set; }
public double TaxRate { get; set; }
public string PTCode { get; set; }

View File

@@ -32,5 +32,13 @@ namespace NX.ERP.Model.Purchase
public string OrderCode { 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 string invcode;
private string unit;
private decimal quantity;
private double quantity;
public string Batch { get; set; }
public int Id { get => id; set => id = value; }
public int PuStoreInId { get => puStoreInId; set => puStoreInId = value; }
public string Invcode { get => invcode; set => invcode = 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; }

View File

@@ -310,18 +310,18 @@ namespace U8AppMain
SupplierCode = "10001",
Source = "采购到货单",
Whcode = "1",
SourceCode = "CGDH210100002",
Maker = "222",
SourceCode = "CGDH210100185",
// Maker = "222",
RdCode = "101",
PuStoreInDetails = new List<NX.ERP.Model.Store.PuStoreInDetail>() {
new NX.ERP.Model.Store.PuStoreInDetail(){
//Batch="001",
Quantity=2,
Id=1,
Invcode="201001",
Invcode="501241",
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="Properties\AssemblyInfo.cs" />
<Compile Include="Base\SupplierDAL.cs" />
<Compile Include="Account\Accinformation.cs" />
<Compile Include="U8LoginContext.cs" />
<Compile Include="Base\UnitDAL.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.cInvCode AS MaterielCode,
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
pu_ArrHead as a
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("brdflag", 1); //DomHead[0]["brdflag"] = ""; //收发标志,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("editprop", "A");
iXMLDOMElement.setAttribute("cdepcode", puStoreIn.Depcode);
@@ -112,7 +112,7 @@ namespace NX.ERP.U8.Store
iXMLDOMElement.setAttribute("ipurarriveid", Arrival.Id);
iXMLDOMElement.setAttribute("darvdate", Arrival.Date);
iXMLDOMElement.setAttribute("itaxrate", Arrival.TaxRate);
iXMLDOMElement.setAttribute("itaxrate", Arrival.TaxRate);
iXMLDOMElement.setAttribute("cptcode", Arrival.PTCode);
domHead.selectSingleNode("//rs:data").appendChild(iXMLDOMElement);
@@ -129,13 +129,33 @@ namespace NX.ERP.U8.Store
iXMLDOMElement.setAttribute("iquantity", detail.Quantity);
iXMLDOMElement.setAttribute("irowno", n);
iXMLDOMElement.setAttribute("cbvencode", "10001");
iXMLDOMElement.setAttribute("cbatch", detail.Batch);
iXMLDOMElement.setAttribute("carvcode", "2");
iXMLDOMElement.setAttribute("ipurarriveid", "222");
iXMLDOMElement.setAttribute("carvcode", Arrival.ArrivalCode);
iXMLDOMElement.setAttribute("cbarvcode", Arrival.ArrivalCode);
iXMLDOMElement.setAttribute("ipurarriveid", Arrival.Id);
iXMLDOMElement.setAttribute("iarrsid", detail.SorceDetailId);
iXMLDOMElement.setAttribute("darvdate", DateTime.Today.ToShortDateString());
iXMLDOMElement.setAttribute("editprop", "A");
iXMLDOMElement.setAttribute("cpoid", arrivalDetail.OrderCode);
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);
}

View File

@@ -5,7 +5,7 @@ using System.Text;
using U8Login;
using UFIDA.U8.U8APIFramework;
using UFIDA.U8.U8MOMAPIFramework;
using Dapper;
namespace NX.ERP.U8
{
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()
{
if (uiLogin != null)
@@ -77,6 +102,21 @@ namespace NX.ERP.U8
return this.ClsLogin.UFDataConnstringForNet;
}
}
public string LoginUserName
{
get
{
return this.ClsLogin.cUserName;
}
}
public string LoginUserId
{
get
{
return this.ClsLogin.cUserId;
}
}
/// <summary>
/// ADO的链接字符串
/// </summary>
@@ -135,12 +175,12 @@ namespace NX.ERP.U8
}
public void AddRdVoucher(string URL,VoucherParameter para)
public void AddRdVoucher(string URL, VoucherParameter para)
{
try
{
U8EnvContext u8EnvContext = new U8EnvContext();
u8EnvContext.U8Login =this.ClsLogin;
u8EnvContext.U8Login = this.ClsLogin;
U8ApiAddress apiAddress = new U8ApiAddress(URL);
U8ApiBroker u8ApiBroker = new U8ApiBroker(apiAddress, u8EnvContext);
@@ -151,7 +191,7 @@ namespace NX.ERP.U8
{
u8ApiBroker.AssignNormalValue("domPosition", para.DomPosition);
}
u8ApiBroker.AssignNormalValue("cnnFrom", null);
if (para.DOMMsg != null)
{
@@ -174,21 +214,21 @@ namespace NX.ERP.U8
if (exception is MomSysException)
{
MomSysException ex = exception as MomSysException;
}
else if (exception is MomBizException)
{
MomBizException ex2 = exception as MomBizException;
}
string exceptionString = u8ApiBroker.GetExceptionString();
if (exceptionString.Length != 0)
{
}
}
para.ReturnValue = false;
u8ApiBroker.Release();
return;
}
@@ -228,7 +268,7 @@ namespace NX.ERP.U8
}
catch (Exception ex3)
{
throw ex3;
}
}
@@ -255,21 +295,21 @@ namespace NX.ERP.U8
if (exception is MomSysException)
{
MomSysException ex = exception as MomSysException;
}
else if (exception is MomBizException)
{
MomBizException ex2 = exception as MomBizException;
}
string exceptionString = u8ApiBroker.GetExceptionString();
if (exceptionString.Length != 0)
{
}
}
para.ReturnValue = false;
u8ApiBroker.Release();
return;
}
@@ -297,14 +337,14 @@ namespace NX.ERP.U8
}
catch (Exception ex3)
{
throw new Exception("装载供应链库存单据失败!");
}
}