添加成品入库单

This commit is contained in:
admin
2021-01-13 17:02:03 +08:00
parent 31408b5e36
commit 11ef4f9f5b
8 changed files with 162 additions and 2 deletions

View File

@@ -78,6 +78,8 @@
<Compile Include="Store\OtherStoreInDetail.cs" />
<Compile Include="Store\OtherStoreOut.cs" />
<Compile Include="Store\OtherStoreOutDetail.cs" />
<Compile Include="Store\ProductStoreIn.cs" />
<Compile Include="Store\ProductStoreInDetail.cs" />
<Compile Include="Store\PuStoreIn.cs" />
<Compile Include="Store\PuStoreInDetail.cs" />
<Compile Include="Store\SaleStoreOut.cs" />

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 ProductStoreIn
{
public DateTime Date { get; set; }
public string Source { get; set; }
public string SourceCode { get; set; }
public string WhCode { get; set; }
public IList<ProductStoreInDetail> Details { get; set; } = new List<ProductStoreInDetail>();
}
}

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 ProductStoreInDetail
{
public string InvCode { get; set; }
public int Quantity { get; set; }
public string Batch { get; set; }
public string Position { get; set; }
public int SourceDetailId { get; set; }
}
}

View File

@@ -47,6 +47,7 @@ namespace U8AppMain
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();
@@ -77,7 +78,8 @@ namespace U8AppMain
this.材料出库单ToolStripMenuItem,
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 = "文件";
@@ -229,6 +231,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);
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
@@ -271,6 +280,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

@@ -420,5 +420,29 @@ namespace U8AppMain
}
});
}
private void 成品入库ToolStripMenuItem_Click(object sender, EventArgs e)
{
var dal = new NX.ERP.U8.Store.ProductInDAL();
dal.AddVoucher(new NX.ERP.Model.Store.ProductStoreIn()
{
Source = "生产订单",
SourceCode = "SCDD210100010",
Date = DateTime.Today,
WhCode = "1",
Details = new List<NX.ERP.Model.Store.ProductStoreInDetail>() {
new NX.ERP.Model.Store.ProductStoreInDetail()
{
Batch="",
InvCode="902009",
SourceDetailId=1000005568,
Quantity=1,
Position=""
}
}
}); ;
}
}
}

View File

@@ -48,6 +48,7 @@
<Compile Include="Store\MaterielStoreOutDAL.cs" />
<Compile Include="Store\OtherStoreInDAL.cs" />
<Compile Include="Store\OtherStoreOutDAL.cs" />
<Compile Include="Store\ProductInDAL.cs" />
<Compile Include="Store\PuStoreInDAL.cs" />
<Compile Include="Store\SaleOutDAL.cs" />
<Compile Include="Store\VoucherBase.cs" />

View File

@@ -0,0 +1,90 @@
using MSXML2;
using NX.ERP.Model.Store;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.U8.Store
{
public class ProductInDAL : VoucherBase
{
public ProductInDAL() : base("10", "U8API/ProductIn")
{
}
public string AddVoucher(ProductStoreIn storeIn)
{
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", 1);
headXml.setAttribute("ccode", "11");
headXml.setAttribute("ddate", storeIn.Date);
headXml.setAttribute("cmaker", "");
headXml.setAttribute("vt_id", "");
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "");
headXml.setAttribute("cpersoncode", "");
headXml.setAttribute("crdcode", "");
if (storeIn.Source == "生产订单")
{
var momOrder = new Mom.MomOrderDAL().GetModel(storeIn.SourceCode);
headXml.setAttribute("csource", storeIn.Source);
headXml.setAttribute("cwhcode", storeIn.WhCode);
headXml.setAttribute("cbustype", "成品入库");
headXml.setAttribute("cmemo", "");
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);
bodyXml.setAttribute("irowno", n + 1);
bodyXml.setAttribute("editprop", "A");
bodyXml.setAttribute("cbatch", detail.Batch);
bodyXml.setAttribute("cposition", detail.Position);
var momOrderDetail = momOrder.momDetails.First(m => { return m.Id == detail.SourceDetailId; });
headXml.setAttribute("cmpocode", momOrder.Code);
headXml.setAttribute("iproorderid", momOrder.Id);
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
}
}
domHead.selectSingleNode("//rs:data").appendChild(headXml);
try
{
return AddRdVoucher(voucherParameter);
}
catch (Exception err)
{
throw err;
}
}
}
}

View File

@@ -39,7 +39,8 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("ccode", storeOut.Code);
headXml.setAttribute("ddate", storeOut.Date);
headXml.setAttribute("cmaker", "");
headXml.setAttribute("vt_id", "");
headXml.setAttribute("vt_id","");
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "");
headXml.setAttribute("cpersoncode", "");