Browse Source

锦州发票修改。锦州接口程序合并到公共版本中。

master
lvzb 4 years ago
parent
commit
b320ecca51
  1. 9
      Controller/SCP_INVOICE_CONTROLLER.cs
  2. 5
      Models/ScpEntity/TB_INVOICE.cs
  3. 6
      Models/ScpEntity/V_TB_INVOICE.cs
  4. 6
      Models/UniApiEntity/xxscm_inv_det.cs
  5. 48
      SCP/SCP.csproj
  6. 2
      SCP/Views/WarehouseData/SCP_INVOICE.aspx.cs
  7. 151
      SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE.aspx
  8. 201
      SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE.aspx.cs
  9. 314
      SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE.aspx.designer.cs
  10. 138
      SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE_EDIT.aspx
  11. 589
      SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE_EDIT.aspx.cs
  12. 359
      SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE_EDIT.aspx.designer.cs
  13. 142
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE.aspx
  14. 207
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE.aspx.cs
  15. 233
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE.aspx.designer.cs
  16. 124
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM.aspx
  17. 226
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM.aspx.cs
  18. 224
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM.aspx.designer.cs
  19. 166
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx
  20. 312
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx.cs
  21. 305
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx.designer.cs
  22. 145
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_DELTAIL.aspx
  23. 296
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_DELTAIL.aspx.cs
  24. 287
      SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_DELTAIL.aspx.designer.cs
  25. 91
      UniApiGroup/Controller/OdbcApiQadController.cs
  26. 9
      UniApiGroup/Controller/OdbcApiScpController.cs
  27. 168
      UniApiGroup/Controller/OdbcApiWmsController.cs

9
Controller/SCP_INVOICE_CONTROLLER.cs

@ -174,7 +174,7 @@ namespace CK.SCP.Controller
{
StringBuilder _builder = new StringBuilder();
_builder.Append( "SELECT DISTINCT InvcBillNum FROM TB_INVOICE_DETAIL a Inner join TB_RECEIVE B on A.RecvBillNum = B.RecvBillNum\r\n");
_builder.Append("SELECT DISTINCT InvcBillNum FROM TB_INVOICE_DETAIL a Inner join TB_RECEIVE_QAD B on A.ErpRecvBillNum = B.ErpRecvBillNum\r\n");
_builder.AppendFormat(" WHERE 1=1 \r\n");
if (!string.IsNullOrEmpty(p_begin))
{
@ -1515,7 +1515,8 @@ namespace CK.SCP.Controller
_entity.InvoiceNum = invoice.InvoiceNum;
_entity.ExpressNum = invoice.ExpressNum;
_entity.Extend1 = invoice.Extend1;
_entity.Extend2 = invoice.Extend2;
_entity.ContractPrice = invoice.ContractPrice;
_entity.BlancePrice = invoice.BlancePrice;
_entity.DiscountPrice = invoice.DiscountPrice;//问题
@ -1641,6 +1642,8 @@ namespace CK.SCP.Controller
{
_entity.UpdateTime = invoice.UpdateTime.Value;
}
_entity.Extend1 = invoice.Extend1;
_entity.Extend2 = invoice.Extend2;
_entity.ContractPrice = invoice.ContractPrice;
_entity.BlancePrice = invoice.BlancePrice;
_entity.DiscountPrice = invoice.DiscountPrice;//问题
@ -1850,6 +1853,8 @@ namespace CK.SCP.Controller
_bill.InvoiceNum = p_invoice.InvoiceNum;
_bill.ExpressNum = p_invoice.ExpressNum;
_bill.ContractPrice = p_invoice.ContractPrice;
_bill.Extend1 = p_invoice.Extend1;
_bill.Extend2 = p_invoice.Extend2;
_bill.BlancePrice = p_invoice.BlancePrice;
_bill.DiscountPrice = p_invoice.DiscountPrice;
_bill.DiscountRemark = p_invoice.DiscountRemark;

5
Models/ScpEntity/TB_INVOICE.cs

@ -33,5 +33,10 @@ namespace CK.SCP.Models.ScpEntity
public string DiscountRemark { get; set; }
public bool IsRed { get; set; }
public decimal? Extend1 { get; set; }
public decimal? Extend2 { get; set; }
public decimal? Extend3 { get; set; }
public decimal? Extend4 { get; set; }
public decimal? Extend5 { get; set; }
}
}

6
Models/ScpEntity/V_TB_INVOICE.cs

@ -83,6 +83,10 @@ namespace CK.SCP.Models.ScpEntity
public decimal? RealTotal { set; get; }
public decimal? Extend1 { get; set; }
public decimal? Extend2 { get; set; }
public decimal? Extend3 { get; set; }
public decimal? Extend4 { get; set; }
public decimal? Extend5 { get; set; }
}
}

6
Models/UniApiEntity/xxscm_inv_det.cs

@ -101,7 +101,11 @@ namespace CK.SCP.Models.UniApiEntity
public decimal xxscm_inv_totdiscount { get; set; }
public string xxscm_inv_project { get; set; }
public decimal xxscm_inv_extend1 { get; set; }
public decimal xxscm_inv_extend2 { get; set; }
public decimal xxscm_inv_extend3 { get; set; }
public decimal xxscm_inv_extend4 { get; set; }
public decimal xxscm_inv_extend5 { get; set; }

48
SCP/SCP.csproj

@ -4570,8 +4570,14 @@
<Content Include="Views\重庆北汽模塑\SupplierData\SCP_ASN_CREATE.aspx" />
<Content Include="Views\锦州锦恒\SupplierData\SCP_ASN.aspx" />
<Content Include="Views\锦州锦恒\SupplierData\SCP_ASN_DETAIL.aspx" />
<Content Include="Views\锦州锦恒\SupplierData\SCP_INVOICE.aspx" />
<Content Include="Views\锦州锦恒\SupplierData\SCP_INVOICE_EDIT.aspx" />
<Content Include="Views\锦州锦恒\SupplierData\SCP_SELECT_MAKE.aspx" />
<Content Include="Views\锦州锦恒\SupplierData\SCP_SHIP_DETAIL_BARCODE.aspx" />
<Content Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE.aspx" />
<Content Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE_CONFIRM.aspx" />
<Content Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE_CONFIRM_DETAIL.aspx" />
<Content Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE_DELTAIL.aspx" />
<Content Include="Views\长春安通林\SCP_ASK.aspx" />
<Content Include="Views\长春安通林\SCP_ASK_AUDIT.aspx" />
<Content Include="Views\长春安通林\SCP_ASK_AUDIT_DETAIL.aspx" />
@ -6054,6 +6060,20 @@
<Compile Include="Views\锦州锦恒\SupplierData\SCP_ASN_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_ASN_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_INVOICE.aspx.cs">
<DependentUpon>SCP_INVOICE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_INVOICE.aspx.designer.cs">
<DependentUpon>SCP_INVOICE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_INVOICE_EDIT.aspx.cs">
<DependentUpon>SCP_INVOICE_EDIT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_INVOICE_EDIT.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_EDIT.aspx</DependentUpon>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_SELECT_MAKE.aspx.cs">
<DependentUpon>SCP_SELECT_MAKE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -6068,6 +6088,34 @@
<Compile Include="Views\锦州锦恒\SupplierData\SCP_SHIP_DETAIL_BARCODE.aspx.designer.cs">
<DependentUpon>SCP_SHIP_DETAIL_BARCODE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE.aspx.cs">
<DependentUpon>SCP_INVOICE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE.aspx.designer.cs">
<DependentUpon>SCP_INVOICE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE_CONFIRM.aspx.cs">
<DependentUpon>SCP_INVOICE_CONFIRM.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE_CONFIRM.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_CONFIRM.aspx</DependentUpon>
</Compile>
<Compile Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE_CONFIRM_DETAIL.aspx.cs">
<DependentUpon>SCP_INVOICE_CONFIRM_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE_CONFIRM_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_CONFIRM_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE_DELTAIL.aspx.cs">
<DependentUpon>SCP_INVOICE_DELTAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\锦州锦恒\WarehouseData\SCP_INVOICE_DELTAIL.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_DELTAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\长春安通林\SCP_ASK.aspx.cs">
<DependentUpon>SCP_ASK.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

2
SCP/Views/WarehouseData/SCP_INVOICE.aspx.cs

@ -167,7 +167,7 @@ namespace SCP.WarehouseData
protected void Grid_V_TB_INVOICE_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e)
{
string ID = GetSelectedDataKey(Grid_V_TB_INVOICE, 1);
string url = String.Format("../SupplierData/SCP_INVOICE_DETAIL.aspx?ID={0}", ID);
string url = String.Format("../WarehouseData/SCP_INVOICE_DETAIL.aspx?ID={0}", ID);
PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}

151
SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE.aspx

@ -0,0 +1,151 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE.aspx.cs" Inherits="SCP.Views.锦州锦恒.SupplierData.SCP_INVOICE" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:Button ID="Button3" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="btnView" runat="server" EnablePostBack="True" Text="查看发票" Icon="Zoom" OnClick="btnView_OnClick">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_OnClick">
</f:Button>
<f:Button ID="btnShow" runat="server" Text="显示查询面板" Icon="Find" OnClick="btnShow_OnClick">
</f:Button>
<f:DropDownList ID="DDL_VEND_LIST" DataValueField="VendId" DataTextField="VendName" runat="server" Label="供应商编码" EnableEdit="true" EnableMultiSelect="false" Hidden="true" />
<f:Button ID="BTN_INV" runat="server" EnablePostBack="True" Text="确认供应商发票管理" OnClick="BTN_INV_Click" Hidden="true"></f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Hidden="True" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server" ID="FormRow_1">
<Items>
<f:CheckBoxList runat="server" ID="ckb" Label="状态">
<%--<f:CheckItem Text="新建" Value="0" Selected="True" />
<f:CheckItem Text="供应商申请" Value="1" />
<f:CheckItem Text="采购审核退回" Value="2" />
<f:CheckItem Text="采购审核通过" Value="3" />
<f:CheckItem Text="发票寄出" Value="4" />
<f:CheckItem Text="财务退回" Value="5" />
<f:CheckItem Text="财务收票" Value="6" />
<f:CheckItem Text="发票作废" Value="-1" />--%>
</f:CheckBoxList>
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_2">
<Items>
<f:TextBox ID="TXT_InvcBillNum" runat="server" Label="发票单号" />
<f:TextBox ID="TXT_VendName" runat="server" Label="供应商" />
<f:TextBox ID="TXT_InvoiceNum" runat="server" Label="金税票号" MaxLength="22" />
<f:TextBox ID="TXT_PO" runat="server" Label="订单编号" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_3">
<Items>
<f:TextBox ID="TXT_Site" runat="server" Label="收货地点" />
<f:TextBox ID="TXT_ASN" runat="server" Label="发货单号" />
<f:DatePicker ID="DP_CreateTime1" runat="server" Required="true" Label="收货时间" />
<f:DatePicker ID="DP_CreateTime2" runat="server" Required="true" Label="至" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_4">
<Items>
<f:Button runat="server" Text="关闭" OnClick="OnClick"></f:Button>
<f:Button ID="BTN_SEARCH" runat="server" OnClick="BTN_SEARCH_Click" Text="快速查找">
</f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="true" ShowHeader="False"
AllowPaging="True" PageSize="20" OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange"
ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1"
DataKeyNames="UID, InvcBillNum" AllowSorting="true" IsDatabasePaging="true" SortField="State" OnRowDataBound="Grid_V_TB_INVOICE_RowDataBound">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" />
<f:BoundField runat="server" HeaderText="发票单号" ColumnID="" DataField="InvcBillNum" />
<f:BoundField runat="server" HeaderText="金税票号" ColumnID="" DataField="InvoiceNum" />
<f:BoundField runat="server" HeaderText="快递单号" ColumnID="" DataField="ExpressNum" />
<f:BoundField runat="server" HeaderText="供应商" ColumnID="" DataField="VendName" />
<f:BoundField runat="server" HeaderText="供应商编码" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="金额" ColumnID="" DataField="Amount" DataFormatString="{0:F}" />
<f:BoundField runat="server" HeaderText="采购金额" ColumnID="" DataField="PurCost" DataFormatString="{0:F}" />
<f:BoundField runat="server" HeaderText="成本金额" ColumnID="" DataField="StdCost" DataFormatString="{0:F}" />
<f:BoundField runat="server" HeaderText="税率" ColumnID="" DataField="Tax" DataFormatString="{0:F}" />
<f:BoundField runat="server" HeaderText="税额" ColumnID="" DataField="TaxAmount" DataFormatString="{0:F}" />
<f:TemplateField HeaderText="税后金额" Width="70px" ColumnID="Total">
<ItemTemplate>
<asp:Label ID="Total1" runat="server" Width="60px" Text='<%# Eval("Total") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:BoundField runat="server" HeaderText="实际税前金额" ColumnID="" DataField="Extend1" DataFormatString="{0:F}" />
<f:BoundField runat="server" HeaderText="实际税额" ColumnID="" DataField="Extend2" DataFormatString="{0:F}" />
<f:BoundField runat="server" HeaderText="折扣金额" ColumnID="" DataField="ContractPrice" DataFormatString="{0:F}" />
<f:BoundField runat="server" HeaderText="调整税额" ColumnID="" DataField="BlancePrice" DataFormatString="{0:F}" Hidden="true" />
<f:BoundField runat="server" HeaderText="开票金额" ColumnID="" DataField="RealTotal" DataFormatString="{0:F}" />
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" runat="server" Hidden="True" AutoScroll="True"
WindowPosition="Center" IsModal="true" Title="发票编辑" Target="Parent" EnableIFrame="true" OnClose="Window1_Close"
IFrameUrl="about:blank" Height="550px" Width="1024px" CloseAction="HidePostBack">
</f:Window>
<f:Window ID="Window2" runat="server" Hidden="True" AutoScroll="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="300px" Width="400px">
</f:Window>
<f:Window ID="WindowUpload" runat="server" Hidden="True" AutoScroll="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px" OnClose="WindowUpload_Close">
</f:Window>
<script type="text/javascript">
</script>
</form>
</body>
</html>

201
SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE.aspx.cs

@ -0,0 +1,201 @@
using System;
using System.Collections.Generic;
using System.Linq;
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
{
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<IQueryable<V_TB_INVOICE>> 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];
}
_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/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)
{
int[] _selections = Grid_V_TB_INVOICE.SelectedRowIndexArray;
if (_selections.Count() == 0)
{
Alert.Show("请选择发票记录导出!");
}
List<string> _ls = new List<string>();
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)
{
BindInvoice();
}
}
}

314
SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE.aspx.designer.cs

@ -0,0 +1,314 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..SupplierData
{
public partial class SCP_INVOICE
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// Button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button3;
/// <summary>
/// btnView 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnView;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// DDL_VEND_LIST 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_VEND_LIST;
/// <summary>
/// BTN_INV 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_INV;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// ckb 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.CheckBoxList ckb;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// TXT_InvcBillNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_InvcBillNum;
/// <summary>
/// TXT_VendName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendName;
/// <summary>
/// TXT_InvoiceNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_InvoiceNum;
/// <summary>
/// TXT_PO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PO;
/// <summary>
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// TXT_Site 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Site;
/// <summary>
/// TXT_ASN 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ASN;
/// <summary>
/// DP_CreateTime1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_CreateTime1;
/// <summary>
/// DP_CreateTime2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_CreateTime2;
/// <summary>
/// FormRow_4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_4;
/// <summary>
/// BTN_SEARCH 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_SEARCH;
/// <summary>
/// Grid_V_TB_INVOICE 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_INVOICE;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// Total1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Total1;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window2;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
}
}

