This commit is contained in:
JPerez
2025-07-03 12:44:59 -07:00
6 changed files with 70 additions and 24 deletions

View File

@@ -120,7 +120,7 @@ Public Class ClsExportaciones
End Sub End Sub
#Region "EXPORTACIONES" #Region "EXPORTACIONES"
Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional EsExportacion As Integer = 1, 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) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesRep") DataAdapter("PA_Exp_ExportacionesRep")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -143,7 +143,7 @@ Public Class ClsExportaciones
CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer, ClaveAduana 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, 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, 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 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 Dim Retorno As Integer = -1
DataAdapter("PA_Exp_ExportacionesAdd") DataAdapter("PA_Exp_ExportacionesAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -177,6 +177,7 @@ Public Class ClsExportaciones
.Add("@CveAgenteExtranjero", SqlDbType.Int).Value = CveAgenteExtranjero .Add("@CveAgenteExtranjero", SqlDbType.Int).Value = CveAgenteExtranjero
.Add("@ITN", SqlDbType.VarChar).Value = ITN .Add("@ITN", SqlDbType.VarChar).Value = ITN
.Add("@Vinculacion", SqlDbType.Bit).Value = Vinculacion .Add("@Vinculacion", SqlDbType.Bit).Value = Vinculacion
.Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion
.Add("@CveExportacion", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CveExportacion", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With

View File

@@ -1284,6 +1284,7 @@ Partial Class Bancos_IE
ViewState("CveCliente") = "-1" ViewState("CveCliente") = "-1"
CargaProveedor(HdnCveProveedor.Value.ToEntero, "-1") CargaProveedor(HdnCveProveedor.Value.ToEntero, "-1")
CargaCuentasDepositos()
End Sub End Sub
Private Sub CargaProveedor(ByVal CveProveedor As Integer, RFC As String) Private Sub CargaProveedor(ByVal CveProveedor As Integer, RFC As String)
@@ -4098,11 +4099,17 @@ Partial Class Bancos_IE
Dim dtc As DataTable = Nothing Dim dtc As DataTable = Nothing
If CveProveedor > 0 Then Dim CveProveedorTemp As Integer = CveProveedor
dtc = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor)
If DdlProveedores.SelectedValue.ToEntero > 0 Then
CveProveedorTemp = DdlProveedores.SelectedValue.ToEntero
End If
If CveProveedorTemp > 0 Then
dtc = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedorTemp)
ElseIf CveCliente > 0 Then ElseIf CveCliente > 0 Then
dtc = GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, CveCliente:=CveCliente) dtc = GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, CveCliente:=CveCliente)
ElseIf cvepersonal > 0 Then ElseIf CvePersonal > 0 Then
dtc = GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) dtc = GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal)
End If End If
@@ -4216,14 +4223,14 @@ Partial Class Bancos_IE
ElseIf OpBanco = 3 Then ElseIf OpBanco = 3 Then
If dtc.Rows.Count > 0 Then If dtc.Rows.Count > 0 Then
DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'") DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus ='True'")
DdlCuentaDeposito.DataBind() DdlCuentaDeposito.DataBind()
DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1"))
End If End If
If dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'").Rows.Count > 0 Then If dtc.FiltraParametros(" Estatus ='True'").Rows.Count > 0 Then
trCuentaDeposito.Visible = True trCuentaDeposito.Visible = True
DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) 'DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1"))
Else Else
BtnGuardar.Enabled = False BtnGuardar.Enabled = False
Alert("El Beneficiario no tiene una cuenta activa en Scotiabank, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) Alert("El Beneficiario no tiene una cuenta activa en Scotiabank, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia)
@@ -4265,6 +4272,19 @@ Partial Class Bancos_IE
End If End If
End If End If
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT", "EGSCREDITO") Then
If DdlTipoTransaccion.SelectedValue.Contiene("9") AndAlso OpBanco = 3 Then
RBL.Items(1).Enabled = False
RBL.Items(2).Enabled = False
Else
RBL.Items(1).Enabled = True
RBL.Items(2).Enabled = True
End If
End If
UPPP.Update()
UpGuardar.Update() UpGuardar.Update()
UpCuentaDeposito.Update() UpCuentaDeposito.Update()
UpDatos.Update() UpDatos.Update()
@@ -4500,6 +4520,7 @@ Partial Class Bancos_IE
DdlProveedores_selectedindexchange(DdlProveedores, Nothing) DdlProveedores_selectedindexchange(DdlProveedores, Nothing)
DdlProveedores.SelectedText = RazonSocial DdlProveedores.SelectedText = RazonSocial
' BuscaCargaProveedor() ' BuscaCargaProveedor()
End If End If
CveOCSolicitudAnticipo = DrOC("CveOC").ToString.ToEntero CveOCSolicitudAnticipo = DrOC("CveOC").ToString.ToEntero
Else Else

