添加销售出库单

This commit is contained in:
admin
2021-01-13 15:02:56 +08:00
parent 1394879cc7
commit 31408b5e36
9 changed files with 167 additions and 19 deletions

View File

@@ -10,7 +10,7 @@ namespace NX.ERP.U8.Sale
{
public IEnumerable<Model.Sale.DispatchList> GetList(string strWhere = "", object Params = null)
{
var strSql = @"select a.DLID as id ,a.cDLCode as Code ,b.AutoID as id ,b.cInvCode as InvCode ,b.cInvName as InvName,b.iQuantity AS Quantity
var strSql = @"select a.DLID as id ,a.cDLCode as Code ,A.cCusCode AS CusCode,b.AutoID as id ,b.cInvCode as InvCode ,b.cInvName as InvName,b.iQuantity AS Quantity
from DispatchList as a
left join DispatchLists as b on a.DLID = b.DLID";

View File

@@ -107,8 +107,7 @@ namespace NX.ERP.U8.Store
}
domHead.selectSingleNode("//rs:data").appendChild(headXml);
var str = voucherParameter.DomBody.xml;
Console.WriteLine(str);
try
{
return AddRdVoucher(voucherParameter);

View File

@@ -1,4 +1,6 @@
using System;
using MSXML2;
using NX.ERP.Model.Store;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -13,11 +15,88 @@ namespace NX.ERP.U8.Store
}
public string AddVoucher()
public string AddVoucher(SaleStoreOut storeOut)
{
return "";
}
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("cvouchtype", this.VoucherID);//DomHead[0]["cvouchtype"] = ""; //单据类型,string类型
headXml.setAttribute("bpufirst", "0");
headXml.setAttribute("bisstqc", "0");
headXml.setAttribute("bomfirst", "0");
headXml.setAttribute("biafirst", "0");
headXml.setAttribute("brdflag", 0);
headXml.setAttribute("ccode", storeOut.Code);
headXml.setAttribute("ddate", storeOut.Date);
headXml.setAttribute("cmaker", "");
headXml.setAttribute("vt_id", "");
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "");
headXml.setAttribute("cpersoncode", "");
headXml.setAttribute("crdcode", "");
headXml.setAttribute("csource", storeOut.Source);
headXml.setAttribute("cwhcode", storeOut.WhCode);
if (storeOut.Source == "发货单")
{
var dispatch = new Sale.DispatchListDAL().GetModel(storeOut.SourceCode);
headXml.setAttribute("cbuscode", storeOut.SourceCode);
headXml.setAttribute("cdlcode", dispatch.ID);
headXml.setAttribute("iarriveid", storeOut.SourceCode);
headXml.setAttribute("iflowid", "");
headXml.setAttribute("cbustype", "普通销售");
headXml.setAttribute("cstcode", "");
headXml.setAttribute("ccuscode", dispatch.CusCode);
headXml.setAttribute("cmemo", "");
IXMLDOMElement bodyXml;
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("irowno", n + 1);
bodyXml.setAttribute("cposition", detail.Position);
bodyXml.setAttribute("editprop", "A");
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
}
}
domHead.selectSingleNode("//rs:data").appendChild(headXml);
try
{
return AddRdVoucher(voucherParameter);
}
catch (Exception err)
{
throw err;
}
}
}

View File

@@ -31,7 +31,7 @@ namespace NX.ERP.U8.Store
return $"{AppDomain.CurrentDomain.BaseDirectory}XMLDOM\\XMLDomHead{this.voucherID}.xml";
}
}
public string LoadUrl
protected string LoadUrl
{
get
{
@@ -39,7 +39,7 @@ namespace NX.ERP.U8.Store
}
}
public string AddUrl
protected string AddUrl
{
get
{