Campos y filtros agregados a exportaciones

This commit is contained in:
SLopez
2025-07-07 08:41:48 -07:00
parent 18940adf9b
commit 0385ec2384
3 changed files with 48 additions and 11 deletions

View File

@@ -143,8 +143,8 @@ Public Class ClsExportaciones
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,
ClaveAduana As Integer, DescripcionContenedor As String, 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")
@@ -161,6 +161,7 @@ Public Class ClsExportaciones
.Add("@CveClienteConsignatario", SqlDbType.Int).Value = CveClienteConsignatario
.Add("@CveAgente", SqlDbType.Int).Value = CveAgente
.Add("@ClaveAduana", SqlDbType.Int).Value = ClaveAduana
.Add("@DescripcionContenedor", SqlDbType.VarChar).Value = DescripcionContenedor
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@MedioTransporte", SqlDbType.Int).Value = MedioTransporte
.Add("@TipoContenedor", SqlDbType.Int).Value = TipoContenedor
@@ -196,8 +197,8 @@ Public Class ClsExportaciones
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,
CveAgente As Integer, ClaveAduana As Integer, DescripcionContenedor As String, 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")
@@ -215,6 +216,7 @@ Public Class ClsExportaciones
.Add("@CveClienteConsignatario", SqlDbType.Int).Value = CveClienteConsignatario
.Add("@CveAgente", SqlDbType.Int).Value = CveAgente
.Add("@ClaveAduana", SqlDbType.Int).Value = ClaveAduana
.Add("@DescripcionContenedor", SqlDbType.VarChar).Value = DescripcionContenedor
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@MedioTransporte", SqlDbType.Int).Value = MedioTransporte
.Add("@TipoContenedor", SqlDbType.Int).Value = TipoContenedor

View File

@@ -25,6 +25,8 @@
<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>
<asp:RequiredFieldValidator ID="RFVSubP" runat="server" ControlToValidate="DdlSubProyecto" Display="None" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sub Proyecto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESubP" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubP" Width="350px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlSubProyecto.ClientID.ToString()%>">Sub Proyecto:</label>
</div>
<div class="form-group form-md-line-input input-iconright" style="width: 200px;">
@@ -344,8 +346,9 @@
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding-left:8px">
<div class="form-group row" style="width: 100%;">
<asp:Label runat="server" CssClass="col-sm-4" Text="Descripción Contenedor:"></asp:Label>
<div class="whitoutcol whitoutcol" style="width: 300px;">
<asp:DropDownList ID="DdlDescContenedor" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="" DataValueField=""></asp:DropDownList>
<div class="form-group form-md-line-input linewhitsize" style="width: 300px;">
<asp:TextBox ID="TxtDescContenedor" runat="server" CssClass="form-control input-sm" MaxLength="50" Width="100%" Text=""></asp:TextBox>
<label for="<%= TxtDescContenedor.ClientID.ToString()%>"></label>
</div>
</div>
<div class="form-group row" style="width: 100%;">
@@ -655,7 +658,7 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Tasa IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="lblTasaIVA" runat="server" Text='<%# Eval("IVA", "{0:N2}") %>'></asp:Label>
<asp:Label ID="lblTasaIVA" runat="server" Text='<%# Eval("IVA") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total de Empaque" ItemStyle-HorizontalAlign="Left">

View File