138
SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE_EDIT.aspx

@ -0,0 +1,138 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE_EDIT.aspx.cs" Inherits="SCP.Views.锦州锦恒.SupplierData.SCP_INVOICE_EDIT" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<Items>
<f:Form runat="server" Title="">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:ToolbarSeparator ID="ToolbarSeparator3" runat="server">
</f:ToolbarSeparator>
<f:Button ID="btnOK" runat="server" Text="修改数据" Hidden="true" OnClientClick="if(!confirm('是否要修改发票?'))return false;" Icon="ApplicationEdit" OnClick="btnOK_Click">
</f:Button>
<f:Button ID="btnApply" runat="server" Text="提交申请" Hidden="true" OnClientClick="if(!confirm('是否要提交申请?'))return false;" Icon="Accept" OnClick="btnApply_Click">
</f:Button>
<f:Button ID="btnMail" runat="server" Text="寄出发票" Hidden="true" OnClientClick="if(!confirm('是否寄出发票?寄出前请检查发票时间和纸质发票时间是否一致!'))return false;" Icon="Mail" OnClick="btnMail_Click" ValidateForms="extForm1">
</f:Button>
<f:Button ID="btnReject" runat="server" Text="发票作废" Hidden="true" OnClientClick="if(!confirm('是否要作废收票?'))return false;" Icon="Exclamation" OnClick="btnReject_Click">
</f:Button>
<f:Button ID="btnRed" runat="server" Hidden="true" Text="添加红字发票" OnClientClick="if(!confirm('是否要添加红字发票?'))return false;" Icon="Exclamation" OnClick="btnRed_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Layout="HBox" >
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%" ID="FormRow_1">
<Items>
<f:TextBox ID="txtBillNo" runat="server" Label="发票单号" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtState" runat="server" Label="状态" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtBillTime" runat="server" Label="创建时间" Text="" MaxLength="100" Readonly="true" Enabled="false" />
<f:TextBox ID="txtSupplierName" runat="server" Label="供应商" Text="" MaxLength="100" Readonly="true" Enabled="false" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%" ID="FormRow_2">
<Items>
<f:Label runat="server" ID="Label1" Text="税率:" Width="100" />
<f:DropDownList runat="server" Label="税率" ID="txtTax" AutoPostBack="true" >
<f:ListItem Text="0.16" Value="0.16" />
<f:ListItem Text="0.13" Value="0.13" />
<f:ListItem Text="0" Value="0" />
</f:DropDownList>
<f:TextBox ID="txtAmount" runat="server" Label="金额" Text="" Readonly="true" Enabled="false" />
<f:TextBox ID="txtTaxAmount" runat="server" Label="税额" Text="" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtTotal" runat="server" Label="税后金额" Text="" Readonly="true" Enabled="false" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%" ID="FormRow_3">
<Items>
<f:NumberBox ID="txtExtend1" runat="server" Label="实际税前金额" />
<f:NumberBox ID="txtExtend2" runat="server" Label="实际税额" />
<f:NumberBox ID="txtContractPrice1" runat="server" Label="折扣金额" />
<f:NumberBox ID="txtBlancePrice1" runat="server" Label="调整税额" MaxValue="1" Hidden="true" />
<f:TextBox ID="txtRealTotal" runat="server" Label="开票金额" Text="" Readonly="true" Enabled="false" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25% " ID="FormRow_4">
<Items>
<f:TextBox ID="txtInvoiceNumber" runat="server" Label="金税票号" Text="" MaxLength="22" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtExpressNumber" runat="server" Label="快递单号" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:DatePicker runat="server" ID ="dpUpdateTime" Label="发票时间" Enabled="false"></f:DatePicker>
<f:TextBox ID="txtMemo" runat="server" Label="备注" Text="" MaxLength="100">
</f:TextBox>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="500" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,InvcBillNum,Qty,CanQty,State" IsDatabasePaging="True" AllowPaging="True"
EnableRowSelectEvent="True" AutoScroll="True" SortField="PartCode" OnRowDataBound="Grid1_RowDataBound">
<Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="ProjectId" DataField="ProjectId" HeaderText="项目编号" ColumnID="ProjectId" Width="100px" />
<f:BoundField SortField="PoBillNum" DataField="PoBillNum" HeaderText="订单" ColumnID="Line" Width="100px" />
<f:BoundField SortField="PoLineNum" DataField="PoLineNum" HeaderText="订单行" ColumnID="ProductCode" Width="80px" />
<%-- <f:BoundField SortField="ProductName" DataField="AsnBillNum" HeaderText="收货单" ColumnID="ProductName" Width="100px" />--%>
<f:BoundField SortField="AsnBillNum" DataField="AsnBillNum" HeaderText="发货单" ColumnID="UnitCode" Width="120px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="PackageQty" Width="80px" />
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="CurrencyCode" Width="300px" />
<f:BoundField SortField="Currency" DataField="Currency" HeaderText="币种" ColumnID="Price" Width="80px" />
<f:TemplateField Width="90px" HeaderText="单价">
<ItemTemplate>
<asp:TextBox ID="txtPrice" runat="server" Width="80px" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"
Text='<%# Eval("Price") %>' MaxLength="12" ></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:BoundField SortField="PurCost" runat="server" HeaderText="采购价格" ColumnID="" DataField="PurCost" />
<f:BoundField SortField="UpdateTime" runat="server" HeaderText="收货日期" ColumnID="" DataField="UpdateTime" />
<f:BoundField SortField="CanQty" DataField="CanQty" HeaderText="可开票数量" ColumnID="OpenQty" Width="80px" />
<f:TemplateField HeaderText="开票数量" Width="90px">
<ItemTemplate>
<asp:TextBox ID="txtQty" runat="server" Width="80px"
Text='<%# Eval("Qty") %>' MaxLength="12"></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField HeaderText="备注" Width="100px">
<ItemTemplate>
<asp:TextBox ID="txtLineMemo" runat="server" Width="300px"
Text='<%# Eval("Remark") %>' MaxLength="200" ></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="640px" Width="700px" OnClose="Window1_OnClose"/>
<f:Window ID="WindowUpload" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px">
</f:Window>
</form>
</body>
</html>

589
SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE_EDIT.aspx.cs

@ -0,0 +1,589 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Common;
using CK.SCP.Controller;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using FineUI;
using System.Drawing;
namespace SCP.Views..SupplierData
{
public partial class SCP_INVOICE_EDIT : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
IsRoleRight();
if (!IsPostBack)
{
TranslatorAgents(Toolbar2);
TranslatorAgent(Grid1);
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
TranslatorAgents(FormRow_4);
BindData();
GetInvoice();
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(Grid1, "合同价格");
//IsPriceVisible(Grid1, "合同差额");
IsPriceVisible(Grid1, "要货日期");
}
public decimal ToDecimal(decimal num, int scale)
{
decimal tempOdds = Math.Round(num, scale);
//if (tempOdds > num)
//{
// num = (decimal)((double)(tempOdds - (decimal)Math.Pow(10, -scale)));
//}
//else
//{
// num = (decimal)((double)tempOdds);
//}
//return num;
return tempOdds;
}
private void Search(Action<IQueryable<V_TB_INVOICE_DETAIL>> p_list)
{
string id = GetQueryValue("ID");
V_TB_INVOICE_DETAIL _tb = new V_TB_INVOICE_DETAIL();
_tb.InvcBillNum = id;
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_DETAIL_List(_tb, (ret) => {
if (ret.State == ReturnStatus.Succeed)
{
p_list(ret.Result);
}
});
}
public void BindData()
{
Search(ret =>
{
Grid1.RecordCount = ret.Count();
var list = SortAndPage(ret, Grid1);
//Grid1.DataSource =SCP_RECIVECE_CONTROLLER.Get_V_TB_INVOICE_LIST(list.ToList());
List<V_TB_INVOICE_DETAIL> temp = SCP_RECIVECE_CONTROLLER.Get_V_TB_INVOICE_LIST(list.ToList());
temp = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(temp);
//decimal htjgSum = 0;//合同总价
//decimal htceSum = 0;//合同差额
//foreach (V_TB_INVOICE_DETAIL rec in temp)
//{
// rec.Qty = ToDecimal(rec.Qty, 2);
// rec.CanQty = ToDecimal(rec.CanQty, 2);
// htjgSum += rec.Qty * (rec.ContractPrice == null ? 0 : Convert.ToDecimal(rec.ContractPrice));//开票数量*合同价格
// htceSum += rec.Qty * (rec.BlancePrice == null ? 0 : Convert.ToDecimal(rec.BlancePrice));//开票数量*合同差额
//}
//txtContractPrice1.Text = htjgSum.ToString();
//txtBlancePrice1.Text = htceSum.ToString();
GetInvoice();
Grid1.DataSource = temp;
Grid1.DataBind();
});
}
private void GetInvoice()
{
string id = GetQueryValue("ID");
string vendid = "";
if (CurrentUser.VenderList != null && CurrentUser.VenderList.Count > 0)
{
vendid = CurrentUser.VenderList[0];
}
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_List(new V_TB_INVOICE { InvcBillNum = id, VendId = vendid }, (ret) => {
if (ret.State == ReturnStatus.Succeed)
{
var _ls = ret.Result.ToList();
if (_ls != null && _ls.Count > 0)
{
var _Model = _ls[0];
Session["Invoice"] = _Model;
txtState.Text = _Model.State_DESC;
txtBillNo.Text = _Model.InvcBillNum;
txtBillTime.Text = Convert.ToDateTime(_Model.CreateTime).ToString("yyyy-MM-dd");
txtSupplierName.Text = _Model.VendName;
txtInvoiceNumber.Text = _Model.InvoiceNum;
txtExpressNumber.Text = _Model.ExpressNum;
dpUpdateTime.SelectedDate = _Model.UpdateTime;
txtTax.SelectedValue = _Model.Tax != null ? _Model.Tax.Value.ToString() : "0";
txtTaxAmount.Text = _Model.TaxAmount != null ? _Model.TaxAmount.Value.ToString() : "0";
txtContractPrice1.Text = _Model.ContractPrice != null ? _Model.ContractPrice.ToString() : string.Empty;
txtBlancePrice1.Text = _Model.BlancePrice != null ? _Model.BlancePrice.ToString() : string.Empty;
txtAmount.Text = _Model.Amount.ToString();
txtTotal.Text = _Model.Total != null ? _Model.Total.ToString() : string.Empty;
txtExtend1.Text = _Model.Extend1 != null ? _Model.Extend1.ToString() : string.Empty;
txtExtend2.Text = _Model.Extend2 != null ? _Model.Extend2.ToString() : string.Empty;
txtRealTotal.Text = _Model.RealTotal != null ? _Model.RealTotal.ToString() : string.Empty;
txtMemo.Text = _Model.Remark;
if (_Model.State == (int)InvoiceState.New || _Model.State == (int)InvoiceState.CheckFail)
{
this.btnOK.Hidden = false;
this.btnApply.Hidden = false;
this.btnReject.Hidden = false;
}
if (_Model.State == (int)InvoiceState.Reject)
{
this.btnReject.Hidden = true;
this.btnOK.Hidden = false;
}
if (_Model.State == (int)InvoiceState.Apply)
{
this.btnOK.Hidden = true;
this.btnApply.Hidden = true;//提交申请
this.btnReject.Hidden = true;//发票作废
this.btnMail.Hidden = true;//寄出发票
}
if (_Model.State == (int)InvoiceState.Mail)
{
this.btnOK.Hidden = true;//确定修改
this.btnApply.Hidden = true;//提交申请
this.btnReject.Hidden = true;//发票作废
this.btnMail.Hidden = true;//寄出发票
txtInvoiceNumber.Readonly = true;
txtInvoiceNumber.Required = false;
txtExpressNumber.Readonly = true;
txtExpressNumber.Required = false;
txtContractPrice1.Readonly = true;
txtContractPrice1.Required = false;
txtContractPrice1.Enabled = false;
txtBlancePrice1.Readonly = true;
txtBlancePrice1.Required = false;
txtBlancePrice1.Enabled = false;
txtExtend1.Readonly = true;
txtExtend1.Required = false;
txtExtend1.Enabled = false;
txtExtend2.Readonly = true;
txtExtend2.Required = false;
txtExtend2.Enabled = false;
txtTax.Enabled = false;
Label1.Enabled = false;
}
if (_Model.State == (int)InvoiceState.FinanceFail || _Model.State == (int)InvoiceState.CheckSuccess)
{
txtInvoiceNumber.Readonly = false;
txtInvoiceNumber.Required = true;
txtExpressNumber.Readonly = false;
txtContractPrice1.Readonly = false;
txtContractPrice1.Required = false;
txtExtend1.Readonly = false;
txtExtend1.Required = false;
txtExtend2.Readonly = false;
txtExtend2.Required = false;
txtBlancePrice1.Readonly = false;
txtBlancePrice1.Required = false;
this.btnMail.Hidden = false;
this.btnReject.Hidden = false;
this.btnOK.Hidden = false;
txtInvoiceNumber.Enabled = true;
txtExpressNumber.Enabled = true;
dpUpdateTime.Enabled = true;
}
if (_Model.State == (int)InvoiceState.CheckSuccess)
{
this.btnOK.Hidden = true;
txtMemo.Enabled = false;
for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
object[] rowDataKeys = Grid1.DataKeys[i];
GridRow row = Grid1.Rows[i];
var txtPrice = (System.Web.UI.WebControls.TextBox)row.FindControl("txtPrice");
var txtQty = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty");
var txtLineMemo = (System.Web.UI.WebControls.TextBox)row.FindControl("txtLineMemo");
txtPrice.ReadOnly = true;
txtPrice.Enabled = false;
txtQty.ReadOnly = true;
txtQty.Enabled = false;
txtLineMemo.ReadOnly = true;
txtLineMemo.Enabled = false;
}
}
}
}
});
}
protected void btnOK_Click(object sender, EventArgs e)
{
var _invoice = Session["Invoice"] as V_TB_INVOICE;
string InvoiceNumber = MyWebString.GetString(this.txtInvoiceNumber.Text.Trim());
string Memo = MyWebString.GetString(this.txtMemo.Text.Trim());
string ExpressNumber = MyWebString.GetString(this.txtExpressNumber.Text.Trim());
string ContractPrice1 = MyWebString.GetString(this.txtContractPrice1.Text.Trim());//折扣
string BlancePrice1 = MyWebString.GetString(this.txtBlancePrice1.Text.Trim());//税额调整
string Extend1 = MyWebString.GetString(this.txtExtend1.Text.Trim());//实际发票税前金额
string Extend2 = MyWebString.GetString(this.txtExtend2.Text.Trim());//实际发票税额
//if (_invoice.State != (int)InvoiceState.New &&
// _invoice.State != (int)InvoiceState.CheckFail)
//{
// Alert.Show(_invoice.InvcBillNum + " 不允许修改,只有状态为 " + "新建" + " 或 " +
// "采购退回" + " 才能修改");
// return;
//}
if (!string.IsNullOrEmpty(txtTax.SelectedValue))
{
_invoice.Tax = decimal.Parse(txtTax.SelectedValue);
}
_invoice.InvoiceNum = InvoiceNumber;
_invoice.Remark = Memo;
_invoice.ExpressNum = ExpressNumber;
//_invoice.UpdateTime = dpUpdateTime.SelectedDate.Value;
//_invoice.State = (int)InvoiceState.Apply;
if (string.IsNullOrEmpty(Extend1))
{
_invoice.Extend1 = 0;
}
if (string.IsNullOrEmpty(Extend2))
{
_invoice.Extend2 = 0;
}
if (string.IsNullOrEmpty(ContractPrice1))
{
_invoice.ContractPrice = 0;
}
if (string.IsNullOrEmpty(BlancePrice1))
{
_invoice.BlancePrice = 0;
}
if (_invoice.State == (int)InvoiceState.CheckSuccess)
{
if (dpUpdateTime.SelectedDate == null)
{
Alert.Show("发票时间必须填写,时间为纸质发票开票时间");
return;
}
else
{
_invoice.UpdateTime = dpUpdateTime.SelectedDate.Value;
}
}
decimal c1;
decimal b1;
decimal d1;
decimal e1;
if (decimal.TryParse(ContractPrice1, out c1))
{
_invoice.ContractPrice = c1;
}
if (decimal.TryParse(Extend1, out d1))
{
_invoice.Extend1 = d1;
}
if (decimal.TryParse(Extend2, out e1))
{
_invoice.Extend2 = e1;
}
if (decimal.TryParse(BlancePrice1, out b1))
{
_invoice.BlancePrice = b1;
}
List<V_TB_INVOICE_DETAIL> _ls = new List<V_TB_INVOICE_DETAIL>();
if (this.txtQty.ReadOnly == false)
{
for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
object[] rowDataKeys = Grid1.DataKeys[i];
GridRow row = Grid1.Rows[i];
V_TB_INVOICE_DETAIL _entity = new V_TB_INVOICE_DETAIL();
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
_entity.InvcBillNum = rowDataKeys[1] as string;
_entity.Qty = ConvertHelper.To<Decimal>(rowDataKeys[2]);
_entity.CanQty = ConvertHelper.To<Decimal>(rowDataKeys[3]);
_entity.State = ConvertHelper.To<Int32>(rowDataKeys[4]);
var txtQty = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQty");
var txtPrice = (System.Web.UI.WebControls.TextBox)row.FindControl("txtPrice");
var txtLineMemo = (System.Web.UI.WebControls.TextBox)row.FindControl("txtLineMemo");
//var txtContractPrice = (System.Web.UI.WebControls.TextBox)row.FindControl("txtContractPrice");
//var txtBlancePrice = (System.Web.UI.WebControls.TextBox)row.FindControl("txtBlancePrice");
decimal QtyNew = 0;
try
{
if (txtQty.Text.Trim() != "")
{
QtyNew = Convert.ToDecimal(txtQty.Text.Trim());
}
}
catch
{
Alert.Show("开票数量输入不正确");
return;
}
if (QtyNew > _entity.CanQty + _entity.Qty)
{
Alert.Show("开票数量不能大于可用开数票");
return;
}
decimal PriceNew = 0;
try
{
if (txtPrice.Text.Trim() != "")
{
PriceNew = Convert.ToDecimal(txtPrice.Text.Trim());
}
}
catch
{
Alert.Show("单价输入不正确");
return;
}
_entity.Remark = txtLineMemo.Text;
_entity.Price = PriceNew;
_entity.Qty = QtyNew;
_ls.Add(_entity);
}
}
if (_ls.Count > 0)
{
var ret = SCP_INVOICE_CONTROLLER.SAVE_TB_INVOICE_APPLY(_invoice, _ls);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("发票明细修改成功!");
BindData();
}
}
else
{
Alert.Show("更改记录数为零");
}
}
private void SET_INVOICE_STATE(string p_msg, InvoiceState p_state)
{
if (Session["Invoice"] != null)
{
var _Invoice = Session["Invoice"] as V_TB_INVOICE;
string InvoiceNumber = MyWebString.GetString(this.txtInvoiceNumber.Text.Trim());//金税票号
string ExpressNumber = MyWebString.GetString(this.txtExpressNumber.Text.Trim());//快递单号
string Extend1 = MyWebString.GetString(this.txtExtend1.Text.Trim());//折扣价格
string Extend2 = MyWebString.GetString(this.txtExtend2.Text.Trim());//折扣价格
string ContractPrice1 = MyWebString.GetString(this.txtContractPrice1.Text.Trim());//折扣价格
string BlancePrice1 = MyWebString.GetString(this.txtBlancePrice1.Text.Trim());//合同差额
_Invoice.InvoiceNum = InvoiceNumber;
_Invoice.ExpressNum = ExpressNumber;
_Invoice.UpdateTime = dpUpdateTime.SelectedDate;
if (string.IsNullOrEmpty(Extend1))
{
_Invoice.Extend1 = 0;
}
if (string.IsNullOrEmpty(Extend2))
{
_Invoice.Extend2 = 0;
}
if (string.IsNullOrEmpty(ContractPrice1))
{
_Invoice.ContractPrice = 0;
}
if (string.IsNullOrEmpty(BlancePrice1))
{
_Invoice.BlancePrice = 0;
}
decimal c1;
decimal b1;
decimal d1;
decimal e1;
if (decimal.TryParse(Extend1, out d1))
{
_Invoice.Extend1 = d1;
}
else
{
_Invoice.Extend1 = 0;
}
if (decimal.TryParse(Extend2, out e1))
{
_Invoice.Extend2 = e1;
}
else
{
_Invoice.Extend2 = 0;
}
if (decimal.TryParse(ContractPrice1, out c1))
{
_Invoice.ContractPrice = c1;
}
else
{
_Invoice.ContractPrice = 0;
}
if (decimal.TryParse(BlancePrice1, out b1))
{
_Invoice.BlancePrice = b1;
}
else
{
_Invoice.BlancePrice = 0;
}
if (p_state == InvoiceState.Mail)
{
if (string.IsNullOrEmpty(InvoiceNumber))
{
Alert.Show("请填写金税票号!");
return;
}
if (string.IsNullOrEmpty(ExpressNumber))
{
Alert.Show("请填写快递单号!");
return;
}
if (dpUpdateTime.SelectedDate == null)
{
Alert.Show("发票时间必须填写,时间为纸质发票开票时间");
return;
}
}
var ret = SCP_INVOICE_CONTROLLER.SAVE_TB_INVOICE_STATE(_Invoice, p_state, CurrentUser.ChineseName);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show(p_msg);
BindData();
GetInvoice();
}
else
{
Alert.Show(ret.Message);
}
}
}
protected void btnApply_Click(object sender, EventArgs e)
{
SET_INVOICE_STATE("发票申请成功!", InvoiceState.Apply);
}
protected void btnMail_Click(object sender, EventArgs e)
{
SET_INVOICE_STATE("发票已经寄出!", InvoiceState.Mail);
}
protected void btnReject_Click(object sender, EventArgs e)
{
SET_INVOICE_STATE("发票已经作废!", InvoiceState.Reject);
}
protected void Window1_OnClose(object sender, WindowCloseEventArgs e)
{
//string id = GetQueryValue("ID");
//TB_INVOICE model = InvoiceController.GetDataByBillInvoiceBillNum(id);
//InvoiceController.UpdateDataRemark(e.CloseArgument, model);
}
protected void btnRed_Click(object sender, EventArgs e)
{
string id = GetQueryValue("ID");
V_TB_INVOICE _tb = new V_TB_INVOICE();
_tb.InvcBillNum = id;
var ret = SCP_INVOICE_CONTROLLER.Add_New_Red_Invoice(_tb);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
GetInvoice();
}
}
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
System.Web.UI.WebControls.TextBox _label = (System.Web.UI.WebControls.TextBox)Grid1.Rows[e.RowIndex].FindControl("txtQty");
if (!string.IsNullOrEmpty(_label.Text))
{
if (decimal.Parse(_label.Text) < 0)
{
_label.ForeColor = Color.Red;
}
}
}
}
}

