2021-01-13 10:21:56 +08:00
|
|
|
|
using MSXML2;
|
|
|
|
|
|
using System;
|
2021-01-12 16:10:37 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
namespace NX.ERP.U8.Store
|
|
|
|
|
|
{
|
2021-01-13 10:21:56 +08:00
|
|
|
|
public class OtherStoreOutDAL : VoucherBase
|
2021-01-12 16:10:37 +08:00
|
|
|
|
{
|
2021-01-13 12:37:27 +08:00
|
|
|
|
public OtherStoreOutDAL() : base("09", "U8API/otherout")
|
2021-01-13 10:21:56 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2021-01-15 10:22:35 +08:00
|
|
|
|
public string AddVocher(Model.Request.OtherStoreInOut storeIn)
|
2021-01-13 10:21:56 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
VoucherParameter voucherParameter = new VoucherParameter
|
|
|
|
|
|
{
|
|
|
|
|
|
VoucherType = this.VoucherID,
|
|
|
|
|
|
DomHead = new DOMDocumentClass(),
|
|
|
|
|
|
DomBody = new DOMDocumentClass()
|
|
|
|
|
|
};
|
|
|
|
|
|
DOMDocument domHead = voucherParameter.DomHead;
|
|
|
|
|
|
DOMDocument domBody = voucherParameter.DomBody;
|
|
|
|
|
|
voucherParameter.DomHead.loadXML(HeadTemplate);
|
|
|
|
|
|
voucherParameter.DomBody.loadXML(BodyTemplate);
|
|
|
|
|
|
IXMLDOMElement headXml = domHead.createElement("z:row");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
headXml.setAttribute("bpufirst", "0");
|
|
|
|
|
|
headXml.setAttribute("bisstqc", "0");
|
|
|
|
|
|
headXml.setAttribute("bomfirst", "0");
|
|
|
|
|
|
headXml.setAttribute("biafirst", "0");
|
|
|
|
|
|
headXml.setAttribute("brdflag", 1);
|
|
|
|
|
|
headXml.setAttribute("ccode", storeIn.Code);
|
|
|
|
|
|
headXml.setAttribute("ddate", storeIn.Date);
|
|
|
|
|
|
headXml.setAttribute("cmaker", "/");
|
|
|
|
|
|
headXml.setAttribute("cvouchtype", this.VoucherID);
|
2021-01-18 16:44:18 +08:00
|
|
|
|
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0302"));
|
2021-01-13 10:21:56 +08:00
|
|
|
|
headXml.setAttribute("editprop", "A");
|
|
|
|
|
|
headXml.setAttribute("cdepcode", "");
|
|
|
|
|
|
headXml.setAttribute("cpersoncode", "");
|
|
|
|
|
|
headXml.setAttribute("crdcode", "");
|
|
|
|
|
|
|
|
|
|
|
|
headXml.setAttribute("csource", "库存");
|
|
|
|
|
|
headXml.setAttribute("cwhcode", storeIn.WhCode);
|
|
|
|
|
|
headXml.setAttribute("cbustype", "其他出库");
|
|
|
|
|
|
headXml.setAttribute("cmemo", "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IXMLDOMElement bodyXml;
|
|
|
|
|
|
for (var n = 0; n < storeIn.details.Count(); n++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var detail = storeIn.details[n];
|
|
|
|
|
|
//var arrivalDetail = Arrival.ArrivalDetails.First(m => { return m.Id == detail.SorceDetailId; });
|
|
|
|
|
|
//headXml.setAttribute("cordercode", arrivalDetail.OrderCode);
|
|
|
|
|
|
// headXml.setAttribute("ipurorderid", arrivalDetail.PoId);
|
|
|
|
|
|
bodyXml = domBody.createElement("z:row");
|
|
|
|
|
|
bodyXml.setAttribute("cinvcode", detail.InvCode);
|
|
|
|
|
|
bodyXml.setAttribute("iquantity", detail.Quantity);
|
|
|
|
|
|
bodyXml.setAttribute("irowno", n + 1);
|
|
|
|
|
|
|
|
|
|
|
|
bodyXml.setAttribute("cbatch", "");
|
|
|
|
|
|
|
|
|
|
|
|
bodyXml.setAttribute("cposition", detail.Position);
|
|
|
|
|
|
bodyXml.setAttribute("cvmivencode", "");
|
|
|
|
|
|
bodyXml.setAttribute("dmadedate", "");
|
|
|
|
|
|
bodyXml.setAttribute("dvdate", "");
|
|
|
|
|
|
bodyXml.setAttribute("iexpiratdatecalcu", "");
|
|
|
|
|
|
bodyXml.setAttribute("cmassunit", "");
|
|
|
|
|
|
bodyXml.setAttribute("imassdate", "");
|
|
|
|
|
|
bodyXml.setAttribute("cexpirationdate", "");
|
|
|
|
|
|
bodyXml.setAttribute("dexpirationdate", "");
|
|
|
|
|
|
bodyXml.setAttribute("citem_class", "");
|
|
|
|
|
|
bodyXml.setAttribute("citemcode", "");
|
|
|
|
|
|
bodyXml.setAttribute("cbmemo", "");
|
|
|
|
|
|
bodyXml.setAttribute("editprop", "A");
|
|
|
|
|
|
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
domHead.selectSingleNode("//rs:data").appendChild(headXml);
|
|
|
|
|
|
var str = voucherParameter.DomBody.xml;
|
|
|
|
|
|
Console.WriteLine(str);
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2021-01-15 10:22:35 +08:00
|
|
|
|
return AddRdVoucher(voucherParameter);
|
2021-01-13 10:21:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception err)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
throw err;
|
|
|
|
|
|
}
|
2021-01-12 16:10:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|