添加销售出库单

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

@@ -80,6 +80,8 @@
<Compile Include="Store\OtherStoreOutDetail.cs" />
<Compile Include="Store\PuStoreIn.cs" />
<Compile Include="Store\PuStoreInDetail.cs" />
<Compile Include="Store\SaleStoreOut.cs" />
<Compile Include="Store\SaleStoreOutDetail.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View 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>();
}
}

View 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; }
}
}

View File

@@ -36,6 +36,7 @@ namespace U8AppMain
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.ImportBom = 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.dataGridView1 = new System.Windows.Forms.DataGridView();
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.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -75,7 +76,8 @@ namespace U8AppMain
this.toolStripMenuItem2,
this.材料出库单ToolStripMenuItem,
this.其他入库ToolStripMenuItem,
this.其他出库ToolStripMenuItem});
this.其他出库ToolStripMenuItem,
this.销售出库ToolStripMenuItem});
this.操作ToolStripMenuItem.Name = "操作ToolStripMenuItem";
this.操作ToolStripMenuItem.Size = new System.Drawing.Size(45, 19);
this.操作ToolStripMenuItem.Text = "文件";
@@ -115,6 +117,13 @@ namespace U8AppMain
this.其他入库ToolStripMenuItem.Text = "其他入库";
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
//
this.导入ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -213,12 +222,12 @@ namespace U8AppMain
this.richTextBox1.Text = "";
this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged);
//
// 其他出库ToolStripMenuItem
// 销售出库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);
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);
//
// 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;
}
}

View File

@@ -305,13 +305,13 @@ namespace U8AppMain
RdCode = "101",
Depcode = "24",
Whcode = "1",
Source = "采购到货单",
Source = "采购到货单",
SourceCode = "CGDH210100187",
Details = new List<NX.ERP.Model.Store.PuStoreInDetail>() {
new NX.ERP.Model.Store.PuStoreInDetail(){
Quantity=1,
Invcode="201763",
SorceDetailId=1000023624,
}
@@ -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,
}
}
});
}
}
}

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
{