359
SCP/Views/锦州锦恒/SupplierData/SCP_INVOICE_EDIT.aspx.designer.cs

@ -0,0 +1,359 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..SupplierData
{
public partial class SCP_INVOICE_EDIT
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// ToolbarSeparator3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator3;
/// <summary>
/// btnOK 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOK;
/// <summary>
/// btnApply 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnApply;
/// <summary>
/// btnMail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnMail;
/// <summary>
/// btnReject 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnReject;
/// <summary>
/// btnRed 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRed;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// txtBillNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBillNo;
/// <summary>
/// txtState 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtState;
/// <summary>
/// txtBillTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBillTime;
/// <summary>
/// txtSupplierName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtSupplierName;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label Label1;
/// <summary>
/// txtTax 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList txtTax;
/// <summary>
/// txtAmount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtAmount;
/// <summary>
/// txtTaxAmount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtTaxAmount;
/// <summary>
/// txtTotal 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtTotal;
/// <summary>
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// txtExtend1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox txtExtend1;
/// <summary>
/// txtExtend2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox txtExtend2;
/// <summary>
/// txtContractPrice1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox txtContractPrice1;
/// <summary>
/// txtBlancePrice1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox txtBlancePrice1;
/// <summary>
/// txtRealTotal 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtRealTotal;
/// <summary>
/// FormRow_4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_4;
/// <summary>
/// txtInvoiceNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtInvoiceNumber;
/// <summary>
/// txtExpressNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtExpressNumber;
/// <summary>
/// dpUpdateTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker dpUpdateTime;
/// <summary>
/// txtMemo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtMemo;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <summary>
/// txtPrice 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPrice;
/// <summary>
/// txtQty 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtQty;
/// <summary>
/// txtLineMemo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtLineMemo;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
}
}

142
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE.aspx

@ -0,0 +1,142 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE.aspx.cs" Inherits="SCP.Views.锦州锦恒.WarehouseData.SCP_INVOICE" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:Button ID="Button3" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="btnView" runat="server" EnablePostBack="True" Text="查看发票" Icon="Zoom" OnClick="btnView_OnClick">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_Click">
</f:Button>
<f:Button ID="btnShow" runat="server" Text="显示查询面板" Icon="Find" OnClick="btnShow_OnClick">
</f:Button>
</Items>
</f:Toolbar>
<f:GroupPanel runat="server" ID="gp1" Hidden="True" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server">
<Items>
<f:CheckBoxList runat="server" ID="ckb" Label="状态">
<f:CheckItem Text="发票寄出" Value="4" Selected="true" />
<f:CheckItem Text="财务退回" Value="6" Selected="true" />
<f:CheckItem Text="财务收票" Value="5" Selected="true" />
<f:CheckItem Text="财务手工收票" Value="8" Selected="true" />
</f:CheckBoxList>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:TextBox ID="TXT_InvcBillNum" runat="server" Label="发票单号" />
<f:DropDownList ID="TXT_VendId" DataValueField="VendId" DataTextField="VendName" runat="server" Label="供应商编码" EnableMultiSelect="false"/>
<f:TextBox ID="TXT_InvoiceNum" runat="server" Label="金税票号" />
<f:TextBox ID="TXT_PO" runat="server" Label="订单编号"/>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:TextBox ID="TXT_ASN" runat="server" Label="发货单号"/>
<f:DatePicker ID="DP_CreateTime1" runat="server" Required="true" Label="收货时间"/>
<f:DatePicker ID="DP_CreateTime2" runat="server" Required="true" Label="至" />
<f:Button runat="server" Text="关闭" OnClick="OnClick"></f:Button>
<f:Button ID="BTN_SEARCH" runat="server" OnClick="BTN_SEARCH_Click" Text="快速查找">
</f:Button>
</Items>
</f:FormRow>
<%-- <f:FormRow runat="server">
<Items>
</Items>
</f:FormRow>--%>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="false"
ShowHeader="False" SortField="State;CreateTime"
AllowPaging="True" PageSize="20" OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange"
ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1"
DataKeyNames="UID, InvcBillNum,State_DESC,InvoiceNum,ExpressNum,VendName,Amount,Tax,TaxAmount,ContractPrice,BlancePrice,Total,CreateTime,Remark,VendId,Extend1,Extend2" AllowSorting="true" IsDatabasePaging="true" >
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" />
<f:BoundField runat="server" HeaderText="发票单号" ColumnID="" DataField="InvcBillNum" />
<f:BoundField runat="server" HeaderText="金税票号" ColumnID="" DataField="InvoiceNum" />
<f:BoundField runat="server" HeaderText="快递单号" ColumnID="" DataField="ExpressNum" />
<f:BoundField runat="server" HeaderText="供应商" ColumnID="" DataField="VendName" />
<f:BoundField runat="server" HeaderText="供应商编码" ColumnID="" DataField="VendId" />
<f:BoundField Width="100px" HeaderText="金额(不含税)" ColumnID="Amount" DataField="Amount" DataFormatString = "{0:F}"></f:BoundField>
<f:BoundField runat="server" HeaderText="采购金额(不含税)" ColumnID="PurCost" DataField="PurCost" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="成本金额(不含税)" ColumnID="StdCost" DataField="StdCost" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="税率" ColumnID="" DataField="Tax" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="税额" ColumnID="" DataField="TaxAmount" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="税后金额" ColumnID="" DataField="Total" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="实际税前金额" ColumnID="" DataField="Extend1" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="实际税额" ColumnID="" DataField="Extend2" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="折扣金额" ColumnID="" DataField="ContractPrice" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="调整税额" ColumnID="" DataField="BlancePrice" DataFormatString = "{0:F}" Hidden="true"/>
<f:BoundField runat="server" HeaderText="开票金额" ColumnID="" DataField="RealTotal" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="发票明细" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="600px" Width="1024px" AutoScroll="True" OnClose="Window1_Close" CloseAction="HidePostBack"/>
<f:Window ID="WindowUpload" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px">
</f:Window>
<script>
var gridClientID = '<%= Grid_V_TB_INVOICE.ClientID %>';
function renderName(value, params) {
if (params.record.data["Amount"] >= params.record.data["StdCost"]) {
params.style = 'color:red';
} else {
params.tdCls = '';
}
return value;
}
</script>
</form>
</body>
</html>

207
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE.aspx.cs