@@ -87,7 +87,6 @@ public partial class Export_ExpDetalle : ClsPaginas
// 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: CveUsuario))
{
DdlVentas.Items.Clear();
@@ -192,6 +191,7 @@ public partial class Export_ExpDetalle : ClsPaginas
DdlAgenteExt.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveAgenteExtranjero");
DdlClaveAduana.SelectedValue = DTExportaciones.FiltroPrimeroValor("ClaveAduana");
TxtDescContenedor.Text = DTExportaciones.FiltroPrimeroValor("DescripcionContenedor");
DdlCompTransportista.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveProveedor");
DdlCompTransportista.SelectedText = DTExportaciones.FiltroPrimeroValor("Proveedor");
TxtPlaca.Text = DTExportaciones.FiltroPrimeroValor("ContenedorPlaca");
@@ -367,6 +367,7 @@ public partial class Export_ExpDetalle : ClsPaginas
string ITN = TxtITN.Text;
int CveSubProyecto = DdlSubProyecto.Text.ToEntero();
string NumeroPedimento = TxtNumPed.Text;
NumeroPedimento = NumeroPedimento == "__--__--____--_______" ? "" : NumeroPedimento;
DateTime FechaPedimento = TxtFechaPedim.Text.ToDate();
int CveVenta = DdlVentas.Text.ToEntero();
decimal TipoCambio = ModExtensiones.ToDecimal(TxtTipoCambio.Text);
@@ -374,6 +375,7 @@ public partial class Export_ExpDetalle : ClsPaginas
int CveExportacionEstatus = DdlExpEstatus.Text.ToEntero();
int CveAgente = DdlAgenteMex.Text.ToEntero();
int ClaveAduana = DdlClaveAduana.Text.ToEntero();
string DescripcionContenedor = TxtDescContenedor.Text;
int CveProveedor = DdlCompTransportista.SelectedValue.ToEntero();
int MedioTransporte = DdlMedioTran.Text.ToEntero();
int TipoContenedor = DdlTipoContenedor.Text.ToEntero();
@@ -421,6 +423,7 @@ public partial class Export_ExpDetalle : ClsPaginas
CveClienteConsignatario.ToEntero(),
CveAgente,
ClaveAduana,
DescripcionContenedor,
CveProveedor,
MedioTransporte,
TipoContenedor,
@@ -501,6 +504,7 @@ public partial class Export_ExpDetalle : ClsPaginas
CveClienteConsignatario.ToEntero(),
CveAgente,
ClaveAduana,
DescripcionContenedor,
CveProveedor,
MedioTransporte,
TipoContenedor,
@@ -794,7 +798,26 @@ public partial class Export_ExpDetalle : ClsPaginas
string FraccionArancelaria = "";
string UnidadAduana = "";
string CveFraccionArancelaria = get_GlobalDTPS(CveEmpresa, CvePS).FiltroPrimeroValor("CveFraccionArancelaria");
DataTable DTPS = get_GlobalDTPS(CveEmpresa, CvePS);
string IVA = DTPS.FiltroPrimeroValor("IVA");
if (IVA == "-1")
{
if (DdlSubProyecto.Text != "-1")
{
DataTable DTSubProyectos = get_GlobalDTSubProyectosUsuarios(CveUsuario, -1, CveEmpresa, DdlSubProyecto.Text.ToEntero());
IVA = DTSubProyectos.FiltroPrimeroValor("IVA");
}
else
{
IVA = "";
}
}
if (IVA != "")
{
decimal iva_decimal = ModExtensiones.ToDecimal(IVA);
IVA = iva_decimal.ToString("N2");
}
string CveFraccionArancelaria = DTPS.FiltroPrimeroValor("CveFraccionArancelaria");
if (CveFraccionArancelaria != "" && GlobalDTFraccionArancelaria.Any())
{
DataTable DTFraccArancelaria = GlobalDTFraccionArancelaria.CopyToDataTable();
@@ -814,6 +837,7 @@ public partial class Export_ExpDetalle : ClsPaginas
PartidaRow["ClaveSATPais"] = ClaveSATPais;
PartidaRow["Precio"] = Precio;
PartidaRow["ValorTotalMXP"] = ValorTotalMXP;
PartidaRow["IVA"] = IVA;
PartidaRow["Cantidad"] = Cantidad;
PartidaRow["PesoUnitario"] = PesoUnitario;
PartidaRow["PesoBruto"] = PesoBruto;
@@ -837,6 +861,7 @@ public partial class Export_ExpDetalle : ClsPaginas
PartidaRow["ClaveSATPais"] = ClaveSATPais;
PartidaRow["Precio"] = Precio;
PartidaRow["ValorTotalMXP"] = ValorTotalMXP;
PartidaRow["IVA"] = IVA;
PartidaRow["Cantidad"] = Cantidad;
PartidaRow["PesoUnitario"] = PesoUnitario;
PartidaRow["PesoBruto"] = PesoBruto;
@@ -879,6 +904,7 @@ public partial class Export_ExpDetalle : ClsPaginas
DTTemp.Columns.Add("ClaveSATPais", typeof(string));
DTTemp.Columns.Add("Precio", typeof(decimal));
DTTemp.Columns.Add("ValorTotalMXP", typeof(decimal));
DTTemp.Columns.Add("IVA", typeof(string));
DTTemp.Columns.Add("Cantidad", typeof(decimal));
DTTemp.Columns.Add("PesoUnitario", typeof(decimal));
DTTemp.Columns.Add("PesoBruto", typeof(decimal));
@@ -963,8 +989,9 @@ public partial class Export_ExpDetalle : ClsPaginas
DataRow RowExp = DTExportaciones.Rows[0];
string ClienteExportador = DTExportaciones.FiltroPrimeroValor("ClienteExportador");
string DirExportador = DTExportaciones.FiltroPrimeroValor("DirExportador");
string ClienteImortador = DTExportaciones.FiltroPrimeroValor("ClienteImportador");
string ClienteImportador = DTExportaciones.FiltroPrimeroValor("ClienteImportador");
string RFCImp = DTExportaciones.FiltroPrimeroValor("RFCImp");
string IMMEXimp = DTExportaciones.FiltroPrimeroValor("IMMEXimp");
string NumFactura = DTExportaciones.FiltroPrimeroValor("SerieFolio");
string ClaveSATPedimento = DTExportaciones.FiltroPrimeroValor("ClaveSATPedimento");
string ITN = DTExportaciones.FiltroPrimeroValor("ITN");
@@ -993,6 +1020,7 @@ public partial class Export_ExpDetalle : ClsPaginas
string ClienteConsignatario = DTExportaciones.FiltroPrimeroValor("ClienteConsignatario");
string DirConsignatario = DTExportaciones.FiltroPrimeroValor("DirConsignatario");
string RFCCon = DTExportaciones.FiltroPrimeroValor("RFCCon");
string IMMEXcon = DTExportaciones.FiltroPrimeroValor("IMMEXcon");
decimal IncFletes = 0.00m;
decimal IncSeguro = 0.00m;
@@ -1014,6 +1042,7 @@ public partial class Export_ExpDetalle : ClsPaginas
string ClaveAduana = DTExportaciones.FiltroPrimeroValor("ClaveSATAduanaSeccionDescripcion");
ClaveAduana = ClaveAduana != " - - " ? ClaveAduana : "";
string ClaveSATIncoterm = DTExportaciones.FiltroPrimeroValor("ClaveSATIncoterm");
string RFCAgente = DTExportaciones.FiltroPrimeroValor("RFCAgente");
string Patente = DTExportaciones.FiltroPrimeroValor("Patente");
string AgenteExt = DTExportaciones.FiltroPrimeroValor("AgenteExt");
string TaxId = DTExportaciones.FiltroPrimeroValor("TaxId");
@@ -1023,8 +1052,9 @@ public partial class Export_ExpDetalle : ClsPaginas
para.Add(new ReportParameter("CveExportacion", CveExportacion.ToString()));
para.Add(new ReportParameter("ClienteExportador", ClienteExportador));
para.Add(new ReportParameter("DirExportador", DirExportador));
para.Add(new ReportParameter("ClienteImportador", ClienteImortador));
para.Add(new ReportParameter("ClienteImportador", ClienteImportador));
para.Add(new ReportParameter("RFCImp", RFCImp));
para.Add(new ReportParameter("IMMEXimp", IMMEXimp));
para.Add(new ReportParameter("NumFactura", NumFactura));
para.Add(new ReportParameter("ClaveSATPedimento", ClaveSATPedimento));
para.Add(new ReportParameter("ITN", ITN));
@@ -1037,6 +1067,7 @@ public partial class Export_ExpDetalle : ClsPaginas
para.Add(new ReportParameter("ClienteConsignatario", ClienteConsignatario));
para.Add(new ReportParameter("DirConsignatario", DirConsignatario));
para.Add(new ReportParameter("RFCCon", RFCCon));
para.Add(new ReportParameter("IMMEXcon", IMMEXcon));
ClsExportaciones Gastos = new ClsExportaciones();
if (Gastos.GetGastos(CveExportacion))
@@ -1079,6 +1110,7 @@ public partial class Export_ExpDetalle : ClsPaginas
para.Add(new ReportParameter("CAAT", CAAT));
para.Add(new ReportParameter("ClaveAduana", ClaveAduana));
para.Add(new ReportParameter("ClaveSATIncoterm", ClaveSATIncoterm));
para.Add(new ReportParameter("RFCAgente", RFCAgente));
para.Add(new ReportParameter("Patente", Patente));
para.Add(new ReportParameter("AgenteExt", AgenteExt));
para.Add(new ReportParameter("TaxId", TaxId));