This commit is contained in:
Oscar Irigoyen
2023-03-24 15:27:38 -07:00
41 changed files with 1678 additions and 1747 deletions

View File

@@ -4308,13 +4308,14 @@ Public Class ClsBancos
Return Retorno Return Retorno
End Function End Function
Public Function DesconciliarIE(CveIE As Integer, FechaDesconciliado As Date, CveUsuario As Integer) As Boolean Public Function DesconciliarIE(CveIE As Integer, FechaDesconciliado As Date, CveUsuario As Integer, Optional DejarConciliado As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Banc_IEDesconciliar") DataAdapter("PA_Banc_IEDesconciliar")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveIE", SqlDbType.Int).Value = CveIE .Add("@CveIE", SqlDbType.Int).Value = CveIE
.Add("@FechaDesconciliado", SqlDbType.Date).Value = FechaDesconciliado .Add("@FechaDesconciliado", SqlDbType.Date).Value = FechaDesconciliado
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@DejarConciliado", SqlDbType.Int).Value = If(DejarConciliado, 1, 0)
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -790,7 +790,8 @@ Public Class ClsCGame
Return Retorno Return Retorno
End Function End Function
Public Function AddHuerta(Huerta As String, CveProveedor As Integer, CveUsuario As Integer, CveEmpresa As Integer, TipoCobro As Integer, Importe As Double, CostoXTonelada As Double) As Boolean Public Function AddHuerta(Huerta As String, CveProveedor As Integer, CveUsuario As Integer, CveEmpresa As Integer, TipoCobro As Integer, Importe As Double, CostoXTonelada As Double,
NombreRegistro As String, NumeroRegistro As String, CveOrigen As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_CGame_HuertaAdd") DataAdapter("PA_CGame_HuertaAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -801,6 +802,9 @@ Public Class ClsCGame
.Add("@TipoCobro", SqlDbType.Int).Value = TipoCobro .Add("@TipoCobro", SqlDbType.Int).Value = TipoCobro
.Add("@Importe", SqlDbType.Float).Value = Importe .Add("@Importe", SqlDbType.Float).Value = Importe
.Add("@CostoXTonelada", SqlDbType.Float).Value = CostoXTonelada .Add("@CostoXTonelada", SqlDbType.Float).Value = CostoXTonelada
.Add("@NombreRegistro", SqlDbType.VarChar).Value = NombreRegistro
.Add("@NumeroRegistro", SqlDbType.VarChar).Value = NumeroRegistro
.Add("@CveOrigen", SqlDbType.Int).Value = CveOrigen
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -811,7 +815,8 @@ Public Class ClsCGame
Return Retorno Return Retorno
End Function End Function
Public Function UpdateHuerta(CveHuerta As Integer, Huerta As String, CveProveedor As Integer, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer, TipoCobro As Integer, Importe As Double, CostoXTonelada As Double) As Boolean Public Function UpdateHuerta(CveHuerta As Integer, Huerta As String, CveProveedor As Integer, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer, TipoCobro As Integer, Importe As Double, CostoXTonelada As Double,
NombreRegistro As String, NumeroRegistro As String, CveOrigen As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_CGame_HuertaUpdate") DataAdapter("PA_CGame_HuertaUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -824,6 +829,9 @@ Public Class ClsCGame
.Add("@TipoCobro", SqlDbType.Int).Value = TipoCobro .Add("@TipoCobro", SqlDbType.Int).Value = TipoCobro
.Add("@Importe", SqlDbType.Float).Value = Importe .Add("@Importe", SqlDbType.Float).Value = Importe
.Add("@CostoXTonelada", SqlDbType.Float).Value = CostoXTonelada .Add("@CostoXTonelada", SqlDbType.Float).Value = CostoXTonelada
.Add("@NombreRegistro", SqlDbType.VarChar).Value = NombreRegistro
.Add("@NumeroRegistro", SqlDbType.VarChar).Value = NumeroRegistro
.Add("@CveOrigen", SqlDbType.Int).Value = CveOrigen
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -2234,7 +2234,8 @@ Public Class ClsContPAQi
''' <returns></returns> ''' <returns></returns>
''' <remarks></remarks> ''' <remarks></remarks>
Public Function AddMovimiento(IdPoliza As Integer, IdCuenta As Integer, TipoMovto As Boolean, Importe As Double, Referencia As String, Public Function AddMovimiento(IdPoliza As Integer, IdCuenta As Integer, TipoMovto As Boolean, Importe As Double, Referencia As String,
Concepto As String, IdSegNeg As Integer, FechaMovto As Date, SIGReferencia As String, Optional ImporteMonedaExtranjera As Double = 0, Optional GUID As String = "-1") As Boolean Concepto As String, IdSegNeg As Integer, FechaMovto As Date, SIGReferencia As String, Optional ImporteMonedaExtranjera As Double = 0, Optional GUID As String = "-1",
Optional CvePrePolizaDetalle As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
If IdPoliza <= 0 Or IdCuenta <= 0 Then If IdPoliza <= 0 Or IdCuenta <= 0 Then
@@ -2307,8 +2308,8 @@ Public Class ClsContPAQi
'StrSQL.AppendLine("") 'StrSQL.AppendLine("")
'StrSQL.AppendLine("END") 'StrSQL.AppendLine("END")
StrSQL.AppendLine(" INSERT INTO MovimientosPoliza (Id, RowVersion, IdPoliza, Ejercicio, Periodo, TipoPol, Folio, NumMovto, IdCuenta, TipoMovto, Importe, ImporteME, Referencia, Concepto, IdDiario, Fecha, IdSegNeg, SIGReferencia, TimeStamp, Guid)") StrSQL.AppendLine(" INSERT INTO MovimientosPoliza (Id, RowVersion, IdPoliza, Ejercicio, Periodo, TipoPol, Folio, NumMovto, IdCuenta, TipoMovto, Importe, ImporteME, Referencia, Concepto, IdDiario, Fecha, IdSegNeg, SIGReferencia, TimeStamp, Guid, CvePrePolizaDetalle)")
StrSQL.AppendLine(" VALUES (@Id, @RowVersion, @IdPoliza, @Ejercicio, @Periodo, @TipoPol, @Folio, @NumMovto, @IdCuenta, @TipoMovto, @Importe, @ImporteME, @Referencia, @Concepto, @IdDiario, @Fecha, IIF(@SegNegMovtos = 1,@IdSegNeg,0), @SIGReferencia, @TimeStamp, @GUID);") StrSQL.AppendLine(" VALUES (@Id, @RowVersion, @IdPoliza, @Ejercicio, @Periodo, @TipoPol, @Folio, @NumMovto, @IdCuenta, @TipoMovto, @Importe, @ImporteME, @Referencia, @Concepto, @IdDiario, @Fecha, IIF(@SegNegMovtos = 1,@IdSegNeg,0), @SIGReferencia, @TimeStamp, @GUID, IIF(@CvePrePolizaDetalle=-1,NULL,@CvePrePolizaDetalle));")
StrSQL.AppendLine(" ") StrSQL.AppendLine(" ")
''DESCOMENTAR PARA CIERRE PERIODO ''DESCOMENTAR PARA CIERRE PERIODO
@@ -2344,156 +2345,6 @@ Public Class ClsContPAQi
SqlDataAdapter(StrSQL.ToString, CommandType.Text)
With SqlAdapter.SelectCommand.Parameters
.Add("@RowVersion", SqlDbType.Int).Value = GlobalRowVersion
.Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza
.Add("@IdCuenta", SqlDbType.Int).Value = IdCuenta
.Add("@TipoMovto", SqlDbType.Int).Value = TipoMovto
.Add("@Importe", SqlDbType.Money).Value = Math.Round(Importe, 2)
.Add("@Referencia", SqlDbType.VarChar, 30).Value = If(Referencia.Length > 30, Referencia.Substring(1, 30), Referencia)
.Add("@Concepto", SqlDbType.VarChar, 100).Value = If(Concepto.Length > 100, Concepto.Substring(1, 100), Concepto)
.Add("@IdSegNeg", SqlDbType.Int).Value = IdSegNeg
.Add("@FechaMov", SqlDbType.DateTime).Value = FechaMovto
.Add("@SIGReferencia", SqlDbType.VarChar).Value = SIGReferencia
.Add("@ImporteME", SqlDbType.Money).Value = ImporteMonedaExtranjera
.Add("@GUID", SqlDbType.VarChar).Value = GUID
End With
Try
SqlAdapter.Fill(Data)
GUIDMovimiento = GUID
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar el movimiento en la póliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
''' <summary>
''' Agrega un movimiento a una póliza
''' </summary>
''' <param name="IdPoliza">Es el ID que generó la póliza</param>
''' <param name="IdCuenta">Es el ID de la cuenta del movimiento a agregar</param>
''' <param name="TipoMovto">Cargo = False; Abono = True</param>
''' <param name="Importe">Es el Importe del movimiento a agregar</param>
''' <param name="Referencia">Es la referencia del movimiento, hasta 30 dígitos</param>
''' <param name="Concepto">Es el concepto del movimiento, hasta 100 dígitos</param>
''' <param name="IdSegNeg">Es el ID del Segmento de Negocio</param>
''' <param name="FechaMovto">Es la fecha del movimiento</param>
''' <returns></returns>
''' <remarks></remarks>
Public Function AddMovimiento(IdPoliza As Integer, IdCuenta As Integer, TipoMovto As Boolean, Importe As Double, Referencia As String,
Concepto As String, IdSegNeg As Integer, FechaMovto As Date, SIGReferencia As String, CvePrePolizaDetalle As Integer, Optional ImporteMonedaExtranjera As Double = 0, Optional GUID As String = "-1") As Boolean
Dim Retorno As Boolean = False
If IdPoliza <= 0 Or IdCuenta <= 0 Then
Return False
End If
If Not FNC_GetCounter() Then
Return Retorno
End If
If Not FNC_GetNumMovto() Then
Return Retorno
End If
'SqlDataAdapter("PA_AddMovimiento
If GUID = "-1" Then GUID = System.Guid.NewGuid().ToString()
StrSQL.Clear()
StrSQL.AppendLine("BEGIN")
StrSQL.AppendLine("")
StrSQL.AppendLine(" DECLARE ")
StrSQL.AppendLine(" @Error NVARCHAR(300),")
StrSQL.AppendLine(" @Id INT,")
StrSQL.AppendLine(" @Ejercicio INT,")
StrSQL.AppendLine(" @Periodo INT,")
StrSQL.AppendLine(" @TipoPol INT,")
StrSQL.AppendLine(" @Folio INT,")
StrSQL.AppendLine(" @NumMovto INT,")
StrSQL.AppendLine(" @IdDiario INT,")
StrSQL.AppendLine(" @Fecha DATETIME,")
StrSQL.AppendLine(" @IDEjercicio INT,")
StrSQL.AppendLine(" @TimeStamp NVARCHAR (200);")
StrSQL.AppendLine(" SET NOCOUNT ON;")
StrSQL.AppendLine(" ")
StrSQL.AppendLine(" SET @Id = dbo.FNC_GetCounter ('Id_MovimientoPoliza');")
StrSQL.AppendLine(" SET @NumMovto = dbo.FNC_GetNumMovto (@IdPoliza);")
StrSQL.AppendLine(" SET @Fecha = @FechaMov;")
StrSQL.AppendLine(" SET @IdDiario = 0;")
StrSQL.AppendLine(" SELECT @Ejercicio = P.Ejercicio, @Periodo = P.Periodo, @TipoPol = TipoPol, @Folio = P.Folio FROM Polizas P WHERE Id = @IdPoliza;")
StrSQL.AppendLine("")
StrSQL.AppendLine(" BEGIN TRY")
StrSQL.AppendLine(" ")
''DESCOMENTAR PARA CIERRE PERIODO
'StrSQL.AppendLine("DECLARE")
'StrSQL.AppendLine(" @IdCtaCierre INT,")
'StrSQL.AppendLine(" @IdPolCierre INT,")
'StrSQL.AppendLine(" @NumMovtoCierre INT;")
'StrSQL.AppendLine("")
'StrSQL.AppendLine("SET @NumMovtoCierre = 0;")
'StrSQL.AppendLine("")
'StrSQL.AppendLine("-- SI ES CUENTA DE RESULTADOS")
'StrSQL.AppendLine("IF (SELECT Tipo FROM Cuentas WHERE Id = @IdCuenta) IN ('G','H')")
'StrSQL.AppendLine("BEGIN ")
'StrSQL.AppendLine("")
'StrSQL.AppendLine(" SELECT @IdCtaCierre = IdCtaCierre, @IdPolCierre = IdPolCierre FROM Ejercicios WHERE Ejercicio = @Ejercicio")
'StrSQL.AppendLine("")
'StrSQL.AppendLine(" -- SI ESTA CERRADO EL EJERCICIO")
'StrSQL.AppendLine(" IF (@IdCtaCierre > 0 AND @IdPolCierre > 0)")
'StrSQL.AppendLine(" BEGIN")
'StrSQL.AppendLine("")
'StrSQL.AppendLine(" -- PARA QUE EL MOVIMIENTO SE AGREGUE DIRECTO EN LA POLIZA DE CIERRE")
'StrSQL.AppendLine(" SET @IdPoliza = @IdPolCierre;")
'StrSQL.AppendLine(" SET @NumMovto = dbo.FNC_GetNumMovto (@IdPolCierre);")
'StrSQL.AppendLine(" SET @NumMovtoCierre = @NumMovto + 1")
'StrSQL.AppendLine("")
'StrSQL.AppendLine(" END")
'StrSQL.AppendLine("")
'StrSQL.AppendLine("END")
StrSQL.AppendLine(" INSERT INTO MovimientosPoliza (Id, RowVersion, IdPoliza, Ejercicio, Periodo, TipoPol, Folio, NumMovto, IdCuenta, TipoMovto, Importe, ImporteME, Referencia, Concepto, IdDiario, Fecha, IdSegNeg, SIGReferencia, TimeStamp, Guid, CvePrePolizaDetalle)")
StrSQL.AppendLine(" VALUES (@Id, @RowVersion, @IdPoliza, @Ejercicio, @Periodo, @TipoPol, @Folio, @NumMovto, @IdCuenta, @TipoMovto, @Importe, @ImporteME, @Referencia, @Concepto, @IdDiario, @Fecha, @IdSegNeg, @SIGReferencia, @TimeStamp, @GUID, @CvePrePolizaDetalle);")
StrSQL.AppendLine(" ")
''DESCOMENTAR PARA CIERRE PERIODO
'StrSQL.AppendLine(" IF @NumMovtoCierre > 0 ")
'StrSQL.AppendLine(" BEGIN ")
'StrSQL.AppendLine(" IF @TipoMovto = 0 BEGIN ")
'StrSQL.AppendLine(" SET @TipoMovto = 1 ")
'StrSQL.AppendLine(" END ")
'StrSQL.AppendLine(" ELSE BEGIN ")
'StrSQL.AppendLine(" SET @TipoMovto = 0 ")
'StrSQL.AppendLine(" END ")
'StrSQL.AppendLine(" INSERT INTO MovimientosPoliza (Id, RowVersion, IdPoliza, Ejercicio, Periodo, TipoPol, Folio, NumMovto, IdCuenta, TipoMovto, Importe, ImporteME, Referencia, Concepto, IdDiario, Fecha, IdSegNeg, SIGReferencia, TimeStamp, Guid) ")
'StrSQL.AppendLine(" VALUES (@Id + 1, @RowVersion, @IdPoliza, @Ejercicio, @Periodo, @TipoPol, @Folio, @NumMovtoCierre, @IdCtaCierre, @TipoMovto, @Importe, @ImporteME, @Referencia, @Concepto, @IdDiario, @Fecha, @IdSegNeg, @SIGReferencia, @TimeStamp,''); ")
'StrSQL.AppendLine(" EXEC PA_UpdateId 'Id_MovimientoPoliza';")
'StrSQL.AppendLine(" END ")
StrSQL.AppendLine(" EXEC PA_UpdateId 'Id_MovimientoPoliza';")
StrSQL.AppendLine(" ")
StrSQL.AppendLine(" SELECT @IDEjercicio = ID FROM Ejercicios WHERE Ejercicio = @Ejercicio;")
StrSQL.AppendLine(" ")
StrSQL.AppendLine(" EXEC PA_UpdateSaldos @IdCuenta, @TipoMovto, @Importe, @IDEjercicio, @Periodo, @Id, @IdPoliza;")
StrSQL.AppendLine(" ")
StrSQL.AppendLine(" SELECT @Id AS IdMovto, @NumMovto AS NumMovto, @GUID AS GUID ;")
StrSQL.AppendLine(" ")
StrSQL.AppendLine(" END TRY")
StrSQL.AppendLine(" ")
StrSQL.AppendLine(" BEGIN CATCH")
StrSQL.AppendLine(" SET @Error = CONCAT('Número: ' , ERROR_NUMBER(), '; Procedimiento: ' , ERROR_PROCEDURE(), '; Linea: ' ,ERROR_LINE(), '; Detalle: ' , ERROR_MESSAGE());")
StrSQL.AppendLine(" RAISERROR(@Error, 16, 1);")
StrSQL.AppendLine(" END CATCH")
StrSQL.AppendLine(" ")
StrSQL.AppendLine("END;")
SqlDataAdapter(StrSQL.ToString, CommandType.Text) SqlDataAdapter(StrSQL.ToString, CommandType.Text)
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -2523,6 +2374,159 @@ Public Class ClsContPAQi
Return Retorno Return Retorno
End Function End Function
'''' <summary>
'''' Agrega un movimiento a una póliza
'''' </summary>
'''' <param name="IdPoliza">Es el ID que generó la póliza</param>
'''' <param name="IdCuenta">Es el ID de la cuenta del movimiento a agregar</param>
'''' <param name="TipoMovto">Cargo = False; Abono = True</param>
'''' <param name="Importe">Es el Importe del movimiento a agregar</param>
'''' <param name="Referencia">Es la referencia del movimiento, hasta 30 dígitos</param>
'''' <param name="Concepto">Es el concepto del movimiento, hasta 100 dígitos</param>
'''' <param name="IdSegNeg">Es el ID del Segmento de Negocio</param>
'''' <param name="FechaMovto">Es la fecha del movimiento</param>
'''' <returns></returns>
'''' <remarks></remarks>
'Public Function AddMovimiento(IdPoliza As Integer, IdCuenta As Integer, TipoMovto As Boolean, Importe As Double, Referencia As String,
' Concepto As String, IdSegNeg As Integer, FechaMovto As Date, SIGReferencia As String, CvePrePolizaDetalle As Integer, Optional ImporteMonedaExtranjera As Double = 0, Optional GUID As String = "-1") As Boolean
' Dim Retorno As Boolean = False
' If IdPoliza <= 0 Or IdCuenta <= 0 Then
' Return False
' End If
' If Not FNC_GetCounter() Then
' Return Retorno
' End If
' If Not FNC_GetNumMovto() Then
' Return Retorno
' End If
' 'SqlDataAdapter("PA_AddMovimiento
' If GUID = "-1" Then GUID = System.Guid.NewGuid().ToString()
' StrSQL.Clear()
' StrSQL.AppendLine("BEGIN")
' StrSQL.AppendLine("")
' StrSQL.AppendLine(" DECLARE ")
' StrSQL.AppendLine(" @Error NVARCHAR(300),")
' StrSQL.AppendLine(" @Id INT,")
' StrSQL.AppendLine(" @Ejercicio INT,")
' StrSQL.AppendLine(" @Periodo INT,")
' StrSQL.AppendLine(" @TipoPol INT,")
' StrSQL.AppendLine(" @Folio INT,")
' StrSQL.AppendLine(" @NumMovto INT,")
' StrSQL.AppendLine(" @IdDiario INT,")
' StrSQL.AppendLine(" @SegNegMovtos INT,")
' StrSQL.AppendLine(" @Fecha DATETIME,")
' StrSQL.AppendLine(" @IDEjercicio INT,")
' StrSQL.AppendLine(" @TimeStamp NVARCHAR (200);")
' StrSQL.AppendLine(" SET NOCOUNT ON;")
' StrSQL.AppendLine(" ")
' StrSQL.AppendLine(" SET @Id = dbo.FNC_GetCounter ('Id_MovimientoPoliza');")
' StrSQL.AppendLine(" SET @NumMovto = dbo.FNC_GetNumMovto (@IdPoliza);")
' StrSQL.AppendLine(" SET @Fecha = @FechaMov;")
' StrSQL.AppendLine(" SET @IdDiario = 0;")
' StrSQL.AppendLine(" SELECT @Ejercicio = P.Ejercicio, @Periodo = P.Periodo, @TipoPol = TipoPol, @Folio = P.Folio FROM Polizas P WHERE Id = @IdPoliza;")
' StrSQL.AppendLine(" SELECT @SegNegMovtos = SegNegMovtos FROM Cuentas C WHERE Id = @IdCuenta;")
' StrSQL.AppendLine("")
' StrSQL.AppendLine(" BEGIN TRY")
' StrSQL.AppendLine(" ")
' ''DESCOMENTAR PARA CIERRE PERIODO
' 'StrSQL.AppendLine("DECLARE")
' 'StrSQL.AppendLine(" @IdCtaCierre INT,")
' 'StrSQL.AppendLine(" @IdPolCierre INT,")
' 'StrSQL.AppendLine(" @NumMovtoCierre INT;")
' 'StrSQL.AppendLine("")
' 'StrSQL.AppendLine("SET @NumMovtoCierre = 0;")
' 'StrSQL.AppendLine("")
' 'StrSQL.AppendLine("-- SI ES CUENTA DE RESULTADOS")
' 'StrSQL.AppendLine("IF (SELECT Tipo FROM Cuentas WHERE Id = @IdCuenta) IN ('G','H')")
' 'StrSQL.AppendLine("BEGIN ")
' 'StrSQL.AppendLine("")
' 'StrSQL.AppendLine(" SELECT @IdCtaCierre = IdCtaCierre, @IdPolCierre = IdPolCierre FROM Ejercicios WHERE Ejercicio = @Ejercicio")
' 'StrSQL.AppendLine("")
' 'StrSQL.AppendLine(" -- SI ESTA CERRADO EL EJERCICIO")
' 'StrSQL.AppendLine(" IF (@IdCtaCierre > 0 AND @IdPolCierre > 0)")
' 'StrSQL.AppendLine(" BEGIN")
' 'StrSQL.AppendLine("")
' 'StrSQL.AppendLine(" -- PARA QUE EL MOVIMIENTO SE AGREGUE DIRECTO EN LA POLIZA DE CIERRE")
' 'StrSQL.AppendLine(" SET @IdPoliza = @IdPolCierre;")
' 'StrSQL.AppendLine(" SET @NumMovto = dbo.FNC_GetNumMovto (@IdPolCierre);")
' 'StrSQL.AppendLine(" SET @NumMovtoCierre = @NumMovto + 1")
' 'StrSQL.AppendLine("")
' 'StrSQL.AppendLine(" END")
' 'StrSQL.AppendLine("")
' 'StrSQL.AppendLine("END")
' StrSQL.AppendLine(" INSERT INTO MovimientosPoliza (Id, RowVersion, IdPoliza, Ejercicio, Periodo, TipoPol, Folio, NumMovto, IdCuenta, TipoMovto, Importe, ImporteME, Referencia, Concepto, IdDiario, Fecha, IdSegNeg, SIGReferencia, TimeStamp, Guid, CvePrePolizaDetalle)")
' StrSQL.AppendLine(" VALUES (@Id, @RowVersion, @IdPoliza, @Ejercicio, @Periodo, @TipoPol, @Folio, @NumMovto, @IdCuenta, @TipoMovto, @Importe, @ImporteME, @Referencia, @Concepto, @IdDiario, @Fecha, IIF(@SegNegMovtos = 1,@IdSegNeg,0), @SIGReferencia, @TimeStamp, @GUID, @CvePrePolizaDetalle);")
' StrSQL.AppendLine(" ")
' ''DESCOMENTAR PARA CIERRE PERIODO
' 'StrSQL.AppendLine(" IF @NumMovtoCierre > 0 ")
' 'StrSQL.AppendLine(" BEGIN ")
' 'StrSQL.AppendLine(" IF @TipoMovto = 0 BEGIN ")
' 'StrSQL.AppendLine(" SET @TipoMovto = 1 ")
' 'StrSQL.AppendLine(" END ")
' 'StrSQL.AppendLine(" ELSE BEGIN ")
' 'StrSQL.AppendLine(" SET @TipoMovto = 0 ")
' 'StrSQL.AppendLine(" END ")
' 'StrSQL.AppendLine(" INSERT INTO MovimientosPoliza (Id, RowVersion, IdPoliza, Ejercicio, Periodo, TipoPol, Folio, NumMovto, IdCuenta, TipoMovto, Importe, ImporteME, Referencia, Concepto, IdDiario, Fecha, IdSegNeg, SIGReferencia, TimeStamp, Guid) ")
' 'StrSQL.AppendLine(" VALUES (@Id + 1, @RowVersion, @IdPoliza, @Ejercicio, @Periodo, @TipoPol, @Folio, @NumMovtoCierre, @IdCtaCierre, @TipoMovto, @Importe, @ImporteME, @Referencia, @Concepto, @IdDiario, @Fecha, @IdSegNeg, @SIGReferencia, @TimeStamp,''); ")
' 'StrSQL.AppendLine(" EXEC PA_UpdateId 'Id_MovimientoPoliza';")
' 'StrSQL.AppendLine(" END ")
' StrSQL.AppendLine(" EXEC PA_UpdateId 'Id_MovimientoPoliza';")
' StrSQL.AppendLine(" ")
' StrSQL.AppendLine(" SELECT @IDEjercicio = ID FROM Ejercicios WHERE Ejercicio = @Ejercicio;")
' StrSQL.AppendLine(" ")
' StrSQL.AppendLine(" EXEC PA_UpdateSaldos @IdCuenta, @TipoMovto, @Importe, @IDEjercicio, @Periodo, @Id, @IdPoliza;")
' StrSQL.AppendLine(" ")
' StrSQL.AppendLine(" SELECT @Id AS IdMovto, @NumMovto AS NumMovto, @GUID AS GUID ;")
' StrSQL.AppendLine(" ")
' StrSQL.AppendLine(" END TRY")
' StrSQL.AppendLine(" ")
' StrSQL.AppendLine(" BEGIN CATCH")
' StrSQL.AppendLine(" SET @Error = CONCAT('Número: ' , ERROR_NUMBER(), '; Procedimiento: ' , ERROR_PROCEDURE(), '; Linea: ' ,ERROR_LINE(), '; Detalle: ' , ERROR_MESSAGE());")
' StrSQL.AppendLine(" RAISERROR(@Error, 16, 1);")
' StrSQL.AppendLine(" END CATCH")
' StrSQL.AppendLine(" ")
' StrSQL.AppendLine("END;")
' SqlDataAdapter(StrSQL.ToString, CommandType.Text)
' With SqlAdapter.SelectCommand.Parameters
' .Add("@RowVersion", SqlDbType.Int).Value = GlobalRowVersion
' .Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza
' .Add("@IdCuenta", SqlDbType.Int).Value = IdCuenta
' .Add("@TipoMovto", SqlDbType.Int).Value = TipoMovto
' .Add("@Importe", SqlDbType.Money).Value = Math.Round(Importe, 2)
' .Add("@Referencia", SqlDbType.VarChar, 30).Value = If(Referencia.Length > 30, Referencia.Substring(1, 30), Referencia)
' .Add("@Concepto", SqlDbType.VarChar, 100).Value = If(Concepto.Length > 100, Concepto.Substring(1, 100), Concepto)
' .Add("@IdSegNeg", SqlDbType.Int).Value = IdSegNeg
' .Add("@FechaMov", SqlDbType.DateTime).Value = FechaMovto
' .Add("@SIGReferencia", SqlDbType.VarChar).Value = SIGReferencia
' .Add("@ImporteME", SqlDbType.Money).Value = ImporteMonedaExtranjera
' .Add("@GUID", SqlDbType.VarChar).Value = GUID
' .Add("@CvePrePolizaDetalle", SqlDbType.Int).Value = CvePrePolizaDetalle
' End With
' Try
' SqlAdapter.Fill(Data)
' GUIDMovimiento = GUID
' Retorno = True
' Catch ex As Exception
' OnError("Ocurrió un error al agregar el movimiento en la póliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End Try
' Return Retorno
'End Function
Public Function UpdatePoliza(Concepto As String, Cargos As Double, Abonos As Double, IdUsuario As Integer, FechaPoliza As Date, Folio As String, TipoPoliza As Integer, IdPoliza As Integer) As Boolean Public Function UpdatePoliza(Concepto As String, Cargos As Double, Abonos As Double, IdUsuario As Integer, FechaPoliza As Date, Folio As String, TipoPoliza As Integer, IdPoliza As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -1406,7 +1406,7 @@ Public Class ClsContabilidad
If dr("ImporteMN").ToString.ToDecimal <> 0 Then If dr("ImporteMN").ToString.ToDecimal <> 0 Then
If Not ObjConta.AddMovimiento(tIdPoliza, dr("IdCtaContable").ToString.ToEntero, tipoMovimiento, If Not ObjConta.AddMovimiento(tIdPoliza, dr("IdCtaContable").ToString.ToEntero, tipoMovimiento,
dr("ImporteMN").ToString.ToDecimal, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegmentoNegocio").ToString.ToEntero, Fecha, SigReferencia, dr("CvePrePolizaDetalle").ToString.ToEntero, ImporteMonedaExtranjera:=dr("ImporteME").ToString.ToDecimal) Then dr("ImporteMN").ToString.ToDecimal, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegmentoNegocio").ToString.ToEntero, Fecha, SigReferencia, CvePrePolizaDetalle:=dr("CvePrePolizaDetalle").ToString.ToEntero, ImporteMonedaExtranjera:=dr("ImporteME").ToString.ToDecimal) Then
OcurrioError = True OcurrioError = True
StrLog.AppendFormat(" Error 1.1 - ") StrLog.AppendFormat(" Error 1.1 - ")
Exit For Exit For
@@ -1415,7 +1415,7 @@ Public Class ClsContabilidad
Else Else
If Not ObjConta.AddMovimiento(tIdPoliza, dr("IdCtaContable").ToString.ToEntero, tipoMovimiento, If Not ObjConta.AddMovimiento(tIdPoliza, dr("IdCtaContable").ToString.ToEntero, tipoMovimiento,
dr("Importe").ToString.ToDecimal, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegmentoNegocio").ToString.ToEntero, Fecha, SigReferencia, dr("CvePrePolizaDetalle").ToString.ToEntero, ImporteMonedaExtranjera:=dr("ImporteME").ToString.ToDecimal) Then dr("Importe").ToString.ToDecimal, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegmentoNegocio").ToString.ToEntero, Fecha, SigReferencia, CvePrePolizaDetalle:=dr("CvePrePolizaDetalle").ToString.ToEntero, ImporteMonedaExtranjera:=dr("ImporteME").ToString.ToDecimal) Then
OcurrioError = True OcurrioError = True
StrLog.AppendFormat(" Error 1.2 - ") StrLog.AppendFormat(" Error 1.2 - ")
Exit For Exit For
@@ -1456,7 +1456,7 @@ Public Class ClsContabilidad
Dim RFC As String = "" Dim RFC As String = ""
Dim RazonSocial As String = "" Dim RazonSocial As String = ""
If Not OcurrioError AndAlso ContabilizarDIOT Then If Not OcurrioError AndAlso ContabilizarDIOT Then
If GetDIOTValores(CvePrePoliza) AndAlso Data.Rows.Count > 0 Then If GetDIOTValores(CvePrePoliza, Empresa.CveEmpresa) AndAlso Data.Rows.Count > 0 Then
Dim IdProveedor As Integer Dim IdProveedor As Integer
For Each dr As DataRow In Data.Rows For Each dr As DataRow In Data.Rows
@@ -1685,7 +1685,7 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
Public Function GetDIOTValores(CvePrePoliza As Integer) As Boolean 'Editado por charlie Public Function GetDIOTValores(CvePrePoliza As Integer, CveEmpresa As Integer) As Boolean 'Editado por charlie
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -1693,6 +1693,7 @@ Public Class ClsContabilidad
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try Try

File diff suppressed because it is too large Load Diff

View File

@@ -5630,7 +5630,7 @@ Public Class ClsInventarios
Public Function AddCamiones(Placa As String, Especificacion As String, CveEmpresa As Integer, CveConfigAutoTransporte As Integer, Anio As Integer, CveTipoPermisoSCT As Integer, NumPermisoSCT As String, NombreAseguradora As String, Public Function AddCamiones(Placa As String, Especificacion As String, CveEmpresa As Integer, CveConfigAutoTransporte As Integer, Anio As Integer, CveTipoPermisoSCT As Integer, NumPermisoSCT As String, NombreAseguradora As String,
NumPolizaSeguro As String, CveUsuario As Integer, NombreAseguradoraMedioAmbiente As String, NumPolizaSeguroMedioAmbiente As String, NombreAseguradoraCarga As String, NumPolizaSeguroCarga As String, NumPolizaSeguro As String, CveUsuario As Integer, NombreAseguradoraMedioAmbiente As String, NumPolizaSeguroMedioAmbiente As String, NombreAseguradoraCarga As String, NumPolizaSeguroCarga As String,
Optional CveTipoCamion As Integer = 1, Optional LongitudCaja As String = "", Optional LineaTransportacion As String = "", Optional SCAC As String = "", Optional CAAT As String = "", Optional CveTipoCamion As Integer = 1, Optional LongitudCaja As String = "", Optional LineaTransportacion As String = "", Optional SCAC As String = "", Optional CAAT As String = "",
Optional CveTipoRemolque As Integer = -1, Optional NumeroTrailer As String = "", Optional Estatus As Boolean = False) As Boolean Optional CveTipoRemolque As Integer = -1, Optional NumeroTrailer As String = "", Optional Estatus As Boolean = False, Optional CveProveedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_CamionesAdd") DataAdapter("PA_Inv_CamionesAdd")
@@ -5657,6 +5657,7 @@ Public Class ClsInventarios
.Add("@CAAT", SqlDbType.VarChar).Value = CAAT .Add("@CAAT", SqlDbType.VarChar).Value = CAAT
.Add("@NumeroTrailer", SqlDbType.VarChar).Value = NumeroTrailer .Add("@NumeroTrailer", SqlDbType.VarChar).Value = NumeroTrailer
.Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -5690,7 +5691,7 @@ Public Class ClsInventarios
Public Function UpdateCamiones(CveCamion As Integer, Placa As String, Especificacion As String, CveConfigAutoTransporte As Integer, Anio As Integer, CveTipoPermisoSCT As Integer, NumPermisoSCT As String, NombreAseguradora As String, Public Function UpdateCamiones(CveCamion As Integer, Placa As String, Especificacion As String, CveConfigAutoTransporte As Integer, Anio As Integer, CveTipoPermisoSCT As Integer, NumPermisoSCT As String, NombreAseguradora As String,
NumPolizaSeguro As String, CveUsuario As Integer, CveEmpresa As Integer, NombreAseguradoraMedioAmbiente As String, NumPolizaSeguroMedioAmbiente As String, NombreAseguradoraCarga As String, NumPolizaSeguro As String, CveUsuario As Integer, CveEmpresa As Integer, NombreAseguradoraMedioAmbiente As String, NumPolizaSeguroMedioAmbiente As String, NombreAseguradoraCarga As String,
NumPolizaSeguroCarga As String, Optional CveTipoCamion As Integer = -1, Optional LongitudCaja As String = "", Optional LineaTransportacion As String = "", Optional SCAC As String = "", Optional CAAT As String = "", NumPolizaSeguroCarga As String, Optional CveTipoCamion As Integer = -1, Optional LongitudCaja As String = "", Optional LineaTransportacion As String = "", Optional SCAC As String = "", Optional CAAT As String = "",
Optional CveTipoRemolque As Integer = -1, Optional NumeroTrailer As String = "", Optional Estatus As Boolean = False) As Boolean Optional CveTipoRemolque As Integer = -1, Optional NumeroTrailer As String = "", Optional Estatus As Boolean = False, Optional CveProveedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_CamionesUpdate") DataAdapter("PA_Inv_CamionesUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -5717,6 +5718,7 @@ Public Class ClsInventarios
.Add("@CAAT", SqlDbType.VarChar).Value = CAAT .Add("@CAAT", SqlDbType.VarChar).Value = CAAT
.Add("@NumeroTrailer", SqlDbType.VarChar).Value = NumeroTrailer .Add("@NumeroTrailer", SqlDbType.VarChar).Value = NumeroTrailer
.Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -609,6 +609,24 @@ Public Class ClsNominas
End Try End Try
Return retorno Return retorno
End Function End Function
Public Function CalculosISRAguinaldo(fraccionII_1 As Decimal, salariomensual As Decimal, diasmes As Int32, ejercicio As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Nom_CalculosISRAguinaldo", CommandType.StoredProcedure)
addParameters("@FraccionII_1", SqlDbType.Money, fraccionII_1)
addParameters("@salariomensual", SqlDbType.Money, salariomensual)
addParameters("@Diasmes", SqlDbType.Money, diasmes)
addParameters("@Ejercicio", SqlDbType.Int, ejercicio)
retorno = RunQuery("Ocurrió un error al obtener el Calculo ISR Aguinaldo.")
Return retorno
End Function
Public Function UMAFechaGet(cveempresa As Integer, fecha As String) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Nom_UMAFechaGet", CommandType.StoredProcedure)
addParameters("@cveempresa", SqlDbType.Int, cveempresa)
addParameters("@Fecha", SqlDbType.VarChar, fecha)
retorno = RunQuery("Ocurrió un error al obtener el valor de la UMA.")
Return retorno
End Function
Public Function GetDispersionnomina(CvePeriodo As Int32, CveEmpresa As Int32) As Boolean Public Function GetDispersionnomina(CvePeriodo As Int32, CveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False
DataAdapter("PA_Nom_Dispersionnomina", CommandType.StoredProcedure) DataAdapter("PA_Nom_Dispersionnomina", CommandType.StoredProcedure)
@@ -2294,7 +2312,26 @@ Public Class ClsNominas
End Function End Function
#End Region #End Region
Public Function ValidaFechaFinPersonal(CvePersonal As Integer, CveEmpresa As Integer, FechaFin As String) Public Function AgroValidacionNomGet(cveValidacionNomina As Int32, cveEmpresa As Int32, CveUsuario As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Agro_ValidacionNomGet", CommandType.StoredProcedure)
addParameters("@CveValidacionNomina", SqlDbType.Int, cveValidacionNomina)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveUsuario", SqlDbType.Int, CveUsuario)
retorno = RunQuery("Ocurrió un error al obtener el PA_Agro_ValidacionNomGet.")
Return retorno
End Function
Public Function ConceptosCveSistemaUp(cveConcepto As Int32, cveSistema As Int32, cveUsuario As Int32, cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Nom_ConceptosCveSistemaUp", CommandType.StoredProcedure)
addParameters("@CveConcepto", SqlDbType.Int, cveConcepto)
addParameters("@CveSistema", SqlDbType.Int, cveSistema)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
retorno = RunQuery("Ocurrió un error al obtener el PA_Nom_ConceptosCveSistemaUp.")
Return retorno
End Function
Public Function ValidaFechaFinPersonal(CvePersonal As Integer, CveEmpresa As Integer, FechaFin As String) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Nom_ValidaFechaFinPersonal") DataAdapter("PA_Nom_ValidaFechaFinPersonal")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters

View File

@@ -542,10 +542,17 @@ Public Class ClsPaginas
End Property End Property
Property GlobalDTNomConceptosFunciones() As DataTable Property GlobalDTNomConceptosFunciones() As DataTable
Get Get
GlobalDTNomConceptosFunciones = DirectCast(Application("GlobalDTNomConceptosFunciones"), DataTable) Dim AppNombre As String = "GlobalDTNomConceptosFunciones"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetConceptosFunciones() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTNomConceptosFunciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTNomConceptosFunciones") = value Dim AppNombre As String = "GlobalDTNomConceptosFunciones"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTUsuarioResponsable(CveEmpresa As Integer) As DataTable Property GlobalDTUsuarioResponsable(CveEmpresa As Integer) As DataTable
@@ -697,18 +704,32 @@ Public Class ClsPaginas
End Property End Property
Property GlobalDTNomSatBancos() As DataTable Property GlobalDTNomSatBancos() As DataTable
Get Get
GlobalDTNomSatBancos = DirectCast(Application("GlobalDTNomSatBancos"), DataTable) Dim AppNombre As String = "GlobalDTNomSatBancos"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetBancos() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTNomSatBancos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(ByVal value As DataTable) Set(value As DataTable)
Application("GlobalDTNomSatBancos") = value Dim AppNombre As String = "GlobalDTNomSatBancos"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTNomSatConceptos() As DataTable Property GlobalDTNomSatConceptos() As DataTable
Get Get
GlobalDTNomSatConceptos = DirectCast(Application("GlobalDTNomSatConceptos"), DataTable) Dim AppNombre As String = "GlobalDTNomSatConceptos"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetConceptos() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTNomSatConceptos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(ByVal value As DataTable) Set(value As DataTable)
Application("GlobalDTNomSatConceptos") = value Dim AppNombre As String = "GlobalDTNomSatConceptos"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTNomSatRegimenContratacion() As DataTable Property GlobalDTNomSatRegimenContratacion() As DataTable
@@ -753,18 +774,32 @@ Public Class ClsPaginas
End Property End Property
Property GlobalDTNomSatRiesgoPuesto() As DataTable Property GlobalDTNomSatRiesgoPuesto() As DataTable
Get Get
GlobalDTNomSatRiesgoPuesto = DirectCast(Application("GlobalDTNomSatRiesgoPuesto"), DataTable) Dim AppNombre As String = "GlobalDTNomSatRiesgoPuesto"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetRiesgoPuesto() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTNomSatRiesgoPuesto = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(ByVal value As DataTable) Set(value As DataTable)
Application("GlobalDTNomSatRiesgoPuesto") = value Dim AppNombre As String = "GlobalDTNomSatRiesgoPuesto"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTNomSatTipoIncapacidad() As DataTable Property GlobalDTNomSatTipoIncapacidad() As DataTable
Get Get
GlobalDTNomSatTipoIncapacidad = DirectCast(Application("GlobalDTNomSatTipoIncapacidad"), DataTable) Dim AppNombre As String = "GlobalDTNomSatTipoIncapacidad"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Using ObjNom As New ClsNominas()
If ObjNom.GetTipoIncapacidad() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
GlobalDTNomSatTipoIncapacidad = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(ByVal value As DataTable) Set(value As DataTable)
Application("GlobalDTNomSatTipoIncapacidad") = value Dim AppNombre As String = "GlobalDTNomSatTipoIncapacidad"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
'Este GlobalDT no debe segmentarse por empresas, puesto que es para todas las empresas 'Este GlobalDT no debe segmentarse por empresas, puesto que es para todas las empresas
@@ -1904,7 +1939,7 @@ Public Class ClsPaginas
Public Shared Property GlobalDTTipoCuenta() As DataTable Public Shared Property GlobalDTTipoCuenta() As DataTable
Get Get
Dim AppNombre As String = "GlobalDTTipoCuenta" Dim AppNombre As String = "GlobalDTTipoCuenta"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
If ObjBancos.GetBancos_TiposCuenta() Then HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados If ObjBancos.GetBancos_TiposCuenta() Then HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados
ObjBancos.Dispose() ObjBancos.Dispose()
@@ -1921,18 +1956,18 @@ Public Class ClsPaginas
'TipoPerioso 'TipoPerioso
Property GlobalDTTipoPeriodo() As DataTable Property GlobalDTTipoPeriodo() As DataTable
Get Get
If HttpContext.Current.Application("GlobalDTTipoPeriodo") Is Nothing Then Dim AppNombre As String = "GlobalDTTipoPeriodo"
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Using ObjNom As New ClsNominas() Using ObjNom As New ClsNominas()
If ObjNom.GetTiposPeriodos() Then Application("GlobalDTTipoPeriodo") = ObjNom.DtResultados Else Application("GlobalDTTipoPeriodo") = Nothing If ObjNom.GetTiposPeriodos() Then Application(AppNombre) = ObjNom.DtResultados
End Using End Using
End If End If
GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
GlobalDTTipoPeriodo = DirectCast(Application("GlobalDTTipoPeriodo"), DataTable)
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = "GlobalDTTipoPeriodo"
Application("GlobalDTTipoPeriodo") = value HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
@@ -1940,20 +1975,26 @@ Public Class ClsPaginas
'Periodos 'Periodos
Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable
Get Get
Dim Str As New StringBuilder Dim AppNombre As String = $"GlobalDTNominasPeriodos-{CveEmpresa}"
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) If HttpContext.Current.Application(AppNombre) Is Nothing Then
If CveTipoPeriodo <> -1 Then Str.AppendFormat(" {0} CveTipoPeriodo = {1}", If(Str.Length > 0, "AND", ""), CveTipoPeriodo) Using ObjNom As New ClsNominas()
If CvePeriodo <> -1 Then Str.AppendFormat(" {0} CvePeriodo = {1}", If(Str.Length > 0, "AND", ""), CvePeriodo) If ObjNom.GetPeriodos(-1, CveEmpresa, -1, -1, -1, -1) Then Application(AppNombre) = ObjNom.DtResultados
If Str.Length > 0 Then End Using
Dim Dv As New DataView(DirectCast(Application("GlobalDTNominasPeriodos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) End If
Dim filtros As New List(Of String)
If CveTipoPeriodo >= 0 Then filtros.Add($"CveTipoPeriodo = {CveTipoPeriodo}")
If CvePeriodo >= 0 Then filtros.Add($"CvePeriodo = {CvePeriodo}")
If filtros.Count > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
GlobalDTNominasPeriodos = Dv.ToTable GlobalDTNominasPeriodos = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTNominasPeriodos = DirectCast(Application("GlobalDTNominasPeriodos"), DataTable) GlobalDTNominasPeriodos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTNominasPeriodos") = value Dim AppNombre As String = $"GlobalDTNominasPeriodos-{CveEmpresa}"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
'Fin Periodos 'Fin Periodos
@@ -2283,14 +2324,7 @@ Public Class ClsPaginas
Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTNom_Periodos() As DataTable
Get
GlobalDTNom_Periodos = DirectCast(Application("GlobalDTNom_Periodos"), DataTable)
End Get
Set(value As DataTable)
Application("GlobalDTNom_Periodos") = value
End Set
End Property
Public Shared Property GlobalDTVtaFormaPago() As DataTable Public Shared Property GlobalDTVtaFormaPago() As DataTable
Get Get
Dim AppNombre As String = "GlobalDTVtaFormaPago" Dim AppNombre As String = "GlobalDTVtaFormaPago"
@@ -3762,7 +3796,7 @@ Public Class ClsPaginas
End Property End Property
#End Region #End Region
#Region "*********** D T - C O M B U S T I B L E S ***********" #Region "*********** D T - C O M B U S T I B L E S ***********"
Public Shared Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable Public Shared Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable
Get Get
Dim AppNombre As String = $"GlobalDTCombustibles-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTCombustibles-{CveEmpresa}"
'sino existe, recarga los datos 'sino existe, recarga los datos

View File

@@ -3568,7 +3568,7 @@ Public Class ClsRH
End Function End Function
Public Function AddTurno(Turno As String, HorarioDe As String, HorarioA As String, CveUsuario As Integer, CveEmpresa As Integer, CveChecadorHorario As Integer, Public Function AddTurno(Turno As String, HorarioDe As String, HorarioA As String, CveUsuario As Integer, CveEmpresa As Integer, CveChecadorHorario As Integer,
ToleranciaERetardo As Integer, ToleranciaEFalta As Integer, ToleranciaSRetardo As Integer, ToleranciaSFalta As Integer, ToleranciaERetardo As Integer, ToleranciaEFalta As Integer, ToleranciaSRetardo As Integer, ToleranciaSFalta As Integer,
Comida As Integer, ComidaDe As String, ComidaA As String) As Boolean Comida As Integer, ComidaDe As String, ComidaA As String, Optional DiaDescanso As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -3590,6 +3590,7 @@ Public Class ClsRH
.Add("@ToleranciaEFalta", SqlDbType.Int).Value = ToleranciaEFalta .Add("@ToleranciaEFalta", SqlDbType.Int).Value = ToleranciaEFalta
.Add("@ToleranciaSRetardo", SqlDbType.Int).Value = ToleranciaSRetardo .Add("@ToleranciaSRetardo", SqlDbType.Int).Value = ToleranciaSRetardo
.Add("@ToleranciaSFalta", SqlDbType.Int).Value = ToleranciaSFalta .Add("@ToleranciaSFalta", SqlDbType.Int).Value = ToleranciaSFalta
.Add("@DiaDescanso", SqlDbType.Int).Value = DiaDescanso
End With End With
Try Try
@@ -3609,7 +3610,7 @@ Public Class ClsRH
End Function End Function
Public Function UpdateTurno(Turno As String, HorarioDe As String, HorarioA As String, Estatus As Boolean, CveTurno As Integer, CveUsuario As Integer, CveChecadorHorario As Integer, Public Function UpdateTurno(Turno As String, HorarioDe As String, HorarioA As String, Estatus As Boolean, CveTurno As Integer, CveUsuario As Integer, CveChecadorHorario As Integer,
ToleranciaERetardo As Integer, ToleranciaEFalta As Integer, ToleranciaSRetardo As Integer, ToleranciaSFalta As Integer, ToleranciaERetardo As Integer, ToleranciaEFalta As Integer, ToleranciaSRetardo As Integer, ToleranciaSFalta As Integer,
Comida As Integer, ComidaDe As String, ComidaA As String) As Boolean Comida As Integer, ComidaDe As String, ComidaA As String, Optional DiaDescanso As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -3631,7 +3632,8 @@ Public Class ClsRH
.Add("@ToleranciaERetardo", SqlDbType.Int).Value = ToleranciaERetardo .Add("@ToleranciaERetardo", SqlDbType.Int).Value = ToleranciaERetardo
.Add("@ToleranciaEFalta", SqlDbType.Int).Value = ToleranciaEFalta .Add("@ToleranciaEFalta", SqlDbType.Int).Value = ToleranciaEFalta
.Add("@ToleranciaSRetardo", SqlDbType.Int).Value = ToleranciaSRetardo .Add("@ToleranciaSRetardo", SqlDbType.Int).Value = ToleranciaSRetardo
.Add("@ToleranciaSFalta", SqlDbType.Int).Value = ToleranciaSFalta .Add("@ToleranciaSFalta", SqlDbType.Int).Value = ToleranciaSFalta
.Add("@DiaDescanso", SqlDbType.Int).Value = DiaDescanso
End With End With
@@ -7441,6 +7443,110 @@ Public Class ClsRH
End Try End Try
Return Retorno Return Retorno
End Function End Function
Public Function PersonalTurnoUp(cveTurno As Int32, cveUsuario As Int32, cveEmpresa As Int32, cvePersonal As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_RH_PersonalTurnoUp", CommandType.StoredProcedure)
addParameters("@CveTurno", SqlDbType.Int, cveTurno)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
retorno = RunQuery("Ocurrió un error al actualizar el turno del personal.")
Return retorno
End Function
Public Function SupervisorOrganigramaGet(cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_RH_SupervisorOrganigramaGet", CommandType.StoredProcedure)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
retorno = RunQuery("Ocurrió un error al obtener el PA_RH_SupervisorOrganigramaGet.")
Return retorno
End Function
Public Function PersonalRPUpdate(cvePersonal As Int32, cveUsuario As Int32, cveEmpresa As Int32, registroPatronal As String) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_RH_PersonalRPUpdate", CommandType.StoredProcedure)
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@RegistroPatronal", SqlDbType.VarChar, registroPatronal)
retorno = RunQuery("Ocurrió un error al obtener el PA_RH_PersonalRPUpdate.")
Return retorno
End Function
Public Function PersonalTSUpdate(cvePersonal As Int32, cveUsuario As Int32, cveEmpresa As Int32, tipodeSalario As String) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_RH_PersonalTSUpdate", CommandType.StoredProcedure)
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@TipodeSalario", SqlDbType.VarChar, tipodeSalario)
retorno = RunQuery("Ocurrió un error al obtener el PA_RH_PersonalTSUpdate.")
Return retorno
End Function
Public Function GetAsistenciaChecador(cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_RH_GetAsistenciaChecador", CommandType.StoredProcedure)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
retorno = RunQuery("Ocurrió un error al obtener el PA_RH_GetAsistenciaChecador.")
Return retorno
End Function
Public Function PersonalDomUp(cveEstadoDomicilio As Int32, ciudadOrigen As String, cvePersonal As Int32, cveEmpresa As Int32, cveUsuario As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_RH_PersonalDomUp", CommandType.StoredProcedure)
addParameters("@CveEstadoDomicilio", SqlDbType.Int, cveEstadoDomicilio)
addParameters("@CiudadOrigen", SqlDbType.VarChar, ciudadOrigen)
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
retorno = RunQuery("Ocurrió un error al obtener el PA_RH_PersonalDomUp.")
Return retorno
End Function
Public Function PersonalAltasRemove(cvePersonalAltas As Int32, cvePersonal As Int32, cveEmpresa As Int32, cveUsuario As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_RH_PersonalAltasRemove", CommandType.StoredProcedure)
addParameters("@CvePersonalAltas", SqlDbType.Int, cvePersonalAltas)
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
retorno = RunQuery("Ocurrió un error al obtener el PA_RH_PersonalAltasRemove.")
Return retorno
End Function
Public Function PersonalAltasUpFechas(cvePersonalAltas As Int32, fechaInicio As String, fechaFin As String, cvePersonal As Int32, cveEmpresa As Int32, cveUsuario As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_RH_PersonalAltasUpFechas", CommandType.StoredProcedure)
addParameters("@CvePersonalAltas", SqlDbType.Int, cvePersonalAltas)
addParameters("@FechaInicio", SqlDbType.VarChar, fechaInicio)
addParameters("@FechaFin", SqlDbType.VarChar, fechaFin)
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
retorno = RunQuery("Ocurrió un error al obtener el PA_RH_PersonalAltasUpFechas.")
Return retorno
End Function
Public Function AsistenciaDetTurnoUp(cveAsistenciaDetalle As Int32, fecha As String, cveTurno As Int32, cveTurnoOLD As Int32, cvePersonal As Int32, cveUsuario As Int32, cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_RH_AsistenciaDetTurnoUp", CommandType.StoredProcedure)
addParameters("@CveAsistenciaDetalle", SqlDbType.Int, cveAsistenciaDetalle)
addParameters("@Fecha", SqlDbType.VarChar, fecha)
addParameters("@CveTurno", SqlDbType.Int, cveTurno)
addParameters("@CveTurnoOLD", SqlDbType.Int, cveTurnoOLD)
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
retorno = RunQuery("Ocurrió un error al obtener el PA_RH_AsistenciaDetTurnoUp.")
Return retorno
End Function
Public Function estatusPersonalUp(Fecha As DateTime, CvePersonal As Integer, CveEstatusPersonal As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional CveMotivoBaja As Integer = -1, Optional Observaciones As String = "") As Boolean Public Function estatusPersonalUp(Fecha As DateTime, CvePersonal As Integer, CveEstatusPersonal As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional CveMotivoBaja As Integer = -1, Optional Observaciones As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
Data = New DataTable Data = New DataTable

View File

@@ -5599,7 +5599,7 @@ Public Class ClsVentas
End Function End Function
Public Function GetLineasAdicionalesSaldo(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, Optional ConSaldo As Integer = -1, Optional FechaVencimientoConsulta As DateTime = MaxFecha) As Boolean Public Function GetLineasAdicionalesSaldo(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, TipoCambioConsulta As Decimal, Optional ConSaldo As Integer = -1, Optional FechaVencimientoConsulta As DateTime = MaxFecha) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_LineasAdicionalesSaldoGet") DataAdapter("PA_Vta_LineasAdicionalesSaldoGet")
@@ -5611,6 +5611,7 @@ Public Class ClsVentas
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@ConSaldo", SqlDbType.Int).Value = ConSaldo .Add("@ConSaldo", SqlDbType.Int).Value = ConSaldo
.Add("@TipoCambioConsulta", SqlDbType.Decimal).Value = TipoCambioConsulta
.Add("@FechaVencimientoConsulta", SqlDbType.Date).Value = FechaVencimientoConsulta .Add("@FechaVencimientoConsulta", SqlDbType.Date).Value = FechaVencimientoConsulta
End With End With
Try Try

View File

@@ -1,45 +0,0 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace SqlServerTypes
{
/// <summary>
/// Utility methods related to CLR Types for SQL Server
/// </summary>
public class Utilities
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr LoadLibrary(string libname);
/// <summary>
/// Loads the required native assemblies for the current architecture (x86 or x64)
/// </summary>
/// <param name="rootApplicationPath">
/// Root path of the current application. Use Server.MapPath(".") for ASP.NET applications
/// and AppDomain.CurrentDomain.BaseDirectory for desktop applications.
/// </param>
public static void LoadNativeAssemblies(string rootApplicationPath)
{
var nativeBinaryPath = IntPtr.Size > 4
? Path.Combine(rootApplicationPath, @"SqlServerTypes\x64\")
: Path.Combine(rootApplicationPath, @"SqlServerTypes\x86\");
LoadNativeAssembly(nativeBinaryPath, "msvcr120.dll");
LoadNativeAssembly(nativeBinaryPath, "SqlServerSpatial140.dll");
}
private static void LoadNativeAssembly(string nativeBinaryPath, string assemblyName)
{
var path = Path.Combine(nativeBinaryPath, assemblyName);
var ptr = LoadLibrary(path);
if (ptr == IntPtr.Zero)
{
throw new Exception(string.Format(
"Error loading {0} (ErrorCode: {1})",
assemblyName,
Marshal.GetLastWin32Error()));
}
}
}
}

View File

@@ -102,12 +102,17 @@ Public Class E141 : Implements IHttpHandler
'DESCARGA DEL PDF 'DESCARGA DEL PDF
If Not String.IsNullOrEmpty(Params) Then If Not String.IsNullOrEmpty(Params) Then
Dim UrlParametros As Hashtable = Parametros(Decripta(Params)) Try
Dim UrlParametros As Hashtable = Parametros(Decripta(Params))
Dim File As String = UrlParametros("FILE").ToString()
If Not String.IsNullOrEmpty(File) Then
ImprimirbytesPDF(context, DescargarFactura(File), File)
End If
Catch ex As Exception
GuardaLogAD("Ocurrió un error al descargar el pdf. " + ex.ToString() + ".parametros: " + Params, "LogE141")
End Try
Dim File As String = UrlParametros("FILE").ToString()
If Not String.IsNullOrEmpty(File) Then
ImprimirbytesPDF(context, DescargarFactura(File), File)
End If
Else Else
Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString()) Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())

View File

@@ -396,10 +396,10 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row"> <div class="row">
<div class="col-md-2" style="text-align: left">Fecha Desconciliado:</div> <div class="col-md-3" style="text-align: left">Fecha Desconciliado:</div>
<div class="col-md-2"> <div class="col-md-3" style="text-align:left">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaDesconciliado" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox> <asp:TextBox ID="TxtFechaDesconciliado" CssClass="form-control input-sm ADSMaskDate" Style="width: 78px" runat="server"></asp:TextBox>
<span class="input-group-btn "> <span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaDesconciliado" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton> <asp:LinkButton ID="LnkFechaDesconciliado" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span> </span>
@@ -408,7 +408,9 @@
<asp:RequiredFieldValidator ID="RfvFechaDesconciliado" runat="server" ControlToValidate="TxtFechaDesconciliado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Desconciliado''</b> es necesario, por favor ingréselo." ValidationGroup="VGMModalDesconciliado"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RfvFechaDesconciliado" runat="server" ControlToValidate="TxtFechaDesconciliado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Desconciliado''</b> es necesario, por favor ingréselo." ValidationGroup="VGMModalDesconciliado"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceFechaDesconciliado" runat="server" HighlightCssClass="vco" TargetControlID="RfvFechaDesconciliado"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VceFechaDesconciliado" runat="server" HighlightCssClass="vco" TargetControlID="RfvFechaDesconciliado"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="col-md-3">
<asp:CheckBox ID="ChkDejarConciliado" runat="server" Text="Dejar Conciliado" TextAlign="Right" /></div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

View File

@@ -402,7 +402,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
Dim ErrorTrans As Boolean = False Dim ErrorTrans As Boolean = False
If ModalidadDesconciliar = "D" Then If ModalidadDesconciliar = "D" Then
If ObjBancos.DesconciliarIE(CveIEDesconciliar, TxtFechaDesconciliado.Text.ToDate(), UsuarioActual.CveUsuario) Then If ObjBancos.DesconciliarIE(CveIEDesconciliar, TxtFechaDesconciliado.Text.ToDate(), UsuarioActual.CveUsuario, ChkDejarConciliado.Checked) Then
If Not ObjOI.AddEventoBitacora("El pago ha sido desconciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIEDesconciliar) Then If Not ObjOI.AddEventoBitacora("El pago ha sido desconciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIEDesconciliar) Then
ErrorTrans = True ErrorTrans = True
End If End If
@@ -412,7 +412,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
ElseIf ModalidadDesconciliar = "DT" Then ElseIf ModalidadDesconciliar = "DT" Then
For Each Gvr As GridViewRow In GvDatos.Rows For Each Gvr As GridViewRow In GvDatos.Rows
If Gvr.FCCheckBox("ChkConciliado").Checked And Not Gvr.FCCheckBox("ChkConciliado").Enabled Then If Gvr.FCCheckBox("ChkConciliado").Checked And Not Gvr.FCCheckBox("ChkConciliado").Enabled Then
If Not ObjBancos.DesconciliarIE(Gvr.DataKey("CveIE").ToEntero, TxtFechaDesconciliado.Text.ToDate(), UsuarioActual.CveUsuario) Then If Not ObjBancos.DesconciliarIE(Gvr.DataKey("CveIE").ToEntero, TxtFechaDesconciliado.Text.ToDate(), UsuarioActual.CveUsuario, ChkDejarConciliado.Checked) Then
ErrorTrans = True ErrorTrans = True
Else Else
If Not ObjOI.AddEventoBitacora("El pago ha sido desconciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then If Not ObjOI.AddEventoBitacora("El pago ha sido desconciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then

View File

@@ -826,15 +826,7 @@
<asp:CheckBox ID="ChkConciliado" runat="server" Text="Conciliado" Enabled="False" /> <asp:CheckBox ID="ChkConciliado" runat="server" Text="Conciliado" Enabled="False" />
</td> </td>
</tr> </tr>
<tr runat="server" id="TRComplementoSustitucion" visible="false">
<td>Complemento de pago Sustituto de: </td>
<td>
<a id="ARefIESustitucion" runat="server" href="" target='_blank' class='Texto'></a>
</td>
</tr>
</table> </table>
</fieldset> </fieldset>
</div> </div>
@@ -1033,10 +1025,7 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<table border="0" cellpadding="0" cellspacing="0" width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr> <tr>
<td align="center"> <td align="center">
@@ -1053,9 +1042,7 @@
</td> </td>
</tr> </tr>
</table> </table>
<br />
<div class="row"> <div class="row">
<div class="col-md-12 "> <div class="col-md-12 ">
@@ -1421,16 +1408,8 @@
<asp:BoundField HeaderText="Estatus" DataField="StrEstatus" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" /> <asp:BoundField HeaderText="Estatus" DataField="StrEstatus" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Fecha C" DataField="FechaCancelacion" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" /> <asp:BoundField HeaderText="Fecha C" DataField="FechaCancelacion" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" />
<%-- <asp:TemplateField HeaderText="Regenerar" Visible="false" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%"> <asp:TemplateField HeaderText="Motivo" Visible="false" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%">
<ItemTemplate>
<asp:LinkButton ID="imgRegenerar" OnClick="imgRegenerar_Click" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Regenerar"
data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea regenerar?" data-btn-ok-label="si"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-reply-all'></i>" />
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Motivo" Visible="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%">
<ItemTemplate> <ItemTemplate>
<asp:DropDownList runat="server" ID="DdlMotivoCancelacion" DataTextField="CodigoSATDescripcion" DataValueField="CveMotivoCancelacion" CssClass="form-control input-sm select2me" Visible="false"> <asp:DropDownList runat="server" ID="DdlMotivoCancelacion" DataTextField="CodigoSATDescripcion" DataValueField="CveMotivoCancelacion" CssClass="form-control input-sm select2me" Visible="false">
</asp:DropDownList> </asp:DropDownList>
@@ -1439,9 +1418,9 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Cancelar" Visible="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%"> <asp:TemplateField HeaderText="Cancelar" Visible="false" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkCancelarComplemetno" OnClick="LnkCancelarComplemetno_Click" runat="server" AlternateText="Editar" CausesValidation="False" <asp:LinkButton ID="LnkCancelarComplemetno" OnClick="LnkCancelarComplemetno_Click" runat="server" AlternateText="Editar" CausesValidation="False"
data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el complemento?" data-btn-ok-label="si" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el complemento?" data-btn-ok-label="si"
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-minus'></i>" /> CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-minus'></i>" />
</ItemTemplate> </ItemTemplate>

View File

@@ -1218,16 +1218,16 @@ Partial Class Bancos_IE
UpCancelacion.Update() UpCancelacion.Update()
'OTROS DATOS - DATOS COMPLEMENTO SUSTITUCION 'OTROS DATOS - DATOS COMPLEMENTO SUSTITUCION
Dim CveIESustitucion As Integer = ObjIE.DtResultados(0)("CveIESustitucion").ToString.ToEntero 'Dim CveIESustitucion As Integer = ObjIE.DtResultados(0)("CveIESustitucion").ToString.ToEntero
If CveIESustitucion > 0 Then 'If CveIESustitucion > 0 Then
TRComplementoSustitucion.Visible = True ' TRComplementoSustitucion.Visible = True
If ObjIE.GetBancosIE(CveIESustitucion, UsuarioActual.CveEmpresa) And ObjIE.DtResultados.Rows.Count > 0 Then ' If ObjIE.GetBancosIE(CveIESustitucion, UsuarioActual.CveEmpresa) And ObjIE.DtResultados.Rows.Count > 0 Then
ARefIESustitucion.HRef = String.Format("/Bancos/IE.aspx?CveIE={0}", CveIESustitucion) ' ARefIESustitucion.HRef = String.Format("/Bancos/IE.aspx?CveIE={0}", CveIESustitucion)
ARefIESustitucion.InnerText = ObjIE.Folio ' ARefIESustitucion.InnerText = ObjIE.Folio
End If ' End If
End If 'End If
'DETALLES - MOVIMIENTOS 'DETALLES - MOVIMIENTOS
@@ -2506,25 +2506,16 @@ Partial Class Bancos_IE
End If End If
Dep.Dispose() Dep.Dispose()
If CveOCSolicitudAnticipo > 0 Then If CveOCSolicitudAnticipo > 0 Then
Dim ObjOC As New ClsOC Dim ObjOC As New ClsOC
If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then
SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal.Round(2) SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal.RoundSQL(2)
Else Else
SaldoOCAnticipo = 0 SaldoOCAnticipo = 0
End If End If
ObjOC.Dispose() ObjOC.Dispose()
Dim ImporteComparacion As Decimal = TxtImporte.Text.ToDecimal Dim ImporteComparacion As Decimal = TxtImporte.Text.ToDecimal
'
If ChkPagarPesos.Checked Then If ChkPagarPesos.Checked Then
ImporteComparacion = ImporteOriginalDolaras ImporteComparacion = ImporteOriginalDolaras
End If End If
@@ -5700,44 +5691,32 @@ Partial Class Bancos_IE
If Tipo = "Abono" Then If Tipo = "Abono" Then
If ObjBancos.GetVincularPago(CveProveedor, CveCompra, 2, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, CveIE) Then If ObjBancos.GetVincularPago(CveProveedor, CveCompra, 2, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, CveIE) Then
GvComplementoPagos.DataSource = ObjBancos.DtResultados GvComplementoPagos.DataSource = ObjBancos.DtResultados
Else Else
GvComplementoPagos.DataSource = Nothing GvComplementoPagos.DataSource = Nothing
End If End If
GvComplementoPagos.Columns(7).Visible = False GvComplementoPagos.Columns(7).Visible = False
Else Else
If CveIE > 0 Then If CveIE > 0 Then
If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And CveEstatusIE <> 2 Then If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And CveEstatusIE <> 2 Then
DVGenerarComplementoModal.Visible = True DVGenerarComplementoModal.Visible = True
End If End If
If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 1 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And CveEstatusIE <> 2 Then If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 1 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And CveEstatusIE <> 2 Then
DivCancelarComplemento.Visible = True DivCancelarComplemento.Visible = True
GvComplementoPagos.Columns(7).Visible = True
If UsuarioActual.TienePermisoProceso(85) Then GvComplementoPagos.Columns(8).Visible = True
End If End If
' GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"})
GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "FolioFiscal", "Folio", "SerieFolio", "FechaComplemento", "Importe", "RFCReceptor", "StrEstatus", "FechaCancelacion", "Tipo", "Estatus", "CveIE", "CvePAC", "MotivoCancelacion"}) GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "FolioFiscal", "Folio", "SerieFolio", "FechaComplemento", "Importe", "RFCReceptor", "StrEstatus", "FechaCancelacion", "Tipo", "Estatus", "CveIE", "CvePAC", "MotivoCancelacion"})
'"CveComplementoPago","FolioFiscal","Folio","SerieFolio","FechaComplemento","Importe","RFCReceptor","StrEstatus","FechaCancelacion","Tipo,Estatus","CveIE","CvePAC"
End If End If
End If End If
GvComplementoPagos.Columns(7).Visible = True
End If End If
ObjBancos.Dispose() ObjBancos.Dispose()
GvComplementoPagos.DataBind() GvComplementoPagos.DataBind()
UpComplementoPagos.Update() UpComplementoPagos.Update()
UpEliminarCotizacion.Update() 'Esto se ocupa para mostrar DVmotivoCancelacion UpEliminarCotizacion.Update() 'Esto se ocupa para mostrar DVmotivoCancelacion
'ObjBancos.Dispose() 'ObjBancos.Dispose()
@@ -5939,7 +5918,7 @@ Partial Class Bancos_IE
End Sub End Sub
Protected Sub LnkCancelar_Click(sender As Object, e As EventArgs) Protected Sub LnkCancelar_Click(sender As Object, e As EventArgs)
If ChkConciliado.Checked Then If ChkConciliado.Checked AndAlso UsuarioActual.CveEmpresa = 119 Then
'TxtFechaDesconciliado.Text = Now.ToShortDateString 'TxtFechaDesconciliado.Text = Now.ToShortDateString
'UpDesconciliar.Update() 'UpDesconciliar.Update()
'RegistraScript("$('#DModalDesconciliar').modal()") 'RegistraScript("$('#DModalDesconciliar').modal()")

View File

@@ -295,7 +295,7 @@ Partial Class Bancos_ProveedoresAbonar
If UsuarioActual.TienePermisoProceso(98) Then If UsuarioActual.TienePermisoProceso(98) Then
PermiteModificarImporte = False PermiteModificarImporte = False
End If End If
Calendario.StartDate = Now.AddMonths(-8) Calendario.StartDate = Now.AddMonths(-18)
'proceso que restringue solo el pago de apartir del dia de hoy y como limite fin de mes 'proceso que restringue solo el pago de apartir del dia de hoy y como limite fin de mes
If UsuarioActual.TienePermisoProceso(105) Then If UsuarioActual.TienePermisoProceso(105) Then
Calendario.StartDate = Now Calendario.StartDate = Now
@@ -898,57 +898,58 @@ Partial Class Bancos_ProveedoresAbonar
Else Else
Dim ImporteME As Decimal = 0 Dim ImporteME As Decimal = 0
If Pago.CveMonedaPago = 2 Then ImporteME = Pago.ImportePago
If Not UsaComplementariaBancos And Pago.CveMonedaPago = 2 Then If Not UsaComplementariaBancos And Pago.CveMonedaPago = 2 Then
ImporteME = tImporteMN ImporteME = tImporteMN
tImporteMN = (tImporteMN * Pago.TCPago).RoundSQL tImporteMN = (tImporteMN * Pago.TCPago).RoundSQL
End If End If
If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, tImporteMN, 30, Referencia, ConceptoMovimiento, IdCuenta, CveIE:=CveIE, CveProveedor:=CveProveedor, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto, ImporteME:=tImporteMN) Then If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, tImporteMN, 30, Referencia, ConceptoMovimiento, IdCuenta, CveIE:=CveIE, CveProveedor:=CveProveedor, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto, ImporteME:=ImporteME) Then
MsgError = "No se pudo insertar la póliza"
End If
If Pago.CveMonedaPago = 2 AndAlso UsaComplementariaBancos Then
If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, (Pago.ImportePago * Pago.TCPago - Pago.ImportePago).RoundSQL, 204, Referencia, ConceptoMovimiento, IdCuentaBancariaComplementaria, CveIE:=CveIE, CveProveedor:=CveProveedor, ImporteME:=Pago.ImportePago, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
If Pago.CveMonedaPago = 2 AndAlso UsaComplementariaBancos Then
If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, (Pago.ImportePago * Pago.TCPago - Pago.ImportePago).RoundSQL, 204, Referencia, ConceptoMovimiento, IdCuentaBancariaComplementaria, CveIE:=CveIE, CveProveedor:=CveProveedor, ImporteME:=Pago.ImportePago, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
'If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
' 'fluctuación.
' Dim TCPago = TxtTCDolares.Text.ToDecimal
' Dim ImporteFluctuacion As Decimal = 0 '((ImporteSeleccionado / TCPago) - TxtImporte.Text.ToDecimal)
' Dim DtPrePoliza As DataTable = Nothing
' If ObjMov.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) Then
' DtPrePoliza = ObjMov.DtResultados.Copy
' End If
' Dim PagoProveedoresME = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 312 AND TipoMovto = 0")
' Dim Bancos = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 30 AND TipoMovto = 1")
' Dim BancosComplementaria = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 204 AND TipoMovto = 1")
' DtPrePoliza.Dispose()
' ImporteFluctuacion = PagoProveedoresME - (Bancos + BancosComplementaria)
' If MsgError = "" AndAlso ImporteFluctuacion.RoundSQL() <> 0 Then
' 'SI EL PAGO DE PROVEEDORES ME ES MAYOR QUE BANCOS METER EL CONCEPTO DE GANANCIA
' If ImporteFluctuacion > 0 Then
' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Referencia, 64, ConceptoMovimiento, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=Me.CveProveedor, CveCompra:=-1, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TipoCambio, TipoCambioPago:=TCPago) Then
' MsgError = "Ocurrio un error al saldar el movimiento"
' End If
' ElseIf ImporteFluctuacion < 0 Then
' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), Referencia, 65, ConceptoMovimiento, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=Me.CveProveedor, CveCompra:=-1, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TipoCambio, TipoCambioPago:=TCPago) Then
' MsgError = "Ocurrio un error al saldar el movimiento"
' End If
' End If
' End If
'End If
End If End If
'If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
' 'fluctuación.
' Dim TCPago = TxtTCDolares.Text.ToDecimal
' Dim ImporteFluctuacion As Decimal = 0 '((ImporteSeleccionado / TCPago) - TxtImporte.Text.ToDecimal)
' Dim DtPrePoliza As DataTable = Nothing
' If ObjMov.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) Then
' DtPrePoliza = ObjMov.DtResultados.Copy
' End If
' Dim PagoProveedoresME = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 312 AND TipoMovto = 0")
' Dim Bancos = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 30 AND TipoMovto = 1")
' Dim BancosComplementaria = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 204 AND TipoMovto = 1")
' DtPrePoliza.Dispose()
' ImporteFluctuacion = PagoProveedoresME - (Bancos + BancosComplementaria)
' If MsgError = "" AndAlso ImporteFluctuacion.RoundSQL() <> 0 Then
' 'SI EL PAGO DE PROVEEDORES ME ES MAYOR QUE BANCOS METER EL CONCEPTO DE GANANCIA
' If ImporteFluctuacion > 0 Then
' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Referencia, 64, ConceptoMovimiento, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=Me.CveProveedor, CveCompra:=-1, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TipoCambio, TipoCambioPago:=TCPago) Then
' MsgError = "Ocurrio un error al saldar el movimiento"
' End If
' ElseIf ImporteFluctuacion < 0 Then
' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), Referencia, 65, ConceptoMovimiento, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=Me.CveProveedor, CveCompra:=-1, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TipoCambio, TipoCambioPago:=TCPago) Then
' MsgError = "Ocurrio un error al saldar el movimiento"
' End If
' End If
' End If
'End If
End If
If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
If ObjMov.ValorPolizaDescuadre > 0 Then If ObjMov.ValorPolizaDescuadre > 0 Then
MsgError = ObjMov.MensajePolizaDescuadre + " " + ObjMov.ValorDiferencia MsgError = ObjMov.MensajePolizaDescuadre + " " + ObjMov.ValorDiferencia
GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
@@ -2032,7 +2033,7 @@ Partial Class Bancos_ProveedoresAbonar
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
RVTxtFechaDocumentoMenor.MinimumValue = DateTime.Now.AddMonths(-12).ToShortDateString RVTxtFechaDocumentoMenor.MinimumValue = DateTime.Now.AddMonths(-18).ToShortDateString
RVTxtFechaDocumentoMenor.MaximumValue = DateTime.Now.ToShortDateString RVTxtFechaDocumentoMenor.MaximumValue = DateTime.Now.ToShortDateString
Calendario.EndDate = DateTime.Now Calendario.EndDate = DateTime.Now

View File

@@ -21,17 +21,10 @@
{ {
if (!IsPostBack){ if (!IsPostBack){
CargaProveedor(); CargaProveedor();
CargaHuerta(); CargaHuerta();
}
}
protected void CargaHuerta()
} }
} }
if (ObjHuer.GetHuerta(UsuarioActual.CveEmpresa)) protected void CargaHuerta()
{
GVHuerta.DataSource = ObjHuer.DtResultados;
GVHuerta.DataBind();
}
{ {
ClsCGame ObjHuer =new ClsCGame(); ClsCGame ObjHuer =new ClsCGame();
if (ObjHuer.GetHuerta(UsuarioActual.CveEmpresa)) if (ObjHuer.GetHuerta(UsuarioActual.CveEmpresa))

View File

@@ -8660,246 +8660,255 @@ Partial Class Compras_Compras
ObjConta = New ClsContabilidad(ObjCompra.IniciaTransacSQL) ObjConta = New ClsContabilidad(ObjCompra.IniciaTransacSQL)
End If End If
Try
Dim Contador As Integer = 0 Dim Contador As Integer = 0
Dim Importe As Double = 0 Dim Importe As Double = 0
Dim ErrorMovtosCxP As Integer = 0 Dim ErrorMovtosCxP As Integer = 0
Dim Fecha As Date Dim Fecha As Date
If ListaDocumentos Is Nothing And Not ListaDocumentos.Count > 0 Then
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then
Contador += 1
'If gvr.DataKey("Fecha").ToDate > Fecha Then Fecha = gvr.DataKey("Fecha").ToDate 'guardo la fecha mayor
Importe += gvr.FCTextBox("TxtAnticipo").Text.ToDouble
If Math.Round(Importe, 2) - Math.Round(CompraSaldo, 2) > 0.01 Then gvr.FCTextBox("TxtAnticipo").Text = "" : gvr.FCCheckBox("Chk").Checked = False
End If
Next
Else
Contador = 1
End If
'If TxtFecha.Text.ToDate > Fecha Then Fecha = TxtFecha.Text.ToDate
Fecha = TxtFechaEjecucion.Text.ToDate
'Contador = 0
If Contador > 0 Then
If ListaDocumentos Is Nothing And Not ListaDocumentos.Count > 0 Then If ListaDocumentos Is Nothing And Not ListaDocumentos.Count > 0 Then
If Math.Round(Importe, 2) - Math.Round(CompraSaldo, 2) > 0.01 Then For Each gvr As GridViewRow In GVAnticipos.Rows
Alert("El Importe seleccionado excede al importe de la compra", TipoMensaje.MsgAdvertencia) If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then
Exit Sub Contador += 1
End If 'If gvr.DataKey("Fecha").ToDate > Fecha Then Fecha = gvr.DataKey("Fecha").ToDate 'guardo la fecha mayor
Importe += gvr.FCTextBox("TxtAnticipo").Text.ToDouble
If Math.Round(Importe, 2) - Math.Round(CompraSaldo, 2) > 0.01 Then gvr.FCTextBox("TxtAnticipo").Text = "" : gvr.FCCheckBox("Chk").Checked = False
End If
Next
Else
Contador = 1
End If End If
ArrAnticipos.Clear() 'If TxtFecha.Text.ToDate > Fecha Then Fecha = TxtFecha.Text.ToDate
Fecha = TxtFechaEjecucion.Text.ToDate
If CveCompra > 0 Then 'Contador = 0
If Contador > 0 Then
Dim ObjContaAC As ClsContPAQi = Nothing If ListaDocumentos Is Nothing And Not ListaDocumentos.Count > 0 Then
If Math.Round(Importe, 2) - Math.Round(CompraSaldo, 2) > 0.01 Then
'INICIALIZA OBJETOS Alert("El Importe seleccionado excede al importe de la compra", TipoMensaje.MsgAdvertencia)
If Not (ObjComprasParametro IsNot Nothing And ObjContaParametro IsNot Nothing) Then Exit Sub
ObjCompra = New ClsCompras End If
ObjConta = New ClsContabilidad(ObjCompra.IniciaTransacSQL)
End If End If
Dim CveCompraNC, IdCtaContable, IdCtaContableComp As Integer ArrAnticipos.Clear()
Dim ConceptoPoliza As String = $"Amortización {NombreProveedor} - {TxtSerie.Text}-{TxtFolio.Text}"
Try If CveCompra > 0 Then
Dim CveIE As Integer = -1
Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal Dim ObjContaAC As ClsContPAQi = Nothing
Dim CompraActual As New Compra
CompraActual.CveCompra = CveCompra
CompraActual.CveTipoConceptoProveedor = CveTipoConcepto
CompraActual.CveProveedor = CveProveedor
CompraActual.CveMoneda = DdlMoneda.SelectedValue.ToEntero
CompraActual.Fecha = TxtFecha.Text.ToDate
CompraActual.SerieFolio = TxtSerie.Text.Trim & "-" & TxtFolio.Text.Trim
CompraActual.ProveedorNombre = HplProveedor.Text
CompraActual.TC = TipoCambio
CompraActual.Total = TxtTotal.Text.ToDecimal
CompraActual.IVA = TxtIVA.Text.ToDecimal
CompraActual.IVADeducible = TxtIVA.Text.ToDecimal
CompraActual.IEPS = TxtIEPS.Text.ToDecimal
CompraActual.RetIVA = TxtRetIVA.Text.ToDecimal
CompraActual.RetISR = TxtRetISR.Text.ToDecimal
CompraActual.CveConceptoRetISR = DdlRetISRConcepto.SelectedValue.ToEntero
CompraActual.CveConceptoRetIVA = DdlRetIVAConcepto.SelectedValue.ToEntero
CompraActual.PorcentajeIVA = PorcentajeIVA
CompraActual.UsuarioActual = UsuarioActual
CompraActual.CveSubProyecto = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero
CompraActual.IdCtaContableProv = CtaProveedor
CompraActual.IdCtaContableProvComplementaria = CtaProveedorComplementaria
CompraActual.EsImportacion = chkImportacion.Checked
Dim CvePrePolizaNueva As Integer = ObjConta.AddPrePolizas("Compras/Anticipos", 52, Importe, Importe, DdlMoneda.SelectedValue.ToEntero, Fecha, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) 'INICIALIZA OBJETOS
If Not (ObjComprasParametro IsNot Nothing And ObjContaParametro IsNot Nothing) Then
ObjCompra = New ClsCompras
ObjConta = New ClsContabilidad(ObjCompra.IniciaTransacSQL)
End If
Dim CveCompraNC, IdCtaContable, IdCtaContableComp As Integer
Dim ConceptoPoliza As String = $"Amortización {NombreProveedor} - {TxtSerie.Text}-{TxtFolio.Text}"
Try
Dim CveIE As Integer = -1
Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal
Dim CompraActual As New Compra
CompraActual.CveCompra = CveCompra
CompraActual.CveTipoConceptoProveedor = CveTipoConcepto
CompraActual.CveProveedor = CveProveedor
CompraActual.CveMoneda = DdlMoneda.SelectedValue.ToEntero
CompraActual.Fecha = TxtFecha.Text.ToDate
CompraActual.SerieFolio = TxtSerie.Text.Trim & "-" & TxtFolio.Text.Trim
CompraActual.ProveedorNombre = HplProveedor.Text
CompraActual.TC = TipoCambio
CompraActual.Total = TxtTotal.Text.ToDecimal
CompraActual.IVA = TxtIVA.Text.ToDecimal
CompraActual.IVADeducible = TxtIVA.Text.ToDecimal
CompraActual.IEPS = TxtIEPS.Text.ToDecimal
CompraActual.RetIVA = TxtRetIVA.Text.ToDecimal
CompraActual.RetISR = TxtRetISR.Text.ToDecimal
CompraActual.CveConceptoRetISR = DdlRetISRConcepto.SelectedValue.ToEntero
CompraActual.CveConceptoRetIVA = DdlRetIVAConcepto.SelectedValue.ToEntero
CompraActual.PorcentajeIVA = PorcentajeIVA
CompraActual.UsuarioActual = UsuarioActual
CompraActual.CveSubProyecto = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero
CompraActual.IdCtaContableProv = CtaProveedor
CompraActual.IdCtaContableProvComplementaria = CtaProveedorComplementaria
CompraActual.EsImportacion = chkImportacion.Checked
Dim CvePrePolizaNueva As Integer = ObjConta.AddPrePolizas("Compras/Anticipos", 52, Importe, Importe, DdlMoneda.SelectedValue.ToEntero, Fecha, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then
CveCompraNC = gvr.DataKey("CveCompra").ToEntero
If CvePrePoliza > 0 Then
Dim CveConceptoCompra As Integer = 60
Dim CveConceptoCompraComplementaria As Integer = 266
Dim TipoMovimientoCompra As Boolean = True
Dim CveMonedaAnticipo As Integer = gvr.DataKey("CveMoneda").ToEntero
Dim TipoCambioAnt As Decimal = gvr.DataKey("TCCompra").ToDecimal
Dim ImporteAnt As Decimal = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal
Dim ImporComisionAnticipo As Decimal = gvr.FCTextBox("TxtComision").Text.ToDecimal
Dim Pago As New CompraPago
Pago.TipoPago = gvr.DataKey("TipoDocto")
Pago.ImportePago = ImporteAnt
Pago.OtroGastoIngreso = ImporComisionAnticipo
Pago.CveMonedaPago = CveMonedaAnticipo
Pago.TCPago = TipoCambioAnt
Pago.CveProveedor = gvr.DataKey("CveProveedor").ToEntero
Select Case gvr.DataKey("TipoDocto")
Case "NC", "DEV"
CveConceptoCompra = If(CveMonedaAnticipo = 1, 60, 60)
CveConceptoCompraComplementaria = 235
IdCtaContable = If(CveMonedaAnticipo = 1, CtaProveedor, CtaProveedorExtranjera)
IdCtaContableComp = CtaProveedorComplementaria
CveIE = -1
Pago.AplicaAcreditable = False
Case "Egsc"
CveConceptoCompra = If(CveMonedaAnticipo = 1, 21, 21)
CveConceptoCompraComplementaria = 266
IdCtaContable = If(CveMonedaAnticipo = 1, CtaProveedorAnticipos, CtaProveedorAnticiposExtranjera)
IdCtaContableComp = CtaProveedorAnticiposComplementaria
'vinculo la compra actual, y no la compra como si fuera nota de credito
CveCompraNC = -1
CveIE = gvr.DataKey("CveIE").ToEntero
CompraActual.IdCtaContableAnticipoProv = IdCtaContable
Case "DD"
CveConceptoCompra = If(CveMonedaAnticipo = 1, 37, 37)
IdCtaContable = CtaProveedorDeudores
'vinculo la compra actual, y no la compra como si fuera nota de credito
CveCompraNC = -1
CveIE = gvr.DataKey("CveIE").ToEntero
End Select
'PorcentajePago = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal / TxtTotal.Text.ToDecimal
Pago.CveIE = CveIE
Pago.CveCompraAmortizacion = CveCompraNC
If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePolizaNueva, ObjConta) Then
ErrorMovtosCxP = 1
End If
End If
End If
Next
If ErrorMovtosCxP = 0 And CvePrePolizaNueva > 0 Then
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IdPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then
If ObjContaAC Is Nothing Then
ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
ObjContaAC.IniciaTransacSQL()
End If
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaNueva, UsuarioActual.CveUsuario, UsuarioActual.Empresa, MinFecha, "", ObjContaAC) Then
ErrorMovtosCxP = 3
End If
End If
End If
Select Case ErrorMovtosCxP
Case 0
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IdPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then
If ObjContaAC IsNot Nothing Then
ObjContaAC.Commit()
End If
End If
Alert("El movimiento se aplicó correctamente.", TipoMensaje.MsgInformacion)
ObjCompra.Commit()
Dim dtnc As DataTable = Nothing
If ObjCompra.GetComprasNotasCredito(CveCompra, -1) Then
dtnc = ObjCompra.DtResultados
End If
GvAnticiposSel.DataSource = dtnc
GvAnticiposSel.DataBind()
LblAmortizacion.Text = (LblAmortizacion.Text.ToDouble + Importe).FormatoNumero
CompraSaldo = CompraSaldo - Importe
HdnCompraSaldo.Value = CompraSaldo.ToString
If CompraSaldo > 0 Then CargaAnticipos(CveProveedor)
If CveCompra > 0 Then VisualizaEstatusCompraSaldo(DdlTipoComprobante.SelectedValue, CompraSaldo.ToDecimal, TxtTotal.Text.ToDecimal)
UpAnticipos.Update()
UpPS.Update()
dtnc.Dispose()
Case 1
Alert("Ocurrió un error al amortizar la nota de crédito<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ObjCompra.RollBack()
Case 2
Alert("Ocurrió un error al amortizar la nota de crédito<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ObjCompra.RollBack()
Case 3
Alert("Ocurrió un error al contabilizar la la amortizacion del anticipo.", TipoMensaje.MsgAdvertencia)
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IdPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then
If ObjContaAC IsNot Nothing Then
Try
ObjContaAC.RollBack()
Catch ex As Exception
End Try
End If
End If
ObjCompra.RollBack()
End Select
Catch ex As Exception
ObjCompra.RollBack()
End Try
If ObjContaAC IsNot Nothing Then
ObjContaAC.Dispose()
End If
ObjCompra.Dispose()
Else
'sino se ha guardado la compra, se registra temporal que anticpos van a cargarle
For Each gvr As GridViewRow In GVAnticipos.Rows For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then
ArrAnticipos.Add(New Anticipos With {.CvePrePoliza = gvr.DataKey("CvePrePoliza").ToEntero, .CveIE = gvr.DataKey("CveIE").ToString.ToEntero, .CveCompra = gvr.DataKey("CveCompra").ToEntero, .Importe = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, .ImporteComision = gvr.FCTextBox("TxtComision").Text.ToDecimal, .TCCompra = gvr.DataKey("TCCompra").ToDecimal, .TipoMovto = gvr.DataKey("TipoDocto")})
CveCompraNC = gvr.DataKey("CveCompra").ToEntero
If CvePrePoliza > 0 Then
Dim CveConceptoCompra As Integer = 60
Dim CveConceptoCompraComplementaria As Integer = 266
Dim TipoMovimientoCompra As Boolean = True
Dim CveMonedaAnticipo As Integer = gvr.DataKey("CveMoneda").ToEntero
Dim TipoCambioAnt As Decimal = gvr.DataKey("TCCompra").ToDecimal
Dim ImporteAnt As Decimal = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal
Dim ImporComisionAnticipo As Decimal = gvr.FCTextBox("TxtComision").Text.ToDecimal
Dim Pago As New CompraPago
Pago.TipoPago = gvr.DataKey("TipoDocto")
Pago.ImportePago = ImporteAnt
Pago.OtroGastoIngreso = ImporComisionAnticipo
Pago.CveMonedaPago = CveMonedaAnticipo
Pago.TCPago = TipoCambioAnt
Pago.CveProveedor = gvr.DataKey("CveProveedor").ToEntero
Select Case gvr.DataKey("TipoDocto")
Case "NC", "DEV"
CveConceptoCompra = If(CveMonedaAnticipo = 1, 60, 60)
CveConceptoCompraComplementaria = 235
IdCtaContable = If(CveMonedaAnticipo = 1, CtaProveedor, CtaProveedorExtranjera)
IdCtaContableComp = CtaProveedorComplementaria
CveIE = -1
Pago.AplicaAcreditable = False
Case "Egsc"
CveConceptoCompra = If(CveMonedaAnticipo = 1, 21, 21)
CveConceptoCompraComplementaria = 266
IdCtaContable = If(CveMonedaAnticipo = 1, CtaProveedorAnticipos, CtaProveedorAnticiposExtranjera)
IdCtaContableComp = CtaProveedorAnticiposComplementaria
'vinculo la compra actual, y no la compra como si fuera nota de credito
CveCompraNC = -1
CveIE = gvr.DataKey("CveIE").ToEntero
CompraActual.IdCtaContableAnticipoProv = IdCtaContable
Case "DD"
CveConceptoCompra = If(CveMonedaAnticipo = 1, 37, 37)
IdCtaContable = CtaProveedorDeudores
'vinculo la compra actual, y no la compra como si fuera nota de credito
CveCompraNC = -1
CveIE = gvr.DataKey("CveIE").ToEntero
End Select
'PorcentajePago = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal / TxtTotal.Text.ToDecimal
Pago.CveIE = CveIE
Pago.CveCompraAmortizacion = CveCompraNC
AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePolizaNueva, ObjConta)
End If
End If End If
Next Next
If ErrorMovtosCxP = 0 And CvePrePolizaNueva > 0 Then Dim ImporteAnticipo As Decimal = 0
If ArrAnticipos.Count > 0 Then
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IdPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
If ObjContaAC Is Nothing Then ImporteAnticipo += Ant.Importe
ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa) Next
ObjContaAC.IniciaTransacSQL()
End If
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaNueva, UsuarioActual.CveUsuario, UsuarioActual.Empresa, MinFecha, "", ObjContaAC) Then
ErrorMovtosCxP = 3
End If
End If
End If End If
Select Case ErrorMovtosCxP LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
Case 0 LblAplicadoCompraAnt.Text = ImporteAnticipo.FormatoNumero
LblSaldoFactura.Text = (TxtTotal.Text.ToDecimal - ImporteAnticipo).ToString.FormatoNumero
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IdPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then UpPS.Update()
If ObjContaAC IsNot Nothing Then
ObjContaAC.Commit()
End If
End If
Alert("El movimiento se aplicó correctamente.", TipoMensaje.MsgInformacion)
ObjCompra.Commit()
Dim dtnc As DataTable = Nothing
If ObjCompra.GetComprasNotasCredito(CveCompra, -1) Then
dtnc = ObjCompra.DtResultados
End If
GvAnticiposSel.DataSource = dtnc
GvAnticiposSel.DataBind()
LblAmortizacion.Text = (LblAmortizacion.Text.ToDouble + Importe).FormatoNumero
CompraSaldo = CompraSaldo - Importe
HdnCompraSaldo.Value = CompraSaldo.ToString
If CompraSaldo > 0 Then CargaAnticipos(CveProveedor)
If CveCompra > 0 Then VisualizaEstatusCompraSaldo(DdlTipoComprobante.SelectedValue, CompraSaldo.ToDecimal, TxtTotal.Text.ToDecimal)
UpAnticipos.Update()
UpPS.Update()
dtnc.Dispose()
Case 1
Alert("Ocurrió un error al amortizar la nota de crédito<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ObjCompra.RollBack()
Case 2
Alert("Ocurrió un error al amortizar la nota de crédito<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ObjCompra.RollBack()
Case 3
Alert("Ocurrió un error al contabilizar la la amortizacion del anticipo.", TipoMensaje.MsgAdvertencia)
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IdPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then
If ObjContaAC IsNot Nothing Then
Try
ObjContaAC.RollBack()
Catch ex As Exception
End Try
End If
End If
ObjCompra.RollBack()
End Select
Catch ex As Exception
ObjCompra.RollBack()
End Try
If ObjContaAC IsNot Nothing Then
ObjContaAC.Dispose()
End If End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAnticipos"))
ObjCompra.Dispose()
Else Else
'sino se ha guardado la compra, se registra temporal que anticpos van a cargarle Alert("No hay movimientos seleccionados para aplicar", TipoMensaje.MsgAdvertencia)
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then
ArrAnticipos.Add(New Anticipos With {.CvePrePoliza = gvr.DataKey("CvePrePoliza").ToEntero, .CveIE = gvr.DataKey("CveIE").ToString.ToEntero, .CveCompra = gvr.DataKey("CveCompra").ToEntero, .Importe = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, .ImporteComision = gvr.FCTextBox("TxtComision").Text.ToDecimal, .TCCompra = gvr.DataKey("TCCompra").ToDecimal, .TipoMovto = gvr.DataKey("TipoDocto")})
End If
Next
Dim ImporteAnticipo As Decimal = 0
If ArrAnticipos.Count > 0 Then
For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
ImporteAnticipo += Ant.Importe
Next
End If
LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
LblAplicadoCompraAnt.Text = ImporteAnticipo.FormatoNumero
LblSaldoFactura.Text = (TxtTotal.Text.ToDecimal - ImporteAnticipo).ToString.FormatoNumero
UpPS.Update()
End If End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAnticipos")) UPPAnticiposSel.Update()
Else
Alert("No hay movimientos seleccionados para aplicar", TipoMensaje.MsgAdvertencia) Catch ex As Exception
End If ObjCompra.RollBack()
UPPAnticiposSel.Update() ObjCompra.Dispose()
End Try
End Sub End Sub
@@ -9355,7 +9364,7 @@ Partial Class Compras_Compras
Dim CvePersonal As Integer = 0 Dim CvePersonal As Integer = 0
If Cont < GvPersonal.Rows.Count Then CvePersonal = GvPersonal.Rows(Cont).FCDropDownList("DdlPersonalGv").SelectedValue.ToEntero If Cont < GvPersonal.Rows.Count Then CvePersonal = GvPersonal.Rows(Cont).FCDropDownList("DdlPersonalGv").SelectedValue.ToEntero
Dim Referencia As String Dim Referencia As String = ""
If Cont < GvPersonal.Rows.Count Then Referencia = GvPersonal.Rows(Cont).FCTextBox("TxtReferencia").Text If Cont < GvPersonal.Rows.Count Then Referencia = GvPersonal.Rows(Cont).FCTextBox("TxtReferencia").Text
Cont = Cont + 1 Cont = Cont + 1

View File

@@ -82,23 +82,23 @@
End Using End Using
GuardaLogAsax(String.Format("Globalasax 7:{0}", DateTime.Now)) 'GuardaLogAsax(String.Format("Globalasax 7:{0}", DateTime.Now))
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'C A R G A - N O M 'C A R G A - N O M
Using ObjNom As New ClsNominas() 'Using ObjNom As New ClsNominas()
'If ObjNom.GetConceptos(-1) Then Application("GlobalDTNomConceptos") = ObjNom.DtResultados Else Application("GlobalDTNomConceptos") = Nothing ' 'If ObjNom.GetConceptos(-1) Then Application("GlobalDTNomConceptos") = ObjNom.DtResultados Else Application("GlobalDTNomConceptos") = Nothing
If ObjNom.GetConceptosFunciones() Then Application("GlobalDTNomConceptosFunciones") = ObjNom.DtResultados Else Application("GlobalDTNomConceptosFunciones") = Nothing ' 'If ObjNom.GetConceptosFunciones() Then Application("GlobalDTNomConceptosFunciones") = ObjNom.DtResultados Else Application("GlobalDTNomConceptosFunciones") = Nothing
'If ObjNom.GetTiposPeriodos() Then Application("GlobalDTTipoPeriodo") = ObjNom.DtResultados Else Application("GlobalDTTipoPeriodo") = Nothing ' 'If ObjNom.GetTiposPeriodos() Then Application("GlobalDTTipoPeriodo") = ObjNom.DtResultados Else Application("GlobalDTTipoPeriodo") = Nothing
If ObjNom.GetPeriodos(-1, -1, -1, -1, -1) Then Application("GlobalDTNominasPeriodos") = ObjNom.DtResultados Else Application("GlobalDTNominasPeriodos") = Nothing ' 'If ObjNom.GetPeriodos(-1, -1, -1, -1, -1) Then Application("GlobalDTNominasPeriodos") = ObjNom.DtResultados Else Application("GlobalDTNominasPeriodos") = Nothing
If ObjNom.GetBancos Then Application("GlobalDTNomSatBancos") = ObjNom.DtResultados Else Application("GlobalDTNomSatBancos") = Nothing ' 'If ObjNom.GetBancos Then Application("GlobalDTNomSatBancos") = ObjNom.DtResultados Else Application("GlobalDTNomSatBancos") = Nothing
If ObjNom.GetConceptos Then Application("GlobalDTNomSatConceptos") = ObjNom.DtResultados Else Application("GlobalDTNomSatConceptos") = Nothing ' 'If ObjNom.GetConceptos Then Application("GlobalDTNomSatConceptos") = ObjNom.DtResultados Else Application("GlobalDTNomSatConceptos") = Nothing
'If ObjNom.GetRegimenContratacion Then Application("GlobalDTNomSatRegimenContratacion") = ObjNom.DtResultados Else Application("GlobalDTNomSatRegimenContratacion") = Nothing ' 'If ObjNom.GetRegimenContratacion Then Application("GlobalDTNomSatRegimenContratacion") = ObjNom.DtResultados Else Application("GlobalDTNomSatRegimenContratacion") = Nothing
If ObjNom.GetRiesgoPuesto Then Application("GlobalDTNomSatRiesgoPuesto") = ObjNom.DtResultados Else Application("GlobalDTNomSatRiesgoPuesto") = Nothing ' 'If ObjNom.GetRiesgoPuesto Then Application("GlobalDTNomSatRiesgoPuesto") = ObjNom.DtResultados Else Application("GlobalDTNomSatRiesgoPuesto") = Nothing
If ObjNom.GetTipoIncapacidad Then Application("GlobalDTNomSatTipoIncapacidad") = ObjNom.DtResultados Else Application("GlobalDTNomSatTipoIncapacidad") = Nothing ' 'If ObjNom.GetTipoIncapacidad Then Application("GlobalDTNomSatTipoIncapacidad") = ObjNom.DtResultados Else Application("GlobalDTNomSatTipoIncapacidad") = Nothing
End Using 'End Using
GuardaLogAsax(String.Format("Globalasax 9:{0}", DateTime.Now)) ' GuardaLogAsax(String.Format("Globalasax 9:{0}", DateTime.Now))
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------S I S T E M A ---------------------------------------------------------------------------------- '------------------------------------------------------------------------------S I S T E M A ----------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@@ -207,18 +207,15 @@ Partial Class Inventarios_CatUnidades
If CveCamion <= 0 Then If CveCamion <= 0 Then
If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, UsuarioActual.CveEmpresa, DdlConfigAuto.SelectedValue.ToEntero, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero(), TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, UsuarioActual.CveEmpresa, DdlConfigAuto.SelectedValue.ToEntero, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero(), TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario,
TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text, ChkEstatus.Checked) Then TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text, ChkEstatus.Checked, CveProveedor:=DdlProveedor.SelectedValue) Then
Alert("Unidad agregada correctamente") Alert("Unidad agregada correctamente")
Else Else
ErrorPrceso = True ErrorPrceso = True
End If End If
Else Else
If ObjInventarios.UpdateCamiones(CveCamion, TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, DdlConfigAuto.SelectedValue.ToEntero, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero(), TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, If ObjInventarios.UpdateCamiones(CveCamion, TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, DdlConfigAuto.SelectedValue.ToEntero, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero(), TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text, ChkEstatus.Checked) Then TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text, ChkEstatus.Checked, CveProveedor:=DdlProveedor.SelectedValue) Then
Alert("Unidad actualizada correctamente") Alert("Unidad actualizada correctamente")
Using objbase = New ClsClaseBase()
objbase.runQuerystr(String.Format("UPDATE Inv_Camiones SET CveProveedor={1} WHERE CveCamion={0}", CveCamion, DdlProveedor.SelectedValue))
End Using
Else Else
ErrorPrceso = True ErrorPrceso = True
End If End If

View File

@@ -2406,7 +2406,7 @@ Partial Class Inventarios_EntregaAlmacen
End If End If
If DtGarantias IsNot Nothing AndAlso DtGarantias.Rows.Count > 0 AndAlso CveAlmacenGarantia > 0 Then If DtGarantias IsNot Nothing AndAlso DtGarantias.Rows.Count > 0 AndAlso CveAlmacenGarantia > 0 Then
CveMovimientoGarantia = ObjInventario.AddMovimiento(CveAlmacenGarantia, 2, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, Modulo:="EA/G5") CveMovimientoGarantia = ObjInventario.AddMovimiento(CveAlmacenGarantia, 14, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, Modulo:="EA/G5")
FolioGarantia = ObjInventario.Folio FolioGarantia = ObjInventario.Folio
For Each RowGarantia As DataRow In DtGarantias.Rows For Each RowGarantia As DataRow In DtGarantias.Rows

View File

@@ -53,14 +53,12 @@ public partial class Nomina_Aguinaldo : ClsPaginas
LtlUma.Text = ""; LtlUma.Text = "";
int cveempresa = 1; int cveempresa = 1;
if (UsuarioActual != null) { cveempresa = UsuarioActual.CveEmpresa; } if (UsuarioActual != null) { cveempresa = UsuarioActual.CveEmpresa; }
using (ClsClaseBaseD objbase = new ClsClaseBaseD())
using (ClsNominas onom = new ClsNominas())
{ {
if (objbase.runQuerystr($"SELECT Valor UMA FROM [dbo].[RH_TablasValores] WHERE Tipo =1 AND CveEmpresa ={cveempresa} AND Fecha<'{DateTime.Now:yyyy/MM/dd}' ORDER BY Fecha DESC")) if (onom.UMAFechaGet(cveempresa, $"{DateTime.Now:yyyy/MM/dd}") && onom.DtResultados.Rows.Count > 0)
{ {
if (objbase.DtResultados.Rows.Count > 0) LtlUma.Text = onom.DtResultados.Rows[0]["UMA"].ToString();
{
LtlUma.Text = objbase.DtResultados.Rows[0]["UMA"].ToString();
}
} }
} }
} }
@@ -395,7 +393,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
int CvePersonal = 0; int CvePersonal = 0;
int CveSubProyecto = 0; int CveSubProyecto = 0;
StringBuilder str = new StringBuilder(); StringBuilder str = new StringBuilder();
using (ClsClaseBaseD objbase = new ClsClaseBaseD()) using (ClsNominas objbase = new ClsNominas())
{ {
foreach (GridViewRow gvrow in GVCalcularAguinaldo.Rows) foreach (GridViewRow gvrow in GVCalcularAguinaldo.Rows)
@@ -433,10 +431,11 @@ public partial class Nomina_Aguinaldo : ClsPaginas
{ {
FraccionI = (aguinaldogravado / diasanio) * diasmes; FraccionI = (aguinaldogravado / diasanio) * diasmes;
FraccionII_1 = salariomensual + FraccionI; FraccionII_1 = salariomensual + FraccionI;
str.Clear(); //str.Clear();
str.AppendFormat("SELECT dbo.Fnc_NomValues(40, 0, {2}, -1, {0}, {1}, {1}) isrFraccionII_2,", FraccionII_1, diasmes, DdlEjercicios.SelectedValue); //str.AppendFormat("SELECT dbo.Fnc_NomValues(40, 0, {2}, -1, {0}, {1}, {1}) isrFraccionII_2,", FraccionII_1, diasmes, DdlEjercicios.SelectedValue);
str.AppendFormat(" dbo.Fnc_NomValues(40, 0, {2}, -1, {0}, {1}, {1}) isrFraccionIII_1", salariomensual, diasmes, DdlEjercicios.SelectedValue); //str.AppendFormat(" dbo.Fnc_NomValues(40, 0, {2}, -1, {0}, {1}, {1}) isrFraccionIII_1", salariomensual, diasmes, DdlEjercicios.SelectedValue);
if (objbase.runQuerystr(str.ToString())) //if (objbase.runQuerystr(str.ToString()))
if(objbase.CalculosISRAguinaldo(FraccionII_1, salariomensual, diasmes, DdlEjercicios.SelectedValue))
{ {
DataRow drow = objbase.DtResultados.Rows[0]; DataRow drow = objbase.DtResultados.Rows[0];
FraccionII_2 = drow["isrFraccionII_2"].ToString().ToDecimal(); FraccionII_2 = drow["isrFraccionII_2"].ToString().ToDecimal();
@@ -658,340 +657,3 @@ public partial class Nomina_Aguinaldo : ClsPaginas
Response.End(); Response.End();
} }
} }
class ClsClaseBaseD : IDisposable
{
protected SqlConnection SqlConexion;
protected SqlDataAdapter SqlAdapter;
protected DataTable datos;
protected DataSet DTSet;
public DataTable DtResultados
{
get
{
return datos;
}
}
public DataSet DTSetResultados
{
get
{
return DTSet;
}
}
protected bool disposedValue = false;
protected bool EsTransaccion = false;
public string MyCurrentError;
// REGISTRAR CONEXIÓN
private int CveConexion = 0;
public ClsClaseBaseD(ClsClaseBaseD adsObj = null, SqlTransaction sqlTransacc = null, SqlDataAdapter sqlAdapter = null)
{
if (adsObj != null && adsObj.SqlAdapter != null && adsObj.SqlAdapter.SelectCommand != null && adsObj.SqlAdapter.SelectCommand.Transaction != null)
{
SqlConexion = adsObj.SqlConexion;
SqlAdapter = adsObj.SqlAdapter;
EsTransaccion = true;
}
else
{
if (sqlTransacc != null)
{
SqlConexion = sqlTransacc.Connection;
SqlAdapter = sqlAdapter;
EsTransaccion = true;
}
else
{
SqlConexion = new SqlConnection();
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString;
try
{
SqlConexion.Open();
SqlAdapter = new SqlDataAdapter("", SqlConexion);
ConexionAdd();
}
catch (Exception ex)
{
this.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex);
}
}
}
}
public void SqlDataAdapter(string StrSQL, CommandType TipoComando = CommandType.StoredProcedure)
{
if (SqlConexion.State == ConnectionState.Open)
{
SqlAdapter.SelectCommand.Parameters.Clear();
SqlAdapter.SelectCommand.CommandText = StrSQL;
SqlAdapter.SelectCommand.CommandType = TipoComando;
datos = new DataTable();
DTSet = new DataSet();
}
}
protected void DataAdapter(string StrSQL, CommandType TipoComando = CommandType.Text)
{
// if (SqlAdapter.SelectCommand == null)
// {
// if ((sqlCommand != null))
// {
// SqlAdapter.SelectCommand = sqlCommand;
// }
// else
// {
// SqlAdapter.SelectCommand = new SqlCommand();
// }
// SqlAdapter.SelectCommand.Connection = SqlConexion;
// }
if (SqlConexion.State == ConnectionState.Open)
{
SqlAdapter.SelectCommand.Parameters.Clear();
SqlAdapter.SelectCommand.CommandText = StrSQL;
SqlAdapter.SelectCommand.CommandType = TipoComando;
datos = new DataTable();
DTSet = new DataSet();
}
}
private void ConexionAdd()
{
if (ConfigurationManager.AppSettings["RegistraConexion"] != null && ConfigurationManager.AppSettings["RegistraConexion"].ToString() == "1")
{
try
{
SqlDataAdapter("PA_Sis_RegistrarConexion");
{
var withBlock = SqlAdapter.SelectCommand.Parameters;
withBlock.Add("@Clase", SqlDbType.VarChar).Value = this.GetType().Name;
withBlock.Add("@Modulo", SqlDbType.VarChar).Value = string.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString(), HttpContext.Current.Request.QueryString.ToString());
withBlock.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output;
}
SqlAdapter.Fill(datos);
CveConexion = SqlAdapter.SelectCommand.Parameters["@IDConexion"].Value.ToString().ToEntero();
}
catch (Exception ex)
{
this.OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo());
}
}
}
private void ConexionClose()
{
if (CveConexion > 0 && ConfigurationManager.AppSettings["RegistraConexion"] != null && ConfigurationManager.AppSettings["RegistraConexion"].ToString() == "1")
{
SqlDataAdapter(string.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text);
try
{
SqlAdapter.Fill(datos);
}
catch (Exception ex)
{
this.OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo());
}
CveConexion = 0;
}
}
protected void addParameters(string name, SqlDbType tipo, object valor)
{
if (SqlConexion.State == ConnectionState.Open)
SqlAdapter.SelectCommand.Parameters.Add(name, tipo).Value = valor;
}
public bool runQuerystr(string Query, List<parametroQuery> Listaparametros = null, string msgError = "", bool mostrarError = true)
{
bool retorno = false;
try
{
if (SqlConexion.State == ConnectionState.Open)
{
SqlAdapter.SelectCommand.Parameters.Clear();
SqlAdapter.SelectCommand.CommandText = Query;
SqlAdapter.SelectCommand.CommandType = CommandType.Text;
datos = new DataTable();
if (Listaparametros != null)
{
foreach (parametroQuery pr in Listaparametros)
{
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
}
}
SqlAdapter.Fill(datos);
retorno = true;
}
else
{
string InfoAdicional = "Se intenta realizar una conexion con una conexion cerrada";
InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}";
ModExtensiones.GuardaLog(InfoAdicional);
}
}
catch (SqlException sqEx)
{
retorno = false;
setOnError(msgError, sqEx);
}
catch (Exception ex)
{
retorno = false;
setOnError(msgError, ex);
}
return retorno;
}
public int ExecQuery(string Query, List<parametroQuery> Listaparametros = null, string msgError = "", bool mostrarError = true)
{
int retorno = -1;
try
{
if (SqlConexion.State == ConnectionState.Open)
{
SqlAdapter.SelectCommand.Parameters.Clear();
SqlAdapter.SelectCommand.CommandText = Query;
SqlAdapter.SelectCommand.CommandType = CommandType.Text;
if (Listaparametros != null)
{
foreach (parametroQuery pr in Listaparametros)
{
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
}
}
retorno = SqlAdapter.SelectCommand.ExecuteNonQuery();
}
else
{
string InfoAdicional = "Se intenta realizar una conexion con una conexion cerrada";
InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}";
this.GuardaLog(InfoAdicional);
}
}
catch (SqlException sqEx)
{
retorno = -1;
setOnError(msgError, sqEx);
}
catch (Exception ex)
{
retorno = -1;
setOnError(msgError, ex);
}
return retorno;
}
protected bool RunQuery(string msgOnError)
{
bool retorno = false;
try
{
SqlAdapter.Fill(datos);
retorno = true;
}
catch (Exception ex)
{
retorno = false;
setOnError(msgOnError, ex);
}
return retorno;
}
protected bool RunQueryDS(string msgOnError)
{
bool retorno = false;
try
{
SqlAdapter.Fill(DTSet);
retorno = true;
}
catch (Exception ex)
{
retorno = false;
setOnError(msgOnError, ex);
}
return retorno;
}
public void setOnError(string Mensaje, Exception Exeption)
{
string InfoAdicional = "";
if (SqlAdapter != null && SqlAdapter.SelectCommand != null && SqlAdapter.SelectCommand.Parameters != null)
InfoAdicional = SqlAdapter.SelectCommand.Parameters.ParametrosInfo();
MyCurrentError = string.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString(), "\r\n", InfoAdicional);
this.OnError(Mensaje, Exeption, InfoAdicional);
}
public void IniciaTransacSQL()
{
SqlAdapter.SelectCommand.Transaction = SqlConexion.BeginTransaction();
EsTransaccion = true;
}
public void Commit()
{
SqlAdapter.SelectCommand.Transaction.Commit();
SqlConexion.Close();
}
public void RollBack()
{
SqlAdapter.SelectCommand.Transaction.Rollback();
SqlConexion.Close();
}
public void Dispose()
{
ConexionClose();
if ((SqlConexion != null))
{
if (SqlConexion.State == ConnectionState.Open)
{
try
{
if ((SqlAdapter != null))
SqlAdapter.Dispose();
SqlConexion.Close();
}
catch (Exception ex)
{
this.OnError("Ocurrió un error al intentar cerrar la base de datos.", ex);
}
}
SqlConexion.Dispose();
}
if (datos != null)
datos.Dispose();
if (SqlAdapter != null)
SqlAdapter.Dispose();
if (DTSet != null)
DTSet.Dispose();
GC.SuppressFinalize(this);
}
}
//public class parametroQuery
//{
// public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection))
// {
// this.ParameterName = parameterName;
// this.SqlDataType = sqlDataType;
// this.ParameterDirection = parameterDirection;
// this.SqlValue = sqlValue;
// }
// public string ParameterName { get; set; }
// public SqlDbType SqlDataType { get; set; }
// public ParameterDirection ParameterDirection { get; set; }
// public object SqlValue { get; set; }
//}

View File

@@ -41,7 +41,6 @@ Partial Class Nomina_CatPeriodos
Dim ObjNom_Periodos As New ClsNominas Dim ObjNom_Periodos As New ClsNominas
If ObjNom_Periodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlEjercicio.SelectedValue.ToEntero(), -1, -1, DdlEstatus.SelectedValue.ToEntero()) Then If ObjNom_Periodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlEjercicio.SelectedValue.ToEntero(), -1, -1, DdlEstatus.SelectedValue.ToEntero()) Then
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados
Else Else
Me.GvDatos.DataSource = Nothing Me.GvDatos.DataSource = Nothing
@@ -153,7 +152,7 @@ Partial Class Nomina_CatPeriodos
If ObjNom_Periodos.RemovePeriodo(GvDatos.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then If ObjNom_Periodos.RemovePeriodo(GvDatos.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then
GvDatos.EditIndex = -1 GvDatos.EditIndex = -1
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
Alert("El Periodo se eliminó correctamente.", TipoMensaje.MsgInformacion) Alert("El Periodo se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If End If
@@ -265,7 +264,7 @@ Partial Class Nomina_CatPeriodos
Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion) Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update() UpDatos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
CargaDatos() CargaDatos()
If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
CargaGrid(ViewState("Orden").ToString()) CargaGrid(ViewState("Orden").ToString())
@@ -281,7 +280,7 @@ Partial Class Nomina_CatPeriodos
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update() UpDatos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
CargaDatos() CargaDatos()
If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
CargaGrid(ViewState("Orden").ToString()) CargaGrid(ViewState("Orden").ToString())

View File

@@ -423,15 +423,9 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
if (continuar) if (continuar)
{ {
using (ClsClaseBase objbase = new ClsClaseBase()) using (ClsGenerales objbase = new ClsGenerales())
{ {
/* objbase.AddHistorialBitacora(384, -1, -1, -1, -1, -1, -1, -1, "Asistió", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,0, "SE INGRESO ASISTENCIA MANUAL","","",CvePersonal: DdlmcPersonal.SelectedValue.ToEntero(),Fecha: $"{fechaing:yyyy/MM/dd}" ,Motivo: "SE INGRESO ASISTENCIA MANUAL");
INSERT INTO Gral_HistorialBitacora(CvePersonal,CveConceptoHistorialBitacora,Descripcion,Motivo,CveUsuario,CveEmpresa,Fecha,Actual)
SELECT CvePersonal, 384,'se ingreso asistencia manual','se ingreso asistencia manual',100,@CveEmpresa,MIN(CAST(Fecha AS DATE))
*/
objbase.runQuerystr(string.Format("INSERT INTO Gral_HistorialBitacora(CvePersonal,CveConceptoHistorialBitacora,Descripcion,Motivo,CveUsuario,CveEmpresa,Fecha,Actual)SELECT {0}, 384,'SE INGRESO ASISTENCIA MANUAL','SE INGRESO ASISTENCIA MANUAL',{3},{2},'{1:yyyy/MM/dd}','Asistió'",
DdlmcPersonal.SelectedValue.ToEntero(), fechaing, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario));
} }
Alert(string.Format("La asistencia se a agregado ({0:dd-MM-yyyy HH:mm:ss}).", fechaing), ModExtensiones.TipoMensaje.ToastInformacion); Alert(string.Format("La asistencia se a agregado ({0:dd-MM-yyyy HH:mm:ss}).", fechaing), ModExtensiones.TipoMensaje.ToastInformacion);
@@ -496,9 +490,9 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
int CvePersonal = TxtCvePersonal.Text.ToEntero(); int CvePersonal = TxtCvePersonal.Text.ToEntero();
List<RequestUpAsistenciaDetalle> registros = new List<RequestUpAsistenciaDetalle>(); List<RequestUpAsistenciaDetalle> registros = new List<RequestUpAsistenciaDetalle>();
int CveTurnoNEW = DdlTurno.SelectedValue.ToEntero(); int CveTurnoNEW = DdlTurno.SelectedValue.ToEntero();
using (ClsClaseBase objbase = new ClsClaseBase()) using (ClsRH objbase = new ClsRH())
{ {
objbase.runQuerystr(string.Format("UPDATE RH_Personal SET CveTurno={1} WHERE CvePersonal ={0}", CvePersonal, CveTurnoNEW)); objbase.PersonalTurnoUp(CveTurnoNEW,UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa, CvePersonal);
} }
foreach (GridViewRow row in GvAsistenciaUp.Rows) foreach (GridViewRow row in GvAsistenciaUp.Rows)
@@ -522,11 +516,10 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
obj.Motivo = TxtMotivo.Text.Trim(); obj.Motivo = TxtMotivo.Text.Trim();
if (CveTurno != CveTurnoNEW) if (CveTurno != CveTurnoNEW)
{ {
using (ClsClaseBase objbase = new ClsClaseBase()) using (ClsRH objbase = new ClsRH())
{ {
objbase.runQuerystr(string.Format("UPDATE RH_PersonalAsistenciasDetalle SET CveTurno={1} WHERE CveAsistenciaDetalle ={0}", CveAsistenciaDetalle, CveTurnoNEW)); objbase.AsistenciaDetTurnoUp(CveAsistenciaDetalle, Fecha, CveTurnoNEW, CveTurno, CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
objbase.runQuerystr(string.Format("UPDATE D SET CveTurno={1} FROM RH_PersonalAsistencias A INNER JOIN RH_PersonalAsistenciasDetalle D ON D.CveAsistencia =A.CveAsistencia AND D.CveTurno = {2} WHERE A.Fecha > '{0}' AND A.CvePersonal ={3}", Fecha, CveTurnoNEW, CveTurno, CvePersonal));
} }
} }
if (obj.Motivo.Length == 0 && CveAsistenciasInasistencias != obj.CveAsistenciasInasistencias) if (obj.Motivo.Length == 0 && CveAsistenciasInasistencias != obj.CveAsistenciasInasistencias)

View File

@@ -941,7 +941,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
} }
if (dtempleados != null) if (dtempleados != null)
{ {
LnkAutorizar.Visible = (dtempleados.COUNT("CvePersonal", "CvePersonal > 0 AND NomAutorizado =0") > 0) || (Estatus < 2); LnkAutorizar.Visible = (dtempleados.COUNT("CvePersonal", "CvePersonal > 0 AND NomAutorizado =0 AND SumaPercepciones > 0 ") > 0) || (Estatus < 2);
LnkCancelarNomina.Visible = (dtempleados.COUNT("CvePersonal", "CvePersonal > 0 AND NomAutorizado =1 AND SeTimbro=0") > 0); LnkCancelarNomina.Visible = (dtempleados.COUNT("CvePersonal", "CvePersonal > 0 AND NomAutorizado =1 AND SeTimbro=0") > 0);
} }
UpDatos.Update(); UpDatos.Update();
@@ -1507,7 +1507,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
byte[] pdf = GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta); byte[] pdf = GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta);
if (pdf != null) if (pdf != null)
{ {
List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>(); List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>();
using (ClsNominas ObjNomina = new ClsNominas()) using (ClsNominas ObjNomina = new ClsNominas())
{ {
@@ -1614,7 +1614,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
byte[] pdf = GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta); byte[] pdf = GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta);
if (pdf != null) if (pdf != null)
{ {
List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>(); List<ClsSisMail.ArchivoMail> objarch = new List<ClsSisMail.ArchivoMail>();
using (ClsNominas ObjNomina = new ClsNominas()) using (ClsNominas ObjNomina = new ClsNominas())
{ {
@@ -2335,12 +2335,11 @@ public partial class Nomina_Nomina2 : ClsPaginas
{ {
Filesgral = TxtCargarNetos.getfiles().Archivos; Filesgral = TxtCargarNetos.getfiles().Archivos;
using (ClsClaseBase objbase = new ClsClaseBase()) using (ClsNominas objbase = new ClsNominas())
{ {
if (objbase.runQuerystr(string.Format("UPDATE C SET C.CveSistema = C.CveSistemaOLD FROM Nom_Conceptos C WHERE CveEmpresa ={0} AND CveSistema =-2; UPDATE C SET C.CveSistemaOLD = C.CveSistema FROM Nom_Conceptos C WHERE CveConcepto ={1};UPDATE C SET C.CveSistema =-2 FROM Nom_Conceptos C WHERE CveConcepto ={1};", UsuarioActual.CveEmpresa, ddlConceptocomisionNeto.SelectedValue.ToEntero()))) objbase.ConceptosCveSistemaUp(ddlConceptocomisionNeto.SelectedValue.ToEntero(), -2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
{
}
} }
} }
@@ -2984,15 +2983,11 @@ public partial class Nomina_Nomina2 : ClsPaginas
if (drow != null) if (drow != null)
{ {
decimal UMA = 96.22M; decimal UMA = 96.22M;
using (ClsNominas onom = new ClsNominas())
using (ClsClaseBase objbase = new ClsClaseBase())
{ {
if (objbase.runQuerystr($"SELECT Valor UMA FROM [dbo].[RH_TablasValores] WHERE Tipo =1 AND CveEmpresa ={UsuarioActual.CveEmpresa} AND Fecha<'{DateTime.Now:yyyy/MM/dd}' ORDER BY Fecha DESC")) if (onom.UMAFechaGet(UsuarioActual.CveEmpresa, $"{DateTime.Now:yyyy/MM/dd}") && onom.DtResultados.Rows.Count > 0)
{ {
if (objbase.DtResultados.Rows.Count > 0) UMA = onom.DtResultados.Rows[0]["UMA"].ToString().ToDecimal();
{
UMA = objbase.DtResultados.Rows[0]["UMA"].ToString().ToDecimal();
}
} }
} }
TxtCCSysUMA.Text = $"{UMA:N2}"; TxtCCSysUMA.Text = $"{UMA:N2}";

View File

@@ -103,11 +103,9 @@ Partial Class RH_ActualizacionMasiva
End Sub End Sub
Private Sub CargaSuperioresOrganigrama() Private Sub CargaSuperioresOrganigrama()
Using objbase As New ClsClaseBase Using objbase As New ClsRH()
Dim strquery As String = String.Format("SELECT CvePersonal,NombreCompleto FROM RH_Personal WHERE CveEmpresa = {0} AND CvePersonal IN (SELECT CvePersonalPadre FROM RH_Organigrama )", UsuarioActual.CveEmpresa) If (objbase.SupervisorOrganigramaGet(UsuarioActual.CveEmpresa)) Then
If (objbase.runQuerystr(strquery)) Then
DdlSupervisor.DataSource = objbase.DtResultados DdlSupervisor.DataSource = objbase.DtResultados
End If End If
End Using End Using
Dim ObjRH As New ClsRH Dim ObjRH As New ClsRH

View File

@@ -34,18 +34,14 @@ Partial Class RH_Asistencias
' Alert("Ocurrió un error al cargar el catálogo de Jefes Inmediatos") ' Alert("Ocurrió un error al cargar el catálogo de Jefes Inmediatos")
'End If 'End If
'ObjRH.Dispose() 'ObjRH.Dispose()
Using objbase As New ClsRH()
Using objbase As New ClsClaseBase If (objbase.SupervisorOrganigramaGet(UsuarioActual.CveEmpresa)) Then
Dim strquery As String = String.Format("SELECT CvePersonal,NombreCompleto FROM RH_Personal WHERE CveEmpresa = {0} AND CvePersonal IN (SELECT CvePersonalPadre FROM RH_Organigrama )", UsuarioActual.CveEmpresa)
If (objbase.runQuerystr(strquery)) Then
DdlSupervisorOrganigrama.DataSource = objbase.DtResultados DdlSupervisorOrganigrama.DataSource = objbase.DtResultados
DdlSupervisorOrganigrama.DataBind()
End If End If
End Using End Using
If DdlSupervisorOrganigrama.DataSource IsNot Nothing Then
DdlSupervisorOrganigrama.DataBind()
End If
End Sub End Sub
#End Region #End Region
Private Sub CargaClientes() Private Sub CargaClientes()

View File

@@ -543,8 +543,7 @@ public partial class RH_CalculoSBC : ClsPaginas
DataTable DTEXcel = Extensiones.ModExtensiones.ReadExcelFile(fileItem.FileUrl, true); DataTable DTEXcel = Extensiones.ModExtensiones.ReadExcelFile(fileItem.FileUrl, true);
StringBuilder str = new StringBuilder(); StringBuilder str = new StringBuilder();
//bool rollback = false; //bool rollback = false;
using (ClsClaseBase objNomina = new ClsClaseBase())
using (ClsRH objpersonal = new ClsRH()) using (ClsRH objpersonal = new ClsRH())
{ {
@@ -567,7 +566,7 @@ public partial class RH_CalculoSBC : ClsPaginas
} }
if (CvePersonal > 0) if (CvePersonal > 0)
{ {
objNomina.runQuerystr(string.Format("EXEC PA_RH_PersonalRPUpdate {0},'{1}'", CvePersonal, RegistroPatronal)); objpersonal.PersonalRPUpdate( CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa , RegistroPatronal);
} }
} }
@@ -584,7 +583,6 @@ public partial class RH_CalculoSBC : ClsPaginas
StringBuilder str = new StringBuilder(); StringBuilder str = new StringBuilder();
//bool rollback = false; //bool rollback = false;
using (ClsClaseBase objNomina = new ClsClaseBase())
using (ClsRH objpersonal = new ClsRH()) using (ClsRH objpersonal = new ClsRH())
{ {
@@ -607,7 +605,7 @@ public partial class RH_CalculoSBC : ClsPaginas
} }
if (CvePersonal > 0) if (CvePersonal > 0)
{ {
objNomina.runQuerystr(string.Format("EXEC PA_RH_PersonalTSUpdate {0},'{1}'", CvePersonal, TipodeSalario)); objpersonal.PersonalTSUpdate(CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TipodeSalario);
} }
} }

View File

@@ -42,12 +42,12 @@
<th colspan="6"></th> <th colspan="6"></th>
<th class="bright bleft" colspan="2">Entrada</th> <th class="bright bleft" colspan="2">Entrada</th>
<th class="bright bleft">Salida</th> <th class="bright bleft">Salida</th>
<th colspan="4"></th> <th colspan="5"></th>
</tr> </tr>
</table> </table>
<asp:GridView ID="GvTurno" runat="server" GridLines="None" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" CellSpacing="0" Width="100%" AutoGenerateColumns="False" <asp:GridView ID="GvTurno" runat="server" GridLines="None" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" CellSpacing="0" Width="100%" AutoGenerateColumns="False"
EmptyDataText="No se encontraron registros" ToolTip="Listado de Turnos" data-tableheader="#thheader" EmptyDataText="No se encontraron registros" ToolTip="Listado de Turnos" data-tableheader="#thheader"
DataKeyNames="CveTurno,Turno,CveChecadorHorario,HorarioDe,HorarioA,Comida,ComidaDe,ComidaA,Estatus,FechaIng,CveUsuario,CveEmpresa,Usuario,ChecadorHorario,ToleranciaERetardo,ToleranciaEFalta,ToleranciaEFalta2,ToleranciaSRetardo,ToleranciaSFalta"> DataKeyNames="CveTurno,Turno,CveChecadorHorario,HorarioDe,DiaDescanso,HorarioA,Comida,ComidaDe,ComidaA,Estatus,FechaIng,CveUsuario,CveEmpresa,Usuario,ChecadorHorario,ToleranciaERetardo,ToleranciaEFalta,ToleranciaEFalta2,ToleranciaSRetardo,ToleranciaSFalta">
<Columns> <Columns>
<asp:BoundField DataField="Turno" HeaderText="Turno" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Turno" HeaderText="Turno" ItemStyle-HorizontalAlign="Left" />
<%--<asp:BoundField DataField="ChecadorHorario" HeaderText="Checador Horario" ItemStyle-HorizontalAlign="Left" />--%> <%--<asp:BoundField DataField="ChecadorHorario" HeaderText="Checador Horario" ItemStyle-HorizontalAlign="Left" />--%>
@@ -63,6 +63,11 @@
<asp:BoundField DataField="ToleranciaERetardo" HeaderStyle-CssClass=" bleft" HeaderText="Tolerancia" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="ToleranciaERetardo" HeaderStyle-CssClass=" bleft" HeaderText="Tolerancia" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="ToleranciaEFalta2" HeaderStyle-CssClass="bright " HeaderText="Retardo" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="ToleranciaEFalta2" HeaderStyle-CssClass="bright " HeaderText="Retardo" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="ToleranciaSFalta" HeaderStyle-CssClass="bright bleft" HeaderText="Tolerancia" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="ToleranciaSFalta" HeaderStyle-CssClass="bright bleft" HeaderText="Tolerancia" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Día descanso">
<ItemTemplate>
<asp:Label ID="lblDiaDescansoTexto" runat="server" Text='<%# Eval("DiaDescansoTexto") %>'>></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Estatus"> <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Estatus">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label> <asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label>
@@ -162,6 +167,19 @@
<asp:TextBox ID="TxtFsalida" runat="server" CausesValidation="true" CssClass="form-control" ValidationGroup="GrpObligatorio"></asp:TextBox> <asp:TextBox ID="TxtFsalida" runat="server" CausesValidation="true" CssClass="form-control" ValidationGroup="GrpObligatorio"></asp:TextBox>
<asp:Label AssociatedControlID="TxtFretardo" runat="server" Text="Tolerancia salida"></asp:Label> <asp:Label AssociatedControlID="TxtFretardo" runat="server" Text="Tolerancia salida"></asp:Label>
</div> </div>
<div class="form-group form-md-line-input input-iconright ocultar">
<asp:DropDownList ID="ddlDiaDescanso" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" Style="width: 100%">
<asp:ListItem Value="-1" Text="Sin Asignar" Selected="True"></asp:ListItem>
<asp:ListItem Value="1" Text="domingo"></asp:ListItem>
<asp:ListItem Value="2" Text="lunes"></asp:ListItem>
<asp:ListItem Value="3" Text="martes"></asp:ListItem>
<asp:ListItem Value="4" Text="miércoles"></asp:ListItem>
<asp:ListItem Value="5" Text="jueves"></asp:ListItem>
<asp:ListItem Value="6" Text="viernes"></asp:ListItem>
<asp:ListItem Value="7" Text="sábado"></asp:ListItem>
</asp:DropDownList>
<label for="<%= ddlDiaDescanso.ClientID.ToString()%>">Día de descanso:</label>
</div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" /> <asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label> <label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>

View File

@@ -42,14 +42,14 @@ Partial Class RH_CatTurno
If ChkEstatus.Checked Then Estatus = True If ChkEstatus.Checked Then Estatus = True
If HdnModalidad.Value = "A" Then If HdnModalidad.Value = "A" Then
If ObjRH.AddTurno(TxtTurno.Text, TxtHorarioDe.Text, TxtHorarioA.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlChecadorHorario.SelectedValue.ToEntero(), If ObjRH.AddTurno(TxtTurno.Text, TxtHorarioDe.Text, TxtHorarioA.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlChecadorHorario.SelectedValue.ToEntero(),
TxtRetardo.Text.ToEntero(), TxtFretardo.Text.ToEntero() - TxtRetardo.Text.ToEntero(), 0, TxtFsalida.Text.ToEntero(), comida, TxtComidade.Text, TxtComidaA.Text) Then TxtRetardo.Text.ToEntero(), TxtFretardo.Text.ToEntero() - TxtRetardo.Text.ToEntero(), 0, TxtFsalida.Text.ToEntero(), comida, TxtComidade.Text, TxtComidaA.Text, ddlDiaDescanso.SelectedValue.ToEntero()) Then
CargaDatos() CargaDatos()
CargaGlobalDTTurno() CargaGlobalDTTurno()
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion) Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
End If End If
ElseIf HdnModalidad.Value = "U" Then ElseIf HdnModalidad.Value = "U" Then
If ObjRH.UpdateTurno(TxtTurno.Text, TxtHorarioDe.Text, TxtHorarioA.Text, Estatus, HdnID.Value.ToEntero(), UsuarioActual.CveUsuario, DdlChecadorHorario.SelectedValue.ToEntero(), If ObjRH.UpdateTurno(TxtTurno.Text, TxtHorarioDe.Text, TxtHorarioA.Text, Estatus, HdnID.Value.ToEntero(), UsuarioActual.CveUsuario, DdlChecadorHorario.SelectedValue.ToEntero(),
TxtRetardo.Text.ToEntero(), TxtFretardo.Text.ToEntero() - TxtRetardo.Text.ToEntero(), 0, TxtFsalida.Text.ToEntero(), comida, TxtComidade.Text, TxtComidaA.Text) Then TxtRetardo.Text.ToEntero(), TxtFretardo.Text.ToEntero() - TxtRetardo.Text.ToEntero(), 0, TxtFsalida.Text.ToEntero(), comida, TxtComidade.Text, TxtComidaA.Text, ddlDiaDescanso.SelectedValue.ToEntero()) Then
CargaDatos() CargaDatos()
CargaGlobalDTTurno() CargaGlobalDTTurno()
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion) Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
@@ -80,7 +80,7 @@ Partial Class RH_CatTurno
chkComida.Checked = (GvRow.DataKey("Comida") = "1") chkComida.Checked = (GvRow.DataKey("Comida") = "1")
TxtComidade.Text = GvRow.DataKey("ComidaDe") TxtComidade.Text = GvRow.DataKey("ComidaDe")
TxtComidaA.Text = GvRow.DataKey("ComidaA") TxtComidaA.Text = GvRow.DataKey("ComidaA")
ddlDiaDescanso.SelectedValueExist(GvRow.DataKey("DiaDescanso"))
UpAddTurno.Update() UpAddTurno.Update()
@@ -100,6 +100,7 @@ Partial Class RH_CatTurno
TxtRetardo.Text = "15" TxtRetardo.Text = "15"
TxtFretardo.Text = "30" TxtFretardo.Text = "30"
TxtFsalida.Text = "15" TxtFsalida.Text = "15"
ddlDiaDescanso.SelectedValueExist("-1")
CargaDdlChecadorHorario() CargaDdlChecadorHorario()
ChkEstatus.Checked = True ChkEstatus.Checked = True
UpAddTurno.Update() UpAddTurno.Update()

View File

@@ -11,12 +11,12 @@ public partial class RH_ChecadorAsistencia : System.Web.UI.Page
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
using(ClsClaseBase objbase = new ClsClaseBase()) using(ClsRH objbase = new ClsRH())
{ {
try try
{ {
Usuario user = (Usuario)Context.Session["UsuarioSIG"]; Usuario user = (Usuario)Context.Session["UsuarioSIG"];
if(objbase.runQuerystr(string.Format("EXEC PA_RH_GetAsistenciaChecador {0}", user.CveEmpresa))){ if(objbase.GetAsistenciaChecador( user.CveEmpresa)){
GVGetAsistenciaChecador.DataSource = objbase.DtResultados; GVGetAsistenciaChecador.DataSource = objbase.DtResultados;
GVGetAsistenciaChecador.DataBind(); GVGetAsistenciaChecador.DataBind();

View File

@@ -769,7 +769,7 @@
<div> <div>
<asp:GridView ID="GvPersonalAltas" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvPersonalAltas_RowDataBound" <asp:GridView ID="GvPersonalAltas" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvPersonalAltas_RowDataBound"
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None"
DataKeyNames="CvePersonalAltas,FechaInicio,FechaFin"> DataKeyNames="CvePersonalAltas,FechaInicio,FechaFin">
<Columns> <Columns>
<asp:BoundField HeaderText="Fecha Inicio" DataField="FechaInicio" DataFormatString="{0:d}"> <asp:BoundField HeaderText="Fecha Inicio" DataField="FechaInicio" DataFormatString="{0:d}">
@@ -778,12 +778,12 @@
<asp:BoundField HeaderText="Fecha Fin" DataField="FechaFin" DataFormatString="{0:d}"> <asp:BoundField HeaderText="Fecha Fin" DataField="FechaFin" DataFormatString="{0:d}">
<ItemStyle Width="150px" /> <ItemStyle Width="150px" />
</asp:BoundField> </asp:BoundField>
<asp:TemplateField HeaderText="Editar"> <asp:TemplateField HeaderText="">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkUpAltass" OnClick="LnkUpAltass_Click" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" /> <asp:LinkButton ID="LnkUpAltass" OnClick="LnkUpAltass_Click" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar"> <asp:TemplateField HeaderText="">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkDAltas" OnClick="LnkDAltas_Click" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" /> <asp:LinkButton ID="LnkDAltas" OnClick="LnkDAltas_Click" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate> </ItemTemplate>

View File

@@ -1968,8 +1968,8 @@ Partial Class RH_Personal
-1, "-1", -1, "-1",
DdlEstatusPersonal.SelectedValue.ToEntero(), TxtFechaNacimiento.Text.ToDate, DdlEstatusPersonal.SelectedValue.ToEntero(), TxtFechaNacimiento.Text.ToDate,
TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim, TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim,
DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtTelefonoEmergencia.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, TxtCredencialElector.Text.Trim, DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtTelefonoEmergencia.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, TxtCURP.Text.Trim, TxtCredencialElector.Text.Trim,
TxtCURP.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(), TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(),
DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), URL, DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), URL,
DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text, DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text,
DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(), DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(),
@@ -2116,10 +2116,8 @@ Partial Class RH_Personal
GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa) = Nothing GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa) = Nothing
If CvePersonal > 0 Then If CvePersonal > 0 Then
Dim strquery As String = String.Format("UPDATE RH_Personal SET CveEstadoDomicilio = {2},CiudadOrigen ='{3}' WHERE CvePersonal ={1} AND CveEmpresa = {0} ", Using objbase As New ClsRH
UsuarioActual.CveEmpresa, CvePersonal, DdlEstadosDomicilio.SelectedValue.ToEntero(), TxtCiudadOrigen.Text) If (objbase.PersonalDomUp(DdlEstadosDomicilio.SelectedValue.ToEntero(), TxtCiudadOrigen.Text, CvePersonal, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
Using objbase As New ClsClaseBase
If (objbase.runQuerystr(strquery)) Then
End If End If
End Using End Using
CargaDatos() CargaDatos()
@@ -7041,16 +7039,13 @@ Partial Class RH_Personal
Protected Sub LnkDAltas_Click(sender As Object, e As EventArgs) Protected Sub LnkDAltas_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CvePersonalAltas = GvRow.DataKey("CvePersonalAltas").ToEntero() CvePersonalAltas = GvRow.DataKey("CvePersonalAltas").ToEntero()
Dim strquery As String = String.Format("DELETE [RH_PersonalAltas] WHERE CvePersonalAltas ={0} AND [CvePersonal] ={1}", CvePersonalAltas, CvePersonal) Using objrh As New ClsRH()
Using objbase As New ClsClaseBase If (objrh.PersonalAltasRemove(CvePersonalAltas, CvePersonal, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
If (objbase.runQuerystr(strquery)) Then If objrh.GetPersonalAltas(CvePersonal) Then
Using objrh As New ClsRH() GvPersonalAltas.DataSource = objrh.DtResultados
If objrh.GetPersonalAltas(CvePersonal) Then GvPersonalAltas.DataBind()
GvPersonalAltas.DataSource = objrh.DtResultados UpDatos.Update()
GvPersonalAltas.DataBind() End If
UpDatos.Update()
End If
End Using
Alert("Alta eliminada") Alert("Alta eliminada")
End If End If
End Using End Using
@@ -7066,16 +7061,13 @@ Partial Class RH_Personal
strfin = String.Format(",[FechaFin]='{0:yyyy-MM-dd}'", fechafin) strfin = String.Format(",[FechaFin]='{0:yyyy-MM-dd}'", fechafin)
End If End If
Dim strquery As String = String.Format("UPDATE [RH_PersonalAltas] SET [FechaInicio]='{2:yyyy-MM-dd}' {3} WHERE CvePersonalAltas ={0} AND [CvePersonal] ={1}", CvePersonalAltas, CvePersonal, TxtFechaInicioUA.Text.ToDateTime(), strfin) Using objrh As New ClsRH()
Using objbase As New ClsClaseBase If (objrh.PersonalAltasUpFechas(CvePersonalAltas, TxtFechaInicioUA.Text.ToDateTime().ToString("yyyy-MM-dd"), strfin, CvePersonal, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
If (objbase.runQuerystr(strquery)) Then If objrh.GetPersonalAltas(CvePersonal) Then
Using objrh As New ClsRH() GvPersonalAltas.DataSource = objrh.DtResultados
If objrh.GetPersonalAltas(CvePersonal) Then GvPersonalAltas.DataBind()
GvPersonalAltas.DataSource = objrh.DtResultados UpDatos.Update()
GvPersonalAltas.DataBind() End If
UpDatos.Update()
End If
End Using
Alert("Alta actualizada") Alert("Alta actualizada")
End If End If
End Using End Using
@@ -7535,8 +7527,8 @@ Partial Class RH_Personal
Dim vacacionesyprima As String = "" Dim vacacionesyprima As String = ""
Dim Utilidades As String = "" Dim Utilidades As String = ""
Dim strquery As String = String.Format("EXEC PA_Agro_ValidacionNomGet @CveValidacionNomina=-1,@CveEmpresa ={0} ", UsuarioActual.CveEmpresa) Dim strquery As String = String.Format("EXEC PA_Agro_ValidacionNomGet @CveValidacionNomina=-1,@CveEmpresa ={0} ", UsuarioActual.CveEmpresa)
Using objbase As New ClsClaseBase Using objbase As New ClsNominas()
If (objbase.runQuerystr(strquery)) Then If (objbase.AgroValidacionNomGet(-1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
Dim dbrow As DataRow Dim dbrow As DataRow
dbrow = objbase.DtResultados.FiltroPrimero("CveValidacionNomina =4") dbrow = objbase.DtResultados.FiltroPrimero("CveValidacionNomina =4")
If Not IsNothing(dbrow) Then If Not IsNothing(dbrow) Then

View File

@@ -148,6 +148,8 @@ Partial Class CatRoles
Next Next
Roles.Dispose() Roles.Dispose()
RegistraScript("$('#DivPermisos').modal('hide');") RegistraScript("$('#DivPermisos').modal('hide');")
RecargaGlobal()
End Sub End Sub
Protected Sub BtnGuardaProcesos_Click(sender As Object, e As EventArgs) Handles BtnGuardaProcesos.Click Protected Sub BtnGuardaProcesos_Click(sender As Object, e As EventArgs) Handles BtnGuardaProcesos.Click
@@ -157,6 +159,8 @@ Partial Class CatRoles
Next Next
Roles.Dispose() Roles.Dispose()
RegistraScript("$('#DivProcesos').modal('hide');") RegistraScript("$('#DivProcesos').modal('hide');")
RecargaGlobal()
End Sub End Sub
#Region "G V D A T O S" #Region "G V D A T O S"
@@ -176,6 +180,12 @@ Partial Class CatRoles
End If End If
Rol.Dispose() Rol.Dispose()
CargaDatos() CargaDatos()
RecargaGlobal()
End Sub
Private Sub RecargaGlobal()
GlobalDTRoles(UsuarioActual.CveEmpresa) = Nothing
End Sub End Sub

View File

@@ -229,10 +229,14 @@ Partial Class Sistemas_RolesDetalle
End If End If
ObjEmpresa.Dispose() ObjEmpresa.Dispose()
RecargaGlobal()
End Sub End Sub
Private Sub RecargaGlobal()
GlobalDTRoles(UsuarioActual.CveEmpresa) = Nothing
End Sub
End Class End Class

View File

@@ -3141,9 +3141,9 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright"> <div runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ValidateEmptyText="true" Display="None" ClientValidationFunction="ValidarCodigoEnsamble" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" /> <asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ClientValidationFunction="ValidarCodigoEnsamble" ValidateEmptyText="true" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label> <label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
</div> </div>
</div> </div>
@@ -3162,7 +3162,7 @@
<div class="col-md-8"> <div class="col-md-8">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodLinea" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtCodLinea" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator ID="CVCodLinea" runat="server" ControlToValidate="TxtCodLinea" ClientValidationFunction="ValidarCodigoLinea" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Linea''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" /> <asp:CustomValidator ID="CVCodLinea" runat="server" ControlToValidate="TxtCodLinea" ClientValidationFunction="ValidarCodigoLinea" ValidateEmptyText="true" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Linea''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodLinea.ClientID.ToString()%>">Cod.Linea:</label> <label for="<%= TxtCodLinea.ClientID.ToString()%>">Cod.Linea:</label>
</div> </div>
</div> </div>
@@ -3185,7 +3185,7 @@
<div class="col-md-8"> <div class="col-md-8">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodInspeccion" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtCodInspeccion" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator ID="CVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" ClientValidationFunction="ValidarCodigoInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" /> <asp:CustomValidator ID="CVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" ClientValidationFunction="ValidarCodigoInspeccion" ValidateEmptyText="true" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<%-- <asp:RegularExpressionValidator ID="REVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[A-L][0-9][1-9A-Z][A-HJ-M]$"></asp:RegularExpressionValidator>--%> <%-- <asp:RegularExpressionValidator ID="REVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[A-L][0-9][1-9A-Z][A-HJ-M]$"></asp:RegularExpressionValidator>--%>
<%--<asp:RequiredFieldValidator ID="RFVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspeccion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%> <%--<asp:RequiredFieldValidator ID="RFVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspeccion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
<%--<ajax:ValidatorCalloutExtender ID="VCECodInspeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodInspeccion"></ajax:ValidatorCalloutExtender>--%> <%--<ajax:ValidatorCalloutExtender ID="VCECodInspeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodInspeccion"></ajax:ValidatorCalloutExtender>--%>

View File

@@ -287,17 +287,17 @@ Partial Class RepVentaDetalle
DdlGrupo.DataBind() DdlGrupo.DataBind()
End Sub End Sub
Private Sub CargaCombos() Private Sub CargaCombos()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto) CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
CargaClientes() CargaClientes()
'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) 'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
'Vendedor 'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
DdlVendedor.DataBind() DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Sin Vendedor", "-2")) DdlVendedor.Items.Insert(0, New ListItem("Sin Vendedor", "-2"))
@@ -312,7 +312,7 @@ Partial Class RepVentaDetalle
'Carga Clasificacion Cliente 'Carga Clasificacion Cliente
DdlClienteClasificacion.DataSource = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa) DdlClienteClasificacion.DataSource = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa)
DdlClienteClasificacion.DataBind() DdlClienteClasificacion.DataBind()
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClienteClasificacion.Items.Insert(0, New ListItem("Sin Giro", "-2")) DdlClienteClasificacion.Items.Insert(0, New ListItem("Sin Giro", "-2"))
@@ -342,7 +342,7 @@ Partial Class RepVentaDetalle
End Sub End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue) CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
End Sub End Sub
Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)

View File

@@ -592,6 +592,7 @@
<asp:UpdatePanel ID="UpParametros" runat="server" UpdateMode="Conditional" class="portlet light xspadding .nolineheight bordered whitoutcol" style="width: 310px;"> <asp:UpdatePanel ID="UpParametros" runat="server" UpdateMode="Conditional" class="portlet light xspadding .nolineheight bordered whitoutcol" style="width: 310px;">
<ContentTemplate> <ContentTemplate>
<asp:HiddenField ID="HdnCargarInventario" runat="server" ClientIDMode="Static" Value="True" />
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
@@ -698,7 +699,7 @@
<td> <td>
<asp:UpdatePanel ID="UPPVentas" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPPVentas" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="200px"> <asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="100%">
<asp:ListItem Selected="true" Text="Sin asignar" Value="0"></asp:ListItem> <asp:ListItem Selected="true" Text="Sin asignar" Value="0"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</ContentTemplate> </ContentTemplate>
@@ -728,7 +729,7 @@
<tr id="TrLineaAdicional" runat="server" visible="false"> <tr id="TrLineaAdicional" runat="server" visible="false">
<td align="left"><b>Linea Adicional:</b></td> <td align="left"><b>Linea Adicional:</b></td>
<td align="left"> <td align="left">
<asp:DropDownList ID="DdlLineaAdicional" DataTextField="InfoGeneral" DataValueField="CveLineaAdicional" AutoPostBack="true" CssClass=" form-control input-sm select2me" runat="server" Width="80%" OnSelectedIndexChanged="DdlLineaAdicional_SelectedIndexChanged"> <asp:DropDownList ID="DdlLineaAdicional" DataTextField="InfoGeneral" DataValueField="CveLineaAdicional" AutoPostBack="true" CssClass=" form-control input-sm select2me" runat="server" Width="100%" OnSelectedIndexChanged="DdlLineaAdicional_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:LinkButton runat="server" Visible="false" ID="LnkUpdateLineaAdicional" OnClick="LnkUpdateLineaAdicional_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea actualizar la linea adicional de crédito de la factura?" data-btn-ok-label="si" Text="<i class='fa fa-check' style='color:green'></i>" CssClass="btn btn-default btn-circle btn-xs" ToolTip="Actualizar Linea adicional" /> <asp:LinkButton runat="server" Visible="false" ID="LnkUpdateLineaAdicional" OnClick="LnkUpdateLineaAdicional_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea actualizar la linea adicional de crédito de la factura?" data-btn-ok-label="si" Text="<i class='fa fa-check' style='color:green'></i>" CssClass="btn btn-default btn-circle btn-xs" ToolTip="Actualizar Linea adicional" />
@@ -1719,7 +1720,6 @@
<asp:UpdatePanel ID="UpINV" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpINV" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:HiddenField ID="HdnCargarInventario" runat="server" ClientIDMode="Static" Value="True"/>
<asp:Button ID="BtnCargarInventario" runat="server" ClientIDMode="Static" Text="" Style="display: none;" OnClick="BtnCargarInventario_Click" /> <asp:Button ID="BtnCargarInventario" runat="server" ClientIDMode="Static" Text="" Style="display: none;" OnClick="BtnCargarInventario_Click" />
<div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server"> <div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server">
<div class="portlet-title"> <div class="portlet-title">
@@ -9497,10 +9497,12 @@
step: 30 step: 30
}); });
if(HdnCargarInventario.value == 'True'){ if(HdnCargarInventario.value == 'True'){
$("#TabAlmacen_tab .ajax__tab_inner").click(function () { $("#TabAlmacen_tab .ajax__tab_inner").click(function () {
CargaMovimientosInventario(); CargaMovimientosInventario();
}); });
}else {
$("#TabAlmacen_tab .ajax__tab_inner").unbind();
} }
} }

View File

@@ -2401,6 +2401,7 @@ Partial Class Ventas
ViewState("ClienteRetISR") = 0 ViewState("ClienteRetISR") = 0
ViewState("CvePrecioLista") = 0 ViewState("CvePrecioLista") = 0
ViewState("CvePrecioListaCliente") = 0 ViewState("CvePrecioListaCliente") = 0
HdnCargarInventario.Value = "True"
Me.CveVendedorVenta = -1 Me.CveVendedorVenta = -1
Me.CveVendedorCliente = -1 Me.CveVendedorCliente = -1
Me.CveVendedorClienteSucursal = -1 Me.CveVendedorClienteSucursal = -1
@@ -2851,8 +2852,7 @@ Partial Class Ventas
'REMOVER EVENTO PARA RECARGAR ALMACEN 'REMOVER EVENTO PARA RECARGAR ALMACEN
HdnCargarInventario.Value = "False" HdnCargarInventario.Value = "False"
'spanAlmacen.Attributes.Remove("onclick") 'spanAlmacen.Attributes.Remove("onclick")
Tab.ActiveTabIndex = 1 UpParametros.Update()
Updatetabs.Update()
End If End If
'Modalidad Devoluciones y Refacturacion 'Modalidad Devoluciones y Refacturacion
@@ -9461,22 +9461,106 @@ Partial Class Ventas
End If End If
If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE 'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
If ObjFactura.TipoDocto = "Rem" AndAlso Me.SaldoLineaAdicional < ObjFactura.Total Then If ObjFactura.TipoDocto = "Ing" Then
TmpDT = TmpDTError.Copy() If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia) 'SI LA LINEA ESTA EN PESOS Y LA FACTURA ESTA EN DOLARES
Exit Sub If Me.CveMonedaLineaAdicional = 1 AndAlso ObjFactura.CveMoneda = 2 Then
Dim SaldoUSD As Decimal = SaldoIngresosLineaAdicional / TxtTipoCambio.Text.ToDecimal()
If SaldoUSD < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'SI LA LINEA ESTA EN DOLARES Y LA FACTURA ESTA EN PESOS
If Me.CveMonedaLineaAdicional = 2 AndAlso ObjFactura.CveMoneda = 1 Then
Dim SaldoMXN As Decimal = SaldoIngresosLineaAdicional * TxtTipoCambio.Text.ToDecimal()
If SaldoMXN < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Else
'SI LA LINEA Y LA FACTURA TIENEN LA MISMA MONEDA
If Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If End If
If ObjFactura.TipoDocto = "Rem" Then
If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
'SI LA LINEA ESTA EN PESOS Y LA FACTURA ESTA EN DOLARES
If Me.CveMonedaLineaAdicional = 1 AndAlso ObjFactura.CveMoneda = 2 Then
Dim SaldoUSD As Decimal = SaldoLineaAdicional / TxtTipoCambio.Text.ToDecimal()
If SaldoUSD < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'SI LA LINEA ESTA EN DOLARES Y LA FACTURA ESTA EN PESOS
If Me.CveMonedaLineaAdicional = 2 AndAlso ObjFactura.CveMoneda = 1 Then
Dim SaldoMXN As Decimal = SaldoLineaAdicional * TxtTipoCambio.Text.ToDecimal()
If SaldoMXN < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Else
'SI LA LINEA Y LA FACTURA TIENEN LA MISMA MONEDA
If Me.SaldoLineaAdicional < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
'If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
' TmpDT = TmpDTError.Copy()
' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
' Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'Else
' If ObjFactura.TipoDocto = "Ing" AndAlso Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
' TmpDT = TmpDTError.Copy()
' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
' Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
'End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
'If ObjFactura.TipoDocto = "Rem" AndAlso Me.SaldoLineaAdicional < ObjFactura.Total Then
' TmpDT = TmpDTError.Copy()
' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
' Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
If ObjFactura.TipoDocto = "Ing" AndAlso (DtRemisionesPS Is Nothing OrElse DtRemisionesPS.Rows.Count = 0) Then If ObjFactura.TipoDocto = "Ing" AndAlso (DtRemisionesPS Is Nothing OrElse DtRemisionesPS.Rows.Count = 0) Then
TmpDT = TmpDTError.Copy() TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False) CalculaTotalesVenta(RecalcularTotalOriginal:=False)
@@ -9484,12 +9568,6 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
If ObjFactura.TipoDocto = "Ing" AndAlso Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If End If
'If Not CveEmpresaCRM > 0 Then 'If Not CveEmpresaCRM > 0 Then
@@ -14198,14 +14276,26 @@ Partial Class Ventas
End If End If
ElseIf AplicoNCFacturaActual AndAlso ChkAplicaNCAnticipo.Checked Then ElseIf AplicoNCFacturaActual AndAlso ChkAplicaNCAnticipo.Checked Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
Dim CveConceptoPagoNC As Integer = 251
If ObjFactura.CveMoneda > 1 Then
CveConceptoPagoNC = 301
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
ErrorPrepoliza = True ErrorPrepoliza = True
Exit For Exit For
End If End If
End If End If
Else Else
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
Dim CveConceptoPagoNC As Integer = 251
If ObjFactura.CveMoneda > 1 Then
CveConceptoPagoNC = 301
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
ErrorPrepoliza = True ErrorPrepoliza = True
Exit For Exit For
End If End If
@@ -14317,7 +14407,12 @@ Partial Class Ventas
End If End If
End If End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimientoDev, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVentaDevolucion, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMXDev, ImporteME:=If(tipoCambio = 1, 0, importeMovimientoDev), CveSubProyecto:=CveSubProyectoContabilizar) Then Dim CveConceptoPagoNC As Integer = 251
If ObjFactura.CveMoneda > 1 Then
CveConceptoPagoNC = 301
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimientoDev, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVentaDevolucion, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMXDev, ImporteME:=If(tipoCambio = 1, 0, importeMovimientoDev), CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True ErrorPrepoliza = True
Exit For Exit For
End If End If
@@ -14526,7 +14621,12 @@ Partial Class Ventas
If importeMovimiento <> 0 Then If importeMovimiento <> 0 Then
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVentaNC").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then Dim CveConceptoPagoNC As Integer = 251
If ObjFactura.CveMoneda > 1 Then
CveConceptoPagoNC = 301
End If
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVentaNC").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, importeMovimiento, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=row2.DataKey("CveVentaNC").ToString().ToEntero(), ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, importeMovimiento, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=row2.DataKey("CveVentaNC").ToString().ToEntero(), ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
ErrorPrepoliza = True ErrorPrepoliza = True
Exit For Exit For
@@ -14647,7 +14747,13 @@ Partial Class Ventas
If sumaAmorticaciones <> 0 Then If sumaAmorticaciones <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, sumaAmorticaciones, Referencia, 251, Concepto, FechaMovimiento, IdCtaContClientes, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=sumaAmorticaciones * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
Dim CveConceptoPagoNC As Integer = 251
If ObjFactura.CveMoneda > 1 Then
CveConceptoPagoNC = 301
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, sumaAmorticaciones, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContClientes, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=sumaAmorticaciones * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
ErrorPrepoliza = True ErrorPrepoliza = True
Else Else
ViewState("SeGuardoPrePoliza") = True ViewState("SeGuardoPrePoliza") = True
@@ -18806,10 +18912,12 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "PA") AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" Then If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "PA") AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
DdlLineaAdicional.DataSource = Nothing DdlLineaAdicional.DataSource = Nothing
Dim TCConsulta As Decimal = TxtTipoCambio.Text.ToDecimal()
Using ObjVentas As New ClsVentas Using ObjVentas As New ClsVentas
'SI ES VENTA EXISTENTE , SI SE VA EDITAR SOLO MOSTRAR LAS CON SALDO, FECHA DE VENCIMIENTO VIGENTE O LA LINEA ACTUAL 'SI ES VENTA EXISTENTE , SI SE VA EDITAR SOLO MOSTRAR LAS CON SALDO, FECHA DE VENCIMIENTO VIGENTE O LA LINEA ACTUAL
If CveVenta > 0 Then If CveVenta > 0 Then
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"(Saldo > 0 AND FechaVencimiento <= '{Now.ToString("dd/MM/yyyy")}') OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}") DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"(Saldo > 0 AND FechaVencimiento <= '{Now.ToString("dd/MM/yyyy")}') OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
@@ -18818,14 +18926,14 @@ Partial Class Ventas
Else Else
'SI SE ESTA FACTURANDO UNA REMISION DEBE SELECCIONAR LA LINEA ADICIONAL DE ESTA 'SI SE ESTA FACTURANDO UNA REMISION DEBE SELECCIONAR LA LINEA ADICIONAL DE ESTA
If Me.CveLineaAdicionalVenta > 0 Then If Me.CveLineaAdicionalVenta > 0 Then
If ObjVentas.GetLineasAdicionalesSaldo(Me.CveLineaAdicionalVenta, CveCliente, -1, -1, UsuarioActual.CveEmpresa, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then If ObjVentas.GetLineasAdicionalesSaldo(Me.CveLineaAdicionalVenta, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados DdlLineaAdicional.DataSource = ObjVentas.DtResultados
End If End If
End If End If
Else Else
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, ConSaldo:=1, FechaVencimientoConsulta:=Now) Then If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=1, FechaVencimientoConsulta:=Now) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados DdlLineaAdicional.DataSource = ObjVentas.DtResultados
@@ -24775,15 +24883,30 @@ Partial Class Ventas
If SaldoVenta <> 0 Then If SaldoVenta <> 0 Then
If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then If UsuarioActual.TienePermisoProceso(269) Then
DivDevAlm.Visible = True
TieneAlmacen = True
End If
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
DivDevAlm.Visible = True DivDevAlm.Visible = True
TieneAlmacen = True TieneAlmacen = True
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then ChkDevAlm.Checked = True
ChkDevAlm.Checked = True ChkDevAlm.Enabled = False
ChkDevAlm.Enabled = False
End If
End If End If
If (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not AplicaDevolucion Then
Using ObjInv As New ClsInventarios
If ObjInv.GetInv_Mov(Me.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInv.DtResultados.Rows.Count > 0 Then
Dim RowInv As DataRow = ObjInv.DtResultados.FiltroPrimero("CveConcepto IN (3,40)")
If RowInv IsNot Nothing Then
CveAlmacenDevolucion = RowInv("CveAlmacen").ToString().ToEntero()
End If
End If
End Using
End If
End If End If
End If End If
@@ -32910,9 +33033,9 @@ Partial Class Ventas
'REMOVER EVENTO PARA RECARGAR ALMACEN 'REMOVER EVENTO PARA RECARGAR ALMACEN
'spanAlmacen.Attributes.Remove("onclick") 'spanAlmacen.Attributes.Remove("onclick")
Tab.ActiveTabIndex = 1
HdnCargarInventario.Value = "False" HdnCargarInventario.Value = "False"
Updatetabs.Update() UpParametros.Update()
UpnTools.Update() UpnTools.Update()
@@ -36441,8 +36564,10 @@ Partial Class Ventas
RBLPago.SelectedValue = "1" RBLPago.SelectedValue = "1"
RBLPago.Enabled = False RBLPago.Enabled = False
Dim TCConsulta As Decimal = TxtTipoCambio.Text.ToDecimal()
Using ObjVentas As New ClsVentas Using ObjVentas As New ClsVentas
If ObjVentas.GetLineasAdicionalesSaldo(DdlLineaAdicional.SelectedValue.ToEntero(), CveCliente, -1, -1, UsuarioActual.CveEmpresa, FechaVencimientoConsulta:=MinFecha) Then If ObjVentas.GetLineasAdicionalesSaldo(DdlLineaAdicional.SelectedValue.ToEntero(), CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
Dim RowLinea As DataRow = ObjVentas.DtResultados.Rows(0) Dim RowLinea As DataRow = ObjVentas.DtResultados.Rows(0)
If RowLinea IsNot Nothing Then If RowLinea IsNot Nothing Then
@@ -36552,16 +36677,36 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE Dim TotalDocumento As Decimal = TxtTotal.Text.ToDecimal()
If Me.SaldoLineaAdicional < TxtTotal.Text.ToDecimal() Then
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA 'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
If Me.CveMonedaLineaAdicional <> DdlMoneda.SelectedValue.ToEntero() Then If Me.CveMonedaLineaAdicional <> DdlMoneda.SelectedValue.ToEntero() Then
Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
Exit Sub 'SI LA LINEA ESTA EN PESOS Y LA FACTURA ESTA EN DOLARES
If Me.CveMonedaLineaAdicional = 1 AndAlso DdlMoneda.SelectedValue.ToEntero() = 2 Then
Dim SaldoUSD As Decimal = SaldoLineaAdicional / TxtTipoCambio.Text.ToDecimal()
If SaldoUSD < TotalDocumento Then
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'SI LA LINEA ESTA EN DOLARES Y LA FACTURA ESTA EN PESOS
If Me.CveMonedaLineaAdicional = 2 AndAlso DdlMoneda.SelectedValue.ToEntero() = 1 Then
Dim SaldoMXN As Decimal = SaldoLineaAdicional * TxtTipoCambio.Text.ToDecimal()
If SaldoMXN < TotalDocumento Then
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Else
'SI LA LINEA Y LA FACTURA TIENEN LA MISMA MONEDA
If Me.SaldoLineaAdicional < TotalDocumento Then
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If End If
End If End If
@@ -36601,7 +36746,7 @@ Partial Class Ventas
'Tab.ActiveTabIndex = 1 'Tab.ActiveTabIndex = 1
HdnCargarInventario.Value = "False" HdnCargarInventario.Value = "False"
'Updatetabs.Update() 'Updatetabs.Update()
UpINV.Update() UpParametros.Update()
End Sub End Sub
Protected Sub LBAplicaDevolucion_Click(sender As Object, e As EventArgs) Protected Sub LBAplicaDevolucion_Click(sender As Object, e As EventArgs)

View File

@@ -493,7 +493,7 @@ Public Class WSGPSApp
} }
Dim JsonParams = Decripta(p) Dim JsonParams = Decripta(p)
Dim Ent = JsonConvert.DeserializeAnonymousType(JsonParams, Estructura) Dim Ent = JsonConvert.DeserializeAnonymousType(JsonParams, Estructura)
If ObjGPS.DispositivoAdd(Ent.TipoDispostivo, Ent.NumTelefono, Ent.CveModelo, Ent.CveProveedorComunicacionCuenta, Ent.CveCliente, Ent.IMEI, Ent.Serie, 1, Ent.SerieVehiculo, "", Ent.NombreVehiculo, Ent.NombreVehiculo, Ent.DevID, 0, "", Ent.Anio, "", "", False, 100D, "", 0D, "", "", 100) Then If ObjGPS.DispositivoAdd(Ent.TipoDispostivo, Ent.NumTelefono, Ent.CveModelo, Ent.CveProveedorComunicacionCuenta, Ent.CveCliente, Ent.IMEI, Ent.Serie, 1, Ent.SerieVehiculo, "", Ent.NombreVehiculo, Ent.NombreVehiculo, Ent.DevID, 0, "", Ent.Anio, "", "", False, 100D, "", 0D, "", "", 100, "") Then
Retorno = ObjGPS.CveDispositivo Retorno = ObjGPS.CveDispositivo
End If End If
Catch ex As Exception Catch ex As Exception
@@ -531,11 +531,11 @@ Public Class WSGPSApp
Dim Ent = JsonConvert.DeserializeAnonymousType(JsonParams, Estructura) Dim Ent = JsonConvert.DeserializeAnonymousType(JsonParams, Estructura)
If Ent.CveDispositivo > 0 Then If Ent.CveDispositivo > 0 Then
If ObjGPS.DispositivosUpdate(Ent.TipoDispostivo, Ent.NumTelefono, Ent.CveDispositivo, Ent.CveModelo, Ent.CveProveedorComunicacionCuenta, Ent.CveCliente, Ent.IMEI, Ent.Serie, 1, Ent.SerieVehiculo, "", Ent.NombreVehiculo, Ent.NombreVehiculo, Ent.DevID, 0, "", Ent.Anio, "", "", False, 100D, "", 0D, "", "", 100) Then If ObjGPS.DispositivosUpdate(Ent.TipoDispostivo, Ent.NumTelefono, Ent.CveDispositivo, Ent.CveModelo, Ent.CveProveedorComunicacionCuenta, Ent.CveCliente, Ent.IMEI, Ent.Serie, 1, Ent.SerieVehiculo, "", Ent.NombreVehiculo, Ent.NombreVehiculo, Ent.DevID, 0, "", Ent.Anio, "", "", False, 100D, "", 0D, "", "", 100, "") Then
Retorno = Ent.CveDispositivo Retorno = Ent.CveDispositivo
End If End If
Else Else
If ObjGPS.DispositivoAdd(Ent.TipoDispostivo, Ent.NumTelefono, Ent.CveModelo, Ent.CveProveedorComunicacionCuenta, Ent.CveCliente, Ent.IMEI, Ent.Serie, 1, Ent.SerieVehiculo, "", Ent.NombreVehiculo, Ent.NombreVehiculo, Ent.DevID, 0, "", Ent.Anio, "", "", False, 100D, "", 0D, "", "", 100) Then If ObjGPS.DispositivoAdd(Ent.TipoDispostivo, Ent.NumTelefono, Ent.CveModelo, Ent.CveProveedorComunicacionCuenta, Ent.CveCliente, Ent.IMEI, Ent.Serie, 1, Ent.SerieVehiculo, "", Ent.NombreVehiculo, Ent.NombreVehiculo, Ent.DevID, 0, "", Ent.Anio, "", "", False, 100D, "", 0D, "", "", 100, "") Then
Retorno = ObjGPS.CveDispositivo Retorno = ObjGPS.CveDispositivo
End If End If
End If End If