This commit is contained in:
JPerez
2025-07-04 17:04:31 -07:00
5 changed files with 237 additions and 161 deletions

View File

@@ -2037,15 +2037,15 @@ Partial Class Bancos_PagoElectronicoGrupos
'Motivo de pago 'Motivo de pago
If drow("Observaciones").ToString.Trim.Length > 30 Then If drow("Observaciones").ToString.Trim.Length > 30 Then
RegistrosPago.Append(drow("Observaciones").ToString.Substring(0, 30)) RegistrosPago.Append(drow("Observaciones").ToString.Trim.Substring(0, 30))
Else Else
RegistrosPago.Append(drow("Observaciones").ToString.PadRight(30, EspacioRelleno)) RegistrosPago.Append(drow("Observaciones").ToString.Trim.PadRight(30, EspacioRelleno))
End If End If
If drow("Referencia").ToString.Trim.Length > 7 Then If drow("Referencia").ToString.Trim.Length > 7 Then
RegistrosPago.Append(drow("Referencia").ToString.Substring(0, 7)) RegistrosPago.Append(drow("Referencia").ToString.Trim.Substring(0, 7))
Else Else
RegistrosPago.Append(drow("Referencia").ToString.PadRight(7, EspacioRelleno)) RegistrosPago.Append(drow("Referencia").ToString.Trim.PadRight(7, EspacioRelleno))
End If End If
RegistrosPago.Append("H") RegistrosPago.Append("H")

View File

@@ -1,23 +1,22 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ExpDetalle.aspx.cs" Inherits="Export_ExpDetalle" %> <%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ExpDetalle.aspx.cs" Inherits="Export_ExpDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Exportación: <asp:Label runat="server" ID="LblExp"></asp:Label>
<asp:Label runat="server" Text="Exportación" ID="LblExp"></asp:Label>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li id="liImprimir" runat="server"> <li id="liImprimir" runat="server">
<asp:LinkButton ID="LBImprimir" runat="server" OnClick="LBImprimir_Click"><i style="font-weight:bold" class="fa fa-file-pdf-o"></i> Exportar PDF</asp:LinkButton> <asp:LinkButton ID="LBImprimir" runat="server" OnClick="LBImprimir_Click"><i style="font-weight:bold" class="fa fa-file-pdf-o"></i> Exportar PDF</asp:LinkButton>
</li> </li>
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<div class="whitoutcol" style="width: 100%;"> <div class="whitoutcol" style="width: 100%;">
<div class="portlet light xspadding bordered" style="width: 100%; padding-left: 7px"> <div class="portlet light xspadding bordered" style="width: 100%; padding-left: 7px">
<asp:UpdatePanel ID="UpFactura" runat="server"> <asp:UpdatePanel ID="UpFactura" runat="server">
@@ -41,7 +40,7 @@
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoExp" runat="server" ControlToValidate="DdlTipoExp" Display="None" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Exportación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVTipoExp" runat="server" ControlToValidate="DdlTipoExp" Display="None" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Exportación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETipoExp" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoExp" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCETipoExp" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoExp" Width="350px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlTipoExp.ClientID.ToString()%>">Tipo Exportación:</label> <label id="LblTipoExp" runat="server" for="<%= DdlTipoExp.ClientID.ToString()%>">Tipo Exportación:</label>
</div> </div>
<div class="form-group form-md-line-input input-iconright" style="width: 180px; margin-bottom: 5px;"> <div class="form-group form-md-line-input input-iconright" style="width: 180px; margin-bottom: 5px;">
<asp:DropDownList ID="DdlExpEstatus" runat="server" CssClass="select2me form-control"> <asp:DropDownList ID="DdlExpEstatus" runat="server" CssClass="select2me form-control">
@@ -613,7 +612,7 @@
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel ID="UpPartidas" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpPartidas" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:Button runat="server" ID="BtnAgregarPartida" OnClick="BtnAgregarPartida_Click" Text="Agregar Partida" CssClass="btn btn-primary" style="margin-top: 5px;" /> <asp:Button runat="server" ID="BtnAgregarPartida" OnClick="BtnAgregarPartida_Click" Text="Agregar Partida" CssClass="btn btn-primary" Style="margin-top: 5px;" />
<br /> <br />
<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"> <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">
@@ -638,14 +637,19 @@
<asp:Label ID="lblUM" runat="server" Text='<%# Eval("UnidadMedida")%>'> </asp:Label> <asp:Label ID="lblUM" runat="server" Text='<%# Eval("UnidadMedida")%>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Valor Total USD" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText="Valor Total USD" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblPrecio" runat="server" Text='<%# Eval("Precio", "{0:#,###.####}")%>'> </asp:Label> <asp:Label ID="lblPrecio" runat="server" Text='<%# Eval("Precio", "{0:N2}")%>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Valor Total MXP" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText="Valor Total MXP" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblValorTotalMXP" runat="server" Text='<%# Eval("ValorTotalMXP", "{0:#,###.####}")%>'> </asp:Label> <asp:Label ID="lblValorTotalMXP" runat="server" Text='<%# Eval("ValorTotalMXP", "{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tasa IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="lblTasaIVA" runat="server" Text='<%# Eval("IVA", "{0:N2}") %>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Total de Empaque" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText="Total de Empaque" ItemStyle-HorizontalAlign="Left">
@@ -679,14 +683,31 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px"> <asp:TemplateField HeaderText="Acciones" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="160px">
<ItemTemplate> <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> <asp:LinkButton
</ItemTemplate> data-toggle="tooltip"
</asp:TemplateField> title="Editar"
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px"> ID="LnkEditarPartida"
<ItemTemplate> CommandName="EditarPartida"
<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í" /> CommandArgument='<%# Eval("CveExportacionDetalle") %>'
CssClass="btn btn-circle btn-sm green"
runat="server"
Text="<i class='fa fa-pencil'></i>">
</asp:LinkButton>
&nbsp;
<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í">
</asp:LinkButton>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
@@ -819,6 +840,6 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -54,6 +54,17 @@ public partial class Export_ExpDetalle : ClsPaginas
EsImportacion = true; EsImportacion = true;
} }
LblTipoExp.InnerText = EsImportacion ? "Tipo Importación:" : "Tipo Exportación:";
if (EsImportacion)
{
LblExp.Text = "Importaciones";
}
else
{
LblExp.Text = "Exportación";
}
CveExportacion = !string.IsNullOrEmpty(Request["CveExportacion"]) ? Request["CveExportacion"].ToEntero() : -1; CveExportacion = !string.IsNullOrEmpty(Request["CveExportacion"]) ? Request["CveExportacion"].ToEntero() : -1;
InicializarValores(); InicializarValores();
CargaDatos(); CargaDatos();