@ -0,0 +1,207 @@
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 CK.SCP.Models.Enums;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Data;
namespace SCP.Views..WarehouseData
{
public partial class SCP_INVOICE : PageBase
{
public void Page_Load(object sender, EventArgs e)
{
IsRoleRight();
if (!IsPostBack)
{
BindInvoice();
SetRoleRule();
BindVender(TXT_VendId);
}
}
public void IsRoleRight()
{
if (!CurrentUser.RoleList.Contains("财务人员"))
{
Alert.Show("当前用户角色不能操作该模块!");
return;
}
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0)
{
Alert.Show("当前用户未选择地点!");
return;
}
}
private void SetRoleRule()
{
//IsPriceVisible(Grid_V_TB_INVOICE, "合同价格");
//IsPriceVisible(Grid_V_TB_INVOICE, "合同差额");
//IsPriceVisible(Grid_V_TB_INVOICE, "要货日期");
}
public void BindInvoice()
{
SearchInvoice((result) =>
{
Grid_V_TB_INVOICE.RecordCount = result.Count();
var list = SortAndPage<V_TB_INVOICE>(result, Grid_V_TB_INVOICE, "ASC");
Grid_V_TB_INVOICE.DataSource = list;
Grid_V_TB_INVOICE.DataBind();
});
}
public void SearchInvoice(Action<IQueryable<V_TB_INVOICE>> p_action)
{
V_TB_INVOICE _entity = new V_TB_INVOICE();
_entity.InvcBillNum = TXT_InvcBillNum.Text;
_entity.VendId = TXT_VendId.SelectedValue;
_entity.InvoiceNum = TXT_InvoiceNum.Text;
_entity.InvoiceList = SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_BY_TIME(DP_CreateTime1.Text, DP_CreateTime2.Text, TXT_PO.Text, TXT_ASN.Text);
_entity.UserInAddress = CurrentUser.FactoryList;
_entity.BillStateList = GetStateList();
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);
}
});
}
private List<int> GetStateList()
{
List<int> lsValue = new List<int>();
string[] values = ckb.SelectedValueArray;
if (values.Contains("0"))
{
lsValue.Add((int)InvoiceState.New);
}
if (values.Contains("1"))
{
lsValue.Add((int)InvoiceState.Apply);
}
if (values.Contains("2"))
{
lsValue.Add((int)InvoiceState.CheckFail);
}
if (values.Contains("3"))
{
lsValue.Add((int)InvoiceState.CheckSuccess);
}
if (values.Contains("4"))
{
lsValue.Add((int)InvoiceState.Mail);
}
if (values.Contains("5"))
{
lsValue.Add((int)InvoiceState.FinanceReceive);
}
if (values.Contains("6"))
{
lsValue.Add((int)InvoiceState.FinanceFail);
}
if (values.Contains("8"))
{
lsValue.Add((int)InvoiceState.CustomReceive);
}
return lsValue;
}
protected void btnView_OnClick(object sender, EventArgs e)
{
if (Grid_V_TB_INVOICE.SelectedRowIndexArray.Length == 0)
{
Alert.Show("请选择一行要操作的记录!");
return;
}
string ID = GetSelectedDataKey(Grid_V_TB_INVOICE, 1);
string url = String.Format("../WarehouseData/SCP_INVOICE_DELTAIL.aspx?ID={0}", ID);
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 ID = GetSelectedDataKey(Grid_V_TB_INVOICE, 1);
string url = String.Format("../WarehouseData/SCP_INVOICE_DETAIL.aspx?ID={0}", ID);
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 Window1_Close(object sender, WindowCloseEventArgs e)
{
BindInvoice();
}
protected void ddlGridPageSize_SelectedIndexChanged1(object sender, EventArgs e)
{
}
protected void btnOutput_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_INVOICE.SelectedRowIndexArray;
if (_selections.Count() == 0)
{
Alert.Show("请选择发票记录导出!");
}
List<string> _ls = new List<string>();
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);
PageBase.DataSetToExcel(ds, "导出发票");
}
}
}

233
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE.aspx.designer.cs

@ -0,0 +1,233 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..WarehouseData
{
public partial class SCP_INVOICE
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// Button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button3;
/// <summary>
/// btnView 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnView;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// ckb 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.CheckBoxList ckb;
/// <summary>
/// TXT_InvcBillNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_InvcBillNum;
/// <summary>
/// TXT_VendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList TXT_VendId;
/// <summary>
/// TXT_InvoiceNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_InvoiceNum;
/// <summary>
/// TXT_PO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PO;
/// <summary>
/// TXT_ASN 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ASN;
/// <summary>
/// DP_CreateTime1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_CreateTime1;
/// <summary>
/// DP_CreateTime2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_CreateTime2;
/// <summary>
/// BTN_SEARCH 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_SEARCH;
/// <summary>
/// Grid_V_TB_INVOICE 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_INVOICE;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
}
}

124
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM.aspx

@ -0,0 +1,124 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE_CONFIRM.aspx.cs" Inherits="SCP.Views.锦州锦恒.WarehouseData.SCP_INVOICE_CONFIRM" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:Button ID="Button3" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="btnView" runat="server" EnablePostBack="True" Text="查看发票" Icon="Zoom" OnClick="btnView_OnClick">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_OnClick">
</f:Button>
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_OnClick">
</f:Button>
</Items>
</f:Toolbar>
<f:GroupPanel runat="server" ID="gp1" Hidden="True" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server">
<Items>
<f:CheckBoxList runat="server" ID="ckb" Label="状态">
<f:CheckItem Text="供应商申请" Value="1" Selected="True" />
<f:CheckItem Text="采购审核退回" Value="2" Selected="True" />
<f:CheckItem Text="采购审核通过" Value="3" Selected="True" />
<f:CheckItem Text="发票寄出" Value="4" Selected="True" />
<f:CheckItem Text="财务收票" Value="5" Selected="True" />
<f:CheckItem Text="财务手工收票" Value="8" Selected="True" />
</f:CheckBoxList>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:TextBox ID="TXT_InvcBillNum" runat="server" Label="发票单号" />
<f:DropDownList ID="ddl_Vender" runat="server" Label="供应商" EnableEdit="true" ></f:DropDownList>
<f:TextBox ID="TXT_InvoiceNum" runat="server" Label="金税票号" />
<f:TextBox ID="TXT_PO" runat="server" Label="订单编号"/>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:TextBox ID="TXT_ASN" runat="server" Label="发货单号"/>
<f:DatePicker ID="DP_CreateTime1" runat="server" Required="true" Label="收货时间"/>
<f:DatePicker ID="DP_CreateTime2" runat="server" Required="true" Label="至" />
<f:Button runat="server" Text="关闭" OnClick="OnClick"></f:Button>
<f:Button ID="BTN_SEARCH" runat="server" OnClick="BTN_SEARCH_Click" Text="快速查找">
</f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="true"
ShowHeader="False" SortField="State;CreateTime" AllowPaging="True" PageSize="200"
OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange"
ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1"
DataKeyNames="UID, InvcBillNum" AllowSorting="true" IsDatabasePaging="true" >
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" />
<f:BoundField runat="server" HeaderText="发票单号" ColumnID="" DataField="InvcBillNum" />
<f:BoundField runat="server" HeaderText="金税票号" ColumnID="" DataField="InvoiceNum" />
<f:BoundField runat="server" HeaderText="快递单号" ColumnID="" DataField="ExpressNum" />
<f:BoundField runat="server" HeaderText="供应商" ColumnID="" DataField="VendName" />
<f:BoundField runat="server" HeaderText="供应商编码" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="金额(不含税)" ColumnID="" DataField="Amount" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="采购金额(不含税)" ColumnID="" DataField="PurCost" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="成本金额(不含税)" ColumnID="" DataField="StdCost" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="税率" ColumnID="" DataField="Tax" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="税额" ColumnID="" DataField="TaxAmount" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="税后金额" ColumnID="" DataField="Total" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="实际税前金额" ColumnID="" DataField="Extend1" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="实际税额" ColumnID="" DataField="Extend2" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="折扣金额" ColumnID="" DataField="ContractPrice" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="调整税额" ColumnID="" DataField="BlancePrice" DataFormatString = "{0:F}" Hidden="true"/>
<f:BoundField runat="server" HeaderText="开票金额" ColumnID="" DataField="RealTotal" DataFormatString = "{0:F}"/>
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="发票明细" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="600px" Width="1024px" AutoScroll="True" OnClose="Window1_Close" CloseAction="HidePostBack"/>
<f:Window ID="WindowUpload" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px">
</f:Window>
</form></body>
</html>

226
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM.aspx.cs

@ -0,0 +1,226 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using CK.SCP.Controller;
using FineUI;
using CK.SCP.Models.Enums;
using System.Data;
namespace SCP.Views..WarehouseData
{
public partial class SCP_INVOICE_CONFIRM : PageBase
{
public void Page_Load(object sender, EventArgs e)
{
IsRoleRight();
if (!IsPostBack)
{
BindInvoice();
BindVender(ddl_Vender);
}
}
private void BindVender()
{
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
{
var ls = SCP_TB_VENDER_CONTROLLER.Getlist(CurrentUser.FactoryList.FirstOrDefault());
var lsVender = ls.Where(p => p.VendId.Substring(0, 1) == "R" || p.VendId.Substring(0, 1) == "E").ToList();
lsVender.ForEach(p => {
p.VendName = string.Format("{0}({1})", p.VendName, p.VendId);
});
ddl_Vender.DataSource = lsVender;
ddl_Vender.DataTextField = "VendName";
ddl_Vender.DataValueField = "VendId";
ddl_Vender.DataBind();
}
}
public void IsRoleRight()
{
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0)
{
Alert.Show("当前用户未选择地点!");
return;
}
}
public void BindInvoice()
{
SearchInvoice((result) => {
Grid_V_TB_INVOICE.RecordCount = result.Count();
var list = SortAndPage<V_TB_INVOICE>(result, Grid_V_TB_INVOICE, "ASC");
Grid_V_TB_INVOICE.DataSource = list;
Grid_V_TB_INVOICE.DataBind();
});
}
public void SearchInvoice(Action<IQueryable<V_TB_INVOICE>> p_action)
{
V_TB_INVOICE _entity = new V_TB_INVOICE();
_entity.InvcBillNum = TXT_InvcBillNum.Text;
_entity.VendId = ddl_Vender.SelectedValue;
_entity.InvoiceNum = TXT_InvoiceNum.Text;
_entity.InvoiceList = SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_BY_TIME(DP_CreateTime1.Text, DP_CreateTime2.Text, TXT_PO.Text, TXT_ASN.Text);
_entity.UserInVendIds = CurrentUser.VenderList;
_entity.UserInAddress = CurrentUser.FactoryList;
_entity.BillStateList = GetStateList();
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_BY_CG_List(_entity, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
if (_entity.InvoiceList == null || _entity.InvoiceList.Count == 0)
{
Alert.Show("未查询到符合条件的发票!");
}
p_action(ret.Result);
}
});
}
private List<int> GetStateList()
{
List<int> lsValue = new List<int>();
string[] values = ckb.SelectedValueArray;
if (values.Contains("0"))
{
lsValue.Add((int)InvoiceState.New);
}
if (values.Contains("1"))
{
lsValue.Add((int)InvoiceState.Apply);
}
if (values.Contains("2"))
{
lsValue.Add((int)InvoiceState.CheckFail);
}
if (values.Contains("3"))
{
lsValue.Add((int)InvoiceState.CheckSuccess);
}
if (values.Contains("4"))
{
lsValue.Add((int)InvoiceState.Mail);
}
if (values.Contains("5"))
{
lsValue.Add((int)InvoiceState.FinanceReceive);
}
if (values.Contains("6"))
{
lsValue.Add((int)InvoiceState.FinanceFail);
}
if (values.Contains("8"))
{
lsValue.Add((int)InvoiceState.CustomReceive);
}
return lsValue;
}
protected void btnView_OnClick(object sender, EventArgs e)
{
if (Grid_V_TB_INVOICE.SelectedRowIndexArray.Length != 1)
{
Alert.Show("请选择一行要操作的记录!");
return;
}
string ID = GetSelectedDataKey(Grid_V_TB_INVOICE, 1);
string url = String.Format("../WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx?ID={0}", ID);
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_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
string ID = GetSelectedDataKey(Grid_V_TB_INVOICE, 1);
string url = String.Format("../WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx?ID={0}", ID);
PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}
protected void Grid_V_TB_INVOICE_PageIndexChange(object sender, GridPageEventArgs e)
{
BindInvoice();
}
protected void BTN_SEARCH_Click(object sender, EventArgs e)
{
BindInvoice();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_INVOICE.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindInvoice();
}
protected void btnOutput_OnClick(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_INVOICE.SelectedRowIndexArray;
if (_selections.Count() == 0)
{
Alert.Show("请选择发票记录导出!");
}
List<string> _ls = new List<string>();
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);
PageBase.DataSetToExcel(ds, "导出发票");
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindInvoice();
}
}
}

224
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM.aspx.designer.cs

@ -0,0 +1,224 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..WarehouseData
{
public partial class SCP_INVOICE_CONFIRM
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// Button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button3;
/// <summary>
/// btnView 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnView;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// ckb 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.CheckBoxList ckb;
/// <summary>
/// TXT_InvcBillNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_InvcBillNum;
/// <summary>
/// ddl_Vender 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddl_Vender;
/// <summary>
/// TXT_InvoiceNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_InvoiceNum;
/// <summary>
/// TXT_PO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PO;
/// <summary>
/// TXT_ASN 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ASN;
/// <summary>
/// DP_CreateTime1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_CreateTime1;
/// <summary>
/// DP_CreateTime2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_CreateTime2;
/// <summary>
/// BTN_SEARCH 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_SEARCH;
/// <summary>
/// Grid_V_TB_INVOICE 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_INVOICE;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
}
}

166
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx

