diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index 6b6d7482e..cc989e5e4 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -4308,13 +4308,14 @@ Public Class ClsBancos
Return Retorno
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
DataAdapter("PA_Banc_IEDesconciliar")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveIE", SqlDbType.Int).Value = CveIE
.Add("@FechaDesconciliado", SqlDbType.Date).Value = FechaDesconciliado
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@DejarConciliado", SqlDbType.Int).Value = If(DejarConciliado, 1, 0)
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsCGame.vb b/App_Code/ClsCGame.vb
index 58274dcbc..fa1ae71b7 100644
--- a/App_Code/ClsCGame.vb
+++ b/App_Code/ClsCGame.vb
@@ -790,7 +790,8 @@ Public Class ClsCGame
Return Retorno
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
DataAdapter("PA_CGame_HuertaAdd")
With SqlAdapter.SelectCommand.Parameters
@@ -801,6 +802,9 @@ Public Class ClsCGame
.Add("@TipoCobro", SqlDbType.Int).Value = TipoCobro
.Add("@Importe", SqlDbType.Float).Value = Importe
.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
Try
SqlAdapter.Fill(Data)
@@ -811,7 +815,8 @@ Public Class ClsCGame
Return Retorno
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
DataAdapter("PA_CGame_HuertaUpdate")
With SqlAdapter.SelectCommand.Parameters
@@ -824,6 +829,9 @@ Public Class ClsCGame
.Add("@TipoCobro", SqlDbType.Int).Value = TipoCobro
.Add("@Importe", SqlDbType.Float).Value = Importe
.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
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb
index b7d21d2e4..4b81efaff 100644
--- a/App_Code/ClsContPAQi.vb
+++ b/App_Code/ClsContPAQi.vb
@@ -2234,7 +2234,8 @@ Public Class ClsContPAQi
'''
'''
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
If IdPoliza <= 0 Or IdCuenta <= 0 Then
@@ -2307,8 +2308,8 @@ Public Class ClsContPAQi
'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)")
- 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(" 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, IIF(@CvePrePolizaDetalle=-1,NULL,@CvePrePolizaDetalle));")
StrSQL.AppendLine(" ")
''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
-
- '''
- ''' Agrega un movimiento a una póliza
- '''
- ''' Es el ID que generó la póliza
- ''' Es el ID de la cuenta del movimiento a agregar
- ''' Cargo = False; Abono = True
- ''' Es el Importe del movimiento a agregar
- ''' Es la referencia del movimiento, hasta 30 dígitos
- ''' Es el concepto del movimiento, hasta 100 dígitos
- ''' Es el ID del Segmento de Negocio
- ''' Es la fecha del movimiento
- '''
- '''
- 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)
With SqlAdapter.SelectCommand.Parameters
@@ -2523,6 +2374,159 @@ Public Class ClsContPAQi
Return Retorno
End Function
+ ''''
+ '''' Agrega un movimiento a una póliza
+ ''''
+ '''' Es el ID que generó la póliza
+ '''' Es el ID de la cuenta del movimiento a agregar
+ '''' Cargo = False; Abono = True
+ '''' Es el Importe del movimiento a agregar
+ '''' Es la referencia del movimiento, hasta 30 dígitos
+ '''' Es el concepto del movimiento, hasta 100 dígitos
+ '''' Es el ID del Segmento de Negocio
+ '''' Es la fecha del movimiento
+ ''''
+ ''''
+ '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
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 92b5aa4d1..a10b756f0 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -1406,7 +1406,7 @@ Public Class ClsContabilidad
If dr("ImporteMN").ToString.ToDecimal <> 0 Then
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
StrLog.AppendFormat(" Error 1.1 - ")
Exit For
@@ -1415,7 +1415,7 @@ Public Class ClsContabilidad
Else
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
StrLog.AppendFormat(" Error 1.2 - ")
Exit For
@@ -1456,7 +1456,7 @@ Public Class ClsContabilidad
Dim RFC As String = ""
Dim RazonSocial As String = ""
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
For Each dr As DataRow In Data.Rows
@@ -1685,7 +1685,7 @@ Public Class ClsContabilidad
Return Retorno
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
@@ -1693,6 +1693,7 @@ Public Class ClsContabilidad
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb
index fa1c9f6d7..31fe1900e 100644
--- a/App_Code/ClsGenerales.vb
+++ b/App_Code/ClsGenerales.vb
@@ -3,11 +3,11 @@ Option Explicit On
Imports System.Data
Imports System.Data.SqlClient
Imports Extensiones
-Imports Stimulsoft.Base.Analysis
-
+Imports Stimulsoft.Base.Analysis
+
Public Class ClsGenerales
- Implements IDisposable
-
+ Implements IDisposable
+
#Region "Campos"
Private _CveColectiva As Integer
@@ -19,11 +19,11 @@ Public Class ClsGenerales
Private DSet As New DataSet
Private disposedValue As Boolean = False
'REGISTRAR CONEXIONES ABIERTAS
- Private CveConexion As Integer = 0
- Private EsTransaccionCompartida As Boolean = False
-
+ Private CveConexion As Integer = 0
+ Private EsTransaccionCompartida As Boolean = False
+
#End Region
-
+
#Region "Propiedades"
Public Property Colectiva As String
Public Property Codigo As String
@@ -50,19 +50,19 @@ Public Class ClsGenerales
Get
DtResultados = Data
End Get
- End Property
-
- Public ReadOnly Property DSResultados() As DataSet
- Get
- DSResultados = DSet
- End Get
- End Property
-
- Public Property FolioInsertado As Integer
-
- Public Property SerieInsertada As String
+ End Property
+
+ Public ReadOnly Property DSResultados() As DataSet
+ Get
+ DSResultados = DSet
+ End Get
+ End Property
+
+ Public Property FolioInsertado As Integer
+
+ Public Property SerieInsertada As String
#End Region
-
+
Public Function IniciaTransacSQL() As SqlTransaction
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
Return SqlTransacc
@@ -86,7 +86,7 @@ Public Class ClsGenerales
End Try
Else
SqlConexion = TransaccionCompartida.Connection
- SqlTransacc = TransaccionCompartida
+ SqlTransacc = TransaccionCompartida
EsTransaccionCompartida = True
End If
@@ -101,9 +101,9 @@ Public Class ClsGenerales
End With
Data = New DataTable
If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
- End Sub
+ End Sub
#Region "Conexiones"
-
+
Private Sub ConexionAdd()
If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
@@ -136,9 +136,9 @@ Public Class ClsGenerales
CveConexion = 0
End If
- End Sub
+ End Sub
#End Region
-
+
Private Sub DataCommand(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure)
With SqlCommand
.Parameters.Clear()
@@ -221,13 +221,13 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los registros de solicitudes CFDI SAT.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
- End Function
-
+ End Function
+
Public Function SAT_DescargaSolicitudeUUIDSGET(CveSolicitudSat As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("[PA_Gral_DescargaSolicitudesUUIDSGET]", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveSolicitudSat", SqlDbType.Int).Value = CveSolicitudSat
+ .Add("@CveSolicitudSat", SqlDbType.Int).Value = CveSolicitudSat
End With
Try
SqlAdapter.Fill(Data)
@@ -236,15 +236,15 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los registros de solicitudes CFDI SAT.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
- End Function
-
-
+ End Function
+
+
Public Function SAT_DescargaSolicitudesAddNotificaciones(CveEmpresa As Int32, CveSolicitudSat As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("[PA_Gral_SAT_DescargaSolicitudesAddNotificaciones]", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CveSolicitudSat", SqlDbType.Int).Value = CveSolicitudSat
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveSolicitudSat", SqlDbType.Int).Value = CveSolicitudSat
End With
Try
SqlAdapter.Fill(Data)
@@ -253,12 +253,12 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los registros de solicitudes CFDI SAT.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
- End Function
+ End Function
Public Function SAT_DescargaSolicitudesAddNotificacionesCOUNT(CveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("[PA_Gral_SAT_DescargaSolicitudesAddNotificacionesCOUNT]", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
@@ -267,8 +267,8 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los registros de solicitudes CFDI SAT.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
- End Function
-
+ End Function
+
Public Function GetMotivosCancelacionSAT() As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Gral_SAT_MotivosCancelacionGet")
@@ -279,15 +279,15 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los motivos de cancelación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
- End Function
-
+ End Function
+
Public Function GetMotivosCancelacionEmpresa(CveEmpresa As Integer, Optional CveMotivoCancelacion As Integer = -1, Optional CveSATMotivoCancelacion As Integer = -1) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Gral_MotivosCancelacionGet")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion
- .Add("@CveSATMotivoCancelacion", SqlDbType.Int).Value = CveSATMotivoCancelacion
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion
+ .Add("@CveSATMotivoCancelacion", SqlDbType.Int).Value = CveSATMotivoCancelacion
End With
Try
SqlAdapter.Fill(Data)
@@ -296,13 +296,13 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los motivos de cancelación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
- End Function
-
+ End Function
+
Public Function GenerarMotivosCancelacionEmpresaDefault(CveEmpresa As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Gral_MotivosCancelacionDefaultAdd")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
@@ -311,8 +311,8 @@ Public Class ClsGenerales
OnError("Ocurrió un error al agregar los motivos de cancelacion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
- End Function
-
+ End Function
+
#Region " I N D I C A D O R E S Y G R A F I C A S"
Public Function GetIndicadores(CveEmpresa As Integer) As DataSet
'Dim Retorno As Boolean = False
@@ -334,10 +334,10 @@ Public Class ClsGenerales
End Try
Return ds
- End Function
-
+ End Function
+
#End Region
-
+
#Region " D I A S I N H A B I L E S "
Public Function DiasInhabiles_Add(CveEmpresa As Integer, CveUsuario As Integer, DiaInhabil As String, Descripcion As String, Estatus As Integer, FechaInhabil As Date) As Boolean
Dim Retorno As Boolean = False
@@ -420,15 +420,15 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region " P A Q U E T E R I A S"
Public Function GetGralPaqueterias(Optional CveEmpresa As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_PaqueteriasGet")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
@@ -559,11 +559,11 @@ Public Class ClsGenerales
OnError("Ocurrió un error al actualizar en el Catálogo de Paqueterias Guias Tipos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "P L A N T I L L A S C O N T R A T O S"
-
+
Public Function ContratoPlantillaAdd(CveEmpresa As Integer, CveUsuario As Integer, NombrePlantilla As String, URL As String, Tipo As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ContratoPlantillaAdd")
@@ -640,55 +640,55 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
- '#Region " E S T A D O S"
- ' Public Function GetGralEstados() As Boolean
- ' Dim Retorno As Boolean = False
- ' DataAdapter("PA_Gral_EstadoGet")
- ' Try
- ' SqlAdapter.Fill(Data)
- ' Retorno = True
- ' Catch ex As Exception
- ' OnError("Ocurrió un error al obtener el Catálogo de Estados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- ' End Try
-
- ' Return Retorno
- ' End Function
- '#End Region
-
- '#Region " M U N I C I P I O S"
- ' Public Function GetGralMunicipios() As Boolean
- ' Dim Retorno As Boolean = False
- ' DataAdapter("PA_Gral_MunicipioGet")
- ' Try
- ' SqlAdapter.Fill(Data)
- ' Retorno = True
- ' Catch ex As Exception
- ' OnError("Ocurrió un error al obtener el Catálogo de Municipios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- ' End Try
-
- ' Return Retorno
- ' End Function
- '#End Region
-
- '#Region " P A I S E S"
- ' Public Function GetGralPaises() As Boolean
- ' Dim Retorno As Boolean = False
- ' DataAdapter("PA_Gral_PaisGet")
- ' Try
- ' SqlAdapter.Fill(Data)
- ' Retorno = True
- ' Catch ex As Exception
- ' OnError("Ocurrió un error al obtener el Catálogo de Paises.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- ' End Try
-
- ' Return Retorno
- ' End Function
- '#End Region
-
+
+ '#Region " E S T A D O S"
+ ' Public Function GetGralEstados() As Boolean
+ ' Dim Retorno As Boolean = False
+ ' DataAdapter("PA_Gral_EstadoGet")
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al obtener el Catálogo de Estados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
+
+ ' Return Retorno
+ ' End Function
+ '#End Region
+
+ '#Region " M U N I C I P I O S"
+ ' Public Function GetGralMunicipios() As Boolean
+ ' Dim Retorno As Boolean = False
+ ' DataAdapter("PA_Gral_MunicipioGet")
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al obtener el Catálogo de Municipios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
+
+ ' Return Retorno
+ ' End Function
+ '#End Region
+
+ '#Region " P A I S E S"
+ ' Public Function GetGralPaises() As Boolean
+ ' Dim Retorno As Boolean = False
+ ' DataAdapter("PA_Gral_PaisGet")
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al obtener el Catálogo de Paises.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
+
+ ' Return Retorno
+ ' End Function
+ '#End Region
+
#Region " P O B L A C I O N E S"
Public Function GetGralPoblaciones() As Boolean
Dim Retorno As Boolean = False
@@ -701,9 +701,9 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "E S C O L A R I D A D"
Public Function GetEscolaridades() As Boolean
Dim Retorno As Boolean = False
@@ -793,9 +793,9 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "C A T E G O R I A S"
Public Function GetCategorias(Optional CveEmpresa As Integer = -1, Optional Tipo As Integer = 1) As Boolean
Dim Retorno As Boolean = False
@@ -892,9 +892,9 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "M O D E L O S"
Public Function GetModelos(CveEmpresa As Integer, Optional CveModelo As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -988,9 +988,9 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "R I M T A M A N I O S"
Public Function GetRimTamanios(CveEmpresa As Integer, Optional CveRinTamaño As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1082,9 +1082,9 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "M E D I D A S"
Public Function GetMedidas(CveEmpresa As Integer, Optional CveMedida As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1164,7 +1164,7 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
Public Function GetMedidasEquivalentes(CveEmpresa As Integer, Optional CveMedida As Integer = -1, Optional CveRin As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1184,7 +1184,7 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
Public Function AddMedidasEquivalentes(CveMedida As Integer, CveRin As Integer, CveMedidaEquivalente As Integer, CveRinEquivalente As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -1205,14 +1205,14 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
Public Function UpdateMedidasEquivalentes(CveMedidaEquivalencia As Integer, CveMedida As Integer, CveRin As Integer, CveMedidaEquivalente As Integer, CveRinEquivalente As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_MedidasEquivalenciasUpdate")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveMedidaEquivalencia", SqlDbType.Int).Value = CveMedidaEquivalencia
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedidaEquivalencia", SqlDbType.Int).Value = CveMedidaEquivalencia
.Add("@CveMedida", SqlDbType.Int).Value = CveMedida
.Add("@CveRin", SqlDbType.Int).Value = CveRin
.Add("@CveMedidaEquivalente", SqlDbType.Int).Value = CveMedidaEquivalente
@@ -1227,7 +1227,7 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
Public Function RemoveMedidasEquivalentes(CveMedidaEquivalencia As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -1245,9 +1245,9 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "C O L E C T I V A S"
Public Function GetColectivas(Optional CveColectiva As Integer = -1, Optional Colectiva As String = "-1", Optional Codigo As String = "-1", Optional Tipo As String = "-1", Optional CveEmpresa As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1403,10 +1403,10 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "C O L E C T I V A S - D E T A L L E S"
Public Function GetColectivasDetalles(CveColectiva As Integer, Tipo As String, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -1524,9 +1524,9 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "S u b i r I m a g e n e s"
Public Function ImagenUpload(pCveOpcion As Integer, pCveClave As Integer, pCveUsuario As Integer, IMEI As String, pCveEmpresa As Integer) As Integer
Dim Retorno As Integer = -1
@@ -1550,10 +1550,10 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
- ' IDisposable
-
+ ' IDisposable
+
#Region "G E N E R A L E S - C U E N T A S B A N C A R I A S "
Public Function GetCuentasDepositos(Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveColectiva As Integer = -1, Optional CveCuentaDeposito As Integer = -1, Optional CveEmpresa As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1564,7 +1564,7 @@ Public Class ClsGenerales
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
- .Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito
+ .Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
@@ -1603,7 +1603,7 @@ Public Class ClsGenerales
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@RefCrediProveedor", SqlDbType.VarChar).Value = RefCrediProveedor
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
- .Add("@Correo", SqlDbType.VarChar).Value = Correo
+ .Add("@Correo", SqlDbType.VarChar).Value = Correo
.Add("@BBVAAlias", SqlDbType.VarChar).Value = BBVAAlias
.Add("@EstatusPagoElectronico", SqlDbType.Bit).Value = EstatusPagoElectronico
.Add("@EstatusPagoElectronicoGrupos", SqlDbType.Bit).Value = EstatusPagoElectronicoGrupos
@@ -1623,13 +1623,13 @@ Public Class ClsGenerales
' End If
Catch ex As Exception
- If ex.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then
- OnError($"Ocurrió un error al Guardar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Else
- OnError("Ocurrió un error al Guardar la cuenta", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End If
-
-
+ If ex.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then
+ OnError($"Ocurrió un error al Guardar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Else
+ OnError("Ocurrió un error al Guardar la cuenta", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
+
+
End Try
Return Retorno
@@ -1638,13 +1638,13 @@ Public Class ClsGenerales
Public Function RemoveCuentasDepositos(CveCuentaDeposito As Integer, CveEmpresa As Integer, CveUsuarioModifico As Integer) As Boolean
Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_CuentasDepositosRemove")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
- End With
-
+ DataAdapter("PA_Gral_CuentasDepositosRemove")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
+ End With
+
Try
SqlAdapter.Fill(Data)
Retorno = True
@@ -1659,15 +1659,15 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function UpdateCuentasDepositosPersonal(CveCuentaDeposito As Integer, BancoNombre As String, Cuenta As String, CLABE As String, CveMoneda As Integer, CveUsuarioModifico As Integer, EstatusPagoElectronico As Boolean, Estatus As Boolean, CveSATBanco As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_CuentasDepositosPersonalUpdate")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@BancoNombre", SqlDbType.VarChar).Value = BancoNombre
.Add("@Cuenta", SqlDbType.VarChar).Value = Cuenta
@@ -1686,35 +1686,35 @@ Public Class ClsGenerales
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Alert("Ya existe un registro con el mismo nombre", TipoMensaje.MsgAdvertencia)
- ElseIf Ex1.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then
- OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ ElseIf Ex1.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then
+ OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
Else
Me.OnError("Ocurrió un error al guardar los cambios", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
- If ex.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then
- OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Else
- OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End If
-
-
+ If ex.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then
+ OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Else
+ OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
+
+
End Try
Return Retorno
- End Function
+ End Function
- Public Function UpdateCuentasDepositos(CveCuentaDeposito As Integer, BancoNombre As String, Plaza As String, Sucursal As String, Cuenta As String, CLABE As String, CIE As String, SWIFT As String, Referencia As String,
- RefCrediProveedor As String, Predeterminada As Boolean, Estatus As Boolean, CveMoneda As Integer, CveEmpresa As Integer, Optional CveUsuarioModifico As Integer = -1, Optional Correo As String = "",
+ Public Function UpdateCuentasDepositos(CveCuentaDeposito As Integer, BancoNombre As String, Plaza As String, Sucursal As String, Cuenta As String, CLABE As String, CIE As String, SWIFT As String, Referencia As String,
+ RefCrediProveedor As String, Predeterminada As Boolean, Estatus As Boolean, CveMoneda As Integer, CveEmpresa As Integer, Optional CveUsuarioModifico As Integer = -1, Optional Correo As String = "",
Optional BBVAAlias As String = "-1", Optional EstatusPagoElectronico As Boolean = False, Optional EstatusPagoElectronicoGrupos As Boolean = False, Optional CveSATBanco As Integer = -1,
Optional ConceptoCIE As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_CuentasDepositosUpdate")
- With SqlAdapter.SelectCommand.Parameters
+ With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@BancoNombre", SqlDbType.VarChar).Value = BancoNombre
.Add("@Plaza", SqlDbType.VarChar).Value = Plaza
@@ -1745,52 +1745,52 @@ Public Class ClsGenerales
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
- Alert("Ya existe un registro con el mismo nombre", TipoMensaje.MsgAdvertencia)
- ElseIf Ex1.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then
+ Alert("Ya existe un registro con el mismo nombre", TipoMensaje.MsgAdvertencia)
+ ElseIf Ex1.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then
OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
Else
Me.OnError("Ocurrió un error al guardar los cambios", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
- Catch ex As Exception
-
- If ex.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then
- OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Else
- OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End If
+ Catch ex As Exception
+
+ If ex.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then
+ OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Else
+ OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
End Try
Return Retorno
- End Function
-
- Public Function UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito As Integer, EstatusPagoElectronicoGrupos As Integer, CveSATBanco As Integer, BBVAAlias As String, Referencia As String, ConceptoCIE As String) As Boolean
-
+ End Function
+
+ Public Function UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito As Integer, EstatusPagoElectronicoGrupos As Integer, CveSATBanco As Integer, BBVAAlias As String, Referencia As String, ConceptoCIE As String) As Boolean
+
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_CuentasDepositosUpdateEstatusPagoElectronicoGrupos")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCuentaDeposito", SqlDbType.VarChar).Value = CveCuentaDeposito
- .Add("@EstatusPagoElectronicoGrupos", SqlDbType.Int).Value = EstatusPagoElectronicoGrupos
- .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco
- .Add("@BBVAAlias", SqlDbType.VarChar).Value = BBVAAlias
- .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
- .Add("@ConceptoCIE", SqlDbType.VarChar).Value = ConceptoCIE
- End With
-
-
+ .Add("@EstatusPagoElectronicoGrupos", SqlDbType.Int).Value = EstatusPagoElectronicoGrupos
+ .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco
+ .Add("@BBVAAlias", SqlDbType.VarChar).Value = BBVAAlias
+ .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
+ .Add("@ConceptoCIE", SqlDbType.VarChar).Value = ConceptoCIE
+ End With
+
+
Try
SqlAdapter.Fill(Data)
- Retorno = True
+ Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "T I P O - C A M B I O"
Public Function AddTipoCambio(TipoCambio As Double, Fecha As Date, Optional TipoCambioEuro As Double = 0, Optional TipoCambioFIX As Double = 0) As Boolean
Dim Retorno As Boolean = False
@@ -1815,7 +1815,7 @@ Public Class ClsGenerales
Return Retorno
- End Function
+ End Function
Public Function GetTipoCambio(CveTipoCambio As Integer, Fecha As Date) As Boolean
Dim Retorno = False
@@ -1911,11 +1911,11 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "C l a s i f i c a c i o n e s C a r a c t e r i s t i c a s"
-
+
Public Function AddClasificacionesCaracteristicas(CaracteristicaClasificacion As String, Orden As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_CaracteristicasClasificacionesAdd")
@@ -1996,12 +1996,12 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "C a r a c t e r í s t i c a s"
-
+
Public Function GetCaracteristicasModulos() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_CaracteristicasModuloGet")
@@ -2255,9 +2255,9 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "O p c i o n e s"
Public Function AddCaracteristicasOpciones(CaracteristicaOpcion As String, CveCaracteristica As Integer, Orden As Integer, Estatus As Boolean, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -2358,9 +2358,9 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "T I P O C U E N T A S E Q U I P O S"
Public Function AddTipoCuentaEquipo(TipoCuentaEquipo As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -2447,9 +2447,9 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "C U E N T A S E Q U I P O S"
Public Function AddCuentaEquipo(CveCliente As Integer, CveTipoCuentaEquipo As Integer, CuentaEquipo As String, NoSerie As String, CveClienteSucursal As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CveCuentaEquipo As Integer = -1, Optional CveCuentaEquipoRelacionado As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -2622,17 +2622,17 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
#End Region
-
+
#Region "Bitacora"
Public Function GetHistorialBitacora(CveAcarreo As Integer, CveOrdenCompra As Integer, CveActivoFijo As Integer,
CveOS As Integer, CvePS As Integer, CveCompra As Integer, CveIE As Integer,
CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional CvePersonal As Integer = -1,
Optional IdPoliza As Integer = -1, Optional CvePrePoliza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveConceptoNomina As Integer = -1, Optional CvePromocion As Integer = -1,
- Optional CveAsistencia As Integer = -1, Optional CveAsistenciaDetalle As Integer = -1, Optional CveTipoBitacora As Integer = -1,
+ Optional CveAsistencia As Integer = -1, Optional CveAsistenciaDetalle As Integer = -1, Optional CveTipoBitacora As Integer = -1,
Optional FechaInicio As String = "", Optional FechaFin As String = "", Optional Fecha As Date = MinFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_HistorialBitacoraGet")
@@ -2651,18 +2651,18 @@ Public Class ClsGenerales
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
- .Add("@CveConceptoNomina", SqlDbType.Int).Value = CveConceptoNomina
- .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
-
-
- .Add("@CveAsistencia", SqlDbType.Int).Value = CveAsistencia
- .Add("@CveAsistenciaDetalle", SqlDbType.Int).Value = CveAsistenciaDetalle
- .Add("@CveTipoBitacora", SqlDbType.Int).Value = CveTipoBitacora
- .Add("@FechaInicio", SqlDbType.VarChar).Value = FechaInicio
- .Add("@FechaFin", SqlDbType.VarChar).Value = FechaFin
- .Add("@Fecha", SqlDbType.Date).Value = Fecha
-
-
+ .Add("@CveConceptoNomina", SqlDbType.Int).Value = CveConceptoNomina
+ .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
+
+
+ .Add("@CveAsistencia", SqlDbType.Int).Value = CveAsistencia
+ .Add("@CveAsistenciaDetalle", SqlDbType.Int).Value = CveAsistenciaDetalle
+ .Add("@CveTipoBitacora", SqlDbType.Int).Value = CveTipoBitacora
+ .Add("@FechaInicio", SqlDbType.VarChar).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.VarChar).Value = FechaFin
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+
+
End With
'SqlTypes.SqlDateTime.Null
Try
@@ -2702,7 +2702,8 @@ Public Class ClsGenerales
CveActivoFijo As Integer, CveOS As Integer, CvePS As Integer, CveCompra As Integer,
CveIE As Integer, Actual As String, Anterior As String, CveUsuario As Integer,
CveEmpresa As Integer, SeElimino As Integer, Descripcion As String, Tipo As String,
- Id_Clave As String, Optional IdPoliza As Integer = -1, Optional CvePromocion As Integer = -1, Optional CveUsuarioTabla As Integer = -1) As Boolean
+ Id_Clave As String, Optional IdPoliza As Integer = -1, Optional CvePromocion As Integer = -1, Optional CveUsuarioTabla As Integer = -1,
+ Optional CvePersonal As Integer = -1, Optional Motivo As String = "", Optional Fecha As String = "1900/01/01") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_HistorialBitacoraAdd")
@@ -2725,9 +2726,12 @@ Public Class ClsGenerales
.Add("@Id_Clave", SqlDbType.VarChar, 100).Value = Id_Clave
.Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza
.Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
- .Add("@CveUsuarioTabla", SqlDbType.Int).Value = CveUsuarioTabla
-
-
+ .Add("@CveUsuarioTabla", SqlDbType.Int).Value = CveUsuarioTabla
+ .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
+ .Add("@Motivo", SqlDbType.VarChar).Value = Motivo
+ .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
+
+
End With
'SqlTypes.SqlDateTime.Null
Try
@@ -2747,7 +2751,7 @@ Public Class ClsGenerales
DataAdapter("PA_Gral_SAT_ProductosServiciosGet")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CodigoSAT", SqlDbType.VarChar).Value = CodigoSAT
+ .Add("@CodigoSAT", SqlDbType.VarChar).Value = CodigoSAT
.Add("@SATClaveProductoServicio", SqlDbType.VarChar).Value = SATClaveProductoServicio
.Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
@@ -2798,10 +2802,10 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "SAT CFDI COMERCIO EXTERIOR"
Public Function GetSATClavePedimento() As Boolean
Dim Retorno As Boolean = False
@@ -2928,9 +2932,9 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los municipios del SAT", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
Public Function GetSATLocalidad(Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_SAT_LocalidadGet")
@@ -2962,10 +2966,10 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener las colonias del SAT", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
Public Function JAMComparativo(Opcion As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_JAM_Comparativo")
@@ -2983,13 +2987,13 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
Public Function GetSATObjetoImpuesto() As Boolean
Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_SAT_ObjetosImpuestos")
-
+ DataAdapter("PA_Gral_SAT_ObjetosImpuestos")
+
Try
SqlAdapter.Fill(Data)
If Data.Rows.Count > 0 Then
@@ -3001,8 +3005,8 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
+ End Function
+
#Region "P A Q U E T E R I A S G U I A S"
Public Function AddPaqueteriasGuias(CvePaqueteria As Integer, CvePaqueteriaGuiaTipo As Integer, CveEstatus As Integer, CveSubProyecto As Integer, Fecha As String, Rastreo As String, Guia As String, NumCajas As Integer,
Peso As Double, Dimensiones As String, FechaEstimada As String, Observaciones As String, CveUsuario As Integer, CveEmpresa As Integer, Optional ImplicaCosto As Boolean = True,
@@ -3055,8 +3059,8 @@ Public Class ClsGenerales
Return Retorno
End Function
- Public Function GetPaqueteriasGuias(CvePaqueteriaGuia As Integer, CvePaqueteriaGuiaTipo As Integer, CvePaqueteria As Integer, CveEstatus As Integer, CveSubProyecto As Integer,
- CveEmpresa As Integer, Guia As String, FechaInicio As String, FechaFin As String, Optional FechaIngInicio As String = "-1",
+ Public Function GetPaqueteriasGuias(CvePaqueteriaGuia As Integer, CvePaqueteriaGuiaTipo As Integer, CvePaqueteria As Integer, CveEstatus As Integer, CveSubProyecto As Integer,
+ CveEmpresa As Integer, Guia As String, FechaInicio As String, FechaFin As String, Optional FechaIngInicio As String = "-1",
Optional FechaIngFin As String = "-1", Optional Filtro As Integer = -1, Optional CveUsuarioEntrega As Integer = -1,
Optional EsEntregaInterna As Boolean = False) As Boolean
@@ -3078,9 +3082,9 @@ Public Class ClsGenerales
.Add("@FechaIngFin", SqlDbType.VarChar).Value = FechaIngFin
.Add("@Filtro", SqlDbType.Int).Value = Filtro
.Add("@CveUsuarioEntrega", SqlDbType.Int).Value = CveUsuarioEntrega
- .Add("@EsEntregaInterna", SqlDbType.Bit).Value = EsEntregaInterna
-
-
+ .Add("@EsEntregaInterna", SqlDbType.Bit).Value = EsEntregaInterna
+
+
End With
Try
SqlAdapter.Fill(Data)
@@ -3090,8 +3094,8 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function UpdatePaqueteriasGuias(CvePaqueteriaGuia As Integer, CvePaqueteriaGuiaTipo As Integer, CveSubProyecto As Integer, CvePaqueteria As Integer, CveEstatus As Integer, Fecha As String, Rastreo As String, Guia As String, NumCajas As Integer, Peso As Double,
Dimensiones As String, FechaEstimada As String, Observaciones As String, Optional ImplicaCosto As Boolean = True) As Boolean
Dim Retorno As Boolean = False
@@ -3147,15 +3151,15 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
- Public Function GetEntregasPorRealizar(CveEmpresa As Integer, Optional CveAsignacionEntrega As Long = -1) As Boolean
+ End Function
+
+ Public Function GetEntregasPorRealizar(CveEmpresa As Integer, Optional CveAsignacionEntrega As Long = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_EntregasPorRealizarGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CveAsignacionEntrega", SqlDbType.BigInt).Value = CveAsignacionEntrega
-
+ .Add("@CveAsignacionEntrega", SqlDbType.BigInt).Value = CveAsignacionEntrega
+
End With
Try
SqlAdapter.Fill(Data)
@@ -3164,17 +3168,17 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener entregas por realizar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
- Return Retorno
- End Function
-
- Public Function AsignarEntregasPorRealizar(CvePaqueteriaGuia As Integer, CvePersonal As Integer, Optional CveAsignacionEntrega As Long = -1, Optional CveMotivoRechazoPaqueteria As Integer = -1) As Boolean
+ Return Retorno
+ End Function
+
+ Public Function AsignarEntregasPorRealizar(CvePaqueteriaGuia As Integer, CvePersonal As Integer, Optional CveAsignacionEntrega As Long = -1, Optional CveMotivoRechazoPaqueteria As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_AsignarEntregasPorRealizar")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia
.Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CvePersonal
.Add("@CveAsignacionEntrega", SqlDbType.BigInt).Value = CveAsignacionEntrega
- .Add("@CveMotivoRechazoPaqueteria", SqlDbType.Int).Value = CveMotivoRechazoPaqueteria
+ .Add("@CveMotivoRechazoPaqueteria", SqlDbType.Int).Value = CveMotivoRechazoPaqueteria
End With
Try
SqlAdapter.Fill(Data)
@@ -3183,10 +3187,10 @@ Public Class ClsGenerales
OnError("Ocurrió un error al asignar entregas por realizar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
- Return Retorno
- End Function
-
- Public Function GetMotivoRechazoPaqueteria(CveMotivoRechazoPaqueteria As Integer, CveEmpresa As Integer) As Boolean
+ Return Retorno
+ End Function
+
+ Public Function GetMotivoRechazoPaqueteria(CveMotivoRechazoPaqueteria As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("Gral_MotivoRechazoPaqueteriaGet")
With SqlAdapter.SelectCommand.Parameters
@@ -3200,10 +3204,10 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los motivos de rechazo de entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
- Return Retorno
- End Function
-
- Public Function AddMotivoRechazoPaqueteria(Descripcion As String, CveEmpresa As Integer) As Boolean
+ Return Retorno
+ End Function
+
+ Public Function AddMotivoRechazoPaqueteria(Descripcion As String, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("Gral_MotivoRechazoPaqueteriaAdd")
With SqlAdapter.SelectCommand.Parameters
@@ -3217,10 +3221,10 @@ Public Class ClsGenerales
OnError("Ocurrió un error al agregar el motivos de rechazo de entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
- Return Retorno
- End Function
-
- Public Function RemoveMotivoRechazoPaqueteria(CveMotivoRechazoPaqueteria As Integer) As Boolean
+ Return Retorno
+ End Function
+
+ Public Function RemoveMotivoRechazoPaqueteria(CveMotivoRechazoPaqueteria As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("Gral_MotivoRechazoPaqueteriaDelete")
With SqlAdapter.SelectCommand.Parameters
@@ -3233,10 +3237,10 @@ Public Class ClsGenerales
OnError("Ocurrió un error al eliminar el motivos de rechazo de entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
- Return Retorno
- End Function
-
- Public Function UpdateMotivoRechazoPaqueteria(CveMotivoRechazoPaqueteria As Integer, Optional Descripcion As String = "-1") As Boolean
+ Return Retorno
+ End Function
+
+ Public Function UpdateMotivoRechazoPaqueteria(CveMotivoRechazoPaqueteria As Integer, Optional Descripcion As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("Gral_MotivoRechazoPaqueteriaUpdate")
With SqlAdapter.SelectCommand.Parameters
@@ -3250,10 +3254,10 @@ Public Class ClsGenerales
OnError("Ocurrió un error al modificar el motivos de rechazo de entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
- Return Retorno
- End Function
+ Return Retorno
+ End Function
#End Region
-
+
#Region "P A Q U E T E R I A S G U I A S D E T A L L E S"
Public Function AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia As Integer, CveVenta As Integer, CveOC As Integer, CveMovimiento As Integer, Optional CveCompra As Integer = -1) As Boolean
@@ -3340,11 +3344,11 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "CLASIFICACIONES PORCENTAJE"
-
+
Public Function GetClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasificacionPorcentaje As Integer = -1,
Optional CveClasificacion As Integer = -1, Optional PorcentajeIVA As Double = -1,
Optional Opcion As Integer = 1) As Boolean
@@ -3420,13 +3424,13 @@ Public Class ClsGenerales
OnError("Ocurrió un error al eliminar la clasificacion del porcentaje.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
-
+
+
#Region "C A R T A P O R T E"
-
+
Public Function GetMaterialPeligroso() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_CP_MaterialPeligrosoGet")
@@ -3447,8 +3451,8 @@ Public Class ClsGenerales
End Function
Public Function GetEmbalajes() As Boolean
Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_CP_EmbalajesGet")
-
+ DataAdapter("PA_Gral_CP_EmbalajesGet")
+
Try
SqlAdapter.Fill(Data)
Retorno = True
@@ -3456,11 +3460,11 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener embalajes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function GetCartaPorteTipoPermisoSCT() As Boolean
Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_CP_TipoPermisoSCTGet")
+ DataAdapter("PA_Gral_CP_TipoPermisoSCTGet")
Try
SqlAdapter.Fill(Data)
Retorno = True
@@ -3468,11 +3472,11 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los permisos de carta porte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function GetCartaPorteConfigAutoTransportes() As Boolean
Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_CP_ConfigAutoTransportesGet")
+ DataAdapter("PA_Gral_CP_ConfigAutoTransportesGet")
Try
SqlAdapter.Fill(Data)
Retorno = True
@@ -3480,12 +3484,12 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los configuración de autotransporte de carta porte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
Public Function GetCartaPorteTiposRemolques() As Boolean
Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_CP_TiposRemolqueGet")
+ DataAdapter("PA_Gral_CP_TiposRemolqueGet")
Try
SqlAdapter.Fill(Data)
Retorno = True
@@ -3493,13 +3497,13 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los tipos de remolque de carta porte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
-
-
-
+
+
+
+
#Region "CRUD_Edoc_DocumentacionTipo"
Public Function GetEdoc_DocumentacionTipo(CveDocumentacionTipo As Integer, CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional EsCatalogo As Integer = 0, Optional Modulo As Integer = 1) As Boolean
@@ -3580,23 +3584,23 @@ Public Class ClsGenerales
Return retorno
- End Function
-
+ End Function
+
#End Region
-
-
-
-
-#Region ""
-
-
+
+
+
+
+#Region ""
+
+
Public Function GetJAMCorveta(Opcion As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_JAM_Corteva")
With SqlAdapter.SelectCommand.Parameters
- .Add("@Opcion", SqlDbType.Int).Value = Opcion
-
+ .Add("@Opcion", SqlDbType.Int).Value = Opcion
+
End With
Try
@@ -3608,23 +3612,23 @@ Public Class ClsGenerales
Return Retorno
- End Function
-
-#End Region
-
-
-
-
-
-#Region "CULTIVOS"
-
-
+ End Function
+
+#End Region
+
+
+
+
+
+#Region "CULTIVOS"
+
+
Public Function GetCultivosCuadro(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_CultivosCuadroGet")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -3636,18 +3640,18 @@ Public Class ClsGenerales
Return Retorno
- End Function
-
-
-
-
+ End Function
+
+
+
+
Public Function GetTempordas(CveTemporada As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AgroTemporadaGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@cveTemporada", SqlDbType.Int).Value = CveTemporada
- .Add("@cveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@cveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -3659,9 +3663,9 @@ Public Class ClsGenerales
Return Retorno
- End Function
-
-
+ End Function
+
+
Public Function UpdateCierreCultivos(CveCultivoCuadro As Integer, CvePrePoliza As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -3669,7 +3673,7 @@ Public Class ClsGenerales
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCultivoCuadro", SqlDbType.Int).Value = CveCultivoCuadro
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -3681,8 +3685,8 @@ Public Class ClsGenerales
Return Retorno
- End Function
-
+ End Function
+
Public Function GetCierreCultivos(CveTemporada As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -3690,7 +3694,7 @@ Public Class ClsGenerales
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTemporada", SqlDbType.Int).Value = CveTemporada
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -3702,21 +3706,21 @@ Public Class ClsGenerales
Return Retorno
- End Function
-
-
-#End Region
-
-
-
-
-
-
+ End Function
+
+
+#End Region
+
+
+
+
+
+
#Region " P O L I Z A V I R T U A L "
Public Function ModelosAutosGet(Estatus As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ModelosAutosGet")
- With SqlAdapter.SelectCommand.Parameters
+ With SqlAdapter.SelectCommand.Parameters
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
@@ -3773,50 +3777,50 @@ Public Class ClsGenerales
OnError("Ocurrió un error al obtener los BCI de Usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
-
-
-
-#Region "GRAL TIMBRES"
-
-
- Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
+
+
+
+
+#Region "GRAL TIMBRES"
+
+
+ Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0,
Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False, Optional CveVenta As Integer = -1) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Gral_TimbreAdd")
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
- .Add("@Serie", SqlDbType.VarChar).Value = Serie
- .Add("@Folio", SqlDbType.Int).Value = Folio
- .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@Estatus", SqlDbType.Int).Value = Estatus
- .Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP
- .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
- .Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyecto
- .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
-
- .Add("@CveTimbre", SqlDbType.Int).Direction = ParameterDirection.Output
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
+ .Add("@Serie", SqlDbType.VarChar).Value = Serie
+ .Add("@Folio", SqlDbType.Int).Value = Folio
+ .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
+ .Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP
+ .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
+ .Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
+
+ .Add("@CveTimbre", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@FolioInsertado", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@SerieInsertada", SqlDbType.VarChar, 5).Direction = ParameterDirection.Output
End With
Try
- SqlAdapter.Fill(Data)
-
- FolioInsertado = SqlAdapter.SelectCommand.Parameters("@FolioInsertado").Value.ToString.ToEntero
- SerieInsertada = SqlAdapter.SelectCommand.Parameters("@SerieInsertada").Value.ToString
-
- Retorno = SqlAdapter.SelectCommand.Parameters("@CveTimbre").Value.ToString.ToEntero
-
+ SqlAdapter.Fill(Data)
+
+ FolioInsertado = SqlAdapter.SelectCommand.Parameters("@FolioInsertado").Value.ToString.ToEntero
+ SerieInsertada = SqlAdapter.SelectCommand.Parameters("@SerieInsertada").Value.ToString
+
+ Retorno = SqlAdapter.SelectCommand.Parameters("@CveTimbre").Value.ToString.ToEntero
+
Catch ex As Exception
OnError("Ocurrió un error al agregar el timbre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
@@ -3830,12 +3834,12 @@ Public Class ClsGenerales
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
- .Add("@FechaI", SqlDbType.Date).Value = FechaI
+ .Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@Estatus", SqlDbType.Int).Value = Estatus
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
- .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
+ .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
End With
Try
@@ -3856,12 +3860,12 @@ Public Class ClsGenerales
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
- .Add("@FolioFiscal", SqlDbType.VarChar).Value = FolioFiscal
- .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
- .Add("@CvePAC", SqlDbType.Int).Value = CvePAC
- .Add("@CDFIVersion", SqlDbType.VarChar).Value = CFDIVersion
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@FolioFiscal", SqlDbType.VarChar).Value = FolioFiscal
+ .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
+ .Add("@CvePAC", SqlDbType.Int).Value = CvePAC
+ .Add("@CDFIVersion", SqlDbType.VarChar).Value = CFDIVersion
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -3871,8 +3875,8 @@ Public Class ClsGenerales
OnError("Ocurrió un error al actualizar el timbrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function CancelarTimbreTimbrado(CveTimbre As Integer, FechaCancelacion As DateTime, CvePACCancelacion As Integer, SelloCancelacion As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_TimbreTimbradoCancelar")
@@ -3880,11 +3884,11 @@ Public Class ClsGenerales
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
- .Add("@FechaCancelacion", SqlDbType.DateTime).Value = FechaCancelacion
- .Add("@CvePACCancelacion", SqlDbType.Int).Value = CvePACCancelacion
- .Add("@SelloCancelacion", SqlDbType.VarChar).Value = SelloCancelacion
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@FechaCancelacion", SqlDbType.DateTime).Value = FechaCancelacion
+ .Add("@CvePACCancelacion", SqlDbType.Int).Value = CvePACCancelacion
+ .Add("@SelloCancelacion", SqlDbType.VarChar).Value = SelloCancelacion
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -3894,10 +3898,10 @@ Public Class ClsGenerales
OnError("Ocurrió un error al actualizar el timbrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
-
+ End Function
+
+
+
Public Function RemoveGralTimbre(CveTimbre As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_TimbreRemove")
@@ -3914,11 +3918,11 @@ Public Class ClsGenerales
OnError("Ocurrió un error al eliminar Timbre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
- Public Function GetGralMovimientosDetalleTimbre(CveTimbre As Integer, CveEmpresa As Integer) As Boolean
-
-
+ End Function
+
+ Public Function GetGralMovimientosDetalleTimbre(CveTimbre As Integer, CveEmpresa As Integer) As Boolean
+
+
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_MovimientosDetalleTimbreGet")
@@ -3932,277 +3936,277 @@ Public Class ClsGenerales
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los movimientos del timbre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
-
- End Function
-
- Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, FechaLlegada As DateTime, Tipo As String,
- FolioReferencia As String, Referencia As String, FechaLimite As Date, Orden As Integer, Estatus As Integer, Distancia As Integer, Optional CveConfigAutoTransporte As Integer = -1,
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, FechaLlegada As DateTime, Tipo As String,
+ FolioReferencia As String, Referencia As String, FechaLimite As Date, Orden As Integer, Estatus As Integer, Distancia As Integer, Optional CveConfigAutoTransporte As Integer = -1,
Optional CveCamionRemolque1 As Integer = -1, Optional CveCamionRemolque2 As Integer = -1, Optional CveCliente As Integer = -1) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Inv_EntregaAlmacenRutaAdd")
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@CveMovimientoAlmacen", SqlDbType.Int).Value = CveMovimientoAlmacen
- .Add("@CveDireccionOrigen", SqlDbType.Int).Value = CveDireccionOrigen
- .Add("@CveDireccionDestino", SqlDbType.Int).Value = CveDireccionDestino
- .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
- .Add("@CveCamion", SqlDbType.Int).Value = CveCamion
- .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
- .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada
- .Add("@Tipo", SqlDbType.VarChar).Value = Tipo
- .Add("@Orden", SqlDbType.Int).Value = Orden
- .Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia
- .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
- .Add("@Estatus", SqlDbType.VarChar).Value = Estatus
- .Add("@Distancia", SqlDbType.Int).Value = Distancia
-
- .Add("@FechaLimite", SqlDbType.DateTime).Value = FechaLimite
-
- .Add("@CveCamionRemolque1", SqlDbType.Int).Value = CveCamionRemolque1
- .Add("@CveCamionRemolque2", SqlDbType.Int).Value = CveCamionRemolque2
- .Add("@CveConfigAutoTransporte", SqlDbType.Int).Value = CveConfigAutoTransporte
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
-
- .Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveMovimientoAlmacen", SqlDbType.Int).Value = CveMovimientoAlmacen
+ .Add("@CveDireccionOrigen", SqlDbType.Int).Value = CveDireccionOrigen
+ .Add("@CveDireccionDestino", SqlDbType.Int).Value = CveDireccionDestino
+ .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
+ .Add("@CveCamion", SqlDbType.Int).Value = CveCamion
+ .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
+ .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada
+ .Add("@Tipo", SqlDbType.VarChar).Value = Tipo
+ .Add("@Orden", SqlDbType.Int).Value = Orden
+ .Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia
+ .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
+ .Add("@Estatus", SqlDbType.VarChar).Value = Estatus
+ .Add("@Distancia", SqlDbType.Int).Value = Distancia
+
+ .Add("@FechaLimite", SqlDbType.DateTime).Value = FechaLimite
+
+ .Add("@CveCamionRemolque1", SqlDbType.Int).Value = CveCamionRemolque1
+ .Add("@CveCamionRemolque2", SqlDbType.Int).Value = CveCamionRemolque2
+ .Add("@CveConfigAutoTransporte", SqlDbType.Int).Value = CveConfigAutoTransporte
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+
+ .Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
- SqlAdapter.Fill(Data)
- Retorno = SqlAdapter.SelectCommand.Parameters("@CveEntregaAlmacen").Value.ToString.ToEntero
+ SqlAdapter.Fill(Data)
+ Retorno = SqlAdapter.SelectCommand.Parameters("@CveEntregaAlmacen").Value.ToString.ToEntero
Catch ex As Exception
OnError("Ocurrió un error al agregar la entrega almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, CveEmpresa As Integer,
- Optional FechaLlegada As DateTime = MinFecha, Optional CveCamionRemolque1 As Integer = -1, Optional CveCamionRemolque2 As Integer = -1, Optional Distancia As Integer = -1,
+ Optional FechaLlegada As DateTime = MinFecha, Optional CveCamionRemolque1 As Integer = -1, Optional CveCamionRemolque2 As Integer = -1, Optional Distancia As Integer = -1,
Optional CveConfigAutoTransporte As Integer = -1, Optional FolioReferencia As String = "-1", Optional Referencia As String = "-1", Optional CveSubProyecto As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
+ Dim Retorno As Boolean = False
DataAdapter("PA_Inv_EntregaAlmacenRutaUpdate")
- With SqlAdapter.SelectCommand.Parameters
-
-
- .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
- .Add("@CveDireccionOrigen", SqlDbType.Int).Value = CveDireccionOrigen
- .Add("@CveDireccionDestino", SqlDbType.Int).Value = CveDireccionDestino
- .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
- .Add("@CveCamion", SqlDbType.Int).Value = CveCamion
- .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
-
- .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada
- .Add("@CveCamionRemolque1", SqlDbType.Int).Value = CveCamionRemolque1
- .Add("@CveCamionRemolque2", SqlDbType.Int).Value = CveCamionRemolque2
- .Add("@Distancia", SqlDbType.Int).Value = Distancia
- .Add("@CveConfigAutoTransporte", SqlDbType.Int).Value = CveConfigAutoTransporte
- .Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia
- .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
-
+ With SqlAdapter.SelectCommand.Parameters
+
+
+ .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
+ .Add("@CveDireccionOrigen", SqlDbType.Int).Value = CveDireccionOrigen
+ .Add("@CveDireccionDestino", SqlDbType.Int).Value = CveDireccionDestino
+ .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
+ .Add("@CveCamion", SqlDbType.Int).Value = CveCamion
+ .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada
+ .Add("@CveCamionRemolque1", SqlDbType.Int).Value = CveCamionRemolque1
+ .Add("@CveCamionRemolque2", SqlDbType.Int).Value = CveCamionRemolque2
+ .Add("@Distancia", SqlDbType.Int).Value = Distancia
+ .Add("@CveConfigAutoTransporte", SqlDbType.Int).Value = CveConfigAutoTransporte
+ .Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia
+ .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+
End With
Try
- SqlAdapter.Fill(Data)
- Retorno = True
+ SqlAdapter.Fill(Data)
+ Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la entrega almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
+ End Function
+
Public Function AsignaEntregaAlmacenRuta(CveCamion As Integer, CveChofer As Integer, FechaEntrega As Date, FechaLlegada As DateTime, CveEntregaAlmacen As Integer, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
+ Dim Retorno As Boolean = False
DataAdapter("PA_Inv_EntregaAlmacenRutaAsignar")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveCamion", SqlDbType.Int).Value = CveCamion
- .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
- .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
- .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada
- .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
-
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCamion", SqlDbType.Int).Value = CveCamion
+ .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
+ .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
+ .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada
+ .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
End With
Try
- SqlAdapter.Fill(Data)
- Retorno = True
+ SqlAdapter.Fill(Data)
+ Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la entrega almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
- Public Function GetInvEntregaAlmacenRuta(CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Opcion As Integer, Optional Estatus As Integer = -1) As Boolean
-
- Dim Retorno As Boolean = False
-
+ End Function
+
+ Public Function GetInvEntregaAlmacenRuta(CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Opcion As Integer, Optional Estatus As Integer = -1) As Boolean
+
+ Dim Retorno As Boolean = False
+
DataAdapter("PA_Inv_EntregaAlmacenRutaGet")
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
- .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@Opcion", SqlDbType.Int).Value = Opcion
- .Add("@Estatus", SqlDbType.Int).Value = Estatus
-
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Opcion", SqlDbType.Int).Value = Opcion
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
+
End With
Try
- SqlAdapter.Fill(Data)
- Retorno = True
+ SqlAdapter.Fill(Data)
+ Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las entregas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
-
- Public Function RemoveInvEntregaAlmacenRuta(CveEntregaAlmacen As Integer, CveEmpresa As Integer) As Boolean
-
- Dim Retorno As Boolean = False
-
+ End Function
+
+
+
+ Public Function RemoveInvEntregaAlmacenRuta(CveEntregaAlmacen As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
DataAdapter("PA_Inv_EntregaAlmacenRutaRemove")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
- SqlAdapter.Fill(Data)
- Retorno = True
+ SqlAdapter.Fill(Data)
+ Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar la entregas o Recolección", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
- Public Function GetInvEntregaAlmacenRutaRep(CveSubProyecto As Integer, CveEmpresa As Integer, Estatus As Integer, FechaInicio As Date, FechaFin As Date, CveChofer As Integer, CveUsuario As Integer, Optional CveTimbre As Integer = -1) As Boolean
-
- Dim Retorno As Boolean = False
-
+ End Function
+
+
+ Public Function GetInvEntregaAlmacenRutaRep(CveSubProyecto As Integer, CveEmpresa As Integer, Estatus As Integer, FechaInicio As Date, FechaFin As Date, CveChofer As Integer, CveUsuario As Integer, Optional CveTimbre As Integer = -1) As Boolean
+
+ Dim Retorno As Boolean = False
+
DataAdapter("PA_Inv_EntregaAlmacenRutaRepGet2")
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@Estatus", SqlDbType.Int).Value = Estatus
- .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
- .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
- .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
- .Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
+ .Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
- SqlAdapter.Fill(Data)
- Retorno = True
+ SqlAdapter.Fill(Data)
+ Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las entregas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
-
- Public Function AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, CveUsuario As Integer, Optional PesoKg As Decimal = -1D) As Boolean
-
-
- Dim Retorno As Boolean = False
-
+ End Function
+
+
+
+ Public Function AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, CveUsuario As Integer, Optional PesoKg As Decimal = -1D) As Boolean
+
+
+ Dim Retorno As Boolean = False
+
DataAdapter("PA_Inv_EntregaAlmacenRutaDetalleAdd")
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@Cantidad", SqlDbType.Float).Value = Cantidad
- .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@PesoKg", SqlDbType.SmallMoney).Value = PesoKg
-
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@Cantidad", SqlDbType.Float).Value = Cantidad
+ .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@PesoKg", SqlDbType.SmallMoney).Value = PesoKg
+
End With
Try
- SqlAdapter.Fill(Data)
- Retorno = True
+ SqlAdapter.Fill(Data)
+ Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar el detalle de recolección", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
-
- Public Function RemoveEntregaAlmacenRutaDetalle(CveEntregaAlmacenDetalle As Integer) As Boolean
-
-
- Dim Retorno As Boolean = False
-
+ End Function
+
+
+
+ Public Function RemoveEntregaAlmacenRutaDetalle(CveEntregaAlmacenDetalle As Integer) As Boolean
+
+
+ Dim Retorno As Boolean = False
+
DataAdapter("PA_Inv_EntregaAlmacenRutaDetalleRemove")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEntregaAlmacenDetalle", SqlDbType.Int).Value = CveEntregaAlmacenDetalle
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEntregaAlmacenDetalle", SqlDbType.Int).Value = CveEntregaAlmacenDetalle
End With
Try
- SqlAdapter.Fill(Data)
- Retorno = True
+ SqlAdapter.Fill(Data)
+ Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el detalle de recolección", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
- Public Function GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer) As Boolean
-
- Dim Retorno As Boolean = False
-
+ End Function
+
+
+ Public Function GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
DataAdapter("PA_Inv_EntregaAlmacenRutaDetalleGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
End With
Try
- SqlAdapter.Fill(Data)
- Retorno = True
+ SqlAdapter.Fill(Data)
+ Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el detalle de recolección", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
- End Function
-
-
-#End Region
-
-
+ End Function
+
+
+#End Region
+
+
Public Function GetMediosTransporte(CveOrigen As Integer, Estatus As Boolean, CveEmpresa As Integer, CveTipoNomina As Integer, CveSubProyecto As Integer, Tipo As Integer, GPO As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_OrigenGet")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveOrigen", SqlDbType.Int).Value = CveOrigen
- .Add("@Estatus", SqlDbType.Bit).Value = Estatus
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CveTipoNomina", SqlDbType.Int).Value = CveTipoNomina
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@Tipo", SqlDbType.Int).Value = Tipo
- .Add("@GPO", SqlDbType.Int).Value = GPO
+ .Add("@CveOrigen", SqlDbType.Int).Value = CveOrigen
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveTipoNomina", SqlDbType.Int).Value = CveTipoNomina
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@Tipo", SqlDbType.Int).Value = Tipo
+ .Add("@GPO", SqlDbType.Int).Value = GPO
End With
Try
@@ -4212,16 +4216,16 @@ Public Class ClsGenerales
OnError($"Ocurrió un error al obtener los medios de transporte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
- Return Retorno
- End Function
-
+ Return Retorno
+ End Function
+
Public Function GetFolioFechaCancelacion(CveEmpresa As Integer, Tipo As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FolioFechaCancelacionGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@Tipo", SqlDbType.Int).Value = Tipo
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Tipo", SqlDbType.Int).Value = Tipo
End With
Try
@@ -4231,10 +4235,10 @@ Public Class ClsGenerales
OnError($"Ocurrió un error al obtener los datos de fechas de cancelación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
- Return Retorno
- End Function
-
-
+ Return Retorno
+ End Function
+
+
#Region "C I T R I C O S"
Public Function GetTipoOrganicos(Optional CveEmpresa As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -4260,10 +4264,10 @@ Public Class ClsGenerales
DataAdapter("PA_Gral_TipoOrganicosAdd")
With SqlAdapter.SelectCommand.Parameters
- .Add("@TipoOrganico", SqlDbType.VarChar).Value = TipoOrganico
- .Add("@Estatus", SqlDbType.Bit).Value = Estatus
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@TipoOrganico", SqlDbType.VarChar).Value = TipoOrganico
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -4355,10 +4359,10 @@ Public Class ClsGenerales
DataAdapter("PA_Gral_EmpacadosAdd")
With SqlAdapter.SelectCommand.Parameters
- .Add("@TipoEmpacado", SqlDbType.VarChar).Value = TipoEmpacado
- .Add("@Estatus", SqlDbType.Bit).Value = Estatus
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@TipoEmpacado", SqlDbType.VarChar).Value = TipoEmpacado
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -4425,22 +4429,22 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-#End Region
-
+ End Function
+#End Region
+
#Region "IDisposable Support"
-
-
- ' IDisposable
+
+
+ ' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
- If disposing Then
- ' TODO: dispose managed state (managed objects).
- If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
- If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
- If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
- If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
- If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
+ If disposing Then
+ ' TODO: dispose managed state (managed objects).
+ If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
+ If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
+ If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
+ If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
+ If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
End If
@@ -4449,20 +4453,20 @@ Public Class ClsGenerales
' TODO: set large fields to null.
End If
Me.disposedValue = True
- End Sub
-
-
-
- ' This code added by Visual Basic to correctly implement the disposable pattern.
+ End Sub
+
+
+
+ ' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
ConexionClose()
Dispose(True)
GC.SuppressFinalize(Me)
- End Sub
-#End Region
-
-
+ End Sub
+#End Region
+
+
End Class
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index acfd001cb..8da82fc41 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -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,
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 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
DataAdapter("PA_Inv_CamionesAdd")
@@ -5657,6 +5657,7 @@ Public Class ClsInventarios
.Add("@CAAT", SqlDbType.VarChar).Value = CAAT
.Add("@NumeroTrailer", SqlDbType.VarChar).Value = NumeroTrailer
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
End With
Try
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,
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 = "",
- 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
DataAdapter("PA_Inv_CamionesUpdate")
With SqlAdapter.SelectCommand.Parameters
@@ -5717,6 +5718,7 @@ Public Class ClsInventarios
.Add("@CAAT", SqlDbType.VarChar).Value = CAAT
.Add("@NumeroTrailer", SqlDbType.VarChar).Value = NumeroTrailer
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb
index d1728e4ba..d0cf74241 100644
--- a/App_Code/ClsNominas.vb
+++ b/App_Code/ClsNominas.vb
@@ -609,6 +609,24 @@ Public Class ClsNominas
End Try
Return retorno
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
Dim retorno As Boolean = False
DataAdapter("PA_Nom_Dispersionnomina", CommandType.StoredProcedure)
@@ -2294,7 +2312,26 @@ Public Class ClsNominas
End Function
#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
DataAdapter("PA_Nom_ValidaFechaFinPersonal")
With SqlAdapter.SelectCommand.Parameters
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index d137c079e..d1ba33607 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -542,10 +542,17 @@ Public Class ClsPaginas
End Property
Property GlobalDTNomConceptosFunciones() As DataTable
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
Set(value As DataTable)
- Application("GlobalDTNomConceptosFunciones") = value
+ Dim AppNombre As String = "GlobalDTNomConceptosFunciones"
+ HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTUsuarioResponsable(CveEmpresa As Integer) As DataTable
@@ -697,18 +704,32 @@ Public Class ClsPaginas
End Property
Property GlobalDTNomSatBancos() As DataTable
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
- Set(ByVal value As DataTable)
- Application("GlobalDTNomSatBancos") = value
+ Set(value As DataTable)
+ Dim AppNombre As String = "GlobalDTNomSatBancos"
+ HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTNomSatConceptos() As DataTable
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
- Set(ByVal value As DataTable)
- Application("GlobalDTNomSatConceptos") = value
+ Set(value As DataTable)
+ Dim AppNombre As String = "GlobalDTNomSatConceptos"
+ HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTNomSatRegimenContratacion() As DataTable
@@ -753,18 +774,32 @@ Public Class ClsPaginas
End Property
Property GlobalDTNomSatRiesgoPuesto() As DataTable
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
- Set(ByVal value As DataTable)
- Application("GlobalDTNomSatRiesgoPuesto") = value
+ Set(value As DataTable)
+ Dim AppNombre As String = "GlobalDTNomSatRiesgoPuesto"
+ HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTNomSatTipoIncapacidad() As DataTable
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
- Set(ByVal value As DataTable)
- Application("GlobalDTNomSatTipoIncapacidad") = value
+ Set(value As DataTable)
+ Dim AppNombre As String = "GlobalDTNomSatTipoIncapacidad"
+ HttpContext.Current.Application(AppNombre) = value
End Set
End Property
'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
Get
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
If ObjBancos.GetBancos_TiposCuenta() Then HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados
ObjBancos.Dispose()
@@ -1921,18 +1956,18 @@ Public Class ClsPaginas
'TipoPerioso
Property GlobalDTTipoPeriodo() As DataTable
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()
- If ObjNom.GetTiposPeriodos() Then Application("GlobalDTTipoPeriodo") = ObjNom.DtResultados Else Application("GlobalDTTipoPeriodo") = Nothing
+ If ObjNom.GetTiposPeriodos() Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
-
- GlobalDTTipoPeriodo = DirectCast(Application("GlobalDTTipoPeriodo"), DataTable)
+ GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get
Set(value As DataTable)
-
- Application("GlobalDTTipoPeriodo") = value
+ Dim AppNombre As String = "GlobalDTTipoPeriodo"
+ HttpContext.Current.Application(AppNombre) = value
End Set
End Property
@@ -1940,20 +1975,26 @@ Public Class ClsPaginas
'Periodos
Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable
Get
- Dim Str As New StringBuilder
- If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
- If CveTipoPeriodo <> -1 Then Str.AppendFormat(" {0} CveTipoPeriodo = {1}", If(Str.Length > 0, "AND", ""), CveTipoPeriodo)
- If CvePeriodo <> -1 Then Str.AppendFormat(" {0} CvePeriodo = {1}", If(Str.Length > 0, "AND", ""), CvePeriodo)
- If Str.Length > 0 Then
- Dim Dv As New DataView(DirectCast(Application("GlobalDTNominasPeriodos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
+ Dim AppNombre As String = $"GlobalDTNominasPeriodos-{CveEmpresa}"
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Using ObjNom As New ClsNominas()
+ If ObjNom.GetPeriodos(-1, CveEmpresa, -1, -1, -1, -1) Then Application(AppNombre) = ObjNom.DtResultados
+ End Using
+ 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
Dv.Dispose()
Else
- GlobalDTNominasPeriodos = DirectCast(Application("GlobalDTNominasPeriodos"), DataTable)
+ GlobalDTNominasPeriodos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
- Application("GlobalDTNominasPeriodos") = value
+ Dim AppNombre As String = $"GlobalDTNominasPeriodos-{CveEmpresa}"
+ HttpContext.Current.Application(AppNombre) = value
End Set
End Property
'Fin Periodos
@@ -2283,14 +2324,7 @@ Public Class ClsPaginas
Application(AppNombre) = value
End Set
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
Get
Dim AppNombre As String = "GlobalDTVtaFormaPago"
@@ -3762,7 +3796,7 @@ Public Class ClsPaginas
End Property
#End Region
#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
Dim AppNombre As String = $"GlobalDTCombustibles-{CveEmpresa}"
'sino existe, recarga los datos
diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb
index f8ca5d0f7..466f25b58 100644
--- a/App_Code/ClsRH.vb
+++ b/App_Code/ClsRH.vb
@@ -3568,7 +3568,7 @@ Public Class ClsRH
End Function
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,
- 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
@@ -3590,6 +3590,7 @@ Public Class ClsRH
.Add("@ToleranciaEFalta", SqlDbType.Int).Value = ToleranciaEFalta
.Add("@ToleranciaSRetardo", SqlDbType.Int).Value = ToleranciaSRetardo
.Add("@ToleranciaSFalta", SqlDbType.Int).Value = ToleranciaSFalta
+ .Add("@DiaDescanso", SqlDbType.Int).Value = DiaDescanso
End With
Try
@@ -3609,7 +3610,7 @@ Public Class ClsRH
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,
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
@@ -3631,7 +3632,8 @@ Public Class ClsRH
.Add("@ToleranciaERetardo", SqlDbType.Int).Value = ToleranciaERetardo
.Add("@ToleranciaEFalta", SqlDbType.Int).Value = ToleranciaEFalta
.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
@@ -7441,6 +7443,110 @@ Public Class ClsRH
End Try
Return Retorno
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
Dim Retorno As Boolean = False
Data = New DataTable
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 1dac5ec5c..f62a5b548 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -5599,7 +5599,7 @@ Public Class ClsVentas
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
DataAdapter("PA_Vta_LineasAdicionalesSaldoGet")
@@ -5611,6 +5611,7 @@ Public Class ClsVentas
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@ConSaldo", SqlDbType.Int).Value = ConSaldo
+ .Add("@TipoCambioConsulta", SqlDbType.Decimal).Value = TipoCambioConsulta
.Add("@FechaVencimientoConsulta", SqlDbType.Date).Value = FechaVencimientoConsulta
End With
Try
diff --git a/App_Code/SqlServerTypes/Loader.cs b/App_Code/SqlServerTypes/Loader.cs
deleted file mode 100644
index ce606cf2e..000000000
--- a/App_Code/SqlServerTypes/Loader.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-
-namespace SqlServerTypes
-{
- ///
- /// Utility methods related to CLR Types for SQL Server
- ///
- public class Utilities
- {
- [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- private static extern IntPtr LoadLibrary(string libname);
-
- ///
- /// Loads the required native assemblies for the current architecture (x86 or x64)
- ///
- ///
- /// Root path of the current application. Use Server.MapPath(".") for ASP.NET applications
- /// and AppDomain.CurrentDomain.BaseDirectory for desktop applications.
- ///
- 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()));
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx
index dbca48046..0bfb003be 100644
--- a/Ashx/E141.ashx
+++ b/Ashx/E141.ashx
@@ -102,12 +102,17 @@ Public Class E141 : Implements IHttpHandler
'DESCARGA DEL PDF
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
Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
diff --git a/Bancos/ConciliacionesBancarias.aspx b/Bancos/ConciliacionesBancarias.aspx
index 39a3e738f..f3eb42492 100644
--- a/Bancos/ConciliacionesBancarias.aspx
+++ b/Bancos/ConciliacionesBancarias.aspx
@@ -396,10 +396,10 @@
-
Fecha Desconciliado:
-
-
-
+
Fecha Desconciliado:
+
+
+
@@ -408,7 +408,9 @@
-
+
+
+
@@ -1033,10 +1025,7 @@
-
-
-
-
+
@@ -1053,9 +1042,7 @@
-
-
-
+
@@ -1421,16 +1408,8 @@
-
- <%--
-
-
-
- --%>
-
-
+
+
@@ -1439,9 +1418,9 @@
-
+
-
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 5e3f93992..c28aae75d 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -1218,16 +1218,16 @@ Partial Class Bancos_IE
UpCancelacion.Update()
'OTROS DATOS - DATOS COMPLEMENTO SUSTITUCION
- Dim CveIESustitucion As Integer = ObjIE.DtResultados(0)("CveIESustitucion").ToString.ToEntero
- If CveIESustitucion > 0 Then
- TRComplementoSustitucion.Visible = True
+ 'Dim CveIESustitucion As Integer = ObjIE.DtResultados(0)("CveIESustitucion").ToString.ToEntero
+ 'If CveIESustitucion > 0 Then
+ ' TRComplementoSustitucion.Visible = True
- If ObjIE.GetBancosIE(CveIESustitucion, UsuarioActual.CveEmpresa) And ObjIE.DtResultados.Rows.Count > 0 Then
- ARefIESustitucion.HRef = String.Format("/Bancos/IE.aspx?CveIE={0}", CveIESustitucion)
- ARefIESustitucion.InnerText = ObjIE.Folio
- End If
+ ' If ObjIE.GetBancosIE(CveIESustitucion, UsuarioActual.CveEmpresa) And ObjIE.DtResultados.Rows.Count > 0 Then
+ ' ARefIESustitucion.HRef = String.Format("/Bancos/IE.aspx?CveIE={0}", CveIESustitucion)
+ ' ARefIESustitucion.InnerText = ObjIE.Folio
+ ' End If
- End If
+ 'End If
'DETALLES - MOVIMIENTOS
@@ -2506,25 +2506,16 @@ Partial Class Bancos_IE
End If
Dep.Dispose()
-
-
-
If CveOCSolicitudAnticipo > 0 Then
-
-
-
-
Dim ObjOC As New ClsOC
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
SaldoOCAnticipo = 0
End If
ObjOC.Dispose()
Dim ImporteComparacion As Decimal = TxtImporte.Text.ToDecimal
-
- '
If ChkPagarPesos.Checked Then
ImporteComparacion = ImporteOriginalDolaras
End If
@@ -5700,44 +5691,32 @@ Partial Class Bancos_IE
If Tipo = "Abono" Then
If ObjBancos.GetVincularPago(CveProveedor, CveCompra, 2, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, CveIE) Then
-
GvComplementoPagos.DataSource = ObjBancos.DtResultados
-
-
Else
GvComplementoPagos.DataSource = Nothing
End If
-
GvComplementoPagos.Columns(7).Visible = False
Else
If CveIE > 0 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
DVGenerarComplementoModal.Visible = True
End If
-
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
+ GvComplementoPagos.Columns(7).Visible = True
+ If UsuarioActual.TienePermisoProceso(85) Then GvComplementoPagos.Columns(8).Visible = True
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"})
- '"CveComplementoPago","FolioFiscal","Folio","SerieFolio","FechaComplemento","Importe","RFCReceptor","StrEstatus","FechaCancelacion","Tipo,Estatus","CveIE","CvePAC"
-
End If
End If
- GvComplementoPagos.Columns(7).Visible = True
End If
ObjBancos.Dispose()
GvComplementoPagos.DataBind()
UpComplementoPagos.Update()
-
-
UpEliminarCotizacion.Update() 'Esto se ocupa para mostrar DVmotivoCancelacion
'ObjBancos.Dispose()
@@ -5939,7 +5918,7 @@ Partial Class Bancos_IE
End Sub
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
'UpDesconciliar.Update()
'RegistraScript("$('#DModalDesconciliar').modal()")
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb
index a6e121345..2cdd0c17f 100644
--- a/Bancos/ProveedoresAbonar.aspx.vb
+++ b/Bancos/ProveedoresAbonar.aspx.vb
@@ -295,7 +295,7 @@ Partial Class Bancos_ProveedoresAbonar
If UsuarioActual.TienePermisoProceso(98) Then
PermiteModificarImporte = False
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
If UsuarioActual.TienePermisoProceso(105) Then
Calendario.StartDate = Now
@@ -898,57 +898,58 @@ Partial Class Bancos_ProveedoresAbonar
Else
Dim ImporteME As Decimal = 0
+ If Pago.CveMonedaPago = 2 Then ImporteME = Pago.ImportePago
If Not UsaComplementariaBancos And Pago.CveMonedaPago = 2 Then
- ImporteME = tImporteMN
- tImporteMN = (tImporteMN * Pago.TCPago).RoundSQL
- End If
+ ImporteME = tImporteMN
+ tImporteMN = (tImporteMN * Pago.TCPago).RoundSQL
+ 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
- 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
+ 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"
+ 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
- '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
-
- If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
+ If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
If ObjMov.ValorPolizaDescuadre > 0 Then
MsgError = ObjMov.MensajePolizaDescuadre + " " + ObjMov.ValorDiferencia
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
RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
- RVTxtFechaDocumentoMenor.MinimumValue = DateTime.Now.AddMonths(-12).ToShortDateString
+ RVTxtFechaDocumentoMenor.MinimumValue = DateTime.Now.AddMonths(-18).ToShortDateString
RVTxtFechaDocumentoMenor.MaximumValue = DateTime.Now.ToShortDateString
Calendario.EndDate = DateTime.Now
diff --git a/CGame/CatHuerta.aspx.cs b/CGame/CatHuerta.aspx.cs
index a1e0fa365..b7ac258f2 100644
--- a/CGame/CatHuerta.aspx.cs
+++ b/CGame/CatHuerta.aspx.cs
@@ -21,17 +21,10 @@
Alert("Tiene que seleccionar un proveedor.");
return;
- }
ClsCGame ObjHuer =new ClsCGame();
bool Continuar = ObjHuer.AddHuerta(TxtHuerhuerta.Text, DdlProveedor.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,DdlTipoCobro.SelectedValue.ToEntero(),TxtImporte.Text.ToDouble(), TxtCostoXTonelada.Text.ToDouble());
ObjHuer.Dispose();
using(ClsClaseBase objclase = new ClsClaseBase())
- {
- objclase.runQuerystr($"PA_CGame_HuertaaBX @CveHuerta={-1},@NombreRegistro='{TxtNombreRegistro.Text}',@NumeroRegistro='{TxtNumeroRegistro.Text}',@CveEmpresa={UsuarioActual.CveEmpresa}");
- }
if(Continuar)
{
RegistraScript("$('#DModalHuerta').modal('hide');");
LimpiaHuerta();
UPModalHuer.Update();
Alert("El Productor se ha agregado");
+ }
ClsCGame ObjHuer =new ClsCGame();
bool Continuar = ObjHuer.AddHuerta(TxtHuerhuerta.Text, DdlProveedor.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,DdlTipoCobro.SelectedValue.ToEntero(),TxtImporte.Text.ToDouble(), TxtCostoXTonelada.Text.ToDouble(), TxtNombreRegistro.Text, TxtNumeroRegistro.Text,ddlOrigen.SelectedValue.ToEntero());
ObjHuer.Dispose();
if(Continuar)
{
RegistraScript("$('#DModalHuerta').modal('hide');");
LimpiaHuerta();
UPModalHuer.Update();
Alert("El Productor se ha agregado");
TxtNombreRegistro.Text = "";
TxtNumeroRegistro.Text = "";
- CargaHuerta();
}
}
protected void BtnHuerEdit_Click(object sender, EventArgs e)
{
ClsCGame ObjHuer =new ClsCGame();
bool Continuar = ObjHuer.UpdateHuerta(CveHuerta, TxtHuerhuerta.Text, DdlProveedor.SelectedValue.ToEntero(), ChkHuerestatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTipoCobro.SelectedValue.ToEntero(), TxtImporte.Text.ToDouble(), TxtCostoXTonelada.Text.ToDouble());
ObjHuer.Dispose();
if(Continuar)
{
- using (ClsClaseBase objclase = new ClsClaseBase())
- {
- objclase.runQuerystr($"PA_CGame_HuertaaBX @CveHuerta={CveHuerta},@NombreRegistro='{TxtNombreRegistro.Text}',@NumeroRegistro='{TxtNumeroRegistro.Text}',@CveEmpresa={UsuarioActual.CveEmpresa}");
- }
RegistraScript("$('#DModalHuerta').modal('hide');");
LimpiaHuerta();
UPModalHuer.Update();
Alert("El Productor se ha actualizado");
+ CargaHuerta();
}
}
protected void BtnHuerEdit_Click(object sender, EventArgs e)
{
ClsCGame ObjHuer =new ClsCGame();
bool Continuar = ObjHuer.UpdateHuerta(CveHuerta, TxtHuerhuerta.Text, DdlProveedor.SelectedValue.ToEntero(), ChkHuerestatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTipoCobro.SelectedValue.ToEntero(), TxtImporte.Text.ToDouble(), TxtCostoXTonelada.Text.ToDouble(), TxtNombreRegistro.Text, TxtNumeroRegistro.Text, ddlOrigen.SelectedValue.ToEntero());
ObjHuer.Dispose();
if(Continuar)
{
RegistraScript("$('#DModalHuerta').modal('hide');");
LimpiaHuerta();
UPModalHuer.Update();
Alert("El Productor se ha actualizado");
TxtNombreRegistro.Text = "";
TxtNumeroRegistro.Text = "";
CargaHuerta();
}
}
protected void LnkEliminarHuer_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
ClsCGame ObjHuer = new ClsCGame();
bool Continuar = ObjHuer.RemoveHuerta(gvRow.DataKey("CveHuerta").ToEntero());
ObjHuer.Dispose();
if(Continuar)
{
CargaHuerta();
Alert("El Productor se ha eliminado");
}
}
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 6815d8f42..c20eb252e 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -8660,246 +8660,255 @@ Partial Class Compras_Compras
ObjConta = New ClsContabilidad(ObjCompra.IniciaTransacSQL)
End If
+ Try
- Dim Contador As Integer = 0
- Dim Importe As Double = 0
- Dim ErrorMovtosCxP As Integer = 0
- Dim Fecha As Date
+ Dim Contador As Integer = 0
+ Dim Importe As Double = 0
+ Dim ErrorMovtosCxP As Integer = 0
+ 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 Math.Round(Importe, 2) - Math.Round(CompraSaldo, 2) > 0.01 Then
- Alert("El Importe seleccionado excede al importe de la compra", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
+ 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
- ArrAnticipos.Clear()
+ 'If TxtFecha.Text.ToDate > Fecha Then Fecha = TxtFecha.Text.ToDate
+ Fecha = TxtFechaEjecucion.Text.ToDate
- If CveCompra > 0 Then
-
- Dim ObjContaAC As ClsContPAQi = Nothing
-
- 'INICIALIZA OBJETOS
- If Not (ObjComprasParametro IsNot Nothing And ObjContaParametro IsNot Nothing) Then
- ObjCompra = New ClsCompras
- ObjConta = New ClsContabilidad(ObjCompra.IniciaTransacSQL)
+ 'Contador = 0
+ If Contador > 0 Then
+ If ListaDocumentos Is Nothing And Not ListaDocumentos.Count > 0 Then
+ If Math.Round(Importe, 2) - Math.Round(CompraSaldo, 2) > 0.01 Then
+ Alert("El Importe seleccionado excede al importe de la compra", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
End If
- Dim CveCompraNC, IdCtaContable, IdCtaContableComp As Integer
- Dim ConceptoPoliza As String = $"Amortización {NombreProveedor} - {TxtSerie.Text}-{TxtFolio.Text}"
+ ArrAnticipos.Clear()
- Try
- Dim CveIE As Integer = -1
+ If CveCompra > 0 Then
- 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 ObjContaAC As ClsContPAQi = Nothing
- 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 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 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
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
- AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePolizaNueva, ObjConta)
- End If
+ 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
- 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
-
+ 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
- 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 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 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()
+ LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
+ LblAplicadoCompraAnt.Text = ImporteAnticipo.FormatoNumero
+ LblSaldoFactura.Text = (TxtTotal.Text.ToDecimal - ImporteAnticipo).ToString.FormatoNumero
+ UpPS.Update()
End If
-
- ObjCompra.Dispose()
-
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAnticipos"))
Else
- 'sino se ha guardado la compra, se registra temporal que anticpos van a cargarle
-
- 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()
+ Alert("No hay movimientos seleccionados para aplicar", TipoMensaje.MsgAdvertencia)
End If
- RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAnticipos"))
- Else
- Alert("No hay movimientos seleccionados para aplicar", TipoMensaje.MsgAdvertencia)
- End If
- UPPAnticiposSel.Update()
+ UPPAnticiposSel.Update()
+
+ Catch ex As Exception
+ ObjCompra.RollBack()
+ ObjCompra.Dispose()
+ End Try
End Sub
@@ -9355,7 +9364,7 @@ Partial Class Compras_Compras
Dim CvePersonal As Integer = 0
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
Cont = Cont + 1
diff --git a/Global.asax b/Global.asax
index bc5c46baa..20ec55d31 100644
--- a/Global.asax
+++ b/Global.asax
@@ -82,23 +82,23 @@
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
- Using ObjNom As New ClsNominas()
- '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.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.GetBancos Then Application("GlobalDTNomSatBancos") = ObjNom.DtResultados Else Application("GlobalDTNomSatBancos") = 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.GetRiesgoPuesto Then Application("GlobalDTNomSatRiesgoPuesto") = ObjNom.DtResultados Else Application("GlobalDTNomSatRiesgoPuesto") = Nothing
- If ObjNom.GetTipoIncapacidad Then Application("GlobalDTNomSatTipoIncapacidad") = ObjNom.DtResultados Else Application("GlobalDTNomSatTipoIncapacidad") = Nothing
- End Using
+ 'Using ObjNom As New ClsNominas()
+ ' '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.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.GetBancos Then Application("GlobalDTNomSatBancos") = ObjNom.DtResultados Else Application("GlobalDTNomSatBancos") = 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.GetRiesgoPuesto Then Application("GlobalDTNomSatRiesgoPuesto") = ObjNom.DtResultados Else Application("GlobalDTNomSatRiesgoPuesto") = Nothing
+ ' 'If ObjNom.GetTipoIncapacidad Then Application("GlobalDTNomSatTipoIncapacidad") = ObjNom.DtResultados Else Application("GlobalDTNomSatTipoIncapacidad") = Nothing
+ '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 ----------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
diff --git a/Inventarios/CatUnidades.aspx.vb b/Inventarios/CatUnidades.aspx.vb
index 245342d76..f2c2a8f17 100644
--- a/Inventarios/CatUnidades.aspx.vb
+++ b/Inventarios/CatUnidades.aspx.vb
@@ -207,18 +207,15 @@ Partial Class Inventarios_CatUnidades
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,
- 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")
Else
ErrorPrceso = True
End If
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,
- 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")
- Using objbase = New ClsClaseBase()
- objbase.runQuerystr(String.Format("UPDATE Inv_Camiones SET CveProveedor={1} WHERE CveCamion={0}", CveCamion, DdlProveedor.SelectedValue))
- End Using
Else
ErrorPrceso = True
End If
diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb
index c011b8eb8..6df9bc9c2 100644
--- a/Inventarios/EntregaAlmacen.aspx.vb
+++ b/Inventarios/EntregaAlmacen.aspx.vb
@@ -2406,7 +2406,7 @@ Partial Class Inventarios_EntregaAlmacen
End If
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
For Each RowGarantia As DataRow In DtGarantias.Rows
diff --git a/Nomina/Aguinaldo.aspx.cs b/Nomina/Aguinaldo.aspx.cs
index bfca04cea..b839c9955 100644
--- a/Nomina/Aguinaldo.aspx.cs
+++ b/Nomina/Aguinaldo.aspx.cs
@@ -53,14 +53,12 @@ public partial class Nomina_Aguinaldo : ClsPaginas
LtlUma.Text = "";
int cveempresa = 1;
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 = objbase.DtResultados.Rows[0]["UMA"].ToString();
- }
+ LtlUma.Text = onom.DtResultados.Rows[0]["UMA"].ToString();
}
}
}
@@ -395,7 +393,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
int CvePersonal = 0;
int CveSubProyecto = 0;
StringBuilder str = new StringBuilder();
- using (ClsClaseBaseD objbase = new ClsClaseBaseD())
+ using (ClsNominas objbase = new ClsNominas())
{
foreach (GridViewRow gvrow in GVCalcularAguinaldo.Rows)
@@ -433,10 +431,11 @@ public partial class Nomina_Aguinaldo : ClsPaginas
{
FraccionI = (aguinaldogravado / diasanio) * diasmes;
FraccionII_1 = salariomensual + FraccionI;
- str.Clear();
- 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);
- if (objbase.runQuerystr(str.ToString()))
+ //str.Clear();
+ //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);
+ //if (objbase.runQuerystr(str.ToString()))
+ if(objbase.CalculosISRAguinaldo(FraccionII_1, salariomensual, diasmes, DdlEjercicios.SelectedValue))
{
DataRow drow = objbase.DtResultados.Rows[0];
FraccionII_2 = drow["isrFraccionII_2"].ToString().ToDecimal();
@@ -658,340 +657,3 @@ public partial class Nomina_Aguinaldo : ClsPaginas
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 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 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; }
-//}
diff --git a/Nomina/CatPeriodos.aspx.vb b/Nomina/CatPeriodos.aspx.vb
index bef041ae4..7e070c3b3 100644
--- a/Nomina/CatPeriodos.aspx.vb
+++ b/Nomina/CatPeriodos.aspx.vb
@@ -41,7 +41,6 @@ Partial Class Nomina_CatPeriodos
Dim ObjNom_Periodos As New ClsNominas
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)
- GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados
Else
Me.GvDatos.DataSource = Nothing
@@ -153,7 +152,7 @@ Partial Class Nomina_CatPeriodos
If ObjNom_Periodos.RemovePeriodo(GvDatos.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then
GvDatos.EditIndex = -1
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)
End If
@@ -265,7 +264,7 @@ Partial Class Nomina_CatPeriodos
Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados
+ GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
CargaDatos()
If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
CargaGrid(ViewState("Orden").ToString())
@@ -281,7 +280,7 @@ Partial Class Nomina_CatPeriodos
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados
+ GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
CargaDatos()
If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
CargaGrid(ViewState("Orden").ToString())
diff --git a/Nomina/ChecadorAsistencia.aspx.cs b/Nomina/ChecadorAsistencia.aspx.cs
index aabb4eaa7..253164b70 100644
--- a/Nomina/ChecadorAsistencia.aspx.cs
+++ b/Nomina/ChecadorAsistencia.aspx.cs
@@ -423,15 +423,9 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
if (continuar)
{
- using (ClsClaseBase objbase = new ClsClaseBase())
+ using (ClsGenerales objbase = new ClsGenerales())
{
- /*
-
- 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));
+ 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");
}
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();
List registros = new List();
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)
@@ -522,11 +516,10 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
obj.Motivo = TxtMotivo.Text.Trim();
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.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));
-
+ objbase.AsistenciaDetTurnoUp(CveAsistenciaDetalle, Fecha, CveTurnoNEW, CveTurno, CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
+
}
}
if (obj.Motivo.Length == 0 && CveAsistenciasInasistencias != obj.CveAsistenciasInasistencias)
diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs
index d5e0217fb..ed4d5bb5b 100644
--- a/Nomina/Nomina.aspx.cs
+++ b/Nomina/Nomina.aspx.cs
@@ -941,7 +941,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
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);
}
UpDatos.Update();
@@ -1507,7 +1507,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
byte[] pdf = GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta);
if (pdf != null)
{
- List objarch = new List();
+ List objarch = new List();
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);
if (pdf != null)
{
- List objarch = new List();
+ List objarch = new List();
using (ClsNominas ObjNomina = new ClsNominas())
{
@@ -2335,12 +2335,11 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
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)
{
decimal UMA = 96.22M;
-
- using (ClsClaseBase objbase = new ClsClaseBase())
+ using (ClsNominas onom = new ClsNominas())
{
- 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 = objbase.DtResultados.Rows[0]["UMA"].ToString().ToDecimal();
- }
+ UMA = onom.DtResultados.Rows[0]["UMA"].ToString().ToDecimal();
}
}
TxtCCSysUMA.Text = $"{UMA:N2}";
diff --git a/RH/ActualizacionMasiva.aspx.vb b/RH/ActualizacionMasiva.aspx.vb
index 31871c530..2e455ab81 100644
--- a/RH/ActualizacionMasiva.aspx.vb
+++ b/RH/ActualizacionMasiva.aspx.vb
@@ -103,11 +103,9 @@ Partial Class RH_ActualizacionMasiva
End Sub
Private Sub CargaSuperioresOrganigrama()
- Using objbase As New ClsClaseBase
- 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
+ Using objbase As New ClsRH()
+ If (objbase.SupervisorOrganigramaGet(UsuarioActual.CveEmpresa)) Then
DdlSupervisor.DataSource = objbase.DtResultados
-
End If
End Using
Dim ObjRH As New ClsRH
diff --git a/RH/Asistencias.aspx.vb b/RH/Asistencias.aspx.vb
index efea4804b..62bdc408a 100644
--- a/RH/Asistencias.aspx.vb
+++ b/RH/Asistencias.aspx.vb
@@ -34,18 +34,14 @@ Partial Class RH_Asistencias
' Alert("Ocurrió un error al cargar el catálogo de Jefes Inmediatos")
'End If
'ObjRH.Dispose()
-
- Using objbase As New ClsClaseBase
- 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
+ Using objbase As New ClsRH()
+ If (objbase.SupervisorOrganigramaGet(UsuarioActual.CveEmpresa)) Then
DdlSupervisorOrganigrama.DataSource = objbase.DtResultados
-
+ DdlSupervisorOrganigrama.DataBind()
End If
End Using
- If DdlSupervisorOrganigrama.DataSource IsNot Nothing Then
- DdlSupervisorOrganigrama.DataBind()
- End If
+
End Sub
#End Region
Private Sub CargaClientes()
diff --git a/RH/CalculoSBC.aspx.cs b/RH/CalculoSBC.aspx.cs
index 0f2a316f1..d031bbd75 100644
--- a/RH/CalculoSBC.aspx.cs
+++ b/RH/CalculoSBC.aspx.cs
@@ -543,8 +543,7 @@ public partial class RH_CalculoSBC : ClsPaginas
DataTable DTEXcel = Extensiones.ModExtensiones.ReadExcelFile(fileItem.FileUrl, true);
StringBuilder str = new StringBuilder();
- //bool rollback = false;
- using (ClsClaseBase objNomina = new ClsClaseBase())
+ //bool rollback = false;
using (ClsRH objpersonal = new ClsRH())
{
@@ -567,7 +566,7 @@ public partial class RH_CalculoSBC : ClsPaginas
}
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();
//bool rollback = false;
- using (ClsClaseBase objNomina = new ClsClaseBase())
using (ClsRH objpersonal = new ClsRH())
{
@@ -607,7 +605,7 @@ public partial class RH_CalculoSBC : ClsPaginas
}
if (CvePersonal > 0)
{
- objNomina.runQuerystr(string.Format("EXEC PA_RH_PersonalTSUpdate {0},'{1}'", CvePersonal, TipodeSalario));
+ objpersonal.PersonalTSUpdate(CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TipodeSalario);
}
}
diff --git a/RH/CatTurno.aspx b/RH/CatTurno.aspx
index cbd930149..7ce26474e 100644
--- a/RH/CatTurno.aspx
+++ b/RH/CatTurno.aspx
@@ -42,12 +42,12 @@
diff --git a/RH/CatTurno.aspx.vb b/RH/CatTurno.aspx.vb
index 7fe9ebd7a..7ce3a67b0 100644
--- a/RH/CatTurno.aspx.vb
+++ b/RH/CatTurno.aspx.vb
@@ -42,14 +42,14 @@ Partial Class RH_CatTurno
If ChkEstatus.Checked Then Estatus = True
If HdnModalidad.Value = "A" Then
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()
CargaGlobalDTTurno()
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf HdnModalidad.Value = "U" Then
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()
CargaGlobalDTTurno()
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
@@ -80,7 +80,7 @@ Partial Class RH_CatTurno
chkComida.Checked = (GvRow.DataKey("Comida") = "1")
TxtComidade.Text = GvRow.DataKey("ComidaDe")
TxtComidaA.Text = GvRow.DataKey("ComidaA")
-
+ ddlDiaDescanso.SelectedValueExist(GvRow.DataKey("DiaDescanso"))
UpAddTurno.Update()
@@ -100,6 +100,7 @@ Partial Class RH_CatTurno
TxtRetardo.Text = "15"
TxtFretardo.Text = "30"
TxtFsalida.Text = "15"
+ ddlDiaDescanso.SelectedValueExist("-1")
CargaDdlChecadorHorario()
ChkEstatus.Checked = True
UpAddTurno.Update()
diff --git a/RH/ChecadorAsistencia.aspx.cs b/RH/ChecadorAsistencia.aspx.cs
index d943312fc..88c044743 100644
--- a/RH/ChecadorAsistencia.aspx.cs
+++ b/RH/ChecadorAsistencia.aspx.cs
@@ -11,12 +11,12 @@ public partial class RH_ChecadorAsistencia : System.Web.UI.Page
{
if (!IsPostBack)
{
- using(ClsClaseBase objbase = new ClsClaseBase())
+ using(ClsRH objbase = new ClsRH())
{
try
{
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.DataBind();
diff --git a/RH/Personal.aspx b/RH/Personal.aspx
index 2caedee11..30f82a627 100644
--- a/RH/Personal.aspx
+++ b/RH/Personal.aspx
@@ -769,7 +769,7 @@
@@ -778,12 +778,12 @@
-
+
-
+
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb
index a49bf4056..bc97f13a3 100644
--- a/RH/Personal.aspx.vb
+++ b/RH/Personal.aspx.vb
@@ -1968,8 +1968,8 @@ Partial Class RH_Personal
-1, "-1",
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,
- DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtTelefonoEmergencia.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, TxtCredencialElector.Text.Trim,
- TxtCURP.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(),
+ DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtTelefonoEmergencia.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, TxtCURP.Text.Trim, TxtCredencialElector.Text.Trim,
+ TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(),
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,
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
If CvePersonal > 0 Then
- Dim strquery As String = String.Format("UPDATE RH_Personal SET CveEstadoDomicilio = {2},CiudadOrigen ='{3}' WHERE CvePersonal ={1} AND CveEmpresa = {0} ",
- UsuarioActual.CveEmpresa, CvePersonal, DdlEstadosDomicilio.SelectedValue.ToEntero(), TxtCiudadOrigen.Text)
- Using objbase As New ClsClaseBase
- If (objbase.runQuerystr(strquery)) Then
+ Using objbase As New ClsRH
+ If (objbase.PersonalDomUp(DdlEstadosDomicilio.SelectedValue.ToEntero(), TxtCiudadOrigen.Text, CvePersonal, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
End If
End Using
CargaDatos()
@@ -7041,16 +7039,13 @@ Partial Class RH_Personal
Protected Sub LnkDAltas_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CvePersonalAltas = GvRow.DataKey("CvePersonalAltas").ToEntero()
- Dim strquery As String = String.Format("DELETE [RH_PersonalAltas] WHERE CvePersonalAltas ={0} AND [CvePersonal] ={1}", CvePersonalAltas, CvePersonal)
- Using objbase As New ClsClaseBase
- If (objbase.runQuerystr(strquery)) Then
- Using objrh As New ClsRH()
- If objrh.GetPersonalAltas(CvePersonal) Then
- GvPersonalAltas.DataSource = objrh.DtResultados
- GvPersonalAltas.DataBind()
- UpDatos.Update()
- End If
- End Using
+ Using objrh As New ClsRH()
+ If (objrh.PersonalAltasRemove(CvePersonalAltas, CvePersonal, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
+ If objrh.GetPersonalAltas(CvePersonal) Then
+ GvPersonalAltas.DataSource = objrh.DtResultados
+ GvPersonalAltas.DataBind()
+ UpDatos.Update()
+ End If
Alert("Alta eliminada")
End If
End Using
@@ -7066,16 +7061,13 @@ Partial Class RH_Personal
strfin = String.Format(",[FechaFin]='{0:yyyy-MM-dd}'", fechafin)
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 objbase As New ClsClaseBase
- If (objbase.runQuerystr(strquery)) Then
- Using objrh As New ClsRH()
- If objrh.GetPersonalAltas(CvePersonal) Then
- GvPersonalAltas.DataSource = objrh.DtResultados
- GvPersonalAltas.DataBind()
- UpDatos.Update()
- End If
- End Using
+ Using objrh As New ClsRH()
+ If (objrh.PersonalAltasUpFechas(CvePersonalAltas, TxtFechaInicioUA.Text.ToDateTime().ToString("yyyy-MM-dd"), strfin, CvePersonal, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
+ If objrh.GetPersonalAltas(CvePersonal) Then
+ GvPersonalAltas.DataSource = objrh.DtResultados
+ GvPersonalAltas.DataBind()
+ UpDatos.Update()
+ End If
Alert("Alta actualizada")
End If
End Using
@@ -7535,8 +7527,8 @@ Partial Class RH_Personal
Dim vacacionesyprima As String = ""
Dim Utilidades As String = ""
Dim strquery As String = String.Format("EXEC PA_Agro_ValidacionNomGet @CveValidacionNomina=-1,@CveEmpresa ={0} ", UsuarioActual.CveEmpresa)
- Using objbase As New ClsClaseBase
- If (objbase.runQuerystr(strquery)) Then
+ Using objbase As New ClsNominas()
+ If (objbase.AgroValidacionNomGet(-1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
Dim dbrow As DataRow
dbrow = objbase.DtResultados.FiltroPrimero("CveValidacionNomina =4")
If Not IsNothing(dbrow) Then
diff --git a/Sistemas/CatRoles.aspx.vb b/Sistemas/CatRoles.aspx.vb
index 06391880a..679ff144d 100644
--- a/Sistemas/CatRoles.aspx.vb
+++ b/Sistemas/CatRoles.aspx.vb
@@ -148,6 +148,8 @@ Partial Class CatRoles
Next
Roles.Dispose()
RegistraScript("$('#DivPermisos').modal('hide');")
+
+ RecargaGlobal()
End Sub
Protected Sub BtnGuardaProcesos_Click(sender As Object, e As EventArgs) Handles BtnGuardaProcesos.Click
@@ -157,6 +159,8 @@ Partial Class CatRoles
Next
Roles.Dispose()
RegistraScript("$('#DivProcesos').modal('hide');")
+
+ RecargaGlobal()
End Sub
#Region "G V D A T O S"
@@ -176,6 +180,12 @@ Partial Class CatRoles
End If
Rol.Dispose()
CargaDatos()
+
+ RecargaGlobal()
+ End Sub
+
+ Private Sub RecargaGlobal()
+ GlobalDTRoles(UsuarioActual.CveEmpresa) = Nothing
End Sub
diff --git a/Sistemas/RolesDetalle.aspx.vb b/Sistemas/RolesDetalle.aspx.vb
index 805e69fc1..a02db40ef 100644
--- a/Sistemas/RolesDetalle.aspx.vb
+++ b/Sistemas/RolesDetalle.aspx.vb
@@ -229,10 +229,14 @@ Partial Class Sistemas_RolesDetalle
End If
ObjEmpresa.Dispose()
+
+ RecargaGlobal()
End Sub
-
+ Private Sub RecargaGlobal()
+ GlobalDTRoles(UsuarioActual.CveEmpresa) = Nothing
+ End Sub
End Class
diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx
index 5d60ca69c..5c97355a1 100644
--- a/Ventas/PV.aspx
+++ b/Ventas/PV.aspx
@@ -3141,9 +3141,9 @@
-
+
-
+
@@ -3162,7 +3162,7 @@
-
+
@@ -3185,7 +3185,7 @@
-
+
<%-- --%>
<%----%>
<%----%>
diff --git a/Ventas/RepVentaDetalle.aspx.vb b/Ventas/RepVentaDetalle.aspx.vb
index d0b713f61..5eb5470d5 100644
--- a/Ventas/RepVentaDetalle.aspx.vb
+++ b/Ventas/RepVentaDetalle.aspx.vb
@@ -287,17 +287,17 @@ Partial Class RepVentaDetalle
DdlGrupo.DataBind()
End Sub
- Private Sub CargaCombos()
+ Private Sub CargaCombos()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
- CargaClientes()
-
-
- 'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
- txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
-
- 'Vendedor
- DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
+ CargaClientes()
+
+
+ 'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
+ txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
+ txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+
+ 'Vendedor
+ DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Sin Vendedor", "-2"))
@@ -312,7 +312,7 @@ Partial Class RepVentaDetalle
'Carga Clasificacion Cliente
DdlClienteClasificacion.DataSource = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa)
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"))
@@ -342,7 +342,7 @@ Partial Class RepVentaDetalle
End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
- CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
+ CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
End Sub
Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 124bdc6fa..3b43bc738 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -592,6 +592,7 @@
+
@@ -698,7 +699,7 @@
-
+
@@ -728,7 +729,7 @@
Linea Adicional:
-
+
@@ -1719,7 +1720,6 @@
-
@@ -9497,10 +9497,12 @@
step: 30
});
- if(HdnCargarInventario.value == 'True'){
+ if(HdnCargarInventario.value == 'True'){
$("#TabAlmacen_tab .ajax__tab_inner").click(function () {
CargaMovimientosInventario();
});
+ }else {
+ $("#TabAlmacen_tab .ajax__tab_inner").unbind();
}
}
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index e030db63d..2a7068f4b 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2401,6 +2401,7 @@ Partial Class Ventas
ViewState("ClienteRetISR") = 0
ViewState("CvePrecioLista") = 0
ViewState("CvePrecioListaCliente") = 0
+ HdnCargarInventario.Value = "True"
Me.CveVendedorVenta = -1
Me.CveVendedorCliente = -1
Me.CveVendedorClienteSucursal = -1
@@ -2851,8 +2852,7 @@ Partial Class Ventas
'REMOVER EVENTO PARA RECARGAR ALMACEN
HdnCargarInventario.Value = "False"
'spanAlmacen.Attributes.Remove("onclick")
- Tab.ActiveTabIndex = 1
- Updatetabs.Update()
+ UpParametros.Update()
End If
'Modalidad Devoluciones y Refacturacion
@@ -9461,22 +9461,106 @@ Partial Class Ventas
End If
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
- 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
+ If ObjFactura.TipoDocto = "Ing" 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 = 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
+ 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
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
@@ -9484,12 +9568,6 @@ Partial Class Ventas
Exit Sub
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
'If Not CveEmpresaCRM > 0 Then
@@ -14198,14 +14276,26 @@ Partial Class Ventas
End If
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
Exit For
End If
End If
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
Exit For
End If
@@ -14317,7 +14407,12 @@ Partial Class Ventas
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
Exit For
End If
@@ -14526,7 +14621,12 @@ Partial Class Ventas
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
ErrorPrepoliza = True
Exit For
@@ -14647,7 +14747,13 @@ Partial Class Ventas
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
Else
ViewState("SeGuardoPrePoliza") = True
@@ -18806,10 +18912,12 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "PA") AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
DdlLineaAdicional.DataSource = Nothing
+ Dim TCConsulta As Decimal = TxtTipoCambio.Text.ToDecimal()
+
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
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
TrLineaAdicional.Visible = True
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
'SI SE ESTA FACTURANDO UNA REMISION DEBE SELECCIONAR LA LINEA ADICIONAL DE ESTA
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
TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados
End If
End If
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
TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados
@@ -24775,15 +24883,30 @@ Partial Class Ventas
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
TieneAlmacen = True
- If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
- ChkDevAlm.Checked = True
- ChkDevAlm.Enabled = False
- End If
+ ChkDevAlm.Checked = True
+ ChkDevAlm.Enabled = False
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
@@ -32910,9 +33033,9 @@ Partial Class Ventas
'REMOVER EVENTO PARA RECARGAR ALMACEN
'spanAlmacen.Attributes.Remove("onclick")
- Tab.ActiveTabIndex = 1
+
HdnCargarInventario.Value = "False"
- Updatetabs.Update()
+ UpParametros.Update()
UpnTools.Update()
@@ -36441,8 +36564,10 @@ Partial Class Ventas
RBLPago.SelectedValue = "1"
RBLPago.Enabled = False
+ Dim TCConsulta As Decimal = TxtTipoCambio.Text.ToDecimal()
+
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
Dim RowLinea As DataRow = ObjVentas.DtResultados.Rows(0)
If RowLinea IsNot Nothing Then
@@ -36552,16 +36677,36 @@ Partial Class Ventas
Exit Sub
End If
- 'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
- 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
+ Dim TotalDocumento As Decimal = TxtTotal.Text.ToDecimal()
- '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
- 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
@@ -36601,7 +36746,7 @@ Partial Class Ventas
'Tab.ActiveTabIndex = 1
HdnCargarInventario.Value = "False"
'Updatetabs.Update()
- UpINV.Update()
+ UpParametros.Update()
End Sub
Protected Sub LBAplicaDevolucion_Click(sender As Object, e As EventArgs)
diff --git a/asmx/WSGPSApp.asmx b/asmx/WSGPSApp.asmx
index 53f281618..384e3af6b 100644
--- a/asmx/WSGPSApp.asmx
+++ b/asmx/WSGPSApp.asmx
@@ -493,7 +493,7 @@ Public Class WSGPSApp
}
Dim JsonParams = Decripta(p)
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
End If
Catch ex As Exception
@@ -531,11 +531,11 @@ Public Class WSGPSApp
Dim Ent = JsonConvert.DeserializeAnonymousType(JsonParams, Estructura)
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
End If
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
End If
End If