材料出库
This commit is contained in:
@@ -46,9 +46,9 @@ namespace NX.ERP.U8.Store
|
||||
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0412"));
|
||||
headXml.setAttribute("editprop", "A");
|
||||
|
||||
headXml.setAttribute("cdepcode", "1");
|
||||
//headXml.setAttribute("cdepcode", "1");
|
||||
headXml.setAttribute("crdcode", "201");
|
||||
headXml.setAttribute("cpersoncode", "it");
|
||||
|
||||
headXml.setAttribute("cwhcode", storeOut.Whcode);
|
||||
headXml.setAttribute("csource", storeOut.Source);
|
||||
if (storeOut.Source == "生产订单")
|
||||
@@ -64,7 +64,9 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
string lastProductNo = null;
|
||||
headXml.setAttribute("crdname", "材料出库");
|
||||
headXml.setAttribute("cdepcode", "24");
|
||||
//headXml.setAttribute("cdepcode", "24");
|
||||
|
||||
|
||||
//headXml.setAttribute("cdepname", "研发LA组");
|
||||
IXMLDOMElement bodyXml;
|
||||
for (var n = 0; n < storeOut.Details.Count(); n++)
|
||||
@@ -77,6 +79,9 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (alllocate.MaterialCode != detail.InvCode)
|
||||
{
|
||||
throw new Exception($"订单明细存货编号与出库存货编号不符:{detail.InvCode}");
|
||||
@@ -90,6 +95,12 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
lastProductNo = "";
|
||||
}
|
||||
|
||||
|
||||
headXml.setAttribute("cdepcode", alllocate.momDetail.MDeptCode);
|
||||
|
||||
|
||||
|
||||
#region 明细
|
||||
|
||||
bodyXml = domBody.createElement("z:row");
|
||||
@@ -139,11 +150,37 @@ namespace NX.ERP.U8.Store
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool UpdateVocher(Model.Request.MaterialStoreOut storeOut)
|
||||
public string SaveVoucher(Model.Request.MaterialStoreOut storeOut)
|
||||
{
|
||||
VoucherParameter voucherParameter = this.LoadVoucher($"Id='{storeOut.Id}'");
|
||||
var voucherParameter = this.LoadVoucher($"id='{storeOut.Id}'");
|
||||
if (voucherParameter.DomHead.selectSingleNode("//rs:data").childNodes.length == 0)
|
||||
{
|
||||
return this.AddVocher(storeOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.UpdateVocher(storeOut, voucherParameter))
|
||||
{
|
||||
return storeOut.Id.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("保存错误");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public bool UpdateVocher(Model.Request.MaterialStoreOut storeOut, VoucherParameter voucherParameter = null)
|
||||
{
|
||||
if (voucherParameter == null)
|
||||
{
|
||||
|
||||
voucherParameter = this.LoadVoucher($"Id='{storeOut.Id}'");
|
||||
}
|
||||
DOMDocument domBody = voucherParameter.DomBody;
|
||||
if (storeOut.Source == "生产订单")
|
||||
{
|
||||
|
||||
@@ -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 == "采购到货单")
|
||||
|
||||
@@ -99,16 +99,40 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
}
|
||||
|
||||
public bool UpdateVoucher(SaleStoreOut storeOut)
|
||||
|
||||
public string SaveVoucher(SaleStoreOut storeOut)
|
||||
{
|
||||
var voucherParameter = this.LoadVoucher($"id='{storeOut.Id}'");
|
||||
if (voucherParameter.DomHead.selectSingleNode("//rs:data").childNodes.length == 0)
|
||||
{
|
||||
return this.AddVoucher(storeOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.UpdateVoucher(storeOut, voucherParameter))
|
||||
{
|
||||
return storeOut.Id.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("保存错误");
|
||||
}
|
||||
|
||||
VoucherParameter voucherParameter = this.LoadVoucher($"id='{storeOut.Id}'");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool UpdateVoucher(SaleStoreOut storeOut, VoucherParameter voucherParameter = null)
|
||||
{
|
||||
if (voucherParameter == null)
|
||||
{
|
||||
voucherParameter = this.LoadVoucher($"id='{storeOut.Id}'");
|
||||
}
|
||||
DOMDocument domBody = voucherParameter.DomBody;
|
||||
IXMLDOMElement bodyXml;
|
||||
|
||||
if (storeOut.Source == "发货单")
|
||||
{
|
||||
var dispatch = new Sale.DispatchListDAL().GetModel(storeOut.SourceCode);
|
||||
|
||||
Reference in New Issue
Block a user