View File

@@ -60,7 +60,7 @@
<div class="col-md-6"> <div class="col-md-6">
<asp:UpdatePanel runat="server" ID="UpComandosGeneracion" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpComandosGeneracion" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="portlet light smmallpadding bordered"> <div class="portlet light xspadding bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
@@ -79,7 +79,7 @@
<div class="row" style="margin-left: 0px; margin-right: 0px;"> <div class="row" style="margin-left: 0px; margin-right: 0px;">
<div class="col-md-6"> <div class="col-md-6">
<div class="portlet light smmallpadding bordered"> <div class="portlet light xspadding bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
@@ -127,7 +127,7 @@
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="portlet light smmallpadding bordered"> <div class="portlet light xspadding bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
@@ -178,7 +178,7 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="portlet light smmallpadding bordered"> <div class="portlet light xspadding bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>

View File

@@ -277,6 +277,8 @@ Partial Class Bancos_PagoElectronico
If DTPendientes IsNot Nothing AndAlso DTPendientes.Rows.Count > 0 Then If DTPendientes IsNot Nothing AndAlso DTPendientes.Rows.Count > 0 Then
CargaDatosInformativos() CargaDatosInformativos()
Else
VistaComandoGeneracion()
End If End If
End Sub End Sub
@@ -946,7 +948,7 @@ Partial Class Bancos_PagoElectronico
Dim correo As String = dr("Correo").ToString.Trim Dim correo As String = dr("Correo").ToString.Trim
If correo.Trim.Length = 0 Then If correo.Trim.Length = 0 Then
SBErrores.Append($"Email no definido en fila {idx + 1}. Debe ser un correo electrónico válido.<br>") SBErrores.Append($" {nombreBen} Email no definido en fila {idx + 1}. Debe ser un correo electrónico válido.<br>")
ErrorLayout = True ErrorLayout = True
End If End If

View File

