材料出库

This commit is contained in:
gongxh
2021-03-15 15:50:14 +08:00
parent f56c8806e7
commit 67d0581674
11 changed files with 135 additions and 21 deletions

View File

@@ -50,7 +50,7 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("24"));
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", puStoreIn.Deptcode);
headXml.setAttribute("cpersoncode", puStoreIn.PersonCode);
headXml.setAttribute("crdcode", "101" /*puStoreIn.RdCode*/);
headXml.setAttribute("cwhcode", puStoreIn.Whcode);
headXml.setAttribute("bisstqc", "0");
@@ -70,6 +70,8 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("darvdate", Arrival.ArrivalDate);
headXml.setAttribute("itaxrate", Arrival.TaxRate);
headXml.setAttribute("cptcode", Arrival.PTCode);
headXml.setAttribute("cpersoncode", Arrival.CPersonCode);
headXml.setAttribute("cpersonname", Arrival.cpersonname);
IXMLDOMElement bodyXml;
for (var n = 0; n < puStoreIn.Details.Count; n++)
{
@@ -134,13 +136,39 @@ namespace NX.ERP.U8.Store
public string SaveVoucher(Model.Request.PuStoreIn puStoreIn)
{
var voucherParameter = this.LoadVoucher($"id='{puStoreIn.Id}'");
if (voucherParameter.DomHead.selectSingleNode("//rs:data").childNodes.length == 0)
{
return this.AddVocher(puStoreIn);
}
else
{
if (this.UpdateVocher(puStoreIn, voucherParameter))
{
return puStoreIn.Id.ToString();
}
else
{
throw new Exception("保存错误");
}
}
public bool UpdateVocher(Model.Request.PuStoreIn puStoreIn)
}
public bool UpdateVocher(Model.Request.PuStoreIn puStoreIn, VoucherParameter voucherParameter = null)
{
try
{
var voucherParameter = this.LoadVoucher($"id='{puStoreIn.Id}'");
if (voucherParameter == null)
{
voucherParameter = this.LoadVoucher($"id='{puStoreIn.Id}'");
}
//添加一條
DOMDocument domBody = voucherParameter.DomBody;
if (puStoreIn.Source == "采购到货单")