From 0385ec23849590bb955aeddd73c545218d34bca7 Mon Sep 17 00:00:00 2001 From: SLopez Date: Mon, 7 Jul 2025 08:41:48 -0700 Subject: [PATCH] Campos y filtros agregados a exportaciones --- App_Code/ClsExportaciones.vb | 10 +++++---- Export/ExpDetalle.aspx | 9 +++++--- Export/ExpDetalle.aspx.cs | 40 ++++++++++++++++++++++++++++++++---- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/App_Code/ClsExportaciones.vb b/App_Code/ClsExportaciones.vb index 45ffee442..81c817d3f 100644 --- a/App_Code/ClsExportaciones.vb +++ b/App_Code/ClsExportaciones.vb @@ -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 diff --git a/Export/ExpDetalle.aspx b/Export/ExpDetalle.aspx index d2ea20d0f..e11559959 100644 --- a/Export/ExpDetalle.aspx +++ b/Export/ExpDetalle.aspx @@ -25,6 +25,8 @@
+ +
@@ -344,8 +346,9 @@
-
- +
+ +
@@ -655,7 +658,7 @@ - + diff --git a/Export/ExpDetalle.aspx.cs b/Export/ExpDetalle.aspx.cs index 4964c8da0..90996a4ae 100644 --- a/Export/ExpDetalle.aspx.cs +++ b/Export/ExpDetalle.aspx.cs @@ -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));