材料出库
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 == "生产订单")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user