CveSubProyecto y filtros en el reporte de exportaciones.

This commit is contained in:
SLopez
2025-07-05 08:56:18 -07:00
parent b633f775cc
commit dfdaedb83c
5 changed files with 343 additions and 195 deletions

View File

@@ -120,7 +120,8 @@ Public Class ClsExportaciones
End Sub
#Region "EXPORTACIONES"
Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional EsExportacion As Boolean = True, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha) As Boolean
Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional EsExportacion As Boolean = True, Optional FechaInicio As Date = MinFecha,
Optional FechaFin As Date = MaxFecha, Optional CveSubProyecto As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesRep")
With SqlAdapter.SelectCommand.Parameters
@@ -129,6 +130,7 @@ Public Class ClsExportaciones
.Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto
End With
Try
SqlAdapter.Fill(Data)
@@ -139,14 +141,15 @@ Public Class ClsExportaciones
Return Retorno
End Function
Public Function AddExportacion(NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, TipoExportacion As Integer, CveExportacionEstatus As Integer,
CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer, ClaveAduana As Integer,
CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, Sello2 As String, Sello3 As String, SCAC As String,
CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer, CveDirConsignatario As Integer,
Public Function AddExportacion(CveSubProyecto As Integer, NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, TipoExportacion As Integer,
CveExportacionEstatus As Integer, CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer,
ClaveAduana As Integer, CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, Sello2 As String, Sello3 As String,
SCAC As String, CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer, CveDirConsignatario As Integer,
CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean, EsExportacion As Boolean) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Exp_ExportacionesAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@NumeroPedimento", SqlDbType.VarChar).Value = NumeroPedimento
.Add("@FechaPedimento", SqlDbType.Date).Value = FechaPedimento
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
@@ -191,15 +194,16 @@ Public Class ClsExportaciones
Return Retorno
End Function
Public Function UpdateExportacion(CveExportacion As Integer, NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, TipoExportacion As Integer, CveExportacionEstatus As Integer,
CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer, ClaveAduana As Integer,
CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, Sello2 As String, Sello3 As String, SCAC As String,
CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer, CveDirConsignatario As Integer,
CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean) As Boolean
Public Function UpdateExportacion(CveExportacion As Integer, CveSubProyecto As Integer, NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal,
TipoExportacion As Integer, CveExportacionEstatus As Integer, CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer,
CveAgente As Integer, ClaveAduana As Integer, CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, Sello2 As String,
Sello3 As String, SCAC As String, CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer,
CveDirConsignatario As Integer, CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@NumeroPedimento", SqlDbType.VarChar).Value = NumeroPedimento
.Add("@FechaPedimento", SqlDbType.Date).Value = FechaPedimento
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta

View File

@@ -23,6 +23,10 @@
<asp:UpdatePanel ID="UpFactura" runat="server">
<ContentTemplate>
<div style="display: flex; align-items: center; gap: 10px; width: 100%;">
<div class="form-group form-md-line-input input-iconright" style="width: 200px;">
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto"></asp:DropDownList>
<label for="<%= DdlSubProyecto.ClientID.ToString()%>">Sub Proyecto:</label>
</div>
<div class="form-group form-md-line-input input-iconright" style="width: 200px;">
<asp:DropDownList ID="DdlVentas" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Folio" DataValueField="CveVenta" AutoPostBack="true" OnSelectedIndexChanged="DdlVentas_SelectedIndexChanged"></asp:DropDownList>
<label for="<%= DdlVentas.ClientID.ToString()%>">Número de Factura:</label>
@@ -616,81 +620,83 @@
<asp:Button runat="server" ID="BtnAgregarPartida" OnClick="BtnAgregarPartida_Click" Text="Agregar Partida" CssClass="btn btn-primary" style="margin-top: 5px;" />
<br />
<br />
<asp:GridView ID="GVPartidas" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CveExportacionDetalle" OnRowCommand="GVPartidas_RowCommand" ShowFooter="true" OnRowDataBound="GVPartidas_RowDataBound" Width="100%" EmptyDataText="No se encontraron Partidas" ToolTip="Partidas" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns>
<%--asp:TemplateField HeaderText="Id" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:LinkButton ID="LnkExpDetalle" runat="server" Text='<%# Eval("CveExportacionDetalle") %>' CommandName="EditarPartida" CommandArgument='<%# Eval("CveExportacionDetalle") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField--%>
<asp:TemplateField HeaderText="Producto / Servicio" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblPS" runat="server" Text='<%# Eval("PSCodigo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="País de Origen" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblPaisOrigen" runat="server" Text='<%# Eval("ClaveSATPais")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Unidad de Medida" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblUM" runat="server" Text='<%# Eval("UnidadMedida")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Valor Total USD" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblPrecio" runat="server" Text='<%# Eval("Precio", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Valor Total MXP" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblValorTotalMXP" runat="server" Text='<%# Eval("ValorTotalMXP", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total de Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblTotalEmpaque" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fracción Arancelaria" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblFraccAran" runat="server" Text='<%# Eval("FraccionArancelaria")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Unidad Aduana" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblUnidadAduana" runat="server" Text='<%# Eval("UnidadAduana")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad Exportada" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Peso Unit. KG" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblPesoUnitario" runat="server" Text='<%# Eval("PesoUnitario", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Peso Bruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblPesoBruto" runat="server" Text='<%# Eval("PesoBruto", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<div style="overflow-x: auto; width: 1235px;">
<asp:GridView ID="GVPartidas" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CveExportacionDetalle" OnRowCommand="GVPartidas_RowCommand" ShowFooter="true" OnRowDataBound="GVPartidas_RowDataBound" Width="100%" EmptyDataText="No se encontraron Partidas" ToolTip="Partidas" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns>
<%--asp:TemplateField HeaderText="Id" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:LinkButton ID="LnkExpDetalle" runat="server" Text='<%# Eval("CveExportacionDetalle") %>' CommandName="EditarPartida" CommandArgument='<%# Eval("CveExportacionDetalle") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField--%>
<asp:TemplateField HeaderText="Producto / Servicio" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblPS" runat="server" Text='<%# Eval("PSCodigo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="País de Origen" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblPaisOrigen" runat="server" Text='<%# Eval("ClaveSATPais")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Unidad de Medida" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblUM" runat="server" Text='<%# Eval("UnidadMedida")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Valor Total USD" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblPrecio" runat="server" Text='<%# Eval("Precio", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Valor Total MXP" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblValorTotalMXP" runat="server" Text='<%# Eval("ValorTotalMXP", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total de Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblTotalEmpaque" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fracción Arancelaria" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblFraccAran" runat="server" Text='<%# Eval("FraccionArancelaria")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Unidad Aduana" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblUnidadAduana" runat="server" Text='<%# Eval("UnidadAduana")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad Exportada" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Peso Unit. KG" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblPesoUnitario" runat="server" Text='<%# Eval("PesoUnitario", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Peso Bruto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblPesoBruto" runat="server" Text='<%# Eval("PesoBruto", "{0:#,###.####}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditarPartida" CommandName="EditarPartida" CommandArgument='<%# Eval("CveExportacionDetalle") %>' CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarPartida" runat="server" CommandName="EliminarPartida" CommandArgument='<%# Eval("CveExportacionDetalle") %>' CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la Partida?" data-btn-ok-label="Sí" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditarPartida" CommandName="EditarPartida" CommandArgument='<%# Eval("CveExportacionDetalle") %>' CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarPartida" runat="server" CommandName="EliminarPartida" CommandArgument='<%# Eval("CveExportacionDetalle") %>' CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la Partida?" data-btn-ok-label="Sí" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>

View File

@@ -66,11 +66,18 @@ public partial class Export_ExpDetalle : ClsPaginas
protected void InicializarValores()
{
int CveEmpresa = UsuarioActual.CveEmpresa;
int CveUsuario = UsuarioActual.CveUsuario;
// Sub Proyecto
DdlSubProyecto.Items.Clear();
DdlSubProyecto.DataSource = get_GlobalDTSubProyectosUsuarios(CveUsuario, -1, CveEmpresa);
DdlSubProyecto.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlSubProyecto.DataBind();
// Factura
ClsVentas Ventas = new ClsVentas();
// El problema es que solo se obtienen los registros donde CveUsuarioConsulta = Sis_UsuariosSubProyectos.CveUsuario en la BD
if (Ventas.GetVentas(CveEmpresa, "-1", "-1", -1, "-1", -1, -1, -1, -1, DateTime.Today.AddMonths(-1).ToString(), ModExtensiones.MaxFecha.ToString(), "-1", CveUsuarioConsulta: UsuarioActual.CveUsuario))
if (Ventas.GetVentas(CveEmpresa, "-1", "-1", -1, "-1", -1, -1, -1, -1, DateTime.Today.AddMonths(-1).ToString(), ModExtensiones.MaxFecha.ToString(), "-1", CveUsuarioConsulta: CveUsuario))
{
DdlVentas.Items.Clear();
DdlVentas.DataSource = Ventas.DtResultados;
@@ -137,6 +144,8 @@ public partial class Export_ExpDetalle : ClsPaginas
{
LblExp.Text = DTExportaciones.FiltroPrimeroValor("CveExportacion");
DdlSubProyecto.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveSubProyecto");
string CveVenta = DTExportaciones.FiltroPrimeroValor("CveVenta");
if (CveVenta != "" && CveVenta != "-1")
{
@@ -345,6 +354,7 @@ public partial class Export_ExpDetalle : ClsPaginas
}
string ITN = TxtITN.Text;
int CveSubProyecto = DdlSubProyecto.Text.ToEntero();
string NumeroPedimento = TxtNumPed.Text;
DateTime FechaPedimento = TxtFechaPedim.Text.ToDate();
int CveVenta = DdlVentas.Text.ToEntero();
@@ -388,6 +398,7 @@ public partial class Export_ExpDetalle : ClsPaginas
if (CveExportacion == -1)
{
int ExportacionGuardada = Exportaciones.AddExportacion(
CveSubProyecto,
NumeroPedimento,
FechaPedimento,
CveVenta,
@@ -467,6 +478,7 @@ public partial class Export_ExpDetalle : ClsPaginas
{
bool Continuar = Exportaciones.UpdateExportacion(
CveExportacion,
CveSubProyecto,
NumeroPedimento,
FechaPedimento,
CveVenta,

View File

@@ -4,6 +4,56 @@
<!--link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" /-->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
<style>
.btnopaco {
background-color: rgba(0,0,0,0.2);
color: #FFF;
}
.btnopaco:hover {
background-color: rgba(0,0,0,0.4);
color: #FFF;
font-weight: bold;
}
.select2 .select2-selection__rendered {
line-height: 1;
color: #111;
}
.select2 .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 20px;
user-select: none;
-webkit-user-select: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
margin-top: 10px;
}
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.select2-selection {
margin-top: 0px;
height: 31px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
outline: 0;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Exportaciones
@@ -18,125 +68,176 @@
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="upDatosExp" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light portlet xspadding bordered " style="margin-bottom: 0px; padding: 8px;" id="form_wizard_1">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject font-green bold uppercase">Información
<asp:Literal ID="LtlPeriodoseleccionado" runat="server"></asp:Literal></span>
</div>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<%--asp:Literal ID="LtlPeriodoseleccionado" runat="server"></asp:Literal--%>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<%--<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>--%>
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
<%--a href="javascript:;" class="expand"></a--%>
</div>
<div class="actions">
<div class="titlefiltros caption">
<div class="row" style="height: 32px;">
<asp:Label ID="LblProyecto" runat="server" class="col-md-1 truncate">Proyecto:</asp:Label>
<div runat="server" id="DivProyecto" class="col-md-2">
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 100%;"></asp:DropDownList>
</div>
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
<div runat="server" id="DivSubProyecto" class="col-md-2">
<asp:ListBox ID="DdlSubProyecto" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
</div>
<div class="col-md-1 truncate">
Fecha Inicio:
</div>
<div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1 truncate">
Fecha Fin:
</div>
<div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<%--div class="tools">
<div class="btn-group">
<div>
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVExportaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVExportaciones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div--%>
</div>
<%--div class="portlet-body" style="display: none">
<div class="row">
<label class="col-md-1 truncate">Relación:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTipoRelacion" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="SATTipoRelacion" DataValueField="CveTipoRelacion">
</asp:DropDownList>
</div>
</div>
</div>
<div class="portlet-body form">
<asp:GridView ID="GVExportaciones" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CveExportacion" Width="100%" EmptyDataText="No se encontraron Exportaciones" ToolTip="Exportaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Exportación" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:HyperLink ID="HlExpDetalle" runat="server" Text='<%# Eval("CveExportacion") %>' NavigateUrl='<%# Eval("CveExportacion", "ExpDetalle.aspx?CveExportacion={0}") %>'>></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="Fecha de Ingreso" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblUsuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Número de Factura" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblNumFact" runat="server" Text='<%# Eval("SerieFolio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha de Factura" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblFechaFact" runat="server" Text='<%# Eval("FechaFact", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo de Cambio" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblTipoCambio" runat="server" Text='<%# Eval("TipoCambio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Exportación" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblTipoExp" runat="server" Text='<%# Eval("TipoExportacion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblEstatus" runat="server" Text='<%# Eval("CveExportacionEstatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Número de Pedimento" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblNumeroPedimento" runat="server" Text='<%# Eval("NumeroPedimento")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Pedimento" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblFechaPedimento" runat="server" Text='<%# Eval("FechaPedimento", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre Exportador" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblClienteExp" runat="server" Text='<%# Eval("ClienteExportador")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC Importador" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblRFCImp" runat="server" Text='<%# Eval("RFCImp")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre Importador" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblClienteImp" runat="server" Text='<%# Eval("ClienteImportador")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC Consignatario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblRFCCon" runat="server" Text='<%# Eval("RFCCon")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre Consignatario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblClienteCon" runat="server" Text='<%# Eval("ClienteConsignatario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="EditarExp_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminar" runat="server" OnClick="EliminarExp_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la Exportación?" data-btn-ok-label="Sí" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div--%>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="upDatosExp" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVExportaciones" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CveExportacion" Width="100%" EmptyDataText="No se encontraron Exportaciones" ToolTip="Exportaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Exportación" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:HyperLink ID="HlExpDetalle" runat="server" Text='<%# Eval("CveExportacion") %>' NavigateUrl='<%# Eval("CveExportacion", "ExpDetalle.aspx?CveExportacion={0}") %>'>></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="Fecha de Ingreso" DataFormatString="{0:d}" />
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblUsuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Número de Factura" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblNumFact" runat="server" Text='<%# Eval("SerieFolio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha de Factura" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblFechaFact" runat="server" Text='<%# Eval("FechaFact", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo de Cambio" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblTipoCambio" runat="server" Text='<%# Eval("TipoCambio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Exportación" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblTipoExp" runat="server" Text='<%# Eval("TipoExportacion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblEstatus" runat="server" Text='<%# Eval("CveExportacionEstatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Número de Pedimento" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblNumeroPedimento" runat="server" Text='<%# Eval("NumeroPedimento")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Pedimento" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblFechaPedimento" runat="server" Text='<%# Eval("FechaPedimento", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre Exportador" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblClienteExp" runat="server" Text='<%# Eval("ClienteExportador")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC Importador" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblRFCImp" runat="server" Text='<%# Eval("RFCImp")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre Importador" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblClienteImp" runat="server" Text='<%# Eval("ClienteImportador")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC Consignatario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblRFCCon" runat="server" Text='<%# Eval("RFCCon")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre Consignatario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblClienteCon" runat="server" Text='<%# Eval("ClienteConsignatario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="EditarExp_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminar" runat="server" OnClick="EliminarExp_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la Exportación?" data-btn-ok-label="Sí" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">

View File

@@ -1,6 +1,7 @@
using DocumentFormat.OpenXml.Wordprocessing;
using Extensiones;
using HigLabo.Core;
using iText.Layout.Element;
using StackExchange.Redis;
using System;
using System.Activities;
@@ -42,15 +43,34 @@ public partial class Export_RepExportaciones : ClsPaginas
if (Request["Opcion"] == "I")
EsImportacion = true;
}
LtlPeriodoseleccionado.Text = EsImportacion ? "Importaciones" : "Exportaciones";
CargaExportaciones();
//LtlPeriodoseleccionado.Text = EsImportacion ? "Importaciones" : "Exportaciones";
InicializarValores();
//CargaExportaciones();
}
}
protected void InicializarValores()
{
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto: DivProyecto);
DdlProyecto.Visible = false;
LblProyecto.Visible = false;
DivProyecto.Visible = false;
LblSubProyecto.Text = $"{LblSubProyecto.Text}:";
txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString();
txtFechaF.Text = NowADS().ToShortDateString();
CargaExportaciones();
}
protected void CargaExportaciones()
{
ClsExportaciones Exportaciones = new ClsExportaciones();
bool EsExportacion = !EsImportacion;
if (Exportaciones.GetExportacion(-1, UsuarioActual.CveEmpresa, EsExportacion))
string SubProyectos = DdlSubProyecto.GetSelectedValuesM();
SubProyectos = SubProyectos == "" ? "-1" : SubProyectos;
DateTime FechaInicio = DateTime.TryParse(txtFechaI.Text, out _) ? txtFechaI.Text.ToDate() : ModExtensiones.MinFecha;
DateTime FechaFin = DateTime.TryParse(txtFechaF.Text, out _) ? txtFechaF.Text.ToDate() : ModExtensiones.MaxFecha;
ClsExportaciones Exportaciones = new ClsExportaciones();
if (Exportaciones.GetExportacion(-1, UsuarioActual.CveEmpresa, EsExportacion, FechaInicio, FechaFin, SubProyectos))
{
GVExportaciones.DataSource = Exportaciones.DtResultados;
GVExportaciones.DataBind();
@@ -64,6 +84,11 @@ public partial class Export_RepExportaciones : ClsPaginas
Response.Redirect($"/Export/ExpDetalle.aspx?CveExportacion={gvRow.DataKey("CveExportacion")}", true);
upDatosExp.Update();
}
protected void BtnConsultar_Click(object sender, EventArgs e)
{
CargaExportaciones();
upDatosExp.Update();
}
protected void EliminarExp_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);