@ -0,0 +1,166 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE_CONFIRM_DETAIL.aspx.cs" Inherits="SCP.Views.锦州锦恒.WarehouseData.SCP_INVOICE_CONFIRM_DETAIL" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server" Title="">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:ToolbarSeparator ID="ToolbarSeparator3" runat="server">
</f:ToolbarSeparator>
<f:Button ID="btnEdit" runat="server" Text="修改数据" OnClientClick="if(!confirm('是否要修改备注?'))return false;" Icon="ScriptSave" OnClick="btnEdit_Click">
</f:Button>
<f:Button ID="btnCheckSuccess" runat="server" Text="审核通过" OnClientClick="if(!confirm('是否要通过该发票申请?'))return false;" Icon="BulletTick" OnClick="btnCheckSuccess_Click">
</f:Button>
<f:Button ID="btnReject" runat="server" Text="未处理退货" Icon="BulletCross" OnClick="btnReject_Click" Hidden="true">
</f:Button>
<f:Button ID="btnCheckFail" runat="server" Text="审核退回" Icon="BulletCross" OnClick="btnCheckFail_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Layout="HBox">
<Items>
<f:Form runat="server" Title="">
<Rows>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox ID="txtBillNo" runat="server" Label="发票单号" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtState" runat="server" Label="状态" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtBillTime" runat="server" Label="创建时间" Text="" MaxLength="100" Readonly="true" Enabled="false" />
<f:TextBox ID="txtSupplierName" runat="server" Label="供应商" Text="" MaxLength="100" Readonly="true" Enabled="false" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:DropDownList runat="server" Label="税率" ID="txtTax" AutoPostBack="true" Enabled="false" >
<f:ListItem Text="0.16" Value="0.16" />
<f:ListItem Text="0.13" Value="0.13" />
<f:ListItem Text="0" Value="0" />
</f:DropDownList>
<f:TextBox ID="txtAmount" runat="server" Label="金额" Text="" MaxLength="100" Readonly="true" Enabled="false" />
<f:TextBox ID="txtTaxAmount" runat="server" Label="税额" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtTotal" runat="server" Label="税后金额" Text="" MaxLength="100" Readonly="true" Enabled="false" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox ID="txtExtend1" runat="server" Label="实际税前金额" Text="0" MaxLength="100" Enabled="false"/>
<f:TextBox ID="txtExtend2" runat="server" Label="实际税额" Text="0" MaxLength="100" Enabled="false"/>
<f:TextBox ID="txtContractPrice1" runat="server" Label="折扣金额" Text="0" MaxLength="100" Enabled="false"/>
<f:TextBox ID="txtBlancePrice1" runat="server" Label="调整税额" Text="0" MaxLength="100" Enabled="false" Hidden="true"/>
<f:TextBox ID="txtRealTotal" runat="server" Label="开票金额" Text="" Readonly="true" Enabled="false" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox ID="txtInvoiceNumber" runat="server" Label="金税票号" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtExpressNumber" runat="server" Label="快递单号" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtMemo" runat="server" Label="备注" Text="" MaxLength="100">
</f:TextBox>
<f:Label runat="server" ID="l2" />
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Toolbar runat="server" Hidden="true">
<Items>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel">
</f:Button>
<f:ToolbarFill runat="server" />
</Items>
</f:Toolbar>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="1000" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,InvcBillNum,Qty,CanQty,State,Price,ContractPrice,BlancePrice" IsDatabasePaging="True" AllowPaging="True"
EnableRowSelectEvent="True" AutoScroll="True" SortField="PoBillNum" AllowCellEditing="true" ClicksToEdit="1">
<Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="ProjectId" DataField="ProjectId" HeaderText="项目编号" ColumnID="ProjectId" Width="100px" />
<f:BoundField SortField="RecvBillNum" DataField="RecvBillNum" HeaderText="收货单号" ColumnID="RecvBillNum" Width="80px" />
<f:BoundField SortField="ErpRecvBillNum" DataField="ErpRecvBillNum" HeaderText="ERP收货单号" ColumnID="ErpRecvBillNum" Width="80px" />
<f:BoundField SortField="PoBillNum" DataField="PoBillNum" HeaderText="订单" ColumnID="Line" Width="100px" />
<f:BoundField SortField="PoLineNum" DataField="PoLineNum" HeaderText="订单行" ColumnID="ProductCode" Width="80px" />
<%-- <f:BoundField SortField="ProductName" DataField="AsnBillNum" HeaderText="收货单" ColumnID="ProductName" Width="100px" />--%>
<f:BoundField SortField="AsnBillNum" DataField="AsnBillNum" HeaderText="发货单" ColumnID="UnitCode" Width="120px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="PackageQty" Width="80px" />
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="CurrencyCode" Width="200px" />
<f:BoundField SortField="Currency" DataField="Currency" HeaderText="币种" ColumnID="Currency" Width="80px" />
<%--<f:BoundField SortField="Price" DataField="Price" HeaderText="单价" ColumnID="Price" Width="80px" />--%>
<f:RenderField Width="100px" HeaderText="单价" ColumnID="Price" DataField="Price" FieldType="Float"
>
<Editor>
<f:NumberBox ID="TXT_PackQty" runat="server" MinValue="0"
MaxValue="99999999" DecimalPrecision="3" >
</f:NumberBox>
</Editor>
</f:RenderField>
<f:BoundField runat="server" HeaderText="采购金额(不含税)" ColumnID="" DataField="PurCost" />
<f:BoundField runat="server" HeaderText="成本金额(不含税)" ColumnID="" DataField="StdCost" hidden="true" />
<f:BoundField SortField="UpdateTime" runat="server" HeaderText="收货日期" ColumnID="" DataField="UpdateTime" />
<f:BoundField SortField="Qty" DataField="Qty" HeaderText="开票数量" ColumnID="OpenQty" Width="80px" />
<f:TemplateField HeaderText="备注" Width="100px">
<ItemTemplate>
<asp:TextBox ID="txtLineMemo" runat="server" Width="300px"
Text='<%# Eval("Remark") %>' MaxLength="200" ></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True" Height="640px" Width="700px" AutoScroll="True"
WindowPosition="Center" IsModal="true" Title="发票详情" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" OnClose="Window1_Close" />
<f:Window ID="WindowUpload" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px">
</f:Window>
</form>
<script>
var gridClientID = '<%= Grid1.ClientID %>';
function renderName(value, params) {
if (params.record.data["Price"] >= params.record.data["PurCost"]) {
params.style = 'color:red';
} else {
params.tdCls = '';
}
return value;
}
</script>
</body>
</html>

312
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx.cs

@ -0,0 +1,312 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Common;
using CK.SCP.Controller;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using FineUI;
namespace SCP.Views..WarehouseData
{
public partial class SCP_INVOICE_CONFIRM_DETAIL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
IsRoleRight();
if (!IsPostBack)
{
GetInvoice();
BindData();
SetRoleRule();
}
}
public void IsRoleRight()
{
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0)
{
Alert.Show("当前用户未选择地点!");
return;
}
}
private void SetRoleRule()
{
//IsPriceVisible(Grid1, "合同价格");
//IsPriceVisible(Grid1, "合同差额");
IsPriceVisible(Grid1, "要货日期");
}
private void GetInvoice()
{
string id = GetQueryValue("ID");
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_List(new V_TB_INVOICE { InvcBillNum = id }, (ret) => {
if (ret.State == ReturnStatus.Succeed)
{
var _ls = ret.Result.ToList();
if (_ls != null && _ls.Count > 0)
{
var _Model = _ls[0];
Session["invoice"] = _Model;
txtState.Text = _Model.State_DESC;
txtBillNo.Text = _Model.InvcBillNum;
txtBillTime.Text = Convert.ToDateTime(_Model.CreateTime).ToString("yyyy-MM-dd");
txtSupplierName.Text = _Model.VendName;
txtInvoiceNumber.Text = _Model.InvoiceNum;
txtTax.SelectedValue = _Model.Tax != null ? _Model.Tax.Value.ToString() : "0";
txtTaxAmount.Text = _Model.TaxAmount != null ? _Model.TaxAmount.Value.ToString() : "0";
txtExpressNumber.Text = _Model.ExpressNum;
txtAmount.Text = _Model.Amount.ToString();
txtTotal.Text = _Model.Total != null ? _Model.Total.ToString() : string.Empty;
txtContractPrice1.Text = _Model.ContractPrice != null ? _Model.ContractPrice.ToString() : string.Empty;
txtExtend1.Text = _Model.Extend1 != null ? _Model.Extend1.ToString() : string.Empty;
txtExtend2.Text = _Model.Extend2 != null ? _Model.Extend2.ToString() : string.Empty;
txtRealTotal.Text = _Model.RealTotal != null ? _Model.RealTotal.ToString() : string.Empty;
txtBlancePrice1.Text = _Model.BlancePrice != null ? _Model.BlancePrice.ToString() : string.Empty;
txtMemo.Text = _Model.Remark;
if (_Model.State == (int)InvoiceState.Apply)
{
this.btnCheckFail.Hidden = false;//.Visible = true;
this.btnCheckSuccess.Hidden = false;//.Visible = true;
}
else
{
this.btnEdit.Hidden = true;
this.btnCheckFail.Hidden = true; // Visible = false;
this.btnCheckSuccess.Hidden = true; //Visible = false;
}
}
}
});
this.btnEdit.Enabled = true;
}
private void Search(Action<IQueryable<V_TB_INVOICE_DETAIL>> p_list)
{
string id = GetQueryValue("ID");
V_TB_INVOICE_DETAIL _tb = new V_TB_INVOICE_DETAIL();
_tb.InvcBillNum = id;
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_DETAIL_List(_tb, (ret) => {
if (ret.State == ReturnStatus.Succeed)
{
p_list(ret.Result);
}
});
}
public void BindData()
{
Search(ret =>
{
Grid1.RecordCount = ret.Count();
var list = SortAndPage<V_TB_INVOICE_DETAIL>(ret, Grid1).ToList();
foreach (V_TB_INVOICE_DETAIL rec in list)
{
rec.Qty = ToDecimal(rec.Qty, 2);
rec.CanQty = ToDecimal(rec.CanQty, 2);
}
Grid1.DataSource = list;
Grid1.DataBind();
});
}
public decimal ToDecimal(decimal num, int scale)
{
decimal tempOdds = Math.Round(num, scale);
return tempOdds;
}
protected void btnCheckFail_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(
Window1.GetShowReference("../../WarehouseData/SCP_INVOICE_CHECKFAIL.aspx", "采购审核退回")
);
}
protected void btnCheckSuccess_Click(object sender, EventArgs e)
{
if (Session["Invoice"] != null)
{
var _Invoice = Session["Invoice"] as V_TB_INVOICE;
var venderId = _Invoice.VendId;
SET_INVOICE_STATE("采购审核通过", InvoiceState.CheckSuccess);
}
}
private void SET_INVOICE_STATE(string p_msg, InvoiceState p_state)
{
if (Session["Invoice"] != null)
{
var _Invoice = Session["Invoice"] as V_TB_INVOICE;
_Invoice.Remark = txtMemo.Text;
//var ret = SCP_INVOICE_CONTROLLER.SAVE_TB_INVOICE_STATE(_Invoice.InvcBillNum, p_state);
var ret = SCP_INVOICE_CONTROLLER.SAVE_TB_INVOICE_STATE(_Invoice, p_state, CurrentUser.ChineseName);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show(p_msg);
if (CurrentUser.ConfigList.Keys.Contains("供应商邮件"))
{
SCP.Common.MailManager.SendMail(_Invoice.VendId, "采购审核通过", "采购审核通过");
}
GetInvoice();
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
}
protected void btnEdit_Click(object sender, EventArgs e)
{
var _invoice = Session["invoice"] as V_TB_INVOICE;
var Memo = MyWebString.GetString(txtMemo.Text.Trim());
_invoice.Remark = Memo;
_invoice.Tax = string.IsNullOrEmpty(txtTax.SelectedValue) ? 0 : decimal.Parse(txtTax.SelectedValue);
_invoice.BlancePrice = string.IsNullOrEmpty(txtBlancePrice1.Text) ? 0 : decimal.Parse(txtBlancePrice1.Text);
List<V_TB_INVOICE_DETAIL> _ls = new List<V_TB_INVOICE_DETAIL>();
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid1.GetModifiedDict();
if (_invoice != null)
{
for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
object[] rowDataKeys = Grid1.DataKeys[i];
GridRow row = Grid1.Rows[i];
V_TB_INVOICE_DETAIL _entity = new V_TB_INVOICE_DETAIL();
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
_entity.InvcBillNum = rowDataKeys[1] as string;
_entity.Qty = ConvertHelper.To<Decimal>(rowDataKeys[2]);
_entity.CanQty = ConvertHelper.To<Decimal>(rowDataKeys[3]);
_entity.State = ConvertHelper.To<Int32>(rowDataKeys[4]);
_entity.Price = ConvertHelper.To<decimal>(rowDataKeys[5]);
if (modifiedDict.Keys.Contains(i))
{
var modifyValue = modifiedDict[i];
_entity.Price = modifyValue.Keys.Contains("Price") ? ConvertHelper.To<decimal>(modifyValue["Price"]) : _entity.Price;
}
var txtLineMemo = (System.Web.UI.WebControls.TextBox)row.FindControl("txtLineMemo");
_entity.ContractPrice = ConvertHelper.To<Decimal>(rowDataKeys[6]);
_entity.BlancePrice = ConvertHelper.To<Decimal>(rowDataKeys[7]);
_entity.Remark = txtLineMemo.Text;
//把备注添加到TB_INVOICE、TB_INVOICE_DETAIL
_ls.Add(_entity);
}
}
if (_ls.Count > 0)
{
var ret = SCP_INVOICE_CONTROLLER.SAVE_TB_INVOICE_APPLY(_invoice, _ls);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("发票备注修改成功!");
BindData();
}
}
else
{
Alert.Show("更改记录数为零");
}
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
if (string.IsNullOrEmpty(e.CloseArgument))
{
Alert.Show("请输入退回原因");
return;
}
else
{
string Memo = e.CloseArgument;
var _invoice = Session["invoice"] as V_TB_INVOICE;
_invoice.State = (int)InvoiceState.CheckFail;
_invoice.Remark = Memo;
List<V_TB_INVOICE_DETAIL> _ls = new List<V_TB_INVOICE_DETAIL>();
if (_invoice != null)
{
for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
object[] rowDataKeys = Grid1.DataKeys[i];
GridRow row = Grid1.Rows[i];
V_TB_INVOICE_DETAIL _entity = new V_TB_INVOICE_DETAIL();
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
_entity.InvcBillNum = rowDataKeys[1] as string;
_entity.Qty = ConvertHelper.To<Decimal>(rowDataKeys[2]);
_entity.CanQty = ConvertHelper.To<Decimal>(rowDataKeys[3]);
_entity.State = (int)InvoiceState.CheckFail;
_entity.Price = ConvertHelper.To<Decimal>(rowDataKeys[5]);
_entity.ContractPrice = ConvertHelper.To<Decimal>(rowDataKeys[6]);
_entity.BlancePrice = ConvertHelper.To<Decimal>(rowDataKeys[7]);
var txtLineMemo = (System.Web.UI.WebControls.TextBox)row.FindControl("txtLineMemo");
_entity.Remark = txtLineMemo.Text;
//把备注添加到TB_INVOICE、TB_INVOICE_DETAIL
_ls.Add(_entity);
}
}
if (_ls.Count > 0)
{
var ret = SCP_INVOICE_CONTROLLER.SAVE_TB_INVOICE_APPLY(_invoice, _ls);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("发票采购退回成功!");
if (CurrentUser.ConfigList.Keys.Contains("供应商邮件"))
{
SCP.Common.MailManager.SendMail(_invoice.VendId, "发票采购退回成功", "发票采购退回成功");
}
BindData();
GetInvoice();
}
}
else
{
Alert.Show("退回记录数为零");
}
}
}
protected void btnReject_Click(object sender, EventArgs e)
{
if (Session["Invoice"] != null)
{
var _Invoice = Session["Invoice"] as V_TB_INVOICE;
var venderId = _Invoice.VendId;
string url = String.Format("../../WarehouseData/SCP_RECEIVE_LIST.aspx?VendId={0}", venderId);
PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}
}
}
}

305
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx.designer.cs

@ -0,0 +1,305 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..WarehouseData
{
public partial class SCP_INVOICE_CONFIRM_DETAIL
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// ToolbarSeparator3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator3;
/// <summary>
/// btnEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnEdit;
/// <summary>
/// btnCheckSuccess 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCheckSuccess;
/// <summary>
/// btnReject 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnReject;
/// <summary>
/// btnCheckFail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCheckFail;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// txtBillNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBillNo;
/// <summary>
/// txtState 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtState;
/// <summary>
/// txtBillTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBillTime;
/// <summary>
/// txtSupplierName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtSupplierName;
/// <summary>
/// txtTax 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList txtTax;
/// <summary>
/// txtAmount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtAmount;
/// <summary>
/// txtTaxAmount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtTaxAmount;
/// <summary>
/// txtTotal 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtTotal;
/// <summary>
/// txtExtend1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtExtend1;
/// <summary>
/// txtExtend2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtExtend2;
/// <summary>
/// txtContractPrice1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtContractPrice1;
/// <summary>
/// txtBlancePrice1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBlancePrice1;
/// <summary>
/// txtRealTotal 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtRealTotal;
/// <summary>
/// txtInvoiceNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtInvoiceNumber;
/// <summary>
/// txtExpressNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtExpressNumber;
/// <summary>
/// txtMemo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtMemo;
/// <summary>
/// l2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label l2;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <summary>
/// TXT_PackQty 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox TXT_PackQty;
/// <summary>
/// txtLineMemo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtLineMemo;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
}
}

145
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_DELTAIL.aspx

