diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index ac47d269b..37ded6f64 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -84,15 +84,16 @@ general optima motobateria + Auxiliar
- + - +
@@ -122,7 +123,7 @@ - +   - +   - - + +   @@ -170,9 +171,9 @@ - + - + @@ -181,10 +182,10 @@ - + - + @@ -258,10 +259,10 @@ - + ControlToValidate="TxtFolioGarantia" runat="server" CssClass="help-block errorimput" + ErrorMessage="solo números" ValidationGroup="GrpFolioGarantia" + ValidationExpression="\d+"> + @@ -269,8 +270,9 @@
-
+
SubProyecto:
+ @@ -286,10 +288,12 @@
Tipo Folio:
+ General Optima Motobateria + Auxiliar
@@ -297,6 +301,7 @@
Área:
+ Piso Almacén @@ -308,7 +313,7 @@
-
+
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 8e7c0f8a7..8882bb2d9 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -295,7 +295,8 @@ Public Class ClsBancos Return Retorno End Function - Public Function AddBancos(Banco As String, Ejecutivo As String, Telefono As String, CveUsuario As Integer, CveEmpresa As Integer, Optional IdContPaq As Integer = -1, Optional RFC As String = "-1") As Boolean + Public Function AddBancos(Banco As String, Ejecutivo As String, Telefono As String, CveUsuario As Integer, CveEmpresa As Integer, Optional IdContPaq As Integer = -1, Optional RFC As String = "-1", + Optional CveSATBanco As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_BancosAdd ") @@ -308,6 +309,7 @@ Public Class ClsBancos .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@IdContPaq", SqlDbType.Int).Value = IdContPaq .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco End With Try @@ -326,7 +328,8 @@ Public Class ClsBancos Return Retorno End Function - Public Function UpdateBancos(Banco As String, Ejecutivo As String, Telefono As String, Estatus As Boolean, CveBanco As Integer, Optional IdContPaq As Integer = -1, Optional RFC As String = "-1") As Boolean + Public Function UpdateBancos(Banco As String, Ejecutivo As String, Telefono As String, Estatus As Boolean, CveBanco As Integer, Optional IdContPaq As Integer = -1, Optional RFC As String = "-1", + Optional CveSATBanco As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_BancosUpdate") @@ -339,6 +342,7 @@ Public Class ClsBancos .Add("@CveBanco", SqlDbType.Int).Value = CveBanco .Add("@IdContPaq", SqlDbType.Int).Value = IdContPaq .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco End With Try diff --git a/App_Code/ClsExportaciones.vb b/App_Code/ClsExportaciones.vb new file mode 100644 index 000000000..8670c2847 --- /dev/null +++ b/App_Code/ClsExportaciones.vb @@ -0,0 +1,452 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports System.Data.SqlClient +Imports Extensiones +Imports Modelos +Imports Profact.TimbraCFDI.Complementos.ComercioExterior10 + +Public Class ClsExportaciones + Implements IDisposable + +#Region "Campos" + + Private SqlConexion As SqlConnection + Private SqlAdapter As SqlDataAdapter + Private SqlTransacc As SqlTransaction + Private SqlCommand As SqlCommand + Private StrSQL As StringBuilder + Private Data As DataTable + Private disposedValue As Boolean = False ' Para detectar llamadas redundantes + 'REGISTRAR CONEXIÓN + Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False + +#End Region + +#Region "Propiedades" + + Public ReadOnly Property DtResultados() As DataTable + Get + DtResultados = Data + End Get + End Property + + Public Property CveExportacion As Integer + Public Property CveExportacionDetalle As Integer + +#End Region + + Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) + + If TransaccionCompartida Is Nothing Then + SqlConexion = New SqlConnection + SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB + Try + SqlConexion.Open() + Catch ex As Exception + OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) + End Try + Else + SqlConexion = TransaccionCompartida.Connection + SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True + End If + + SqlCommand = New SqlCommand("", SqlConexion) + SqlAdapter = New SqlDataAdapter("", SqlConexion) + StrSQL = New StringBuilder + ConexionAdd() + End Sub + + Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) + With SqlAdapter.SelectCommand + .Parameters.Clear() + .CommandText = StrSQL + .CommandType = TipoComando + End With + If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc + Data = New DataTable + End Sub +#Region "Conexiones" + + Private Sub ConexionAdd() + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + Try + DataAdapter("PA_Sis_RegistrarConexion") + With SqlAdapter.SelectCommand.Parameters + .Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name + .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString) + .Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output + End With + SqlAdapter.Fill(Data) + CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero + Catch ex As Exception + OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + End If + End Sub + + Private Sub ConexionClose() + If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + + DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text) + + Try + SqlAdapter.Fill(Data) + + Catch ex As Exception + OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + CveConexion = 0 + End If + + End Sub +#End Region + + Public Function IniciaTransacSQL() As SqlTransaction + If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction() + Return SqlTransacc + End Function + Public Sub RollBack() + If SqlTransacc IsNot Nothing Then SqlTransacc.Rollback() + SqlTransacc = Nothing + End Sub + Public Sub Commit() + If SqlTransacc IsNot Nothing Then SqlTransacc.Commit() + SqlTransacc = Nothing + 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 + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesRep") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Exportaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + 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, + 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("@NumeroPedimento", SqlDbType.VarChar).Value = NumeroPedimento + .Add("@FechaPedimento", SqlDbType.Date).Value = FechaPedimento + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@TipoCambio", SqlDbType.Decimal).Value = TipoCambio + .Add("@TipoExportacion", SqlDbType.Int).Value = TipoExportacion + .Add("@CveExportacionEstatus", SqlDbType.Int).Value = CveExportacionEstatus + .Add("@CveClienteExportador", SqlDbType.Int).Value = CveClienteExportador + .Add("@CveClienteImportador", SqlDbType.Int).Value = CveClienteImportador + .Add("@CveClienteConsignatario", SqlDbType.Int).Value = CveClienteConsignatario + .Add("@CveAgente", SqlDbType.Int).Value = CveAgente + .Add("@ClaveAduana", SqlDbType.Int).Value = ClaveAduana + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@MedioTransporte", SqlDbType.Int).Value = MedioTransporte + .Add("@TipoContenedor", SqlDbType.Int).Value = TipoContenedor + .Add("@Sello1", SqlDbType.VarChar).Value = Sello1 + .Add("@Sello2", SqlDbType.VarChar).Value = Sello2 + .Add("@Sello3", SqlDbType.VarChar).Value = Sello3 + .Add("@SCAC", SqlDbType.VarChar).Value = SCAC + .Add("@CAAT", SqlDbType.VarChar).Value = CAAT + .Add("@ContenedorPlaca", SqlDbType.VarChar).Value = ContenedorPlaca + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveDirExportador", SqlDbType.Int).Value = CveDirExportador + .Add("@CveDirConsignatario", SqlDbType.Int).Value = CveDirConsignatario + .Add("@CveIncoterm", SqlDbType.Int).Value = CveIncoterm + .Add("@Notas", SqlDbType.VarChar).Value = Notas + .Add("@CvePedimento", SqlDbType.Int).Value = CvePedimento + .Add("@CveAgenteExtranjero", SqlDbType.Int).Value = CveAgenteExtranjero + .Add("@ITN", SqlDbType.VarChar).Value = ITN + .Add("@Vinculacion", SqlDbType.Bit).Value = Vinculacion + .Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion + + .Add("@CveExportacion", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + CveExportacion = SqlAdapter.SelectCommand.Parameters("@CveExportacion").Value.ToString.ToEntero + Retorno = CveExportacion + Catch ex As Exception + OnError("Ocurrió un error al guardar la Exportación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + 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 + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + .Add("@NumeroPedimento", SqlDbType.VarChar).Value = NumeroPedimento + .Add("@FechaPedimento", SqlDbType.Date).Value = FechaPedimento + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@TipoCambio", SqlDbType.Decimal).Value = TipoCambio + .Add("@TipoExportacion", SqlDbType.Int).Value = TipoExportacion + .Add("@CveExportacionEstatus", SqlDbType.Int).Value = CveExportacionEstatus + .Add("@CveClienteExportador", SqlDbType.Int).Value = CveClienteExportador + .Add("@CveClienteImportador", SqlDbType.Int).Value = CveClienteImportador + .Add("@CveClienteConsignatario", SqlDbType.Int).Value = CveClienteConsignatario + .Add("@CveAgente", SqlDbType.Int).Value = CveAgente + .Add("@ClaveAduana", SqlDbType.Int).Value = ClaveAduana + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@MedioTransporte", SqlDbType.Int).Value = MedioTransporte + .Add("@TipoContenedor", SqlDbType.Int).Value = TipoContenedor + .Add("@Sello1", SqlDbType.VarChar).Value = Sello1 + .Add("@Sello2", SqlDbType.VarChar).Value = Sello2 + .Add("@Sello3", SqlDbType.VarChar).Value = Sello3 + .Add("@SCAC", SqlDbType.VarChar).Value = SCAC + .Add("@CAAT", SqlDbType.VarChar).Value = CAAT + .Add("@ContenedorPlaca", SqlDbType.VarChar).Value = ContenedorPlaca + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveDirExportador", SqlDbType.Int).Value = CveDirExportador + .Add("@CveDirConsignatario", SqlDbType.Int).Value = CveDirConsignatario + .Add("@CveIncoterm", SqlDbType.Int).Value = CveIncoterm + .Add("@Notas", SqlDbType.VarChar).Value = Notas + .Add("@CvePedimento", SqlDbType.Int).Value = CvePedimento + .Add("@CveAgenteExtranjero", SqlDbType.Int).Value = CveAgenteExtranjero + .Add("@ITN", SqlDbType.VarChar).Value = ITN + .Add("@Vinculacion", SqlDbType.Bit).Value = Vinculacion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la Exportación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function RemoveExportacion(CveExportacion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar la Exportación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + Public Function GetGastos(CveExportacion As Integer, Optional CveTG As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_Exportaciones_TranspGastosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + .Add("@CveTG", SqlDbType.Int).Value = CveTG + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los Gastos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function AddGastos(IncFletes As Decimal, IncSeguro As Decimal, IncEmbalajes As Decimal, IncEmbalaje As Decimal, IncConexos As Decimal, + DecFlete As Decimal, DecSeguro As Decimal, DecCarga As Decimal, DecDescarga As Decimal, DecOtros As Decimal, CveExportacion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_Exportaciones_TranspGastosAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@IncFletes", SqlDbType.Decimal).Value = IncFletes + .Add("@IncSeguro", SqlDbType.Decimal).Value = IncSeguro + .Add("@IncEmbalajes", SqlDbType.Decimal).Value = IncEmbalajes + .Add("@IncEmbalaje", SqlDbType.Decimal).Value = IncEmbalaje + .Add("@IncConexos", SqlDbType.Decimal).Value = IncConexos + .Add("@DecFlete", SqlDbType.Decimal).Value = DecFlete + .Add("@DecSeguro", SqlDbType.Decimal).Value = DecSeguro + .Add("@DecCarga", SqlDbType.Decimal).Value = DecCarga + .Add("@DecDescarga", SqlDbType.Decimal).Value = DecDescarga + .Add("@DecOtros", SqlDbType.Decimal).Value = DecOtros + .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + + .Add("@CveTG", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al guardar los Gastos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function UpdateGastos(IncFletes As Decimal, IncSeguro As Decimal, IncEmbalajes As Decimal, IncEmbalaje As Decimal, IncConexos As Decimal, + DecFlete As Decimal, DecSeguro As Decimal, DecCarga As Decimal, DecDescarga As Decimal, DecOtros As Decimal, CveExportacion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_Exportaciones_TranspGastosUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@IncFletes", SqlDbType.Decimal).Value = IncFletes + .Add("@IncSeguro", SqlDbType.Decimal).Value = IncSeguro + .Add("@IncEmbalajes", SqlDbType.Decimal).Value = IncEmbalajes + .Add("@IncEmbalaje", SqlDbType.Decimal).Value = IncEmbalaje + .Add("@IncConexos", SqlDbType.Decimal).Value = IncConexos + .Add("@DecFlete", SqlDbType.Decimal).Value = DecFlete + .Add("@DecSeguro", SqlDbType.Decimal).Value = DecSeguro + .Add("@DecCarga", SqlDbType.Decimal).Value = DecCarga + .Add("@DecDescarga", SqlDbType.Decimal).Value = DecDescarga + .Add("@DecOtros", SqlDbType.Decimal).Value = DecOtros + .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar los Gastos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function +#End Region + +#Region "PARTIDAS" + Public Function GetPartidas(Optional CveEmpresa As Integer = -1, Optional CveExportacion As Integer = -1, Optional CveExportacionDetalle As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesDetalleGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + .Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Partidas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function AddPartida(CvePS As Integer, CveUnidadMedida As Integer, Precio As Decimal, CveEmpresa As Integer, CveUsuario As Integer, CveExportacion As Integer, Cantidad As Decimal, + PesoUnitario As Decimal, CvePais As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesDetalleAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida + .Add("@Precio", SqlDbType.Decimal).Value = Precio + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad + .Add("@PesoUnitario", SqlDbType.Decimal).Value = PesoUnitario + .Add("@CvePais", SqlDbType.Int).Value = CvePais + + .Add("@CveExportacionDetalle", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + CveExportacionDetalle = SqlAdapter.SelectCommand.Parameters("@CveExportacionDetalle").Value.ToString.ToEntero + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al guardar la Partida.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function UpdatePartida(CveExportacionDetalle As Integer, CvePS As Integer, CveUnidadMedida As Integer, Precio As Decimal, CveUsuario As Integer, Cantidad As Decimal, + PesoUnitario As Decimal, CvePais As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesDetalleUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida + .Add("@Precio", SqlDbType.Decimal).Value = Precio + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad + .Add("@PesoUnitario", SqlDbType.Decimal).Value = PesoUnitario + .Add("@CvePais", SqlDbType.Int).Value = CvePais + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la Partida.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemovePartida(CveExportacionDetalle As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_ExportacionesDetalleRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar la Partida.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function +#End Region + +#Region "AGENTES" + Public Function GetAgentes(Optional CveAgente As Integer = -1, Optional CveEmpresa As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Exp_AgentesGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAgente", SqlDbType.Int).Value = CveAgente + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los Agentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function +#End Region + +#Region "IDisposable Support" + ' IDisposable + Protected Overridable Sub Dispose(disposing As Boolean) + If Not Me.disposedValue Then + If disposing Then + + If Not Data Is Nothing Then Data.Dispose() : Data = Nothing + If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing + If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing + If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing + If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close() + If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing + + End If + End If + Me.disposedValue = True + End Sub + Public Sub Dispose() Implements IDisposable.Dispose + ConexionClose() + Dispose(True) + GC.SuppressFinalize(Me) + End Sub +#End Region + +End Class diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 37a62c152..9df264da9 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3017,6 +3017,45 @@ Public Class ClsGenerales OnError("Ocurrió un error al obtener los motivos de traslado del SAT", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno + End Function + Public Function GetSATContenedores() As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_SAT_ContenedoresGet") + With SqlAdapter.SelectCommand.Parameters + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los contenedores del SAT", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function GetSATMediosTransporte() As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_SAT_MediosTransporteGet") + With SqlAdapter.SelectCommand.Parameters + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los medios de transporte del SAT", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function GetSATAduanasSeccion() As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_SAT_AduanasSeccionGet") + With SqlAdapter.SelectCommand.Parameters + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las secciones de aduanas del SAT", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno End Function Public Function GetSATTipoOperacion() As Boolean diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 5753a6ec5..65e819be0 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -545,6 +545,51 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property + Property GlobalDTSATContenedores() As DataTable + Get + Dim AppNombre As String = "GlobalDTSATContenedores" + If Application(AppNombre) Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATContenedores() Then Application(AppNombre) = ObjGrales.DtResultados + ObjGrales.Dispose() + End If + GlobalDTSATContenedores = DirectCast(Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = "GlobalDTSATContenedores" + Application(AppNombre) = value + End Set + End Property + Property GlobalDTSATMediosTransporte() As DataTable + Get + Dim AppNombre As String = "GlobalDTSATMediosTransporte" + If Application(AppNombre) Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATMediosTransporte() Then Application(AppNombre) = ObjGrales.DtResultados + ObjGrales.Dispose() + End If + GlobalDTSATMediosTransporte = DirectCast(Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = "GlobalDTSATMediosTransporte" + Application(AppNombre) = value + End Set + End Property + Property GlobalDTSATAduanasSeccion() As DataTable + Get + Dim AppNombre As String = "GlobalDTSATAduanasSeccion" + If Application(AppNombre) Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATAduanasSeccion() Then Application(AppNombre) = ObjGrales.DtResultados + ObjGrales.Dispose() + End If + GlobalDTSATAduanasSeccion = DirectCast(Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = "GlobalDTSATAduanasSeccion" + Application(AppNombre) = value + End Set + End Property Property GlobalDTUnidadAduana() As DataTable Get Dim AppNombre As String = "GlobalDTUnidadAduana" @@ -3210,6 +3255,27 @@ Public Class ClsPaginas End Property #End Region #Region "***********************************************************************DT GENERALES**************************************************************************************" + Property GlobalDTGralAgentes(CveAgente As Integer, CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = $"GlobalDTGralAgentes-{CveEmpresa}" + If Application(AppNombre) Is Nothing Then + Dim A As New ClsExportaciones + If A.GetAgentes(-1, CveEmpresa) Then Application(AppNombre) = A.DtResultados + A.Dispose() + End If + If CveAgente <> -1 Then + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveAgente = {0}", CveAgente), "", DataViewRowState.CurrentRows) + GlobalDTGralAgentes = Dv.ToTable + Dv.Dispose() + Else + GlobalDTGralAgentes = DirectCast(Application(AppNombre), DataTable) + End If + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTGralAgentes-{CveEmpresa}" + Application(AppNombre) = value + End Set + End Property Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = $"GlobalDTGralCategorias-{CveEmpresa}" @@ -8125,12 +8191,12 @@ Public Class ClsPaginas 'If Not Archivo.Exists Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197) Then Dim ObjProveedor As New ClsCompProveedores - If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, ObjOC.CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, EmpresaActual.CveEmpresa) Then - If ObjProveedor.DtResultados.Rows.Count > 0 Then - params.Add(New ReportParameter("PlazoPago", ObjProveedor.PlazoPago.ToString)) - End If + If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, ObjOC.CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, EmpresaActual.CveEmpresa) Then + If ObjProveedor.DtResultados.Rows.Count > 0 Then + params.Add(New ReportParameter("PlazoPago", ObjProveedor.PlazoPago.ToString)) End If - ObjProveedor.Dispose() + End If + ObjProveedor.Dispose() 'End If @@ -10524,6 +10590,10 @@ Public Class ClsPaginas PaginaDict.Add("/CxC/GestionCobranza.aspx".ToUpper(), 490) PaginaDict.Add("/CxC/RepCxCPeriodo.aspx".ToUpper(), 887) #End Region +#Region "Exportaciones" + 'PaginaDict.Add("/Export/RepExportaciones.aspx".ToUpper(), 77) + PaginaDict.Add("/Export/ExpDetalle.aspx".ToUpper(), 77) +#End Region #Region "Finanzas" PaginaDict.Add("/Finanzas/RepRazonesFinancieras.aspx".ToUpper(), 592) PaginaDict.Add("/Finanzas/FinanMetas.aspx".ToUpper(), 361) @@ -11292,6 +11362,12 @@ Public Class ClsPaginas Case Else : Retorno = 9 End Select End If + If Pagina.ToUpper() = ("/Export/RepExportaciones.aspx").ToUpper() Then + Select Case Request("Opcion") + Case "I" : Retorno = 85 + Case Else : Retorno = 77 + End Select + End If Return Retorno End Function #End Region diff --git a/Bancos/CatBancos.aspx b/Bancos/CatBancos.aspx index 3fa839955..481fe7485 100644 --- a/Bancos/CatBancos.aspx +++ b/Bancos/CatBancos.aspx @@ -4,6 +4,16 @@ +
  • @@ -24,6 +34,12 @@ + +
    + + Banco SAT + + + Banco @@ -64,6 +80,13 @@
    + + Seleccione uno + + + + @@ -90,8 +113,22 @@ - + + + + + + + + Seleccione uno + + + + + @@ -142,10 +179,14 @@ -
    - -   -
    +
    +
    + +
    +
    + +
    +
    diff --git a/Bancos/CatBancos.aspx.vb b/Bancos/CatBancos.aspx.vb index 1784f8c16..ab30a2db6 100644 --- a/Bancos/CatBancos.aspx.vb +++ b/Bancos/CatBancos.aspx.vb @@ -19,13 +19,43 @@ Partial Class Bancos_CatBancos End Set End Property + Private Property DTBancosSAT As DataTable + Get + If ViewState("DTBancosSAT") Is Nothing Then + ViewState("DTBancosSAT") = New DataTable() + End If + Return DirectCast(ViewState("DTBancosSAT"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DTBancosSAT") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then + CargaBancosSAT() ViewState("Orden") = "" CargaDatos() End If End Sub + Private Sub CargaBancosSAT() + + Dim ObjBancos As New ClsBancos + + If ObjBancos.GetBancosSAT Then + DdlSatBanco.DataSource = ObjBancos.DtResultados + DTBancosSAT = ObjBancos.DtResultados + End If + + ObjBancos.Dispose() + + DdlSatBanco.DataBind() + DdlSatBanco.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + End Sub + Public Sub CargaDatos() Dim ObjBancos As New ClsBancos If ObjBancos.GetBancos() Then @@ -47,7 +77,8 @@ Partial Class Bancos_CatBancos Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click Dim ObjBancos As New ClsBancos - If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveSATBanco:=DdlSatBanco.SelectedValue.ToEntero) Then + DdlSatBanco.SelectedValueExist(-1) TxtBanco.Text = "" TxtEjecutivo.Text = "" TxtTelefono.Text = "" @@ -68,24 +99,42 @@ Partial Class Bancos_CatBancos #Region "G V D A T O S" Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.RowIndex = 0 Then - e.Row.Cells(0).Width = Unit.Pixel(156) 'BANCO - e.Row.Cells(1).Width = Unit.Pixel(206) 'EJECUTIVO - e.Row.Cells(2).Width = Unit.Pixel(106) 'TELEFONO - e.Row.Cells(3).Width = Unit.Pixel(95) 'ESTATUS - e.Row.Cells(4).Width = Unit.Pixel(95) 'FECHA - e.Row.Cells(5).Width = Unit.Pixel(100) 'USUARIO - e.Row.Cells(6).Width = Unit.Pixel(100) 'EDITAR - e.Row.Cells(7).Width = Unit.Pixel(65) 'ELIMINAR + e.Row.Cells(0).Width = Unit.Pixel(156) 'BANCO SAT + e.Row.Cells(1).Width = Unit.Pixel(156) 'BANCO + e.Row.Cells(2).Width = Unit.Pixel(206) 'EJECUTIVO + e.Row.Cells(3).Width = Unit.Pixel(106) 'TELEFONO + e.Row.Cells(4).Width = Unit.Pixel(95) 'ESTATUS + e.Row.Cells(5).Width = Unit.Pixel(95) 'FECHA + e.Row.Cells(6).Width = Unit.Pixel(100) 'USUARIO + e.Row.Cells(7).Width = Unit.Pixel(65) 'EDITAR + e.Row.Cells(8).Width = Unit.Pixel(65) 'ELIMINAR End If + e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left - e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center + e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center - e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center + 'e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center + e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Center + End If + + If (e.Row.RowState And DataControlRowState.Edit) = DataControlRowState.Edit Then + Dim DdlSatBanco As DropDownList = e.Row.FCDropDownList("DdlSatBanco") + DdlSatBanco.ClearSelection() + DdlSatBanco.SelectedValue = Nothing + DdlSatBanco.Items.Clear() + DdlSatBanco.DataSource = DTBancosSAT + DdlSatBanco.DataBind() + DdlSatBanco.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + DdlSatBanco.SelectedValueExist(e.Row.DataKey("CveSATBanco").ToString()) + End If + End Sub Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting @@ -126,19 +175,16 @@ Partial Class Bancos_CatBancos Dim Telefono As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTelefono"), TextBox).Text.Trim Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked Dim CveBanco As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero + Dim CveSATBanco As Integer = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlSatBanco").SelectedValue.ToEntero Dim TieneError As Boolean = False - If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco) Then - If ObjBancos.InhabilitarCuentasBancos(CveBanco, Estatus) Then - GvDatos.EditIndex = -1 - ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTBancos = ObjBancos.DtResultados - Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) - Else + If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco, CveSATBanco:=CveSATBanco) Then + + If Not ObjBancos.InhabilitarCuentasBancos(CveBanco, Estatus) Then TieneError = True End If + Else TieneError = True End If @@ -152,12 +198,24 @@ Partial Class Bancos_CatBancos ObjBancos.Dispose() - If ViewState("Orden").ToString() <> String.Empty Then - CargaGrid(ViewState("Orden").ToString()) - Else - CargaGrid("") + If Not TieneError Then + + GvDatos.EditIndex = -1 + CargaDatos() + GlobalDTBancos = Nothing + Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + + If ViewState("Orden").ToString() <> String.Empty Then + CargaGrid(ViewState("Orden").ToString()) + Else + CargaGrid("") + End If + End If + + + End Sub Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 12b98c61b..673703de3 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1284,6 +1284,7 @@ Partial Class Bancos_IE ViewState("CveCliente") = "-1" CargaProveedor(HdnCveProveedor.Value.ToEntero, "-1") + CargaCuentasDepositos() End Sub Private Sub CargaProveedor(ByVal CveProveedor As Integer, RFC As String) @@ -1553,6 +1554,9 @@ Partial Class Bancos_IE If trIEDevolucion.Visible And RBL.SelectedValue <> "C" Then CargaIEDevoluciones() End If + + CargaCuentasDepositos() + End Sub #End Region @@ -4084,88 +4088,204 @@ Partial Class Bancos_IE #Region " CUENTAS DEPOSITOS " 'Si la cuenta no esta activa, no la muestra. Private Sub CargaCuentasDepositos() - DdlCuentaDeposito.Items.Clear() + '¿DdlCuentaDeposito.Items.Clear() 'If DdlTipoTransaccion.SelectedValue.Contiene("2", "9") Then ' transferencias y layout + + DdlCuentaDeposito.ClearSelection() + DdlCuentaDeposito.SelectedValue = Nothing + DdlCuentaDeposito.Items.Clear() + trCuentaDeposito.Visible = False Dim dtc As DataTable = Nothing - If CveProveedor > 0 Then - dtc = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + Dim CveProveedorTemp As Integer = 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 dtc = GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, CveCliente:=CveCliente) - ElseIf cvepersonal > 0 Then + ElseIf CvePersonal > 0 Then dtc = GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) End If - ' If Dep.GetCuentasDepositos(CveProveedor:=CveProveedor, CveCliente:=CveCliente, CvePersonal:=CvePersonal) Then - If dtc IsNot Nothing Then - - If DdlTipoTransaccion.SelectedValue = "9" And CveIE <= -1 Then - - DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") - - If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then - trCuentaDeposito.Visible = True - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - Else - Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) - End If - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - ElseIf DdlTipoTransaccion.SelectedValue = "17" And CveIE <= -1 Then - - If dtc.Rows.Count > 0 Then - DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus = 'True' ") - trCuentaDeposito.Visible = True - BtnGuardar.ToolTip = "" - Else - BtnGuardar.Enabled = False - Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) - BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" - - End If - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - UpGuardar.Update() - - Else - DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") - If dtc.Rows.Count > 0 Then - trCuentaDeposito.Visible = True - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - - End If - End If - - Else - - If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") And CveIE <= -1 Then - - BtnGuardar.Enabled = False - Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) - BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" - Else - trCuentaDeposito.Visible = True - BtnGuardar.Enabled = True - End If - - UpGuardar.Update() + Dim OpBanco As Integer = 1 + Dim CuentaBanco As String = DdlCuenta.SelectedItem.Text.ToUpper + If CuentaBanco.Contains("BBVA") Or CuentaBanco.Contains("BANCOMER") Then + OpBanco = 1 + 'ElseIf CuentaBanco.Contains("BAJIO") Then + ' OpBanco = 2 + ElseIf CuentaBanco.Contains("SCOTIA") Then + OpBanco = 3 End If + If DdlCuenta.SelectedValue = "-1" Then + BtnGuardar.Enabled = False + trCuentaDeposito.Visible = False + DdlCuentaDeposito.Items.Clear() + 'UpnCuentasPago.Update() + UpCuentaDeposito.Update() + Return + End If + + + '' If Dep.GetCuentasDepositos(CveProveedor:=CveProveedor, CveCliente:=CveCliente, CvePersonal:=CvePersonal) Then + 'If dtc IsNot Nothing Then + + ' If DdlTipoTransaccion.SelectedValue = "9" And CveIE <= -1 Then + + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") + + ' If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + ' End If + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' ElseIf DdlTipoTransaccion.SelectedValue = "17" And CveIE <= -1 Then + + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus = 'True' ") + ' trCuentaDeposito.Visible = True + ' BtnGuardar.ToolTip = "" + ' Else + ' BtnGuardar.Enabled = False + ' Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + + ' End If + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' UpGuardar.Update() + + ' Else + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + ' If dtc.Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + + ' End If + ' End If + + 'Else + + ' If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") And CveIE <= -1 Then + + ' BtnGuardar.Enabled = False + ' Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' Else + ' trCuentaDeposito.Visible = True + ' BtnGuardar.Enabled = True + ' End If + + ' UpGuardar.Update() + + 'End If + 'If DdlTipoTransaccion.SelectedValue = "9" AndAlso DdlCuentaDeposito.Items.Count = 0 Then ' BtnIEGuardar.Enabled = False 'End If 'GVCuentasPago.DataBind() - DdlCuentaDeposito.DataBind() + 'DdlCuentaDeposito.DataBind() 'Else ' trCuentaDeposito.Visible = False ' DdlCuentaDeposito.Items.Clear() 'End If + + If dtc IsNot Nothing Then + + If DdlTipoTransaccion.SelectedValue = "9" Then + + If OpBanco = 1 Then + If dtc.Rows.Count > 0 Then + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() + End If + + If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + Else + BtnGuardar.Enabled = False + Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + End If + + ElseIf OpBanco = 3 Then + If dtc.Rows.Count > 0 Then + DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus ='True'") + DdlCuentaDeposito.DataBind() + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + End If + + If dtc.FiltraParametros(" Estatus ='True'").Rows.Count > 0 Then + trCuentaDeposito.Visible = True + 'DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + Else + 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) + End If + End If + ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + If OpBanco = 1 Then + If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'").Rows.Count > 0 Then + DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + trCuentaDeposito.Visible = True + BtnGuardar.ToolTip = "" + Else + BtnGuardar.Enabled = False + BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + End If + + Else + BtnGuardar.Enabled = False + BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito para layout grupos" + Alert("El proveedor no tiene cuentas deposito para layout grupos.", TipoMensaje.MsgAdvertencia) + End If + + + + Else + 'Respuesta = True + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + DdlCuentaDeposito.DataBind() + + If dtc.Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + End If + BtnGuardar.Enabled = True + 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() UpCuentaDeposito.Update() UpDatos.Update() End Sub @@ -4400,6 +4520,7 @@ Partial Class Bancos_IE DdlProveedores_selectedindexchange(DdlProveedores, Nothing) DdlProveedores.SelectedText = RazonSocial ' BuscaCargaProveedor() + End If CveOCSolicitudAnticipo = DrOC("CveOC").ToString.ToEntero Else diff --git a/Bancos/PagoElectronico.aspx b/Bancos/PagoElectronico.aspx index 453f22d68..5bd2bf71c 100644 --- a/Bancos/PagoElectronico.aspx +++ b/Bancos/PagoElectronico.aspx @@ -60,7 +60,7 @@
    -
    +
    @@ -79,7 +79,7 @@
    -
    +
    @@ -127,7 +127,7 @@
    -
    +
    @@ -178,7 +178,7 @@
    -
    +
    diff --git a/Bancos/PagoElectronico.aspx.vb b/Bancos/PagoElectronico.aspx.vb index a9414bc09..b058e60bb 100644 --- a/Bancos/PagoElectronico.aspx.vb +++ b/Bancos/PagoElectronico.aspx.vb @@ -277,6 +277,8 @@ Partial Class Bancos_PagoElectronico If DTPendientes IsNot Nothing AndAlso DTPendientes.Rows.Count > 0 Then CargaDatosInformativos() + Else + VistaComandoGeneracion() End If End Sub @@ -946,7 +948,7 @@ Partial Class Bancos_PagoElectronico Dim correo As String = dr("Correo").ToString.Trim If correo.Trim.Length = 0 Then - SBErrores.Append($"Email no definido en fila {idx + 1}. Debe ser un correo electrónico válido.
    ") + SBErrores.Append($" {nombreBen} Email no definido en fila {idx + 1}. Debe ser un correo electrónico válido.
    ") ErrorLayout = True End If @@ -1044,35 +1046,35 @@ Partial Class Bancos_PagoElectronico Dim NombreArchivo As String = $"pagos_{NowADS.ToString("ddMMyyyy")}_001.txt" '"pagos_03062025_001.txt" - 'If InsertaEnDB Then + If InsertaEnDB Then - ' Dim ObjBancos As New ClsBancos - ' ObjBancos.IniciaTransacSQL() + Dim ObjBancos As New ClsBancos + ObjBancos.IniciaTransacSQL() - ' Dim CveLayoutEnvio As Integer = ObjBancos.AddLayoutEnvios(NombreArchivo, NowADS(), CveCuenta, PorGrupos:=True) + Dim CveLayoutEnvio As Integer = ObjBancos.AddLayoutEnvios(NombreArchivo, NowADS(), CveCuenta, PorGrupos:=True) - ' If CveLayoutEnvio > 0 Then - ' For Each dr As DataRow In DTPendientes.Rows - ' If dr("CveProveedor").ToString <> "" Or dr("CvePersonal").ToString <> "" Then - ' If Not ObjBancos.AddLayoutEnviosDetalle(CveLayoutEnvio, dr("CveIE").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, dr("CvePersonal").ToString.ToEntero, 1, "Observaciones") Then - ' ErrorLayout = True - ' Exit For - ' End If - ' End If - ' Next - ' Else - ' ErrorLayout = True - ' End If + If CveLayoutEnvio > 0 Then + For Each dr As DataRow In DTPendientes.Rows + If dr("CveProveedor").ToString <> "" Or dr("CvePersonal").ToString <> "" Then + If Not ObjBancos.AddLayoutEnviosDetalle(CveLayoutEnvio, dr("CveIE").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, dr("CvePersonal").ToString.ToEntero, 1, "Observaciones") Then + ErrorLayout = True + Exit For + End If + End If + Next + Else + ErrorLayout = True + End If - ' If ErrorLayout Then - ' ObjBancos.RollBack() - ' ObjBancos.Dispose() - ' Else - ' ObjBancos.Commit() - ' ObjBancos.Dispose() - ' End If + If ErrorLayout Then + ObjBancos.RollBack() + ObjBancos.Dispose() + Else + ObjBancos.Commit() + ObjBancos.Dispose() + End If - 'End If + End If Dim path As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo) Dim pathDirectorio As String = String.Format("{0}Layout\", UsuarioActual.Empresa.Ruta) @@ -1499,11 +1501,23 @@ Partial Class Bancos_PagoElectronico End If ObjBancos.Dispose() - If DtRegenerar IsNot Nothing Then - GeneraPago(DtRegenerar, CveBLE) - Else - Alert("Ocurrió un error al obtener los datos para generar el archivo. Por favor vuelva a intentar.", TipoMensaje.MsgError) + If OpBancos = 1 Then + If DtRegenerar IsNot Nothing Then + GeneraPago(DtRegenerar, CveBLE) + Else + Alert("Ocurrió un error al obtener los datos para generar el archivo. Por favor vuelva a intentar.", TipoMensaje.MsgError) + End If End If + + If OpBancos = 3 Then + If DtRegenerar IsNot Nothing Then + GeneraPagoScotiaBank(DtRegenerar, False) + Else + Alert("Ocurrió un error al obtener los datos para generar el archivo. Por favor vuelva a intentar.", TipoMensaje.MsgError) + End If + End If + + End Sub #End Region @@ -1900,8 +1914,9 @@ Partial Class Bancos_PagoElectronico ElseIf OpBancos = 2 Then ElseIf OpBancos = 3 Then - If DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'") IsNot Nothing Then - GeneraPagoScotiaBank(DTPendientes.FiltraParametros("EstatusPagoElectronico > 0 AND EstatusCtaDeposito > 0"), False) + If DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'") IsNot Nothing AndAlso + DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'").Rows.Count > 0 Then + GeneraPagoScotiaBank(DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'"), True) Else Alert("No hay registros para generar pagos en ScotiaBank", TipoMensaje.MsgAdvertencia) End If @@ -2370,6 +2385,8 @@ Partial Class Bancos_PagoElectronico If OpBancos = 3 Then + TextoArreglo = File.ReadAllLines(path:=NombreArchivo) ' Texto.Split(CChar(vbCrLf)) + Dim SBCuentasAltas As New StringBuilder Dim SBErrores As New StringBuilder Dim ErrorArchivoScotia As Boolean = False @@ -2399,6 +2416,7 @@ Partial Class Bancos_PagoElectronico End If Dim ObjBancos As New ClsBancos + ObjBancos.IniciaTransacSQL() For i As Integer = 1 To TextoArreglo.Length - 2 Step 1 @@ -2406,12 +2424,17 @@ Partial Class Bancos_PagoElectronico If Linea.Length = 140 Then - Dim CodigoRespuesta As String = Linea.Substring(0, 3) + Dim CodigoRespuesta As String = Linea.Substring(109, 3) + Dim DTipoArchivo As String = Linea.Substring(0, 2) Dim Cuenta As String = Linea.Substring(12, 20) - 'Dim FechaEliminacion As Date = Linea.Substring(32, 8).ToDate Dim FechaEliminacion As Date = Date.ParseExact(Linea.Substring(32, 8), "yyyyMMdd", Globalization.CultureInfo.InvariantCulture) + If DTipoArchivo <> "SP" Then + SBErrores.Append($"Error Linea {i} el tipo de archivo no es un archivo de respuesta (SP), inicia con codigo {DTipoArchivo}.
    ") + ErrorArchivoScotia = True + End If + If CodigoRespuesta = "000" Or CodigoRespuesta = " " Then Dim CveCuentaDeposito As Integer = Linea.Substring(40, 50).Trim.ToEntero @@ -2439,11 +2462,16 @@ Partial Class Bancos_PagoElectronico Next If ErrorArchivoScotia Then - Alert($"El archivo presento errores en su procesamiento({SBErrores.Length}). Se dieron de alta {SBCuentasAltas.Length} cuentas.
    Altas:
    {SBCuentasAltas.ToString}.

    Errores:
    {SBErrores.ToString}", TipoMensaje.MsgAdvertencia) + ObjBancos.RollBack() + Alert($"El archivo presento errores en su procesamiento({SBErrores.Length}). Correctos {SBCuentasAltas.Length} cuentas.
    Altas:
    {SBCuentasAltas.ToString}.

    Errores:
    {SBErrores.ToString}", TipoMensaje.MsgAdvertencia) Else + ObjBancos.Commit() Alert($"El archivo se analizo correctamente y se efectuaron todos los cambios en el sistema. cuentas procesadas:
    {SBCuentasAltas.ToString}", TipoMensaje.MsgInformacion) End If + + + ObjBancos.Dispose() End If @@ -2944,6 +2972,8 @@ Partial Class Bancos_PagoElectronico If OpBancos = 3 Then + TextoArreglo = File.ReadAllLines(NombreArchivo) 'Texto.Split(CChar(vbCrLf)) + Dim CveIES As List(Of Integer) = New List(Of Integer) Dim LienasCount As Integer = TextoArreglo.Length Dim SBErrores As New StringBuilder @@ -2956,8 +2986,9 @@ Partial Class Bancos_PagoElectronico End If Dim Header As String = TextoArreglo(0) - Dim HCodigo As String = TextoArreglo(0).Substring(0, 3).Trim - If HCodigo <> "SVH" Then + Dim HCodigo As String = TextoArreglo(0).Substring(35, 3).Trim + Dim HTipoArchivo As String = TextoArreglo(0).Substring(0, 3).Trim + If HTipoArchivo <> "SVH" Then Alert("El archivo no es un archivo de respuesta, debe tener un encabezado con SVH.", TipoMensaje.MsgError) Exit Sub End If @@ -3130,13 +3161,14 @@ Partial Class Bancos_PagoElectronico End If Next Catch ex As Exception - Alert("Ocurrió un error al enviar los correos de notificación.", TipoMensaje.MsgError) + Alert("Ocurrió un error al enviar los correos de notificación.", TipoMensaje.MsgAdvertencia) End Try Alert(Respuesta.ToString, TipoMensaje.MsgInformacion) Else + Alert("Ocurrió un error al procesar el archivo.", TipoMensaje.MsgAdvertencia) objIE.RollBack() End If diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb index 94f068664..981d83af1 100644 --- a/Bancos/PagoElectronicoGrupos.aspx.vb +++ b/Bancos/PagoElectronicoGrupos.aspx.vb @@ -442,7 +442,7 @@ Partial Class Bancos_PagoElectronicoGrupos Case DdlCuenta.SelectedItem.Text.ToUpper.Contains("SCOTIA") - habilitada = (dr("EstatusPagoElectronicoGruposScotia").ToString = "True") + habilitada = (dr("EstatusPagoElectronicoScotia").ToString = "True") Case Else habilitada = False 'Otros bancos sin bandera propia @@ -689,7 +689,7 @@ Partial Class Bancos_PagoElectronicoGrupos CuentaDepositoSinAlta = True End If - If DdlCuenta.SelectedItem.Text.ToUpper.Contains("SCOTIA") AndAlso e.Row.DBCampo("EstatusPagoElectronicoGruposScotia").ToString <> "True" Then + If DdlCuenta.SelectedItem.Text.ToUpper.Contains("SCOTIA") AndAlso e.Row.DBCampo("EstatusPagoElectronicoScotia").ToString <> "True" Then CuentaDepositoSinAlta = True End If @@ -2037,15 +2037,15 @@ Partial Class Bancos_PagoElectronicoGrupos 'Motivo de pago 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 - RegistrosPago.Append(drow("Observaciones").ToString.PadRight(30, EspacioRelleno)) + RegistrosPago.Append(drow("Observaciones").ToString.Trim.PadRight(30, EspacioRelleno)) End If 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 - RegistrosPago.Append(drow("Referencia").ToString.PadRight(7, EspacioRelleno)) + RegistrosPago.Append(drow("Referencia").ToString.Trim.PadRight(7, EspacioRelleno)) End If RegistrosPago.Append("H") diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 5d3eb3332..ee457fcd8 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -774,73 +774,178 @@ Partial Class Bancos_PopIECompras End Sub Private Sub CargaCuentasDepositos() - DdlCuentaDeposito.Items.Clear() - If DdlTipoTransaccion.SelectedValue.Contiene("2", "9", "17") Then ' transferencias y layout - trCuentaDeposito.Visible = False - - Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + 'DdlCuentaDeposito.Items.Clear() - If dtc IsNot Nothing Then + 'If DdlTipoTransaccion.SelectedValue.Contiene("2", "9", "17") Then ' transferencias y layout + ' trCuentaDeposito.Visible = False - If DdlTipoTransaccion.SelectedValue = "9" Then - - DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") - - If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then - trCuentaDeposito.Visible = True - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - Else - BtnGuardar.Enabled = False - Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) - End If - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + ' Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + ' If dtc IsNot Nothing Then + + ' If DdlTipoTransaccion.SelectedValue = "9" Then + + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") + + ' If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' BtnGuardar.Enabled = False + ' Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + ' End If + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc + ' trCuentaDeposito.Visible = True + ' BtnGuardar.ToolTip = "" + ' Else + + ' BtnGuardar.Enabled = False + ' BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + + ' End If + + ' UpGuardar.Update() + + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + ' If dtc.Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + ' End If + ' Else + + ' If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then + + ' BtnGuardar.Enabled = False + ' BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' Else + ' trCuentaDeposito.Visible = True + ' BtnGuardar.Enabled = True + ' BtnGuardar.ToolTip = "" + ' End If + + ' UpGuardar.Update() + + ' End If + + ' DdlCuentaDeposito.DataBind() + + 'Else + ' trCuentaDeposito.Visible = False + ' DdlCuentaDeposito.Items.Clear() + ' 'TrReferenciaCIE.Visible = False + 'End If + + 'UpCuentaDeposito.Update() + + DdlCuentaDeposito.ClearSelection() + DdlCuentaDeposito.SelectedValue = Nothing + DdlCuentaDeposito.Items.Clear() + + trCuentaDeposito.Visible = False + + + Dim OpBanco As Integer = 1 + Dim CuentaBanco As String = DdlCuenta.SelectedItem.Text.ToUpper + + If CuentaBanco.Contains("BBVA") Or CuentaBanco.Contains("BANCOMER") Then + OpBanco = 1 + 'ElseIf CuentaBanco.Contains("BAJIO") Then + ' OpBanco = 2 + ElseIf CuentaBanco.Contains("SCOTIA") Then + OpBanco = 3 + End If + + If DdlCuenta.SelectedValue = "-1" Then + BtnGuardar.Enabled = False + trCuentaDeposito.Visible = False + DdlCuentaDeposito.Items.Clear() + 'UpnCuentasPago.Update() + UpCuentaDeposito.Update() + Return + End If + + + Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + + If dtc IsNot Nothing Then + + If DdlTipoTransaccion.SelectedValue = "9" Then + + If OpBanco = 1 Then If dtc.Rows.Count > 0 Then - DdlCuentaDeposito.DataSource = dtc + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() + End If + + If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + Else + BtnGuardar.Enabled = False + Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + End If + + ElseIf OpBanco = 3 Then + If dtc.Rows.Count > 0 Then + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + End If + + If dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'").Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + Else + 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) + End If + End If + ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + If OpBanco = 1 Then + If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'").Rows.Count > 0 Then + DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) trCuentaDeposito.Visible = True BtnGuardar.ToolTip = "" Else - BtnGuardar.Enabled = False BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" - + Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) End If - UpGuardar.Update() - - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - Else - DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") - If dtc.Rows.Count > 0 Then - trCuentaDeposito.Visible = True - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - End If - End If - Else - - If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then - - BtnGuardar.Enabled = False - BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" Else - trCuentaDeposito.Visible = True - BtnGuardar.Enabled = True - BtnGuardar.ToolTip = "" + BtnGuardar.Enabled = False + BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito para layout grupos" + Alert("El proveedor no tiene cuentas deposito para layout grupos.", TipoMensaje.MsgAdvertencia) End If - UpGuardar.Update() - - End If - DdlCuentaDeposito.DataBind() - - Else - trCuentaDeposito.Visible = False - DdlCuentaDeposito.Items.Clear() - 'TrReferenciaCIE.Visible = False + + Else + 'Respuesta = True + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + DdlCuentaDeposito.DataBind() + + If dtc.Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + End If + + BtnGuardar.Enabled = True + End If End If + 'UpnCuentasPago.Update() + UpGuardar.Update() UpCuentaDeposito.Update() End Sub @@ -896,6 +1001,9 @@ Partial Class Bancos_PopIECompras Banco.Dispose() End If + + CargaCuentasDepositos() + End Sub 'Private Sub DdlOtrosPagos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlOtrosPagos.SelectedIndexChanged diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 86cad07ec..3094fe5e3 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1405,6 +1405,10 @@ Partial Class Bancos_ProveedoresAbonar TxtFolio.Text = "" End If + 'ValidaCuentasDepositoLayouts() + + CargaCuentasDepositos() + 'Dim dr2 As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) 'If dr2 IsNot Nothing Then @@ -1416,6 +1420,106 @@ Partial Class Bancos_ProveedoresAbonar 'End If End Sub + 'Function ValidaCuentasDepositoLayouts() As Boolean + + ' Dim Respuesta As Boolean = False + ' Dim OpBanco As Integer = 1 + + ' Dim CuentaBanco As String = DdlCuenta.SelectedItem.Text.ToUpper + + ' If CuentaBanco.Contains("BBVA") Or CuentaBanco.Contains("BANCOMER") Then + ' OpBanco = 1 + ' 'ElseIf CuentaBanco.Contains("BAJIO") Then + ' ' OpBanco = 2 + ' ElseIf CuentaBanco.Contains("SCOTIA") Then + ' OpBanco = 3 + ' End If + + + ' Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + + ' If dtc IsNot Nothing Then + + ' If DdlTipoTransaccion.SelectedValue = "9" Then + + ' If OpBanco = 1 Then + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + + ' If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' BtnIEGuardar.Enabled = False + ' Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + ' End If + + ' ElseIf OpBanco = 3 Then + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + + ' If dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'").Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' BtnIEGuardar.Enabled = False + ' Alert("El Beneficiario no tiene una cuenta activa en Scotiabank, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + ' End If + ' End If + ' ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + ' If OpBanco = 1 Then + ' If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'").Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' trCuentaDeposito.Visible = True + ' BtnIEGuardar.ToolTip = "" + ' Else + ' BtnIEGuardar.Enabled = False + ' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' End If + ' 'ElseIf OpBanco = 3 Then + ' ' If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'").Rows.Count > 0 Then + ' ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'") + ' ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' ' trCuentaDeposito.Visible = True + ' ' BtnIEGuardar.ToolTip = "" + ' ' Else + ' ' BtnIEGuardar.Enabled = False + ' ' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' ' Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' ' End If + ' Else + ' BtnIEGuardar.Enabled = False + ' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito para layout grupos" + ' Alert("El proveedor no tiene cuentas deposito para layout grupos.", TipoMensaje.MsgAdvertencia) + ' End If + + + + ' Else + ' Respuesta = True + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + ' If dtc.Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + ' End If + ' End If + + + + ' UpGuardar.Update() + + ' Return Respuesta + + 'End Function + 'Private Sub CargaGridTarjetas() @@ -1432,20 +1536,120 @@ Partial Class Bancos_ProveedoresAbonar #Region " CUENTAS DEPOSITOS" Private Sub CargaCuentasDepositos() + + DdlCuentaDeposito.ClearSelection() + DdlCuentaDeposito.SelectedValue = Nothing DdlCuentaDeposito.Items.Clear() trCuentaDeposito.Visible = False + 'Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + 'If dtc IsNot Nothing Then + + ' If dtc.FiltraParametros("Estatus ='True'").Rows.Count > 0 Then + + ' If DdlTipoTransaccion.SelectedValue = "9" Then + + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + + ' If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' 'BtnIEGuardar.Enabled = False + ' 'Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + ' End If + + ' ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' trCuentaDeposito.Visible = True + ' BtnIEGuardar.ToolTip = "" + ' Else + ' 'BtnIEGuardar.Enabled = False + ' 'BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' 'Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' End If + ' UpGuardar.Update() + ' Else + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + ' If dtc.Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + ' End If + ' DdlCuentaDeposito.DataBind() + ' Else + + ' If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then + ' 'BtnIEGuardar.Enabled = False + ' 'BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' 'Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' Else + ' trCuentaDeposito.Visible = True + ' BtnIEGuardar.Enabled = True + ' BtnIEGuardar.ToolTip = "" + ' End If + ' UpGuardar.Update() + ' End If + 'Else + + ' If DdlTipoTransaccion.SelectedValue = "17" Then + ' BtnIEGuardar.Enabled = False + ' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' Else + ' trCuentaDeposito.Visible = True + ' BtnIEGuardar.Enabled = True + ' BtnIEGuardar.ToolTip = "" + ' End If + + ' UpGuardar.Update() + 'End If + + 'Else + ' trCuentaDeposito.Visible = False + ' DdlCuentaDeposito.Items.Clear() + 'End If + 'RecargaGlobalCuentasBancarias() + + + Dim OpBanco As Integer = 1 + + Dim CuentaBanco As String = DdlCuenta.SelectedItem.Text.ToUpper + + If CuentaBanco.Contains("BBVA") Or CuentaBanco.Contains("BANCOMER") Then + OpBanco = 1 + 'ElseIf CuentaBanco.Contains("BAJIO") Then + ' OpBanco = 2 + ElseIf CuentaBanco.Contains("SCOTIA") Then + OpBanco = 3 + End If + + If DdlCuenta.SelectedValue = "-1" Then + BtnIEGuardar.Enabled = False + trCuentaDeposito.Visible = False + DdlCuentaDeposito.Items.Clear() + UpnCuentasPago.Update() + UpCuentaDeposito.Update() + Return + End If + + Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + If dtc IsNot Nothing Then - If dtc.FiltraParametros("Estatus ='True'").Rows.Count > 0 Then - - If DdlTipoTransaccion.SelectedValue = "9" Then + If DdlTipoTransaccion.SelectedValue = "9" Then + If OpBanco = 1 Then If dtc.Rows.Count > 0 Then DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + DdlCuentaDeposito.DataBind() End If If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then @@ -1456,10 +1660,27 @@ Partial Class Bancos_ProveedoresAbonar Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) End If - ElseIf DdlTipoTransaccion.SelectedValue = "17" Then - + ElseIf OpBanco = 3 Then If dtc.Rows.Count > 0 Then - DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus ='True'") + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + End If + + If dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'").Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + Else + BtnIEGuardar.Enabled = False + Alert("El Beneficiario no tiene una cuenta activa en Scotiabank, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + End If + End If + ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + If OpBanco = 1 Then + If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'").Rows.Count > 0 Then + DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) trCuentaDeposito.Visible = True BtnIEGuardar.ToolTip = "" @@ -1468,47 +1689,39 @@ Partial Class Bancos_ProveedoresAbonar BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) End If - UpGuardar.Update() + 'ElseIf OpBanco = 3 Then + ' If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'").Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' trCuentaDeposito.Visible = True + ' BtnIEGuardar.ToolTip = "" + ' Else + ' BtnIEGuardar.Enabled = False + ' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' End If Else - DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") - If dtc.Rows.Count > 0 Then - trCuentaDeposito.Visible = True - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - End If - End If - DdlCuentaDeposito.DataBind() - Else - - If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then BtnIEGuardar.Enabled = False - BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" - Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) - Else - trCuentaDeposito.Visible = True - BtnIEGuardar.Enabled = True - BtnIEGuardar.ToolTip = "" + BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito para layout grupos" + Alert("El proveedor no tiene cuentas deposito para layout grupos.", TipoMensaje.MsgAdvertencia) End If - UpGuardar.Update() - End If - Else - If DdlTipoTransaccion.SelectedValue = "17" Then - BtnIEGuardar.Enabled = False - BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + + Else - trCuentaDeposito.Visible = True - BtnIEGuardar.Enabled = True - BtnIEGuardar.ToolTip = "" - End If + 'Respuesta = True + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + DdlCuentaDeposito.DataBind() - UpGuardar.Update() + If dtc.Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + End If + BtnIEGuardar.Enabled = True + End If End If - 'Else - ' trCuentaDeposito.Visible = False - ' DdlCuentaDeposito.Items.Clear() - 'End If - 'RecargaGlobalCuentasBancarias() + UpGuardar.Update() UpnCuentasPago.Update() UpCuentaDeposito.Update() End Sub diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index bf2ccb6ec..3d6d102d3 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -5042,7 +5042,7 @@ - + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index dc292aa46..b9ee9e5b3 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -15524,6 +15524,9 @@ Partial Class Compras_Compras End If End If + Dim ivaPorcentaje As Decimal = DTOCGV.MAX("IVAPorcentaje").ToDecimal + Dim IVAPorcentajeTmp As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal + If DTOCGV.MAX("IVAPorcentaje").ToDecimal <> TmpDT.MAX("IVAPorcentaje").ToDecimal Then Alert("La orden de compra(s) tiene diferentes tasa de IVA.", TipoMensaje.MsgAdvertencia) End If diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index a3e2ddbda..634f7cc68 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -5890,7 +5890,14 @@ Partial Class Compras_Proveedores Private Sub CargaTipoTransaccion() + + + If GlobalDTDIOTTipoOperacion IsNot Nothing AndAlso GlobalDTDIOTTipoOperacion.Rows.Count = 0 Then + GlobalDTDIOTTipoOperacion = Nothing + End If + Dim Filtro As String = "" + Select Case DDlDIOTTipoTercero.SelectedValue Case "1" Filtro = "AplicaProvNacional = 1" @@ -5900,8 +5907,11 @@ Partial Class Compras_Proveedores Filtro = "AplicaProvGlobal = 1" End Select + GlobalDTDIOTTipoOperacion.FiltraParametros(Filtro) + DdlDIOTTipoOperacion.DataSource = GlobalDTDIOTTipoOperacion.FiltraParametros(Filtro) DdlDIOTTipoOperacion.DataBind() + End Sub diff --git a/Contabilidad/DiarioPagos.aspx b/Contabilidad/DiarioPagos.aspx index 6c193ac59..7c2ba64e9 100644 --- a/Contabilidad/DiarioPagos.aspx +++ b/Contabilidad/DiarioPagos.aspx @@ -695,6 +695,7 @@ + diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb index 83cc6abd3..0d53e58ab 100644 --- a/CxC/RepCxCDetalle.aspx.vb +++ b/CxC/RepCxCDetalle.aspx.vb @@ -481,7 +481,7 @@ Partial Class RepCxCDetalle DdlContrato.DataBind() End Sub - Private Function CargaDatos() As DataSet + Private Function CargaDatos(Optional Impresion As Boolean = True) As DataSet Dim DSRespuesta As New DataSet @@ -515,12 +515,12 @@ Partial Class RepCxCDetalle CveContrato:=DdlContrato.SelectedValue.ToEntero, Aseguradora:=DdlAseguradora.SelectedValue.ToEntero, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero()) Then Dim DTdatos As DataTable = ObjMovtos.DSResultados.Tables(0).Copy - DTGvSourcePersonalizaRangos(DTdatos) + DTGvSourcePersonalizaRangos(DTdatos, Impresion) GvDatos.DataSource = DTdatos 'ObjMovtos.DSResultados.Tables(0) 'DTaDAtos = ObjMovtos.DSResultados.Tables(0) 'DTaDAtos.TableName = "DTaDAtos" - DSRespuesta.Tables.Add(ObjMovtos.DSResultados.Tables(0).Copy) + DSRespuesta.Tables.Add(DTdatos.Copy) If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then GvCartera.DataSource = ObjMovtos.DSResultados.Tables(1) @@ -824,7 +824,7 @@ Partial Class RepCxCDetalle Dim lrds As New List(Of ReportDataSource) - Dim DSDatos As DataSet = CargaDatos() + Dim DSDatos As DataSet = CargaDatos(Impresion:=True) Dim dtt1 As DataTable = Nothing Dim dtt2 As DataTable = Nothing @@ -1262,7 +1262,7 @@ Partial Class RepCxCDetalle End Sub - Private Sub DTGvSourcePersonalizaRangos(ByRef DtDatos As DataTable) + Private Sub DTGvSourcePersonalizaRangos(ByRef DtDatos As DataTable, Optional Impresion As Boolean = False) DtDatos.Columns.Add("R1", GetType(Decimal)) DtDatos.Columns.Add("R2", GetType(Decimal)) @@ -1290,7 +1290,10 @@ Partial Class RepCxCDetalle Dim chk As CheckBox = TryCast(TPersonalizar.FindControl(ChkID), CheckBox) If chk.Checked Then + Impresion = True + End If + If Impresion Then For Each dRowDT As DataRow In DtDatos.Rows Dim DiasVencidos As Integer = dRowDT("DiasVencidos").ToString.ToEntero @@ -1319,9 +1322,9 @@ Partial Class RepCxCDetalle Next NumColActual = NumColActual + 1 - - End If + + Next diff --git a/Empresas/Grales/Formatos/RepCxCDetalle.rdlc b/Empresas/Grales/Formatos/RepCxCDetalle.rdlc index aaad0022a..40a04a400 100644 --- a/Empresas/Grales/Formatos/RepCxCDetalle.rdlc +++ b/Empresas/Grales/Formatos/RepCxCDetalle.rdlc @@ -1,1978 +1,5 @@  - - - - - - - - 1.97083cm - - - 2.01211cm - - - 2.16822cm - - - 2.31777cm - - - 2.39476cm - - - 3.15201cm - - - 2.24291cm - - - 1.89897cm - - - 1.74625cm - - - 6.44442cm - - - - - 0.49417cm - - - - - true - true - - - - - Tipo Docto - - - - - - - Textbox3 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha - - - - - - - Textbox4 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Folio - - - - - - - Textbox12 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Total - - - - - - - Textbox14 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Saldo - - - - - - - Textbox16 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Sucursal Venta - - - - - - - Textbox18 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha Venc. - - - - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Dias Venc. - - - - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Código - - - - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Nombre - - - - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.41479cm - - - - - true - true - - - - - - - - - - - - TipoDocto - - - =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Microsoft.VisualBasic.Interaction.IIF(Fields!Fecha.Value Is Nothing, "Cantidad:", Fields!Fecha.Value) - - - - - - - Fecha2 - - - =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SerieFolio.Value - - - - - - - SerieFolio4 - - - =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Total.Value - - - - - - - Total2 - - - =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Saldo.Value - - - - - - - Saldo2 - - - =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Microsoft.VisualBasic.Interaction.IIF(Fields!SubProyecto.Value = "", "Total", Fields!SubProyecto.Value) - - - - - - =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) - 2pt - 2pt - 2pt - 2pt - - - 5 - - - - - - - - - - 0.36363cm - - - - - true - true - - - - - =Fields!TipoDocto.Value - - - - - - - TipoDocto1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Fecha.Value - - - - - - - Fecha1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SerieFolio.Value - - - - - - - SerieFolio1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Total.Value - - - - - - - Total1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Saldo.Value - - - - - - - Saldo - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SubProyecto.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!FechaVencimiento.Value - - - - - - - FechaVencimiento1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!DiasVencidos.Value - - - - - - - DiasVencidos1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - =iif(Fields!Fecha.Value IS NOTHING, false, true) - - - - - =iif(Fields!Fecha.Value IS NOTHING, True, False) - - - - - - - true - true - DataSet1 - 0.15021cm - 0.0635cm - 1.27259cm - 26.34825cm - - - - - - - - - 2.5cm - - - 2.5cm - - - 2.5cm - - - 2.5cm - - - - - 0.49417cm - - - - - true - true - - - - - Rango Días - - - - - - - Textbox15 - - - - Black - - - Black - - - Black - - - Black - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Importe - - - - - - - Textbox19 - - - - Black - - - Black - - - Black - - - Black - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - % - - - - - - - Textbox23 - - - - Black - - - Black - - - Black - - - Black - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Objetivo - - - - - - - Textbox26 - - - - Black - - - Black - - - Black - - - Black - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.2825cm - - - - - true - true - - - - - =Fields!Rango.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Saldo.Value - - - - - - - Saldo1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Porcentaje.Value - - - - - - - Porcentaje - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Objetivo.Value - - - - - - - Objetivo - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - After - - - - - - - DSCartera - 1.6429cm - 0.77667cm - 10cm - 1 - - =IIF(CountRows()>0,false,true) - - - - - - - 0.99425in - - - - - - - Textbox1 - 0.18521cm - 7.41726cm - 0.6cm - 13.02632cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!TituloReporte.Value - - - - - - - Textbox2 - 0.94396cm - 7.41726cm - 0.52945cm - 13.02632cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!LogoPath.Value - FitProportional - 0.0635cm - 1.87966cm - 3.21028cm - 2 - - - - - - true - true - - - - - =Parameters!AgrupadoPor.Value - HTML - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 3.61032cm - 0cm - 26.34825cm - 4 - - - - - - - - - - - 1.42862cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.2099cm - 23.83501cm - 0.40039cm - 2.35691cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Usuario: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!UsuarioImprimio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Globals!ExecutionTime - - - - - - - Textbox11 - 0.22224cm - 13.83641cm - 0.40039cm - 6.04724cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - 0.11641cm - 0.0635cm - 0cm - 26.34825cm - 5 - - - - - - true - true - - - - - IMPRESO EN SIG, Rep. CxC Detalle - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 21.59cm - 27.94cm - 0.5cm - 0.5cm - 0.5cm - 0.5cm - 0.13cm - + + + + + + Textbox3 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox4 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio + + + + + + + Textbox12 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + Textbox14 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Saldo + + + + + + + Textbox16 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sucursal Venta + + + + + + + Textbox18 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha Venc. + + + + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Dias Venc. + + + + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Código + + + + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Nombre + + + + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + + + + + + + + TipoDocto + + + =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Microsoft.VisualBasic.Interaction.IIF(Fields!Fecha.Value Is Nothing, "Cantidad:", Fields!Fecha.Value) + + + + + + + Fecha2 + + + =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + + SerieFolio4 + + + =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Total.Value + + + + + + + Total2 + + + =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Saldo.Value + + + + + + + Saldo2 + + + =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Microsoft.VisualBasic.Interaction.IIF(Fields!SubProyecto.Value = "", "Total", Fields!SubProyecto.Value) + + + + + + =iif(Fields!SubProyecto.Value= "", "#67809F" , iif(Fields!Fecha.Value= "", "LightGrey", "No Color")) + 2pt + 2pt + 2pt + 2pt + + + 5 + + + + + + + + + + 0.36363cm + + + + + true + true + + + + + =Fields!TipoDocto.Value + + + + + + + TipoDocto1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + + + + + Fecha1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + + SerieFolio1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Total.Value + + + + + + + Total1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Saldo.Value + + + + + + + Saldo + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SubProyecto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FechaVencimiento.Value + + + + + + + FechaVencimiento1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!DiasVencidos.Value + + + + + + + DiasVencidos1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + =iif(Fields!Fecha.Value IS NOTHING, false, true) + + + + + =iif(Fields!Fecha.Value IS NOTHING, True, False) + + + + + + + true + true + DataSet1 + 0.15021cm + 0.0635cm + 1.27259cm + 24.80181cm + + + + + + + + + 2.5cm + + + 2.5cm + + + 2.5cm + + + 2.5cm + + + + + 0.49417cm + + + + + true + true + + + + + Rango Días + + + + + + + Textbox15 + + + + Black + + + Black + + + Black + + + Black + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox19 + + + + Black + + + Black + + + Black + + + Black + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + % + + + + + + + Textbox23 + + + + Black + + + Black + + + Black + + + Black + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Objetivo + + + + + + + Textbox26 + + + + Black + + + Black + + + Black + + + Black + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.2825cm + + + + + true + true + + + + + =Fields!Rango.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Saldo.Value + + + + + + + Saldo1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Porcentaje.Value + + + + + + + Porcentaje + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Objetivo.Value + + + + + + + Objetivo + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DSCartera + 1.6429cm + 0.77667cm + 10cm + 1 + + =IIF(CountRows()>0,false,true) + + + + + + + 0.99425in + + + + + + + Textbox1 + 0.18521cm + 7.41726cm + 0.6cm + 13.02632cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!TituloReporte.Value + + + + + + + Textbox2 + 0.94396cm + 7.41726cm + 0.52945cm + 13.02632cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.0635cm + 1.87966cm + 3.21028cm + 2 + + + + + + true + true + + + + + =Parameters!AgrupadoPor.Value + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 3.61032cm + 0cm + 26.34825cm + 4 + + + + + + + + + + + 1.42862cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.2099cm + 23.83501cm + 0.40039cm + 2.35691cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + Textbox11 + 0.22224cm + 13.83641cm + 0.40039cm + 6.04724cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + 0.11641cm + 0.0635cm + 0cm + 26.34825cm + 5 + + + + + + true + true + + + + + IMPRESO EN SIG, Rep. CxC Detalle + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 21.59cm + 27.94cm + 0.5cm + 0.5cm + 0.5cm + 0.5cm + 0.13cm +