View File

@@ -6,7 +6,7 @@
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Exportaciones <asp:Literal ID="LtlTitulo" runat="server"></asp:Literal>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
<li> <li>
@@ -45,7 +45,7 @@
</div> </div>
<div class="portlet-body form"> <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"> <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" OnRowDataBound="GVExportaciones_RowDataBound">
<Columns> <Columns>
<asp:TemplateField HeaderText="Exportación" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText="Exportación" ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>

View File

@@ -25,6 +25,8 @@ public partial class Export_RepExportaciones : ClsPaginas
set { ViewState["CveExportacion"] = value; } set { ViewState["CveExportacion"] = value; }
} }
public string EmptyDataTextPersonalizado { get; set; }
public string ToolTipPersonalizado { get; set; }
private bool EsImportacion private bool EsImportacion
{ {
get{ return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); } get{ return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); }
@@ -35,14 +37,35 @@ public partial class Export_RepExportaciones : ClsPaginas
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
// Primero, inicializa la bandera
EsImportacion = false; EsImportacion = false;
if (Request["Opcion"] != null && Request["Opcion"] == "I")
if (Request["Opcion"] != null)
{ {
if (Request["Opcion"] == "I")
EsImportacion = true; EsImportacion = true;
} }
LtlPeriodoseleccionado.Text = EsImportacion ? "Importaciones" : "Exportaciones";
Page.Title = EsImportacion ? "Importaciones" : "Exportaciones";
// Ahora sí, usa la bandera para los textos
if (EsImportacion)
{
LtlTitulo.Text = "Importaciones";
EmptyDataTextPersonalizado = "No se encontraron importaciones";
ToolTipPersonalizado = "Importaciones";
HLAgregarExp.Text = "<i class='fa fa-plus'></i> Agregar Importación";
HLAgregarExp.NavigateUrl = "ExpDetalle.aspx?CveExportacion=-1&Opcion=I";
}
else
{
LtlTitulo.Text = "Exportaciones";
EmptyDataTextPersonalizado = "No se encontraron exportaciones";
ToolTipPersonalizado = "Exportaciones";
HLAgregarExp.Text = "<i class='fa fa-plus'></i> Agregar Exportación";
HLAgregarExp.NavigateUrl = "ExpDetalle.aspx?CveExportacion=-1";
}
GVExportaciones.EmptyDataText = EmptyDataTextPersonalizado;
GVExportaciones.ToolTip = ToolTipPersonalizado;
CargaExportaciones(); CargaExportaciones();
} }
} }
@@ -61,7 +84,11 @@ public partial class Export_RepExportaciones : ClsPaginas
protected void EditarExp_Click(object sender, EventArgs e) protected void EditarExp_Click(object sender, EventArgs e)
{ {
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
Response.Redirect($"/Export/ExpDetalle.aspx?CveExportacion={gvRow.DataKey("CveExportacion")}", true); string cve = gvRow.DataKey("CveExportacion").ToString();
string url = EsImportacion
? $"/Export/ExpDetalle.aspx?CveExportacion={cve}&Opcion=I"
: $"/Export/ExpDetalle.aspx?CveExportacion={cve}";
Response.Redirect(url, true);
upDatosExp.Update(); upDatosExp.Update();
} }
protected void EliminarExp_Click(object sender, EventArgs e) protected void EliminarExp_Click(object sender, EventArgs e)
@@ -76,4 +103,21 @@ public partial class Export_RepExportaciones : ClsPaginas
Alert("La Exportación se ha eliminado correctamente."); Alert("La Exportación se ha eliminado correctamente.");
} }
} }
protected void GVExportaciones_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink hl = (HyperLink)e.Row.FindControl("HlExpDetalle");
if (hl != null)
{
string cve = DataBinder.Eval(e.Row.DataItem, "CveExportacion").ToString();
if (EsImportacion)
hl.NavigateUrl = $"ExpDetalle.aspx?CveExportacion={cve}&Opcion=I";
else
hl.NavigateUrl = $"ExpDetalle.aspx?CveExportacion={cve}";
} }
}
}
}