产品入库
This commit is contained in:
@@ -85,5 +85,52 @@ namespace NX.ERP.U8.Store
|
||||
}
|
||||
|
||||
|
||||
public bool UpdateVoucher(ProductStoreIn storeIn)
|
||||
{
|
||||
var voucherParameter = this.LoadVoucher($"cCode='{storeIn.Code}'");
|
||||
|
||||
DOMDocument domBody = voucherParameter.DomBody;
|
||||
|
||||
if (storeIn.Source == "生产订单")
|
||||
{
|
||||
var momOrder = new Mom.MomOrderDAL().GetModel(storeIn.SourceCode);
|
||||
|
||||
IXMLDOMElement bodyXml;
|
||||
for (var n = 0; n < storeIn.Details.Count; n++)
|
||||
{
|
||||
bodyXml = domBody.createElement("z:row");
|
||||
var detail = storeIn.Details[n];
|
||||
bodyXml.setAttribute("cinvcode", detail.InvCode);
|
||||
bodyXml.setAttribute("iquantity", detail.Quantity);
|
||||
var _cost = new MaterialDAL().GetCost(detail.InvCode, 0);
|
||||
bodyXml.setAttribute("iunitcost", _cost);
|
||||
bodyXml.setAttribute("iprice", new Account.Accinformation().FormatMoney(_cost * detail.Quantity));
|
||||
|
||||
bodyXml.setAttribute("editprop", "A");
|
||||
|
||||
bodyXml.setAttribute("cbatch", detail.Batch);
|
||||
bodyXml.setAttribute("cposition", detail.Position);
|
||||
var momOrderDetail = momOrder.ProductDtlLst.First(m => { return m.ProductOrderDtlId == detail.SourceDetailId; });
|
||||
|
||||
bodyXml.setAttribute("cmocode", momOrder.ProductOrderNo);
|
||||
bodyXml.setAttribute("impoids", detail.SourceDetailId);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user