添加销售出库单
This commit is contained in:
@@ -80,6 +80,8 @@
|
|||||||
<Compile Include="Store\OtherStoreOutDetail.cs" />
|
<Compile Include="Store\OtherStoreOutDetail.cs" />
|
||||||
<Compile Include="Store\PuStoreIn.cs" />
|
<Compile Include="Store\PuStoreIn.cs" />
|
||||||
<Compile Include="Store\PuStoreInDetail.cs" />
|
<Compile Include="Store\PuStoreInDetail.cs" />
|
||||||
|
<Compile Include="Store\SaleStoreOut.cs" />
|
||||||
|
<Compile Include="Store\SaleStoreOutDetail.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
17
NX.ERP.Model/Store/SaleStoreOut.cs
Normal file
17
NX.ERP.Model/Store/SaleStoreOut.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NX.ERP.Model.Store
|
||||||
|
{
|
||||||
|
public class SaleStoreOut
|
||||||
|
{
|
||||||
|
public string Code { get; set; }
|
||||||
|
public string Source { get; set; }
|
||||||
|
public string SourceCode { get; set; }
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
public string WhCode { get; set; }
|
||||||
|
public IList<SaleStoreOutDetail> Details { get; set; } = new List<SaleStoreOutDetail>();
|
||||||
|
}
|
||||||
|
}
|
||||||
16
NX.ERP.Model/Store/SaleStoreOutDetail.cs
Normal file
16
NX.ERP.Model/Store/SaleStoreOutDetail.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NX.ERP.Model.Store
|
||||||
|
{
|
||||||
|
public class SaleStoreOutDetail
|
||||||
|
{
|
||||||
|
public string InvCode { get; set; }
|
||||||
|
public double Quantity { get; set; }
|
||||||
|
public string Position { get; set; }
|
||||||
|
public int SourceDetailId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
24
NX.ERP.U8.App/FrmMain.Designer.cs
generated
24
NX.ERP.U8.App/FrmMain.Designer.cs
generated
@@ -36,6 +36,7 @@ namespace U8AppMain
|
|||||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
|
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.材料出库单ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.材料出库单ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.其他入库ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.其他入库ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.其他出库ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.导入ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.导入ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.ImportBom = new System.Windows.Forms.ToolStripMenuItem();
|
this.ImportBom = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.BtnPurchaseImport = new System.Windows.Forms.ToolStripMenuItem();
|
this.BtnPurchaseImport = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
@@ -45,7 +46,7 @@ namespace U8AppMain
|
|||||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||||
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||||
this.其他出库ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.销售出库ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.splitContainer1.Panel1.SuspendLayout();
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
this.splitContainer1.Panel2.SuspendLayout();
|
this.splitContainer1.Panel2.SuspendLayout();
|
||||||
@@ -75,7 +76,8 @@ namespace U8AppMain
|
|||||||
this.toolStripMenuItem2,
|
this.toolStripMenuItem2,
|
||||||
this.材料出库单ToolStripMenuItem,
|
this.材料出库单ToolStripMenuItem,
|
||||||
this.其他入库ToolStripMenuItem,
|
this.其他入库ToolStripMenuItem,
|
||||||
this.其他出库ToolStripMenuItem});
|
this.其他出库ToolStripMenuItem,
|
||||||
|
this.销售出库ToolStripMenuItem});
|
||||||
this.操作ToolStripMenuItem.Name = "操作ToolStripMenuItem";
|
this.操作ToolStripMenuItem.Name = "操作ToolStripMenuItem";
|
||||||
this.操作ToolStripMenuItem.Size = new System.Drawing.Size(45, 19);
|
this.操作ToolStripMenuItem.Size = new System.Drawing.Size(45, 19);
|
||||||
this.操作ToolStripMenuItem.Text = "文件";
|
this.操作ToolStripMenuItem.Text = "文件";
|
||||||
@@ -115,6 +117,13 @@ namespace U8AppMain
|
|||||||
this.其他入库ToolStripMenuItem.Text = "其他入库";
|
this.其他入库ToolStripMenuItem.Text = "其他入库";
|
||||||
this.其他入库ToolStripMenuItem.Click += new System.EventHandler(this.其他入库ToolStripMenuItem_Click);
|
this.其他入库ToolStripMenuItem.Click += new System.EventHandler(this.其他入库ToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
// 其他出库ToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.其他出库ToolStripMenuItem.Name = "其他出库ToolStripMenuItem";
|
||||||
|
this.其他出库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
|
this.其他出库ToolStripMenuItem.Text = "其他出库";
|
||||||
|
this.其他出库ToolStripMenuItem.Click += new System.EventHandler(this.其他出库ToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// 导入ToolStripMenuItem
|
// 导入ToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.导入ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.导入ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
@@ -213,12 +222,12 @@ namespace U8AppMain
|
|||||||
this.richTextBox1.Text = "";
|
this.richTextBox1.Text = "";
|
||||||
this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged);
|
this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged);
|
||||||
//
|
//
|
||||||
// 其他出库ToolStripMenuItem
|
// 销售出库ToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.其他出库ToolStripMenuItem.Name = "其他出库ToolStripMenuItem";
|
this.销售出库ToolStripMenuItem.Name = "销售出库ToolStripMenuItem";
|
||||||
this.其他出库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
this.销售出库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.其他出库ToolStripMenuItem.Text = "其他出库";
|
this.销售出库ToolStripMenuItem.Text = "销售出库";
|
||||||
this.其他出库ToolStripMenuItem.Click += new System.EventHandler(this.其他出库ToolStripMenuItem_Click);
|
this.销售出库ToolStripMenuItem.Click += new System.EventHandler(this.销售出库ToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// FrmMain
|
// FrmMain
|
||||||
//
|
//
|
||||||
@@ -261,6 +270,7 @@ namespace U8AppMain
|
|||||||
private System.Windows.Forms.ToolStripMenuItem 材料出库单ToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem 材料出库单ToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem 其他入库ToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem 其他入库ToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem 其他出库ToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem 其他出库ToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem 销售出库ToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -395,5 +395,30 @@ namespace U8AppMain
|
|||||||
|
|
||||||
}); ;
|
}); ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void 销售出库ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var dal = new NX.ERP.U8.Store.SaleOutDAL();
|
||||||
|
dal.AddVoucher(new NX.ERP.Model.Store.SaleStoreOut()
|
||||||
|
{
|
||||||
|
Code = "222",
|
||||||
|
Source = "发货单",
|
||||||
|
SourceCode = "XSFH210100009",
|
||||||
|
WhCode = "1",
|
||||||
|
Date = DateTime.Now,
|
||||||
|
Details = new List<NX.ERP.Model.Store.SaleStoreOutDetail>()
|
||||||
|
{
|
||||||
|
new NX.ERP.Model.Store.SaleStoreOutDetail()
|
||||||
|
{
|
||||||
|
InvCode="902112",
|
||||||
|
Position="",
|
||||||
|
Quantity=1,
|
||||||
|
SourceDetailId=2921,
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace NX.ERP.U8.Sale
|
|||||||
{
|
{
|
||||||
public IEnumerable<Model.Sale.DispatchList> GetList(string strWhere = "", object Params = null)
|
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
|
from DispatchList as a
|
||||||
left join DispatchLists as b on a.DLID = b.DLID";
|
left join DispatchLists as b on a.DLID = b.DLID";
|
||||||
|
|
||||||
|
|||||||
@@ -107,8 +107,7 @@ namespace NX.ERP.U8.Store
|
|||||||
}
|
}
|
||||||
domHead.selectSingleNode("//rs:data").appendChild(headXml);
|
domHead.selectSingleNode("//rs:data").appendChild(headXml);
|
||||||
|
|
||||||
var str = voucherParameter.DomBody.xml;
|
|
||||||
Console.WriteLine(str);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return AddRdVoucher(voucherParameter);
|
return AddRdVoucher(voucherParameter);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using MSXML2;
|
||||||
|
using NX.ERP.Model.Store;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace NX.ERP.U8.Store
|
|||||||
return $"{AppDomain.CurrentDomain.BaseDirectory}XMLDOM\\XMLDomHead{this.voucherID}.xml";
|
return $"{AppDomain.CurrentDomain.BaseDirectory}XMLDOM\\XMLDomHead{this.voucherID}.xml";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string LoadUrl
|
protected string LoadUrl
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -39,7 +39,7 @@ namespace NX.ERP.U8.Store
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string AddUrl
|
protected string AddUrl
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user