@ -0,0 +1,145 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_INVOICE_DELTAIL.aspx.cs" Inherits="SCP.Views.锦州锦恒.WarehouseData.SCP_INVOICE_DELTAIL" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="btnEdit" runat="server" Text="修改数据" Enabled="true" OnClientClick="if(!confirm('是否要修改备注?'))return false;" Icon="ScriptSave" OnClick="btnEdit_OnClick">
</f:Button>
<f:Button ID="btnInvoiceFail" runat="server" Text="财务退回" Icon="BulletCross" OnClick="btnInvoiceFail_OnClick">
</f:Button>
<f:Button ID="btnReceive" runat="server" Text="确定收票" OnClientClick="if(!confirm('是否要确认收票?确认收票前请检查发票时间和纸质发票时间是否一致!'))return false;" Icon="Mail" OnClick="btnReceive_OnClick">
</f:Button>
<f:Button ID="btnRecv" runat="server" Text="已经手工收票" OnClientClick="if(!confirm('是否要确认手工收票?确认手工收票前请检查发票时间和纸质发票时间是否一致!'))return false;" Icon="Mail" OnClick="btnRecv_Click" Hidden="true">
</f:Button>
<%-- <f:Button ID="btnRejectReceive" runat="server" Text="取消收票" OnClientClick="if(!confirm('是否要取消收票?'))return false;" Icon="Cancel" OnClick="btnRejectReceive_OnClick">
</f:Button>--%>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Form runat="server" Title="">
<Items>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox ID="txtBillNo" runat="server" Label="发票单号" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtState" runat="server" Label="状态" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtBillTime" runat="server" Label="创建时间" Text="" MaxLength="100" Readonly="true" Enabled="false" />
<f:TextBox ID="txtSupplierName" runat="server" Label="供应商" Text="" MaxLength="100" Readonly="true" Enabled="false" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox ID="txtTax" runat="server" Label="税率" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtAmount" runat="server" Label="金额" Text="" MaxLength="100" Readonly="true" Enabled="false" />
<f:TextBox ID="txtTaxAmount" runat="server" Label="税额" Text="" MaxLength="100" Readonly="true" Enabled="false">
</f:TextBox>
<f:TextBox ID="txtTotal" runat="server" Label="税后金额" Text="" MaxLength="100" Readonly="true" Enabled="false" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:NumberBox ID="txtExtend1" runat="server" Label="实际税前金额" Enabled="false" />
<f:NumberBox ID="txtExtend2" runat="server" Label="实际税额" Enabled="false" />
<f:NumberBox ID="txtContractPrice1" runat="server" Label="折扣金额" Enabled="false" />
<f:TextBox ID="txtRealTotal" runat="server" Label="开票金额" Text="" Readonly="true" Enabled="false" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox ID="txtInvoiceNumber" runat="server" Label="金税票号" Text="" MaxLength="100">
</f:TextBox>
<f:TextBox ID="txtExpressNumber" runat="server" Label="快递单号" Text="" MaxLength="100" Enabled="false">
</f:TextBox>
<f:DatePicker runat="server" ID="dpUpdateTime" Label="发票时间"></f:DatePicker>
<f:TextBox ID="txtMemo" runat="server" Label="备注" Text="" MaxLength="100">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:NumberBox ID="txtBlancePrice1" runat="server" Label="调整税额" MaxValue="1" Hidden="true" />
<f:Label runat="server" ID="txtTAXOLD" Label="ERP税额" Hidden="true"></f:Label>
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="500" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,InvcBillNum,Qty,CanQty,State,Price" IsDatabasePaging="True" AllowPaging="True"
EnableRowSelectEvent="True" AutoScroll="True" SortField="CreateTime" OnRowDataBound="Grid1_RowDataBound">
<Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="RecvBillNum" DataField="RecvBillNum" HeaderText="收货单号" ColumnID="RecvBillNum" Width="80px" />
<f:BoundField SortField="ErpRecvBillNum" DataField="ErpRecvBillNum" HeaderText="ERP收货单号" ColumnID="ErpRecvBillNum" Width="80px" />
<f:BoundField SortField="PoLineNum" DataField="ProjectId" HeaderText="项目编号" ColumnID="ProjectId" Width="80px" />
<f:BoundField SortField="PoBillNum" DataField="PoBillNum" HeaderText="订单" ColumnID="Line" Width="100px" />
<f:BoundField SortField="PoLineNum" DataField="PoLineNum" HeaderText="订单行" ColumnID="ProductCode" Width="80px" />
<%--<f:BoundField SortField="ProductName" DataField="AsnBillNum" HeaderText="收货单" ColumnID="ProductName" Width="100px" />--%>
<f:BoundField SortField="AsnBillNum" DataField="AsnBillNum" HeaderText="发货单" ColumnID="UnitCode" Width="120px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="PackageQty" Width="80px" />
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="CurrencyCode" Width="200px" />
<f:BoundField SortField="Currency" DataField="Currency" HeaderText="币种" ColumnID="Currency" Width="80px" />
<f:RenderField Width="100px" HeaderText="单价" ColumnID="Price" DataField="Price" FieldType="Float"
RendererFunction="renderName">
<Editor>
<f:Label ID="tbxEditorName" runat="server">
</f:Label>
</Editor>
</f:RenderField>
<%-- <f:BoundField SortField="Price" DataField="Price" HeaderText="单价" ColumnID="PlanQty" Width="80px" />--%>
<f:BoundField SortField="PurCost" runat="server" HeaderText="采购价格(未含税)" ColumnID="PurCost" DataField="PurCost" />
<f:BoundField SortField="StdCost" runat="server" HeaderText="成本价格(未含税)" ColumnID="StdCost" DataField="StdCost" Hidden="true" />
<f:BoundField SortField="UpdateTime" runat="server" HeaderText="收货日期" ColumnID="" DataField="UpdateTime" />
<%--<f:BoundField SortField="Qty" DataField="Qty" HeaderText="开票数量" ColumnID="OpenQty" Width="80px" />--%>
<f:TemplateField HeaderText="开票数量" Width="70px" ColumnID="Qty">
<ItemTemplate>
<asp:Label ID="Qty1" runat="server" Width="60px" Text='<%# Eval("Qty") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<%-- <f:BoundField runat="server" HeaderText="ERP税额" ColumnID="" DataField="OLDTAX" />
<f:BoundField runat="server" HeaderText="票面税额" ColumnID="" DataField="NEWTAX" />
<f:BoundField runat="server" HeaderText="税差额" ColumnID="" DataField="DISTAX" />--%>
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="640px" Width="700px" OnClose="Window1_OnClose" />
<f:Window ID="WindowUpload" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px">
</f:Window>
<script>
var gridClientID = '<%= Grid1.ClientID %>';
function renderName(value, params) {
if (params.record.data["Price"] >= params.record.data["StdCost"]) {
params.style = 'color:red';
} else {
params.tdCls = '';
}
return value;
}
</script>
</form>
</body>
</html>

296
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_DELTAIL.aspx.cs

@ -0,0 +1,296 @@
using System;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using System.Drawing;
namespace SCP.Views..WarehouseData
{
public partial class SCP_INVOICE_DELTAIL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
IsRoleRight();
if (!IsPostBack)
{
GetInvoice();
BindData();
SetRoleRule();
}
}
public void IsRoleRight()
{
if (!CurrentUser.RoleList.Contains("财务人员"))
{
Alert.Show("当前用户角色不能操作该模块!");
return;
}
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0)
{
Alert.Show("当前用户未选择地点!");
return;
}
}
private void SetRoleRule()
{
//IsPriceVisible(Grid1, "合同价格");
//IsPriceVisible(Grid1, "合同差额");
IsPriceVisible(Grid1, "要货日期");
}
//修改备注
protected void btnEdit_OnClick(object sender, EventArgs e)
{
string id = GetQueryValue("ID");
var _blan = string.IsNullOrEmpty(txtBlancePrice1.Text) ? 0 : decimal.Parse(txtBlancePrice1.Text);
if (string.IsNullOrEmpty(txtInvoiceNumber.Text))
{
Alert.Show("金税票号不能为空!");
return;
}
if (string.IsNullOrEmpty(dpUpdateTime.Text))
{
Alert.Show("发票日期不能为空!");
return;
}
var ro = SCP_INVOICE_CONTROLLER.UpdateMemoByInvcBillNum(id, txtMemo.Text.Trim(), _blan, txtInvoiceNumber.Text, dpUpdateTime.SelectedDate.Value);
if (ro.State == ReturnStatus.Succeed)
{
Alert.Show("修改成功!");
GetInvoice();
return;
}
else
{
Alert.Show("修改失败!");
return;
}
}
//确定发票
protected void btnReceive_OnClick(object sender, EventArgs e)
{
if (dpUpdateTime.SelectedDate == null)
{
Alert.Show("请填写发票时间!");
return;
}
SET_INVOICE_STATE("财务接收发票", InvoiceState.FinanceReceive);
}
//取消发票
protected void btnRejectReceive_OnClick(object sender, EventArgs e)
{
SET_INVOICE_STATE("财务取消发票", InvoiceState.Mail);
}
private void SET_INVOICE_STATE(string p_msg, InvoiceState p_state)
{
string id = GetQueryValue("ID");
if (InvoiceState.FinanceReceive == p_state)
{
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_List(new V_TB_INVOICE { InvcBillNum = id }, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
var _ls = ret.Result.ToList();
if (_ls != null && _ls.Count > 0)
{
var _inv = _ls.FirstOrDefault();
if (_inv.UpdateTime == null)
{
Alert.Show("无发票日期是否正确填写,若修改发票日期请点击【修改数据】");
return;
}
}
}
else
{
Alert.Show("请重新打开发票明细");
}
});
}
var ro = SCP_INVOICE_CONTROLLER.SET_INVOICE_STATE(id, p_state);
if (ro.State == ReturnStatus.Succeed)
{
Alert.Show(p_msg + "成功!");
if (CurrentUser.ConfigList.Keys.Contains("供应商邮件"))
{
SCP.Common.MailManager.SendMail(ro.Message, p_msg, p_msg);
}
GetInvoice();
BindData();
return;
}
else
{
Alert.Show(p_msg + "失败!");
return;
}
}
private void GetInvoice()
{
string id = GetQueryValue("ID");
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_List(new V_TB_INVOICE { InvcBillNum = id }, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
var _ls = ret.Result.ToList();
if (_ls != null && _ls.Count > 0)
{
var _Model = _ls[0];
txtState.Text = _Model.State_DESC;
txtBillNo.Text = _Model.InvcBillNum;
txtBillTime.Text = Convert.ToDateTime(_Model.CreateTime).ToString("yyyy-MM-dd");
txtSupplierName.Text = _Model.VendName;
txtInvoiceNumber.Text = _Model.InvoiceNum;
txtExpressNumber.Text = _Model.ExpressNum;
txtTax.Text = _Model.Tax != null ? _Model.Tax.Value.ToString() : "0";
txtTaxAmount.Text = _Model.TaxAmount != null ? _Model.TaxAmount.Value.ToString() : "0";
dpUpdateTime.SelectedDate = _Model.UpdateTime;
txtExtend1.Text = _Model.Extend1 != null ? _Model.Extend1.ToString() : string.Empty;
txtExtend2.Text = _Model.Extend2 != null ? _Model.Extend2.ToString() : string.Empty;
txtContractPrice1.Text = _Model.ContractPrice != null ? _Model.ContractPrice.ToString() : string.Empty;
txtContractPrice1.Text = _Model.ContractPrice != null ? _Model.ContractPrice.ToString() : string.Empty;
txtBlancePrice1.Text = _Model.BlancePrice != null ? _Model.BlancePrice.ToString() : string.Empty;
txtAmount.Text = _Model.Amount.ToString();
txtTotal.Text = _Model.Total != null ? _Model.Total.ToString() : string.Empty;
txtRealTotal.Text = _Model.RealTotal != null ? _Model.RealTotal.ToString() : string.Empty;
txtMemo.Text = _Model.Remark;
if (Convert.ToInt32(_Model.State) == (int)InvoiceState.Mail)
{
btnInvoiceFail.Hidden = false;
btnReceive.Hidden = false;
}
else
{
btnEdit.Hidden = true;
btnInvoiceFail.Hidden = true;
btnReceive.Hidden = true;
}
}
}
});
}
private void Search(Action<IQueryable<V_TB_INVOICE_DETAIL>> p_list)
{
string id = GetQueryValue("ID");
V_TB_INVOICE_DETAIL _tb = new V_TB_INVOICE_DETAIL();
_tb.InvcBillNum = id;
SCP_INVOICE_CONTROLLER.Get_V_TB_INVOICE_DETAIL_List(_tb, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
p_list(ret.Result);
}
});
}
public void BindData()
{
Search(ret =>
{
Grid1.RecordCount = ret.Count();
var list = SortAndPage<V_TB_INVOICE_DETAIL>(ret, Grid1);
foreach (V_TB_INVOICE_DETAIL rec in list)
{
rec.Qty = ToDecimal(rec.Qty, 2);
rec.CanQty = ToDecimal(rec.CanQty, 2);
}
var _lst = list.ToList();
Grid1.DataSource = _lst;
txtTAXOLD.Text = _lst.Sum(p => p.OLDTAX).ToString();
Grid1.DataBind();
});
}
public decimal ToDecimal(decimal num, int scale)
{
decimal tempOdds = Math.Round(num, scale);
return tempOdds;
}
//财务退回
protected void btnInvoiceFail_OnClick(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(
Window1.GetShowReference("../../WarehouseData/SCP_INVOICE_CHECKFAIL.aspx", "财务退回")
);
}
protected void Window1_OnClose(object sender, WindowCloseEventArgs e)
{
if (string.IsNullOrEmpty(e.CloseArgument))
{
Alert.Show("请输入退回原因");
return;
}
else
{
string Memo = e.CloseArgument;
string id = GetQueryValue("ID");
var ro = SCP_INVOICE_CONTROLLER.CaiWu_Return_Reason(id, Memo);
if (ro.State == ReturnStatus.Succeed)
{
Alert.Show("财务退回成功!");
if (CurrentUser.ConfigList.Keys.Contains("供应商邮件"))
{
SCP.Common.MailManager.SendMail(ro.Message, "财务退回成功", "财务退回成功");
}
GetInvoice();
BindData();
return;
}
else
{
Alert.Show("财务退回失败!");
return;
}
}
}
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
System.Web.UI.WebControls.Label _label = (System.Web.UI.WebControls.Label)Grid1.Rows[e.RowIndex].FindControl("Qty1");
if (!string.IsNullOrEmpty(_label.Text))
{
if (decimal.Parse(_label.Text) < 0)
{
_label.ForeColor = Color.Red;
}
}
}
protected void btnRecv_Click(object sender, EventArgs e)
{
if (dpUpdateTime.SelectedDate == null)
{
Alert.Show("请填写发票时间!");
return;
}
SET_INVOICE_STATE("财务手工接收发票", InvoiceState.CustomReceive);
}
}
}

287
SCP/Views/锦州锦恒/WarehouseData/SCP_INVOICE_DELTAIL.aspx.designer.cs

@ -0,0 +1,287 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..WarehouseData
{
public partial class SCP_INVOICE_DELTAIL
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// btnEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnEdit;
/// <summary>
/// btnInvoiceFail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnInvoiceFail;
/// <summary>
/// btnReceive 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnReceive;
/// <summary>
/// btnRecv 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRecv;
/// <summary>
/// txtBillNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBillNo;
/// <summary>
/// txtState 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtState;
/// <summary>
/// txtBillTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBillTime;
/// <summary>
/// txtSupplierName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtSupplierName;
/// <summary>
/// txtTax 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtTax;
/// <summary>
/// txtAmount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtAmount;
/// <summary>
/// txtTaxAmount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtTaxAmount;
/// <summary>
/// txtTotal 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtTotal;
/// <summary>
/// txtExtend1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox txtExtend1;
/// <summary>
/// txtExtend2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox txtExtend2;
/// <summary>
/// txtContractPrice1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox txtContractPrice1;
/// <summary>
/// txtRealTotal 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtRealTotal;
/// <summary>
/// txtInvoiceNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtInvoiceNumber;
/// <summary>
/// txtExpressNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtExpressNumber;
/// <summary>
/// dpUpdateTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker dpUpdateTime;
/// <summary>
/// txtMemo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtMemo;
/// <summary>
/// txtBlancePrice1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox txtBlancePrice1;
/// <summary>
/// txtTAXOLD 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label txtTAXOLD;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <summary>
/// tbxEditorName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label tbxEditorName;
/// <summary>
/// Qty1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Qty1;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
}
}

