销售出库追加
This commit is contained in:
@@ -99,6 +99,60 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
}
|
||||
|
||||
public bool UpdateVoucher(SaleStoreOut storeOut)
|
||||
{
|
||||
|
||||
VoucherParameter voucherParameter = this.LoadVoucher($"cCode='{storeOut.Code}'");
|
||||
|
||||
|
||||
|
||||
DOMDocument domBody = voucherParameter.DomBody;
|
||||
IXMLDOMElement bodyXml;
|
||||
|
||||
if (storeOut.Source == "发货单")
|
||||
{
|
||||
var dispatch = new Sale.DispatchListDAL().GetModel(storeOut.SourceCode);
|
||||
|
||||
for (var n = 0; n < storeOut.Details.Count; n++)
|
||||
{
|
||||
bodyXml = domBody.createElement("z:row");
|
||||
var detail = storeOut.Details[n];
|
||||
bodyXml.setAttribute("cinvcode", detail.InvCode);
|
||||
bodyXml.setAttribute("iquantity", detail.Quantity);
|
||||
|
||||
|
||||
|
||||
bodyXml.setAttribute("cposition", detail.Position);
|
||||
|
||||
bodyXml.setAttribute("editprop", "A");
|
||||
|
||||
|
||||
|
||||
bodyXml.setAttribute("irowno", domBody.selectSingleNode("//rs:data").childNodes.length + 1);
|
||||
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
return UpdateRdVoucher(voucherParameter);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
|
||||
throw err;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,5 +17,15 @@ namespace NX.ERP.WebAPi.Controllers.Store
|
||||
var dal = new NX.ERP.U8.Store.SaleOutDAL();
|
||||
return new { Id = dal.AddVoucher(storeIn) };
|
||||
}
|
||||
|
||||
|
||||
[Route("api/SaleStoreOut/Update")]
|
||||
[HttpPost]
|
||||
public bool UpdateVoucher([FromBody] Model.Request.SaleStoreOut storeIn)
|
||||
{
|
||||
var dal = new NX.ERP.U8.Store.SaleOutDAL();
|
||||
// return new { Id = dal.UpdateVoucher(storeIn) };
|
||||
return dal.UpdateVoucher(storeIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user