@@ -35,6 +35,12 @@ public partial class Export_ExpDetalle : ClsPaginas
get { return (ViewState["CveExportacionDetalle"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacionDetalle"]); } get { return (ViewState["CveExportacionDetalle"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacionDetalle"]); }
set { ViewState["CveExportacionDetalle"] = value; } set { ViewState["CveExportacionDetalle"] = value; }
} }
private bool EsImportacion
{
get { return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); }
set { ViewState["EsImportacion"] = value; }
}
#endregion #endregion
@@ -42,6 +48,12 @@ public partial class Export_ExpDetalle : ClsPaginas
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
EsImportacion = false;
if (!string.IsNullOrEmpty(Request["Opcion"]) && Request["Opcion"].Equals("I", StringComparison.OrdinalIgnoreCase))
{
EsImportacion = true;
}
CveExportacion = !string.IsNullOrEmpty(Request["CveExportacion"]) ? Request["CveExportacion"].ToEntero() : -1; CveExportacion = !string.IsNullOrEmpty(Request["CveExportacion"]) ? Request["CveExportacion"].ToEntero() : -1;
InicializarValores(); InicializarValores();
CargaDatos(); CargaDatos();
@@ -117,7 +129,8 @@ public partial class Export_ExpDetalle : ClsPaginas
{ {
DataTable DTExportaciones = new DataTable(); DataTable DTExportaciones = new DataTable();
ClsExportaciones Exportaciones = new ClsExportaciones(); ClsExportaciones Exportaciones = new ClsExportaciones();
if (Exportaciones.GetExportacion(CveExportacion, UsuarioActual.CveEmpresa)) bool EsExportacion = !EsImportacion;
if (Exportaciones.GetExportacion(CveExportacion, UsuarioActual.CveEmpresa, EsExportacion))
{ {
DTExportaciones = Exportaciones.DtResultados; DTExportaciones = Exportaciones.DtResultados;
if (DTExportaciones.Rows.Count > 0) if (DTExportaciones.Rows.Count > 0)
@@ -371,7 +384,7 @@ public partial class Export_ExpDetalle : ClsPaginas
decimal DecOtros = ModExtensiones.ToDecimal(TxtDecOtros.Text); decimal DecOtros = ModExtensiones.ToDecimal(TxtDecOtros.Text);
ClsExportaciones Exportaciones = new ClsExportaciones(); ClsExportaciones Exportaciones = new ClsExportaciones();
bool EsExportacion = !EsImportacion;
if (CveExportacion == -1) if (CveExportacion == -1)
{ {
int ExportacionGuardada = Exportaciones.AddExportacion( int ExportacionGuardada = Exportaciones.AddExportacion(
@@ -404,7 +417,8 @@ public partial class Export_ExpDetalle : ClsPaginas
CvePedimento, CvePedimento,
CveAgenteExtranjero, CveAgenteExtranjero,
ITN, ITN,
Vinculacion Vinculacion,
EsExportacion
); );
if (ExportacionGuardada != -1) if (ExportacionGuardada != -1)
{ {
@@ -442,8 +456,10 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
//string Liga = "document.location.href=\"/Export/RepExportaciones.aspx\";"; //string Liga = "document.location.href=\"/Export/RepExportaciones.aspx\";";
string Liga = $"document.location.href=\"/Export/ExpDetalle.aspx?CveExportacion={ExportacionGuardada}\";"; string liga = EsImportacion
Alert("La Exportación se ha agregado correctamente.", JSBtnAceptar: Liga); ? $"document.location.href=\"/Export/ExpDetalle.aspx?CveExportacion={ExportacionGuardada}&Opcion=I\";"
: $"document.location.href=\"/Export/ExpDetalle.aspx?CveExportacion={ExportacionGuardada}\";";
Alert("La Exportación se ha agregado correctamente.", JSBtnAceptar: liga);
} }
Exportaciones.Dispose(); Exportaciones.Dispose();
} }
@@ -948,7 +964,9 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
string TipoCambio = ModExtensiones.ToDecimal(DTExportaciones.FiltroPrimeroValor("TipoCambio")).ToString("#,###.####"); string TipoCambio = ModExtensiones.ToDecimal(DTExportaciones.FiltroPrimeroValor("TipoCambio")).ToString("#,###.####");
string MedioTransporte = DTExportaciones.FiltroPrimeroValor("MedioTransporte"); string MedioTransporte = DTExportaciones.FiltroPrimeroValor("MedioTransporte");
MedioTransporte = MedioTransporte != "-1" ? MedioTransporte : "";
string TipoContenedor = DTExportaciones.FiltroPrimeroValor("TipoContenedor"); string TipoContenedor = DTExportaciones.FiltroPrimeroValor("TipoContenedor");
TipoContenedor = TipoContenedor != "-1" ? TipoContenedor : "";
string ClienteConsignatario = DTExportaciones.FiltroPrimeroValor("ClienteConsignatario"); string ClienteConsignatario = DTExportaciones.FiltroPrimeroValor("ClienteConsignatario");
string DirConsignatario = DTExportaciones.FiltroPrimeroValor("DirConsignatario"); string DirConsignatario = DTExportaciones.FiltroPrimeroValor("DirConsignatario");
string RFCCon = DTExportaciones.FiltroPrimeroValor("RFCCon"); string RFCCon = DTExportaciones.FiltroPrimeroValor("RFCCon");
@@ -976,6 +994,7 @@ public partial class Export_ExpDetalle : ClsPaginas
string Patente = DTExportaciones.FiltroPrimeroValor("Patente"); string Patente = DTExportaciones.FiltroPrimeroValor("Patente");
string AgenteExt = DTExportaciones.FiltroPrimeroValor("AgenteExt"); string AgenteExt = DTExportaciones.FiltroPrimeroValor("AgenteExt");
string TaxId = DTExportaciones.FiltroPrimeroValor("TaxId"); string TaxId = DTExportaciones.FiltroPrimeroValor("TaxId");
string Notas = DTExportaciones.FiltroPrimeroValor("Notas");
List <ReportParameter> para = new List<ReportParameter>(); List <ReportParameter> para = new List<ReportParameter>();
para.Add(new ReportParameter("CveExportacion", CveExportacion.ToString())); para.Add(new ReportParameter("CveExportacion", CveExportacion.ToString()));
@@ -1040,6 +1059,7 @@ public partial class Export_ExpDetalle : ClsPaginas
para.Add(new ReportParameter("Patente", Patente)); para.Add(new ReportParameter("Patente", Patente));
para.Add(new ReportParameter("AgenteExt", AgenteExt)); para.Add(new ReportParameter("AgenteExt", AgenteExt));
para.Add(new ReportParameter("TaxId", TaxId)); para.Add(new ReportParameter("TaxId", TaxId));
para.Add(new ReportParameter("Notas", Notas));
List <ReportDataSource> lrds = new List<ReportDataSource>(); List <ReportDataSource> lrds = new List<ReportDataSource>();
ReportDataSource RDSExportaciones = new ReportDataSource(); ReportDataSource RDSExportaciones = new ReportDataSource();
@@ -1058,12 +1078,14 @@ public partial class Export_ExpDetalle : ClsPaginas
DTPartidas.Columns.Add("ValorUnitarioMN", typeof(decimal)); DTPartidas.Columns.Add("ValorUnitarioMN", typeof(decimal));
DTPartidas.Columns["ValorUnitarioUSD"].DefaultValue = 0.0m; DTPartidas.Columns["ValorUnitarioUSD"].DefaultValue = 0.0m;
DTPartidas.Columns["ValorUnitarioMN"].DefaultValue = 0.0m; DTPartidas.Columns["ValorUnitarioMN"].DefaultValue = 0.0m;
DataRow RowPartida = DTPartidas.Rows[0]; foreach (DataRow row in DTPartidas.Rows)
decimal cantidad = Convert.ToDecimal(RowPartida["Cantidad"]);
if (cantidad > 0)
{ {
RowPartida["ValorUnitarioUSD"] = Convert.ToDecimal(RowPartida["Precio"]) / cantidad; decimal cantidad = Convert.ToDecimal(row["Cantidad"]);
RowPartida["ValorUnitarioMN"] = Convert.ToDecimal(RowPartida["ValorTotalMXP"]) / cantidad; if (cantidad > 0)
{
row["ValorUnitarioUSD"] = Convert.ToDecimal(row["Precio"]) / cantidad;
row["ValorUnitarioMN"] = Convert.ToDecimal(row["ValorTotalMXP"]) / cantidad;
}
} }
ReportDataSource RDSPartidas = new ReportDataSource(); ReportDataSource RDSPartidas = new ReportDataSource();
RDSPartidas.Name = "DsPartidas"; RDSPartidas.Name = "DsPartidas";

View File

@@ -49,7 +49,7 @@ public partial class Export_RepExportaciones : ClsPaginas
protected void CargaExportaciones() protected void CargaExportaciones()
{ {
ClsExportaciones Exportaciones = new ClsExportaciones(); ClsExportaciones Exportaciones = new ClsExportaciones();
int EsExportacion = EsImportacion ? 0 : 1; // 0 = importación, 1 = exportación bool EsExportacion = !EsImportacion;
if (Exportaciones.GetExportacion(-1, UsuarioActual.CveEmpresa, EsExportacion)) if (Exportaciones.GetExportacion(-1, UsuarioActual.CveEmpresa, EsExportacion))
{ {
GVExportaciones.DataSource = Exportaciones.DtResultados; GVExportaciones.DataSource = Exportaciones.DtResultados;