91
UniApiGroup/Controller/OdbcApiQadController.cs

@ -128,7 +128,7 @@ namespace CK.SCP.GrupUniApi.Controller
case QadTableName.xxqad_prh_det:
Console.WriteLine($"发现 QAD 接口数据:{qadCtrl.xxqad_table}:{qadCtrl.xxqad_table_qty}");
AddReceive(idb, wdb, qadCtrl.xxqad_seq,0 );
AddReject(idb, wdb, qadCtrl.xxqad_seq, 0);
AddReject(idb, wdb, qadCtrl.xxqad_seq, 1);
qadCtrl.xxqad_scm = ((int)UniApiState.).ToString();
EntitiesFactory.SaveDb(wdb);
EntitiesFactory.SaveDb(authdb);
@ -155,13 +155,13 @@ namespace CK.SCP.GrupUniApi.Controller
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
qadCtrl.xxqad_scm = ((int)UniApiState.).ToString();
qadCtrl.xxqad_rmks += " SCM:" + ex.Message;
qadCtrl.xxqad_rmks += " SCM:" + ex.Message+ex.InnerException.Message;
}
catch (Exception ex)
{
qadCtrl.xxqad_scm = ((int)UniApiState.).ToString();
qadCtrl.xxqad_rmks += " SCM:" + ex.Message;
qadCtrl.xxqad_rmks += " SCM:" + ex.Message + ex.InnerException.Message;
}
finally
@ -339,7 +339,7 @@ namespace CK.SCP.GrupUniApi.Controller
" MAX(xxqad_prh_uid)\n" +
" FROM [xxqad_prh_det] where xxqad_prh_seq='{0}' and xxqad_prh_qty_rcvd>=0\n" +
" GROUP BY\n" +
" [xxqad_prh_psnbr]\n" +
" [xxqad_prh_receiver]\n" +
" ,[xxqad_prh_po_nbr]\n" +
" ,[xxqad_prh_po_line]\n" +
" ,[xxqad_prh_part]\n" +
@ -349,26 +349,25 @@ namespace CK.SCP.GrupUniApi.Controller
var scpRcvList = new List<TB_RECEIVE_QAD>();
var scpRcveDetailList = new List<TB_RECEIVE_DETAIL_QAD>();
//根据xxwms_rc_po_nbr采购单字段去重
var qadReceiveNbrList = qadRcvDetailList.Where(p=> !string.IsNullOrEmpty(p.xxqad_prh_psnbr) )
.Select(p => p.xxqad_prh_psnbr.ToUpper()).DistinctBy(p => p).ToList();
var qadReceiveNbrList = qadRcvDetailList.Select(p => p.xxqad_prh_receiver.ToUpper()).DistinctBy(p => p).ToList();
int j = 0;
foreach (var qadRcvNbrList in qadReceiveNbrList)
foreach (var qadReceiveNbr in qadReceiveNbrList)
{
//qadRcvDetailList同一xxqad_prh_receiver所有记录
var qadDataList = qadRcvDetailList.Where(p => p.xxqad_prh_psnbr== qadRcvNbrList ).ToList();
var qadDataList = qadRcvDetailList.Where(p => p.xxqad_prh_receiver == qadReceiveNbr).ToList();
if (qadDataList.Count == 0)
{
continue;
}
var firstqadData = qadDataList[0];
var scpRcv = wdb.TB_RECEIVE_QAD.SingleOrDefault(p => p.RecvBillNum != null && p.RecvBillNum == qadRcvNbrList && p.Site == firstqadData.xxqad_prh_domain);
var scpRcv = wdb.TB_RECEIVE_QAD.SingleOrDefault(p => p.ErpRecvBillNum != null && p.ErpRecvBillNum == qadReceiveNbr && p.Site == firstqadData.xxqad_prh_domain);
//判断0100工厂的收货自动审核是否为允许
if (scpRcv == null)
{
scpRcv = new TB_RECEIVE_QAD
{
RecvBillNum = qadRcvNbrList,//彶億等瘍
ErpRecvBillNum = qadReceiveNbr,//彶億等瘍
State = (int)FormState.,
Remark = "",
CreateTime = firstqadData.xxqad_prh_createdt == null ? DateTime.Now : (DateTime)firstqadData.xxqad_prh_createdt,//创建日期
@ -376,18 +375,20 @@ namespace CK.SCP.GrupUniApi.Controller
IsDeleted = false,
GUID = System.Guid.NewGuid(),
BillType = billtype,
Site= firstqadData.xxqad_prh_domain,
SubSite = firstqadData.xxqad_prh_site,
};
}
scpRcv.PoBillNum = firstqadData.xxqad_prh_po_nbr;//采购单
//发货单号
scpRcv.Site = firstqadData.xxqad_prh_domain;//華萸
scpRcv.SubSite = firstqadData.xxqad_prh_site;
// scpRcv.Site = firstqadData.xxqad_prh_domain;//華萸
//scpRcv.SubSite = firstqadData.xxqad_prh_site;
scpRcv.VendId = firstqadData.xxqad_prh_vend;//供货商名称
scpRcv.ShipTime = firstqadData.xxqad_prh_date_ship;//收货日期
scpRcv.ErpRecvBillNum = firstqadData.xxqad_prh_receiver;
scpRcv.RecvBillNum = firstqadData.xxqad_prh_psnbr;
if (scpRcvList.Count(p =>
p.RecvBillNum == scpRcv.RecvBillNum &&
p.ErpRecvBillNum == scpRcv.ErpRecvBillNum &&
p.Site == scpRcv.Site
) == 0)
{
@ -402,7 +403,7 @@ namespace CK.SCP.GrupUniApi.Controller
var poLineNum = Convert.ToInt32(qadData.xxqad_prh_po_line);
var scpRcvDetail =
wdb.TB_RECEIVE_DETAIL_QAD.FirstOrDefault(
p => p.RecvBillNum == qadRcvNbrList &&
p => p.ErpRecvBillNum == qadReceiveNbr &&
p.PoBillNum == qadData.xxqad_prh_po_nbr &&
p.PoLine == poLineNum &&
p.PartCode == qadData.xxqad_prh_part &&
@ -413,8 +414,8 @@ namespace CK.SCP.GrupUniApi.Controller
{
scpRcvDetail = new TB_RECEIVE_DETAIL_QAD
{
ErpRecvBillNum = qadData.xxqad_prh_receiver,
RecvBillNum = qadRcvNbrList,//彶億等瘍
ErpRecvBillNum = qadReceiveNbr,
RecvBillNum = qadData.xxqad_prh_psnbr,//彶億等瘍
PoBillNum = qadData.xxqad_prh_po_nbr,//采购单
PoLine = poLineNum,//订单行
PartCode = qadData.xxqad_prh_part,//零件号
@ -424,7 +425,7 @@ namespace CK.SCP.GrupUniApi.Controller
LocUnit = qadData.xxqad_prh_loc_um,//基本单位
Qty = qadData.xxqad_prh_qty_rcvd,//收货总量
CurAmt = qadData.xxqad_prh_curr_amt != null ? qadData.xxqad_prh_curr_amt.Value : 0,
//DockCode = ?,//彶億諳
DockCode = qadData.xxqad_prh_loc,//彶億諳
State = (int)FormState.,// (int)FormState.关闭,
CreateTime = qadData.xxqad_prh_createdt == null ? DateTime.Now : (DateTime)qadData.xxqad_prh_createdt,//创建日期
CreateUser = qadData.xxqad_prh_createur,//创建用户
@ -435,18 +436,19 @@ namespace CK.SCP.GrupUniApi.Controller
StdCost = qadData.xxqad_prh_std_cost != null ? qadData.xxqad_prh_std_cost.Value : 0,
Rate = qadData.xxqad_prh_curr_rate != null ? qadData.xxqad_prh_curr_rate.Value : 1,
Site = qadData.xxqad_prh_domain,
Tax = firstqadData.xxqad_prh_taxc
Tax = firstqadData.xxqad_prh_taxc,
SubSite = qadData.xxqad_prh_site,
};
}
scpRcvDetail.ErpRecvBillNum = !string.IsNullOrEmpty(qadData.xxqad_prh_receiver) ? qadData.xxqad_prh_receiver : string.Empty;
scpRcvDetail.RecvBillNum = !string.IsNullOrEmpty(qadData.xxqad_prh_psnbr) ? qadData.xxqad_prh_psnbr : string.Empty;
scpRcvDetail.CurAmt = qadData.xxqad_prh_curr_amt != null ? qadData.xxqad_prh_curr_amt.Value : 0;
scpRcvDetail.PurCost = qadData.xxqad_prh_pur_cost;
scpRcvDetail.StdCost = qadData.xxqad_prh_std_cost != null ? qadData.xxqad_prh_std_cost.Value : 0;
scpRcvDetail.Rate = qadData.xxqad_prh_curr_rate != null ? qadData.xxqad_prh_curr_rate.Value : 1;
scpRcvDetail.Site = qadData.xxqad_prh_domain;
scpRcvDetail.SubSite = qadData.xxqad_prh_site;
//scpRcvDetail.Site = qadData.xxqad_prh_domain;
//scpRcvDetail.SubSite = qadData.xxqad_prh_site;
scpRcvDetail.Tax = firstqadData.xxqad_prh_taxc;
if (scpRcveDetailList.Count(p =>
p.RecvBillNum == scpRcvDetail.RecvBillNum &&
@ -490,7 +492,7 @@ namespace CK.SCP.GrupUniApi.Controller
" MAX(xxqad_prh_uid)\n" +
" FROM [xxqad_prh_det] where xxqad_prh_seq='{0}' and xxqad_prh_qty_rcvd<0 \n" +
" GROUP BY\n" +
" [xxqad_prh_psnbr]\n" +
" [xxqad_prh_receiver]\n" +
" ,[xxqad_prh_po_nbr]\n" +
" ,[xxqad_prh_po_line]\n" +
" ,[xxqad_prh_part]\n" +
@ -500,25 +502,19 @@ namespace CK.SCP.GrupUniApi.Controller
var scpRcvList = new List<TB_RECEIVE_QAD>();
var scpRcveDetailList = new List<TB_RECEIVE_DETAIL_QAD>();
//根据xxwms_rc_po_nbr采购单字段去重
var qadReceiveNbrList = qadRcvDetailList.Where(p => !string.IsNullOrEmpty(p.xxqad_prh_psnbr) )
.Select(p => p.xxqad_prh_psnbr.ToUpper()).DistinctBy(p => p).ToList();
var qadReceiveNbrList = qadRcvDetailList.Select(p => p.xxqad_prh_receiver.ToUpper()).DistinctBy(p => p).ToList();
foreach (var qadRcvNbrList in qadReceiveNbrList)
foreach (var qadReceiveNbr in qadReceiveNbrList)
{
var _first= wdb.TB_RECEIVE_DETAIL_QAD.Where(p => p.RecvBillNum == qadRcvNbrList).FirstOrDefault();
if(_first!=null && _first.Qty>0)
{
continue;
}
//qadRcvDetailList同一xxqad_prh_receiver所有记录
var qadDataList = qadRcvDetailList.Where(p => p.xxqad_prh_psnbr == qadRcvNbrList).ToList();
var qadDataList = qadRcvDetailList.Where(p => p.xxqad_prh_receiver == qadReceiveNbr).ToList();
if (qadDataList.Count == 0)
{
continue;
}
var firstqadData = qadDataList[0];
var scpRcv = wdb.TB_RECEIVE_QAD.FirstOrDefault(p => p.RecvBillNum != null && p.RecvBillNum == qadRcvNbrList && p.Site == firstqadData.xxqad_prh_domain);
var scpRcv = wdb.TB_RECEIVE_QAD.FirstOrDefault(p => p.ErpRecvBillNum != null && p.ErpRecvBillNum == qadReceiveNbr && p.Site == firstqadData.xxqad_prh_domain);
//判断0100工厂的收货自动审核是否为允许
@ -526,7 +522,7 @@ namespace CK.SCP.GrupUniApi.Controller
{
scpRcv = new TB_RECEIVE_QAD
{
RecvBillNum = qadRcvNbrList,//彶億等瘍
ErpRecvBillNum = qadReceiveNbr,//彶億等瘍
State = (int)FormState.,
Remark = "",
CreateTime = firstqadData.xxqad_prh_createdt == null ? DateTime.Now : (DateTime)firstqadData.xxqad_prh_createdt,//创建日期
@ -534,14 +530,16 @@ namespace CK.SCP.GrupUniApi.Controller
IsDeleted = false,
GUID = System.Guid.NewGuid(),
BillType = billtype,
Site= firstqadData.xxqad_prh_domain,
SubSite = firstqadData.xxqad_prh_site,
};
}
scpRcv.PoBillNum = firstqadData.xxqad_prh_po_nbr;//采购单 //发货单号
scpRcv.Site = firstqadData.xxqad_prh_domain;//華萸
scpRcv.SubSite = firstqadData.xxqad_prh_site;//華萸
//scpRcv.Site = firstqadData.xxqad_prh_domain;//華萸
//scpRcv.SubSite = firstqadData.xxqad_prh_site;//華萸
scpRcv.VendId = firstqadData.xxqad_prh_vend;//供货商名称
scpRcv.ShipTime = firstqadData.xxqad_prh_date_ship;//收货日期
scpRcv.ErpRecvBillNum = firstqadData.xxqad_prh_receiver;
scpRcv.RecvBillNum = firstqadData.xxqad_prh_psnbr;
scpRcvList.Add(scpRcv);
scpRcv.Tax = firstqadData.xxqad_prh_taxc;
foreach (var qadData in qadDataList)
@ -551,7 +549,7 @@ namespace CK.SCP.GrupUniApi.Controller
var poLineNum = Convert.ToInt32(qadData.xxqad_prh_po_line);
var scpRcvDetail =
wdb.TB_RECEIVE_DETAIL_QAD.SingleOrDefault(
p => p.RecvBillNum == qadRcvNbrList &&
p => p.ErpRecvBillNum == qadReceiveNbr &&
p.PoBillNum == qadData.xxqad_prh_po_nbr &&
p.PoLine == poLineNum &&
p.PartCode == qadData.xxqad_prh_part
@ -563,8 +561,8 @@ namespace CK.SCP.GrupUniApi.Controller
scpRcvDetail = new TB_RECEIVE_DETAIL_QAD
{
ErpRecvBillNum = qadData.xxqad_prh_receiver,
RecvBillNum = qadRcvNbrList,//彶億等瘍
ErpRecvBillNum = qadReceiveNbr,
RecvBillNum = qadData.xxqad_prh_psnbr,//彶億等瘍
PoBillNum = qadData.xxqad_prh_po_nbr,//采购单
PoLine = poLineNum,//订单行
PartCode = qadData.xxqad_prh_part,//零件号
@ -574,7 +572,7 @@ namespace CK.SCP.GrupUniApi.Controller
LocUnit = qadData.xxqad_prh_loc_um,//基本单位
Qty = qadData.xxqad_prh_qty_rcvd,//收货总量
CurAmt = qadData.xxqad_prh_curr_amt != null ? qadData.xxqad_prh_curr_amt.Value : 0,
//DockCode = ?,//彶億諳
DockCode = qadData.xxqad_prh_loc,//彶億諳
State = (int)FormState.,// (int)FormState.关闭,
CreateTime = qadData.xxqad_prh_createdt == null ? DateTime.Now : (DateTime)qadData.xxqad_prh_createdt,//创建日期
CreateUser = qadData.xxqad_prh_createur,//创建用户
@ -590,13 +588,13 @@ namespace CK.SCP.GrupUniApi.Controller
};
}
scpRcvDetail.ErpRecvBillNum = !string.IsNullOrEmpty(qadData.xxqad_prh_receiver) ? qadData.xxqad_prh_receiver : string.Empty;
scpRcvDetail.RecvBillNum = !string.IsNullOrEmpty(qadData.xxqad_prh_psnbr) ? qadData.xxqad_prh_psnbr : string.Empty;
scpRcvDetail.PurCost = qadData.xxqad_prh_pur_cost;
scpRcvDetail.StdCost = qadData.xxqad_prh_std_cost != null ? qadData.xxqad_prh_std_cost.Value : 0;
scpRcvDetail.Rate = qadData.xxqad_prh_curr_rate != null ? qadData.xxqad_prh_curr_rate.Value : 1;
scpRcvDetail.CurAmt = qadData.xxqad_prh_curr_amt != null ? qadData.xxqad_prh_curr_amt.Value : 0;
scpRcvDetail.Site = qadData.xxqad_prh_domain;
scpRcvDetail.SubSite = qadData.xxqad_prh_domain;
//scpRcvDetail.Site = qadData.xxqad_prh_domain;
//scpRcvDetail.SubSite = qadData.xxqad_prh_domain;
scpRcveDetailList.Add(scpRcvDetail);
qadData.xxqad_prh_scmread = ((int)UniApiState.).ToString();
@ -612,7 +610,7 @@ namespace CK.SCP.GrupUniApi.Controller
}
wdb.TB_RECEIVE_QAD.AddOrUpdate(scpRcvList.ToArray());
wdb.TB_RECEIVE_DETAIL_QAD.AddOrUpdate(scpRcveDetailList.ToArray());
Console.WriteLine($"載陔 億等 杅擂ㄩ{qadRcvDetailList.Count}");
Console.WriteLine($"載陔 億等 杅擂ㄩ{qadRcvDetailList.Count}");
}
/// <summary>
/// 更新采购订单
@ -1303,7 +1301,8 @@ namespace CK.SCP.GrupUniApi.Controller
if (_first != null)
{
var _ef= authdb.VenderUsers.FirstOrDefault(p => p.VenderId == qadData.xxqad_vd_addr && p.UserId == _first.ID)??new VenderUsers() {
var _ef= authdb.VenderUsers.FirstOrDefault(p => p.VenderId == qadData.xxqad_vd_addr && p.UserId == _first.ID)??new VenderUsers()
{
UserId=_first.ID,
VenderId=qadData.xxqad_vd_addr.ToUpper()
};

9
UniApiGroup/Controller/OdbcApiScpController.cs

@ -310,7 +310,7 @@ namespace CK.SCP.GrupUniApi.Controller
qadData.xxscm_inv_domain = p.Domain;
qadData.xxscm_inv_amt = Math.Round(p.Price * p.Qty, 2);
qadData.xxscm_inv_asn = p.SourceBillNum;
qadData.xxscm_inv_curr = p.Currency;
qadData.xxscm_inv_curr = p.Currency==null? "CNY" : p.Currency;
qadData.xxscm_inv_vend = p.VendId;
qadData.xxscm_inv_project = p.VendBatch;//代替项目传值
qadData.xxscm_inv_line = p.ErpLineNum;
@ -326,9 +326,10 @@ namespace CK.SCP.GrupUniApi.Controller
qadData.xxscm_inv_date = _invoice.UpdateTime == null ? _invoice.CreateTime.Value.AddDays(1) : _invoice.UpdateTime.Value;
qadData.xxscm_inv_totamt = _invoice.Amount.Value;
qadData.xxscm_inv_tottax = _invoice.Total.Value;
qadData.xxscm_inv_totdiscount = (_invoice.ContractPrice == null ? 0 : _invoice.ContractPrice.Value)+
(_invoice.DiscountPrice == null ? 0 : _invoice.DiscountPrice.Value);
qadData.xxscm_inv_tottaxvar = (_invoice.BlancePrice == null ? 0 : _invoice.BlancePrice.Value);
qadData.xxscm_inv_totdiscount = _invoice.ContractPrice == null ? 0 : _invoice.ContractPrice.Value;
qadData.xxscm_inv_tottaxvar = _invoice.BlancePrice == null ? 0 : _invoice.BlancePrice.Value;
qadData.xxscm_inv_extend1 = _invoice.Extend1 == null ? 0 : _invoice.Extend1.Value;
qadData.xxscm_inv_extend2 = _invoice.Extend2 == null ? 0 : _invoice.Extend2.Value;
qadDataList.Add(qadData);
p.State = (int)BillState.Finish;
p.PutTime = DateTime.Now;

168
UniApiGroup/Controller/OdbcApiWmsController.cs

@ -23,8 +23,8 @@ namespace CK.SCP.GrupUniApi.Controller
var tableNameList = EnumHelper.EnumToList<WmsTableName>();
List<string> _lst = new List<string>();
_lst.Add("xxwms_rc_det");
_lst.Add("xxwms_rct_det");
_lst.Add("xxwms_rt_det");
_lst.Add("xxwms_arv_det");
_lst.Add("xxwms_qua_det");
_lst.Add("xxwms_review_det");
@ -87,6 +87,7 @@ namespace CK.SCP.GrupUniApi.Controller
{
Console.WriteLine($"发现 WMS 接口数据:{wmsCtrl.xxwms_table}:{wmsCtrl.xxwms_table_qty}");
AddMaterialReceive(idb, wdb, wmsCtrl.xxwms_seq, 0);//xxwms_seq:流水号
AddMaterialReturn_RC(idb, wdb, wmsCtrl.xxwms_seq, 1);//xxwms_seq:流水号
}
break;
case WmsTableName.xxwms_rt_det:
@ -204,7 +205,7 @@ namespace CK.SCP.GrupUniApi.Controller
private static void AddMaterialReceive(UniApiEntities idb, ScpEntities wdb, string seq, int billtype)
{
var qadRcvDetailList = idb.xxwms_rc_det.Where(p => p.xxwms_rc_seq == seq).ToList();
var qadRcvDetailList = idb.xxwms_rc_det.Where(p => p.xxwms_rc_seq == seq&&p.xxwms_rc_qty_total>=0).ToList();
var scpRcvList = new List<TB_RECEIVE>();
var scpRcveDetailList = new List<TB_RECEIVE_DETAIL>();
@ -328,7 +329,7 @@ namespace CK.SCP.GrupUniApi.Controller
PoUnit = qadData.xxwms_rc_po_um,//采购单位
LocUnit = qadData.xxwms_rc_loc_um,//基本单位
Qty = qadData.xxwms_rc_qty_total,//收货总量
//DockCode = ?,//ÊÕ»õ¿Ú
DockCode = qadData.xxwms_rc_loc,//收货口
State = istate,// (int)FormState.关闭,
Site = firstqadData.xxwms_rc_domain,
SubSite = !string.IsNullOrEmpty(firstqadData.xxwms_rc_site) ? firstqadData.xxwms_rc_site : firstqadData.xxwms_rc_domain,
@ -382,6 +383,167 @@ namespace CK.SCP.GrupUniApi.Controller
Console.WriteLine($"更新 收货单 数据:{qadRcvDetailList.Count}");
}
/// <summary>
/// 接收退货单
/// </summary>
private static void AddMaterialReturn_RC(UniApiEntities idb, ScpEntities wdb, string seq, int billtype)
{
var qadRcvDetailList = idb.xxwms_rc_det.Where(p => p.xxwms_rc_seq == seq && p.xxwms_rc_qty_total < 0).ToList();
var scpRcvList = new List<TB_RECEIVE>();
var scpRcveDetailList = new List<TB_RECEIVE_DETAIL>();
//根据xxqad_prh_receiver字段去重
var qadReceiveNbrList = qadRcvDetailList.Select(p => p.xxwms_rc_nbr.ToUpper()).DistinctBy(p => p);
foreach (var qadRcvNbrList in qadReceiveNbrList)
{
//qadRcvDetailList同一xxqad_prh_receiver所有记录
var qadDataList = qadRcvDetailList.Where(p => p.xxwms_rc_nbr == qadRcvNbrList).ToList();
if (qadDataList.Count == 0)
{
continue;
}
var firstqadData = qadDataList[0];
var scpRcv = wdb.TB_RECEIVE.SingleOrDefault(p => p.RecvBillNum == qadRcvNbrList && p.Site == firstqadData.xxwms_rc_domain);
//判断0100工厂的收货自动审核是否为允许
bool isRerviceOk = false;
if (!string.IsNullOrEmpty(firstqadData.xxwms_rc_domain))
{
string site = firstqadData.xxwms_rc_domain;//0100
List<TA_FACTORY_CONFIG> configs = wdb.TA_FACTORY_CONFIG.Where(p => p.FactoryId == site).ToList();
foreach (TA_FACTORY_CONFIG cfg in configs)
{
TA_CONFIG tacfg = wdb.TA_CONFIG.Where(p => p.UID == cfg.ConfigId).SingleOrDefault();
if (tacfg != null && !string.IsNullOrEmpty(tacfg.ParamName) && tacfg.ParamName == "收货自动审核")
{
if ("允许" == tacfg.ParamValue)
{
isRerviceOk = true;
}
}
}
}
if (scpRcv == null)
{
int istate = 0;
if (isRerviceOk == false)
{
istate = (int)FormState.;
}
else
{
istate = (int)FormState.;
}
scpRcv = new TB_RECEIVE
{
RecvBillNum = qadRcvNbrList,//退货单号
State = istate,
Remark = "",
Site = firstqadData.xxwms_rc_domain,
CreateTime = firstqadData.xxwms_rc_createdt == null ? DateTime.Now : (DateTime)firstqadData.xxwms_rc_createdt,//创建日期
CreateUser = firstqadData.xxwms_rc_createur,//创建用户
IsDeleted = false,
GUID = System.Guid.NewGuid(),
BillType = billtype
};
scpRcvList.Add(scpRcv);
}
scpRcv.PoBillNum = firstqadData.xxwms_rc_po_nbr;//采购单
//scpRcv.AsnBillNum = firstqadData.xxqad_prh_psnbr;//发货单号
scpRcv.Site = firstqadData.xxwms_rc_domain;//地点
scpRcv.VendId = firstqadData.xxwms_rc_vend;//供货商名称
scpRcv.ShipTime = firstqadData.xxwms_rc_date_ship;//收货日期
scpRcv.SubSite = !string.IsNullOrEmpty(firstqadData.xxwms_rc_site) ? firstqadData.xxwms_rc_site : firstqadData.xxwms_rc_domain;
//var scpAsn = wdb.TF_ASN.FirstOrDefault(p => p.BillNum == scpRcv.AsnBillNum);
var scpAsn = wdb.TB_ASN.FirstOrDefault(p => p.PoBillNum == scpRcv.AsnBillNum);//发货单主表订单号==退货单主表发货单号
if (scpAsn != null)
scpAsn.State = (int)ShipState.Reject;
foreach (var qadData in qadDataList)
{
try
{
var poLineNum = Convert.ToInt32(qadData.xxwms_rc_po_line);
var scpRcvDetail =
wdb.TB_RECEIVE_DETAIL.SingleOrDefault(
p => p.RecvBillNum == qadRcvNbrList &&
p.PoBillNum == qadData.xxwms_rc_po_nbr &&
p.PoLine == poLineNum &&
p.PartCode == qadData.xxwms_rc_part &&
p.Batch == qadData.xxwms_rc_lot);
if (scpRcvDetail == null)
{
int istate = 0;
if (isRerviceOk == false)
{
istate = (int)FormState.;
}
else
{
istate = (int)FormState.;
}
scpRcvDetail = new TB_RECEIVE_DETAIL
{
RecvBillNum = qadRcvNbrList,//退货单号码
PoBillNum = qadData.xxwms_rc_po_nbr,//采购单
PoLine = poLineNum,//订单行
PartCode = qadData.xxwms_rc_part,//物料号
Batch = qadData.xxwms_rc_lot,//批次
VendBatch = qadData.xxwms_rc_vend_batch,//供应商批号
PoUnit = qadData.xxwms_rc_po_um,//采购单位
LocUnit = qadData.xxwms_rc_loc_um,//基本单位
Qty = qadData.xxwms_rc_qty_total,//退货总量
DockCode = qadData.xxwms_rc_loc,//收货口
State = istate,// (int)FormState.关闭,
Site = firstqadData.xxwms_rc_domain,
SubSite = firstqadData.xxwms_rc_site,
CreateTime = qadData.xxwms_rc_createdt == null ? DateTime.Now : (DateTime)qadData.xxwms_rc_createdt,//创建日期
CreateUser = qadData.xxwms_rc_createur,//创建用户
IsDeleted = false,
GUID = System.Guid.NewGuid(),
BillType = billtype
};
scpRcveDetailList.Add(scpRcvDetail);
}
//var scpPoDetail =
// wdb.TB_PO_DETAIL.FirstOrDefault(
// p => p.PoBillNum == qadData.xxwms_rt_po_nbr && p.PoLine == poLineNum);
//if (scpPoDetail != null)
//{
// //订单明细RejectQty已退数量 += 退货明细Qty已结束量
// scpPoDetail.RejectQty -= scpRcvDetail.Qty;
//}
//var scpPo = wdb.TB_PO.FirstOrDefault(p => p.ErpBillNum == qadData.xxwms_rt_po_nbr);
//if (scpPo != null)
//{
// //订单明细
// var scpPoDetails = wdb.TB_PO_DETAIL.Where(p => p.PoBillNum == qadData.xxwms_rt_po_nbr);
// //if (scpPoDetails.All(p => p.BillQty == p.ReceivedQty))
// // scpPo.State = (int)PlanState.Complete;
// if (scpPoDetails.All(p => p.PlanQty == p.ReceivedQty)) //订货数量==已收数量
// scpPo.State = (int)PlanState.Complete;
//}
qadData.xxwms_rc_wmsread = ((int)UniApiState.).ToString();
}
catch (Exception ex)
{
qadData.xxwms_rc_wmsread = ((int)UniApiState.).ToString();
qadData.xxwms_rc_rmks += " SCM:" + ex.Message;
}
qadData.xxwms_rc_updateur = ScpCache.Config.SCP用户名;
qadData.xxwms_rc_updatedt = DateTime.Now;
}
}
wdb.TB_RECEIVE.AddOrUpdate(scpRcvList.ToArray());
wdb.TB_RECEIVE_DETAIL.AddOrUpdate(scpRcveDetailList.ToArray());
Console.WriteLine($"更新 退货单 数据:{qadRcvDetailList.Count}");
}
#region WMS库存质量
private static void AddMaterialQuality(UniApiEntities idb, ScpEntities sdb, string seq)
{

Loading…
Cancel
Save