From 4d15e58893a22194c21147491b00a4febf461542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Wed, 9 Sep 2020 16:50:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E3=80=81=E4=BE=9B=E5=BA=94=E5=95=86=E7=89=A9?= =?UTF-8?q?=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SCP/SCP.csproj | 74 ++- .../SupplierFinance/SCP_INVOICE.aspx | 161 +++++ .../SupplierFinance/SCP_INVOICE.aspx.cs | 225 +++++++ .../SCP_INVOICE.aspx.designer.cs | 314 ++++++++++ .../SupplierFinance/SCP_INVOICE_CREATE.aspx | 103 ++++ .../SCP_INVOICE_CREATE.aspx.cs | 416 +++++++++++++ .../SCP_INVOICE_CREATE.aspx.designer.cs | 143 +++++ .../SupplierFinance/SCP_INVOICE_EDIT.aspx | 152 +++++ .../SupplierFinance/SCP_INVOICE_EDIT.aspx.cs | 560 ++++++++++++++++++ .../SCP_INVOICE_EDIT.aspx.designer.cs | 359 +++++++++++ .../SupplierFinance/SCP_RECEIVE_LIST.aspx | 250 ++++++++ .../SupplierFinance/SCP_RECEIVE_LIST.aspx.cs | 512 ++++++++++++++++ .../SCP_RECEIVE_LIST.aspx.designer.cs | 395 ++++++++++++ .../SupplierLogistics/SCP_ASK.aspx | 154 +++++ .../SupplierLogistics/SCP_ASK.aspx.cs | 351 +++++++++++ .../SCP_ASK.aspx.designer.cs | 368 ++++++++++++ .../SupplierLogistics/SCP_ASK_DETAIL.aspx | 119 ++++ .../SupplierLogistics/SCP_ASK_DETAIL.aspx.cs | 144 +++++ .../SCP_ASK_DETAIL.aspx.designer.cs | 224 +++++++ .../SupplierLogistics/SCP_ASN.aspx | 129 ++++ .../SupplierLogistics/SCP_ASN.aspx.cs | 175 ++++++ .../SCP_ASN.aspx.designer.cs | 323 ++++++++++ .../SupplierLogistics/SCP_ASN_CREATE.aspx | 217 +++++++ .../SupplierLogistics/SCP_ASN_CREATE.aspx.cs | 491 +++++++++++++++ .../SCP_ASN_CREATE.aspx.designer.cs | 359 +++++++++++ .../SupplierLogistics/SCP_ASN_DETAIL.aspx | 183 ++++++ .../SupplierLogistics/SCP_ASN_DETAIL.aspx.cs | 540 +++++++++++++++++ .../SCP_ASN_DETAIL.aspx.designer.cs | 314 ++++++++++ SCP/Web.config | 12 +- 29 files changed, 7759 insertions(+), 8 deletions(-) create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.cs create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.designer.cs create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.cs create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.designer.cs create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx.cs create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx.designer.cs create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_RECEIVE_LIST.aspx create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_RECEIVE_LIST.aspx.cs create mode 100644 SCP/Views/SupplierData/SupplierFinance/SCP_RECEIVE_LIST.aspx.designer.cs create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASK.aspx create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASK.aspx.cs create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASK.aspx.designer.cs create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASK_DETAIL.aspx create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASK_DETAIL.aspx.cs create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASK_DETAIL.aspx.designer.cs create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASN.aspx create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASN.aspx.cs create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASN.aspx.designer.cs create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_CREATE.aspx create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_CREATE.aspx.cs create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_CREATE.aspx.designer.cs create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_DETAIL.aspx create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_DETAIL.aspx.cs create mode 100644 SCP/Views/SupplierData/SupplierLogistics/SCP_ASN_DETAIL.aspx.designer.cs diff --git a/SCP/SCP.csproj b/SCP/SCP.csproj index 8f2e9ea..9c91f6b 100644 --- a/SCP/SCP.csproj +++ b/SCP/SCP.csproj @@ -4502,6 +4502,15 @@ + + + + + + + + + @@ -5580,6 +5589,69 @@ SCP_UNPAID.aspx + + SCP_INVOICE.aspx + ASPXCodeBehind + + + SCP_INVOICE.aspx + + + SCP_INVOICE_CREATE.aspx + ASPXCodeBehind + + + SCP_INVOICE_CREATE.aspx + + + SCP_INVOICE_EDIT.aspx + ASPXCodeBehind + + + SCP_INVOICE_EDIT.aspx + + + SCP_RECEIVE_LIST.aspx + ASPXCodeBehind + + + SCP_RECEIVE_LIST.aspx + + + SCP_ASK.aspx + ASPXCodeBehind + + + SCP_ASK.aspx + + + SCP_ASK_DETAIL.aspx + ASPXCodeBehind + + + SCP_ASK_DETAIL.aspx + + + SCP_ASN.aspx + ASPXCodeBehind + + + SCP_ASN.aspx + + + SCP_ASN_CREATE.aspx + ASPXCodeBehind + + + SCP_ASN_CREATE.aspx + + + SCP_ASN_DETAIL.aspx + ASPXCodeBehind + + + SCP_ASN_DETAIL.aspx + SCP_INVOICE_VIEW.aspx ASPXCodeBehind @@ -6153,8 +6225,6 @@ - - diff --git a/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx new file mode 100644 index 0000000..6a46c56 --- /dev/null +++ b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx @@ -0,0 +1,161 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE.aspx.cs" Inherits="SCP.Views.SupplierData.SupplierFinance.SCP_INVOICE" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + <%----%> + + + + + + + + + + + + + diff --git a/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.cs b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.cs new file mode 100644 index 0000000..6329fb9 --- /dev/null +++ b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.cs @@ -0,0 +1,225 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using CK.SCP.Models.ScpEntity; +using CK.SCP.Controller; +using FineUI; +using System.Data; +using System.Drawing; + +namespace SCP.Views.SupplierData.SupplierFinance +{ + public partial class SCP_INVOICE :PageBase + { + + public void Page_Load(object sender, EventArgs e) + { + IsRoleRight(); + + if (!IsPostBack) + { + TranslatorAgents(Toolbar1); + TranslatorAgent(Grid_V_TB_INVOICE); + TranslatorAgents(FormRow_1); + TranslatorAgents(FormRow_2); + TranslatorAgents(FormRow_3); + TranslatorAgents(FormRow_4); + BindInvoice(); + BindVender(DDL_VEND_LIST); + } + } + + public void IsRoleRight() + { + if (CurrentUser.RoleList.Contains("采购人员")) + { + DDL_VEND_LIST.Hidden = false; + BTN_INV.Hidden = false; + } + } + + public void BindInvoice() + { + SearchInvoice(ret => { + Grid_V_TB_INVOICE.RecordCount = ret.Count(); + ret = SortAndPage(ret, Grid_V_TB_INVOICE); + + var _ls=ret.ToList(); + + Grid_V_TB_INVOICE.DataSource = ret; + Grid_V_TB_INVOICE.DataBind(); + }); + } + public void SearchInvoice(Action> p_action) + { + V_TB_INVOICE _entity = new V_TB_INVOICE(); + _entity.InvcBillNum = TXT_InvcBillNum.Text; + _entity.VendName = TXT_VendName.Text; + _entity.InvoiceNum = TXT_InvoiceNum.Text; + _entity.UserInVendIds = CurrentUser.VenderList; + + if (CurrentUser.RoleList.Contains("采购人员")) + { + if (string.IsNullOrEmpty(DDL_VEND_LIST.SelectedValue)) + { + Alert.Show("选择开票的供应商,并点击确认!"); + return; + } + var _venderId = DDL_VEND_LIST.SelectedValue; + _entity.VendId = _venderId; + } + else + { + if (CurrentUser.VenderList != null && CurrentUser.VenderList.Count > 0) + { + _entity.VendId = CurrentUser.VenderList[0]; + } + } + if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0) + { + _entity.Site = CurrentUser.FactoryList[0]; + } + if (string.IsNullOrEmpty(_entity.VendId)) + { + return; + } + if (DP_CreateTime1.SelectedDate != null || DP_CreateTime2.SelectedDate != null || !string.IsNullOrEmpty(TXT_PO.Text) || !string.IsNullOrEmpty(TXT_ASN.Text)) + { + _entity.InvoiceList = SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_BY_TIME(DP_CreateTime1.Text, DP_CreateTime2.Text, TXT_PO.Text, TXT_ASN.Text); + } + SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_List(_entity, (ret) => + { + if (ret.State == ReturnStatus.Succeed) + { + //if (_entity.InvoiceList == null || _entity.InvoiceList.Count == 0) + //{ + // Alert.Show("未查询到符合条件的发票!"); + //} + p_action(ret.Result); + } + }); + } + protected void btnView_OnClick(object sender, EventArgs e) + { + if (Grid_V_TB_INVOICE.SelectedRowIndexArray.Length != 1) + { + Alert.Show("请选择一行要操作的记录!"); + return; + } + string roleID = GetSelectedDataKey(Grid_V_TB_INVOICE, 1); + string url = String.Format("../SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx?ID={0}", roleID); + PageContext.RegisterStartupScript(Window1.GetShowReference(url)); + } + + + //显示面板 + protected void btnShow_OnClick(object sender, EventArgs e) + { + gp1.Hidden = false; + } + //关闭面板 + protected void OnClick(object sender, EventArgs e) + { + gp1.Hidden = true; + } + + + protected void Grid_V_TB_INVOICE_PageIndexChange(object sender, FineUI.GridPageEventArgs e) + { + BindInvoice(); + } + + protected void Grid_V_TB_INVOICE_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e) + { + //string roleID = GetSelectedDataKey(Grid1, 1); + //string url = String.Format("../SupplierData/InvoiceDetail.aspx?ID={0}", roleID); + //PageContext.RegisterStartupScript(Window1.GetShowReference(url)); + } + + protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid_V_TB_INVOICE.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); + BindInvoice(); + } + protected void BTN_SEARCH_Click(object sender, EventArgs e) + { + BindInvoice(); + } + //导出 + protected void btnOutput_OnClick(object sender, EventArgs e) + { + //List _ls = new List(); + //for (int i = 0, count = Grid_V_TB_INVOICE.Rows.Count; i < count; i++) + //{ + // object[] rowDataKeys = Grid_V_TB_INVOICE.DataKeys[i]; + // _ls.Add(rowDataKeys[1] as string); + //} + //DataSet ds = SCP_EXCEL_CONTROLLER.GET_INVOICE_EXECEL(_ls); + //PageBase.DataSetToExcel(ds, "财务确认"); + + int[] _selections = Grid_V_TB_INVOICE.SelectedRowIndexArray; + if (_selections.Count() == 0) + { + Alert.Show("请选择发票记录导出!"); + } + List _ls = new List(); + for (int i = 0, count = Grid_V_TB_INVOICE.Rows.Count; i < count; i++) + { + if (_selections.Contains(i)) + { + + object[] rowDataKeys = Grid_V_TB_INVOICE.DataKeys[i]; + _ls.Add(rowDataKeys[1] as string); + } + } + if (_ls.Count == 0) + { + Alert.Show("请选择记录导出!"); + return; + } + DataSet ds = SCP_EXCEL_CONTROLLER.GET_INVOICE_EXECEL(_ls); + ds.Tables[1].Columns.Remove("成本价"); + PageBase.DataSetToExcel(ds, "导出发票"); + + + + } + + protected void Grid_V_TB_INVOICE_RowDataBound(object sender, GridRowEventArgs e) + { + int i = 0; + System.Web.UI.WebControls.Label _label = (System.Web.UI.WebControls.Label)Grid_V_TB_INVOICE.Rows[e.RowIndex].FindControl("Total1"); + if (!string.IsNullOrEmpty(_label.Text)) + { + try + { + if (decimal.Parse(_label.Text) < 0) + { + _label.ForeColor = Color.Red; + i++; + } + } + catch + { } + } + //if (i > 0) + //{ + // Alert.Show("请尽快处理索赔和退货数据,如果不处理新建发票将") + //} + } + + protected void BTN_INV_Click(object sender, EventArgs e) + { + BindInvoice(); + } + + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + + } + } +} + \ No newline at end of file diff --git a/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.designer.cs b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.designer.cs new file mode 100644 index 0000000..b7f22dd --- /dev/null +++ b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE.aspx.designer.cs @@ -0,0 +1,314 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace SCP.Views.SupplierData.SupplierFinance +{ + + + public partial class SCP_INVOICE + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Toolbar Toolbar1; + + /// + /// Button3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button Button3; + + /// + /// btnView 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button btnView; + + /// + /// btnOutput 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button btnOutput; + + /// + /// btnShow 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button btnShow; + + /// + /// DDL_VEND_LIST 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.DropDownList DDL_VEND_LIST; + + /// + /// BTN_INV 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button BTN_INV; + + /// + /// gp1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.GroupPanel gp1; + + /// + /// FormRow_1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.FormRow FormRow_1; + + /// + /// ckb 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.CheckBoxList ckb; + + /// + /// FormRow_2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.FormRow FormRow_2; + + /// + /// TXT_InvcBillNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.TextBox TXT_InvcBillNum; + + /// + /// TXT_VendName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.TextBox TXT_VendName; + + /// + /// TXT_InvoiceNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.TextBox TXT_InvoiceNum; + + /// + /// TXT_PO 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.TextBox TXT_PO; + + /// + /// FormRow_3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.FormRow FormRow_3; + + /// + /// TXT_Site 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.TextBox TXT_Site; + + /// + /// TXT_ASN 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.TextBox TXT_ASN; + + /// + /// DP_CreateTime1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.DatePicker DP_CreateTime1; + + /// + /// DP_CreateTime2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.DatePicker DP_CreateTime2; + + /// + /// FormRow_4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.FormRow FormRow_4; + + /// + /// BTN_SEARCH 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button BTN_SEARCH; + + /// + /// Grid_V_TB_INVOICE 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Grid Grid_V_TB_INVOICE; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.ToolbarText ToolbarText1; + + /// + /// ddlGridPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.DropDownList ddlGridPageSize; + + /// + /// Total1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Total1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Window Window2; + + /// + /// WindowUpload 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Window WindowUpload; + } +} diff --git a/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx new file mode 100644 index 0000000..3e045d9 --- /dev/null +++ b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx @@ -0,0 +1,103 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE_CREATE.aspx.cs" Inherits="SCP.Views.SupplierData.SupplierFinance.SCP_INVOICE_CREATE" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + diff --git a/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.cs b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.cs new file mode 100644 index 0000000..db4f7e6 --- /dev/null +++ b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.cs @@ -0,0 +1,416 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity.Migrations; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using CK.SCP.Controller; +using CK.SCP.Models.AppBoxEntity; +using CK.SCP.Models.Enums; +using CK.SCP.Models.ScpEntity; +using CK.SCP.Utils; +using FineUI; +using NPOI.OpenXmlFormats.Dml; +using SCP.Code; +using SCP.WarehouseData; +using System.Drawing; + +namespace SCP.Views.SupplierData.SupplierFinance +{ + public partial class SCP_INVOICE_CREATE : PageBase + { + protected void Page_Load(object sender, EventArgs e) + { + IsRoleRight(); + if (!IsPostBack) + { + TranslatorAgents(Toolbar2); + TranslatorAgent(Grid_SCP_INVOICE_CREATE); + TranslatorAgents(FormRow_1); + LoadData(); + SetRoleRule(); + } + } + + public void IsRoleRight() + { + //if (!CurrentUser.RoleList.Contains("供应商")) + //{ + // Alert.Show("当前用户角色不能操作该模块!"); + // return; + //} + //if (CurrentUser.VenderList == null || CurrentUser.VenderList.Count == 0) + //{ + // Alert.Show("当前用户未选择地点!"); + // return; + //} + } + private void SetRoleRule() + { + //IsPriceVisible(Grid_SCP_INVOICE_CREATE, "合同价格"); + //IsPriceVisible(Grid_SCP_INVOICE_CREATE, "合同差额"); + IsPriceVisible(Grid_SCP_INVOICE_CREATE, "要货日期"); + } + + public void LoadData() + { + BindData(); + } + + + private void SearchData(Action> p_action) + { + V_TB_RECEIVE_LIST _entity = new V_TB_RECEIVE_LIST(); + + + if (Session["InvoiceCreateQueryParm"] != null) + { + InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm; + + if (string.IsNullOrEmpty(parm.ReceiveID)) + + { Alert.Show("参数不正确!"); return; } + var ary = parm.ReceiveID.Split(','); + if (ary != null && ary.Length > 0) + { + _entity.UIDList = new List(); + foreach (var itm in ary) + { + _entity.UIDList.Add(long.Parse(itm)); + } + _entity.State = 1; + _entity.UserInVendIds = CurrentUser.VenderList; + SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST_List(_entity, (ret) => + { + if (ret.State == ReturnStatus.Succeed) + { + p_action(ret.Result); + } + }); + } + } + else + { + Alert.Show("操作超时!"); + } + + + + + } + + public void BindData() + { + SearchData(q => + { + + InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm; + Grid_SCP_INVOICE_CREATE.RecordCount = q.Count(); + q = SortAndPage(q, Grid_SCP_INVOICE_CREATE); + // List temp = SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST(q.ToList()); + List temp = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(q.ToList()); + + foreach (V_TB_RECEIVE_LIST rec in temp) + { + rec.Qty = ToDecimal(rec.Qty, 2); + rec.CanQty = ToDecimal(rec.CanQty, 2); + } + + string _vendId = string.Empty; + if (CurrentUser.RoleList.Contains("采购人员")) + { + + _vendId = parm.VendId; + } + else + { + _vendId = CurrentUser.VenderList[0]; + } + //SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST_PRICE(_vendId, temp, (rs) => + //{ + + // if (rs.State == ReturnStatus.Succeed) + // { + // temp.ForEach(itm => + // { + // var _entityList = rs.Result.ToList().Where(p => p.PartCode == itm.PartCode && itm.CreateTime >= p.StartTime && itm.CreateTime <= p.EndTime).ToList(); + // if (_entityList.Count > 0) + // { + // var _max = _entityList.Select(p => p.UID).Max(); + // var _entity = _entityList.Where(p => p.UID == _max).FirstOrDefault(); + // if (itm.ModType == (int)BillModType.Contract) + // { + // if (CurrentUser.FactoryList.FirstOrDefault() == "CNS") + // { + // itm.Price = _entity.Amt; + // } + // else + // { + // itm.Price = itm.Price > 0 ? itm.Price : _entity.Amt; + // } + // } + // else + // { + // itm.Price = itm.Price > 0 ? itm.Price : _entity.Amt; + // } + // } + // }); + // } + //}); + + var _isall=parm.IsAll; + if(_isall=="0") + { + temp.ForEach(p => { + p.InputQty =0; + if (p.CanQty < 0) + { + p.InputQty = p.CanQty; + } + }); + } + else + { + temp.ForEach(p => { p.InputQty = p.CanQty; }); + } + + Grid_SCP_INVOICE_CREATE.DataSource = temp; + Grid_SCP_INVOICE_CREATE.DataBind(); + + }); + } + + + public decimal ToDecimal(decimal num, int scale) + { + decimal tempOdds = Math.Round(num, scale); + + return tempOdds; + } + + protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid_SCP_INVOICE_CREATE.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); + BindData(); + } + //确认创建发票 + protected void btnOk_OnClick(object sender, EventArgs e) + { + if (Session["InvoiceCreateQueryParm"] != null) + { + + + InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm; + + V_TB_INVOICE invoice = new V_TB_INVOICE(); + invoice.InvcBillNum = SCP_BILLCODE_CONTROLLER.MakeInvoiceCode(); + invoice.CreateTime = DateTime.Now; + invoice.InvoiceNum = ""; + invoice.Remark = txtRemark.Text; + invoice.CreateUser = CurrentUser.Name; + + string _VendId = parm.VendId; + string _tax = parm.Tax; + invoice.VendId = _VendId; + invoice.State = (int)InvoiceState.New; + invoice.Tax = decimal.Parse(_tax); + string _cj = parm.CJ; + string _tz = parm.TZ; + invoice.BlancePrice = decimal.Parse(_tz); + invoice.ContractPrice = decimal.Parse(_cj); + + int num = 0; + List _list = new List(); + for (int i = 0; i < Grid_SCP_INVOICE_CREATE.Rows.Count; i++) + { + object[] rowDataKeys = Grid_SCP_INVOICE_CREATE.DataKeys[i]; + string uid = rowDataKeys[0].ToString(); + var _entity = new V_TB_RECEIVE_LIST(); + _entity.UID = ConvertHelper.To(rowDataKeys[0]); + _entity.RecvBillNum = rowDataKeys[1] as string; + _entity.PoLine = ConvertHelper.To(rowDataKeys[2]); + _entity.PartCode = rowDataKeys[3] as string; + _entity.Batch = rowDataKeys[4] as string; + _entity.Qty = ConvertHelper.To(rowDataKeys[5]); + _entity.DockCode = rowDataKeys[6] as string; + _entity.Remark = rowDataKeys[7] as string; + _entity.CreateTime = ConvertHelper.To(rowDataKeys[8]); + _entity.CreateUser = rowDataKeys[9] as string; + if (string.IsNullOrEmpty(_entity.CreateUser)) + { + _entity.CreateUser = CurrentUser.Name; + } + _entity.IsDeleted = ConvertHelper.To(rowDataKeys[10]); + _entity.AsnBillNum = rowDataKeys[12] as string; + _entity.Site = rowDataKeys[13] as string; + invoice.Site = rowDataKeys[13] as string; + _entity.VendId = rowDataKeys[14] as string; + _entity.ShipTime = ConvertHelper.To(rowDataKeys[15]); + _entity.OperName = rowDataKeys[16] as string; + _entity.PartDesc1 = rowDataKeys[17] as string; + _entity.State = ConvertHelper.To(rowDataKeys[18]); + _entity.PoBillNum = rowDataKeys[19] as string; + _entity.VendName = rowDataKeys[20] as string; + _entity.Site_Desc = rowDataKeys[21] as string; + _entity.PoUnit = rowDataKeys[22] as string; + _entity.LocUnit = rowDataKeys[23] as string; + _entity.Price = ConvertHelper.To(rowDataKeys[24]); + _entity.VendBatch = rowDataKeys[25] as string; + _entity.Currency = rowDataKeys[26] as string; + _entity.BillType_DESC = rowDataKeys[27] as string; + _entity.ErpRecvBillNum= rowDataKeys[28] as string; + + + + + + + System.Web.UI.WebControls.Label _label = (System.Web.UI.WebControls.Label)Grid_SCP_INVOICE_CREATE.Rows[i].FindControl("Total1"); + _entity.CanQty = ConvertHelper.To(_label.Text);//ConvertHelper.To < Int32 >(rowDataKeys[2]); + GridRow row = Grid_SCP_INVOICE_CREATE.Rows[i]; + System.Web.UI.WebControls.TextBox txtQty = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty"); + System.Web.UI.WebControls.TextBox txtPrice = (System.Web.UI.WebControls.TextBox)row.FindControl("txtPrice"); + System.Web.UI.WebControls.TextBox txtLineMemo = (System.Web.UI.WebControls.TextBox)row.FindControl("txtLineMemo"); + + decimal Qty = 0; + try + { + if (txtQty.Text.Trim() != "") + { + Qty = Convert.ToDecimal(txtQty.Text.Trim()); + } + } + catch + { + PageContext.RegisterStartupScript(Alert.GetShowInTopReference("开票数量输入不正确")); + return; + } + + decimal Price = 0; + try + { + if (txtPrice.Text.Trim() != "") + { + Price = Convert.ToDecimal(txtPrice.Text.Trim()); + } + } + catch + { + PageContext.RegisterStartupScript(Alert.GetShowInTopReference("单价输入不正确")); + return; + } + + if (Qty == 0) + { + continue; + } + if (Qty > _entity.CanQty) + { + PageContext.RegisterStartupScript(Alert.GetShowInTopReference("开票数量不能大于可用开票数量")); + return; + } + _entity.Qty = Qty; + _entity.Price = Price; + _entity.Remark = txtLineMemo.Text; + _list.Add(_entity); + num++; + } + if (num == 0) + { + PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有可用的开票记录")); + return; + } + int _number = 0; + _list.ForEach(p => + { + if (p.Qty > 0) + { + _number++; + } + }); + if (_number == _list.Count) + { + string _modify = parm.Modify; + if (_modify == "1") + { + Alert.Show("有退货单未处理!"); + return; + } + } + var ret = SCP_INVOICE_CONTROLLER.CREATE_TB_INVOICE(invoice, _list); + if (ret.State == ReturnStatus.Succeed) + { + string script = $"alert(\'发票 {invoice.InvcBillNum} 生成成功\');"; + script += ActiveWindow.GetHidePostBackReference(); + PageContext.RegisterStartupScript(script); + } + } + else + { + Alert.Show("操作超时"); + } + + + } + + protected void Grid_SCP_INVOICE_CREATE_RowDataBound(object sender, GridRowEventArgs e) + { + object[] rowDataKeys = Grid_SCP_INVOICE_CREATE.DataKeys[e.RowIndex]; + + + System.Web.UI.WebControls.Label _label = (System.Web.UI.WebControls.Label)Grid_SCP_INVOICE_CREATE.Rows[e.RowIndex].FindControl("Total1"); + + var _number = ConvertHelper.To(_label.Text); + if (_number<= 0) + { + GridRow row = Grid_SCP_INVOICE_CREATE.Rows[e.RowIndex]; + System.Web.UI.WebControls.TextBox txtQty = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty"); + txtQty.ReadOnly = true; + txtQty.Enabled = false; + if (_number < 0) + { + + if (!string.IsNullOrEmpty(_label.Text)) + { + if (decimal.Parse(_label.Text) < 0) + { + _label.ForeColor = Color.Red; + } + } + } + } + } + + private decimal? GetTax() + { + decimal? strTax = null; + string name = GetIdentityName(); + User modelUsers = DB.Users.SingleOrDefault(p => p.Name == name); + VenderUsers vu = null; + TA_VENDER tv = null; + + if (modelUsers != null) + { + vu = DB.VenderUsers.SingleOrDefault(p => p.UserId == modelUsers.ID); + if (vu != null) + { + tv = SCPDB.TA_VENDER.SingleOrDefault(p => p.VendId == vu.VenderId); + + if (tv != null) + { + strTax = tv.Tax; + } + } + //_info.SupplierCode = vu.VenderId; + } + Session["InvoiceCreateQueryParm"] = null; + return strTax; + } + + + } + + + +} \ No newline at end of file diff --git a/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.designer.cs b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.designer.cs new file mode 100644 index 0000000..b4cfb7d --- /dev/null +++ b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_CREATE.aspx.designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace SCP.Views.SupplierData.SupplierFinance +{ + + + public partial class SCP_INVOICE_CREATE + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Panel Panel1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Toolbar Toolbar2; + + /// + /// btnOk 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button btnOk; + + /// + /// FormRow_1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.FormRow FormRow_1; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.TextArea txtRemark; + + /// + /// Grid_SCP_INVOICE_CREATE 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Grid Grid_SCP_INVOICE_CREATE; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.ToolbarText ToolbarText1; + + /// + /// ddlGridPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.DropDownList ddlGridPageSize; + + /// + /// txtPrice 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.TextBox txtPrice; + + /// + /// Total1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Total1; + + /// + /// txtQty 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.TextBox txtQty; + + /// + /// txtLineMemo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.TextBox txtLineMemo; + } +} diff --git a/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx new file mode 100644 index 0000000..1e38161 --- /dev/null +++ b/SCP/Views/SupplierData/SupplierFinance/SCP_INVOICE_EDIT.aspx @@ -0,0 +1,152 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE_EDIT.aspx.cs" Inherits="SCP.Views.SupplierData.SupplierFinance.SCP_INVOICE_EDIT" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +