This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2023-03-26 14:51:19 -07:00
25 changed files with 2429 additions and 2254 deletions

View File

@@ -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)

View File

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

View File

@@ -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

View File

@@ -1153,7 +1153,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function MovimientoRemove(CveMovimiento As Integer, CveEmpresa As Integer) As Boolean
Public Function MovimientoRemove(CveMovimiento As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1162,6 +1162,7 @@ Public Class ClsInventarios
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With

View File

@@ -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

View File

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

View File

@@ -102,12 +102,17 @@ Public Class E141 : Implements IHttpHandler
'DESCARGA DEL PDF
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())

View File

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

View File

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

View File

@@ -719,7 +719,10 @@ Partial Class Bancos_Creditos
ErrorCredito = True
End If
If ObjCredito.AddCreditos(TipoCreditoTemp, TxtCSReferencia.Text, TxtCSObservaciones.Text, DdlCuentaCredito.SelectedValue.ToEntero, HdnCveCompra.Value.ToEntero, -1, DdlCSTipoMoneda.SelectedValue.ToEntero, TxtCSFechaInicio.Text.Trim.ToDate, TxtCSFechaVencimiento.Text.Trim.ToDate, TxtCSTasa.Text.Trim.ToDouble, TxtCSSobreTasa.Text.Trim.ToDouble, -1, TxtCSPlazo.Text.ToEntero, CveIE, If(TipoCreditoTemp = 2, TxtCSTotalCredito.Text.ToEntero, TotalCompra), -1, -1, -1, CveProveedor, RBLClasificacionContable.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=DdlTarjetaCredito.SelectedValue.ToEntero, AplicaAnticipo:=If(RBLAnticipo.SelectedValue.ToEntero = 1, True, False)) > 0 Then
If ObjCredito.AddCreditos(TipoCreditoTemp, TxtCSReferencia.Text, TxtCSObservaciones.Text, DdlCuentaCredito.SelectedValue.ToEntero, HdnCveCompra.Value.ToEntero, -1, DdlCSTipoMoneda.SelectedValue.ToEntero, TxtCSFechaInicio.Text.Trim.ToDate,
TxtCSFechaVencimiento.Text.Trim.ToDate, TxtCSTasa.Text.Trim.ToDouble, TxtCSSobreTasa.Text.Trim.ToDouble, -1, TxtCSPlazo.Text.ToEntero, CveIE, If(TipoCreditoTemp = 2, TxtCSTotalCredito.Text.ToEntero, TotalCompra),
-1, -1, -1, CveProveedor, RBLClasificacionContable.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=DdlTarjetaCredito.SelectedValue.ToEntero,
AplicaAnticipo:=If(RBLAnticipo.SelectedValue.ToEntero = 1, True, False)) > 0 Then
'Dim Fecha = If(TipoCreditoTemp = 2, TxtCSFechaDeposito.Text.ToDate, TxtCSFechaVencimiento.Text.ToDate)
'For i = 1 To If(TipoCreditoTemp = 2, TxtCSPeriodos.Text.Trim.ToEntero, 1)
'DateAdd("d", TxtPlazo.Text.ToEntero, Fecha)
@@ -761,7 +764,10 @@ Partial Class Bancos_Creditos
If CveCredito > 0 Then
Dim TipoCreditoTemp = DdlTipoCredito.SelectedValue.ToEntero
If ObjCredito.UpdateCreditos(CveCredito, TipoCreditoTemp, TxtCSReferencia.Text, TxtCSObservaciones.Text, DdlCuentaCredito.SelectedValue.ToEntero, HdnCveCompra.Value.ToEntero, -1, DdlCSTipoMoneda.SelectedValue.ToEntero, TxtCSFechaInicio.Text.Trim.ToDate, TxtCSFechaVencimiento.Text.Trim.ToDate, TxtCSTasa.Text.Trim.ToDouble, TxtCSSobreTasa.Text.Trim.ToDouble, -1, TxtCSPlazo.Text.ToEntero, CveIE, If(TipoCreditoTemp = 2, TxtCSTotalCredito.Text.ToEntero, TotalCompra), -1, -1, -1, -1, RBLClasificacionContable.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=DdlTarjetaCredito.SelectedValue.ToEntero, AplicaAnticipo:=If(RBLAnticipo.SelectedValue.ToEntero = 1, True, False)) Then
If ObjCredito.UpdateCreditos(CveCredito, TipoCreditoTemp, TxtCSReferencia.Text, TxtCSObservaciones.Text, DdlCuentaCredito.SelectedValue.ToEntero, HdnCveCompra.Value.ToEntero, -1, DdlCSTipoMoneda.SelectedValue.ToEntero, TxtCSFechaInicio.Text.Trim.ToDate,
TxtCSFechaVencimiento.Text.Trim.ToDate, TxtCSTasa.Text.Trim.ToDouble, TxtCSSobreTasa.Text.Trim.ToDouble, -1, TxtCSPlazo.Text.ToEntero, CveIE, If(TipoCreditoTemp = 2, TxtCSTotalCredito.Text.ToEntero, TotalCompra),
-1, -1, -1, -1, RBLClasificacionContable.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=DdlTarjetaCredito.SelectedValue.ToEntero,
AplicaAnticipo:=If(RBLAnticipo.SelectedValue.ToEntero = 1, True, False)) Then
If Not ObjCredito.UpdateCreditosDetalle(ObjCredito.CveCredito, TxtCSFechaVencimiento.Text.ToDate, If(TipoCreditoTemp = 2, TxtCSTotalCredito.Text.ToString.ToEntero, TotalCompra), 0.0, 0.0, 0.0, 0.0, 0.0, If(TipoCreditoTemp = 1, 101, 1)) Then
ErrorCredito = True
End If

View File

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

View File

@@ -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
@@ -5691,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()
@@ -5930,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()")

View File

@@ -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

View File

@@ -6331,7 +6331,7 @@ Partial Class Compras_Compras
funcionalidad = 317
ConceptoContable = 243
ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 3 Then
funcionalidad = 349
funcionalidad = 348
ConceptoContable = 327
End If
importeMovimiento = CompraActual.RetISR
@@ -8557,40 +8557,45 @@ Partial Class Compras_Compras
Dim CveMovimientoActual As Integer = diRow("CveMovimiento").ToString.ToEntero
Dim DTMovimientoActual As DataTable = DTInventarios.FiltraParametros($"CveMovimiento = {CveMovimientoActual} ")
Dim detalleDescripcion As String = ""
Dim Description As String = ""
Dim FolioMovimiento As String = ""
Dim ConceptoMovimiento As String = ""
For Each dRowMovActual As DataRow In DTMovimientoActual.Rows
If dRowMovActual("UM").ToString = "" Then
FolioMovimiento = dRowMovActual("Folio").ToString
ConceptoMovimiento = dRowMovActual("Concepto").ToString
Description = String.Format("Eliminación Compra {6},Movimiento con Concepto: {0}, Almacen: {1}, Fecha: {2}, Folio: {3}, Usuario: {4}, Observaciones adicionales: {5}, Productos Información:<br/>",
ConceptoMovimiento,
dRowMovActual("Almacen").ToString,
dRowMovActual("FechaMovto").ToString.ToDate.ToString("dd/MM/yyyy"),
FolioMovimiento,
dRowMovActual("Usuario").ToString,
dRowMovActual("Observaciones").ToString,
$"{TxtSerie.Text}-{TxtFolio.Text}")
Else
detalleDescripcion = String.Format("- Cant: {0}, PS: {1}, PU: {2}, UM: {3}<br/>", dRowMovActual("Cantidad").ToString.ToEntero, dRowMovActual("CodigoPS"), dRowMovActual("PU"), dRowMovActual("UM"))
End If
Next
If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1,
String.Format("{0}, Informacion = {1}", Description, detalleDescripcion),
"Inventarios", FolioMovimiento + " / " + ConceptoMovimiento) Then
If Not ObjInventarios.MovimientoRemove(CveMovimientoActual, UsuarioActual.CveEmpresa, CveUsuario:=UsuarioActual.CveUsuario) Then
ErrorCompra = True
Exit For
End If
'Dim DTMovimientoActual As DataTable = DTInventarios.FiltraParametros($"CveMovimiento = {CveMovimientoActual} ")
'Dim detalleDescripcion As String = ""
'Dim Description As String = ""
'Dim FolioMovimiento As String = ""
'Dim ConceptoMovimiento As String = ""
'For Each dRowMovActual As DataRow In DTMovimientoActual.Rows
' If dRowMovActual("UM").ToString = "" Then
' FolioMovimiento = dRowMovActual("Folio").ToString
' ConceptoMovimiento = dRowMovActual("Concepto").ToString
' Description = String.Format("Eliminación Compra {6},Movimiento con Concepto: {0}, Almacen: {1}, Fecha: {2}, Folio: {3}, Usuario: {4}, Observaciones adicionales: {5}, Productos Información:<br/>",
' ConceptoMovimiento,
' dRowMovActual("Almacen").ToString,
' dRowMovActual("FechaMovto").ToString.ToDate.ToString("dd/MM/yyyy"),
' FolioMovimiento,
' dRowMovActual("Usuario").ToString,
' dRowMovActual("Observaciones").ToString,
' $"{TxtSerie.Text}-{TxtFolio.Text}")
' Else
' detalleDescripcion = String.Format("- Cant: {0}, PS: {1}, PU: {2}, UM: {3}<br/>", dRowMovActual("Cantidad").ToString.ToEntero, dRowMovActual("CodigoPS"), dRowMovActual("PU"), dRowMovActual("UM"))
' End If
'Next
'If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1,
' String.Format("{0}, Informacion = {1}", Description, detalleDescripcion),
' "Inventarios", FolioMovimiento + " / " + ConceptoMovimiento) Then
' ErrorCompra = True
' Exit For
'End If
Next
End If
@@ -8655,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<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ObjCompra.RollBack()
Case 2
Alert("Ocurrió un error al amortizar la nota de crédito<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ObjCompra.RollBack()
Case 3
Alert("Ocurrió un error al contabilizar la la amortizacion del anticipo.", TipoMensaje.MsgAdvertencia)
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IdPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then
If ObjContaAC IsNot Nothing Then
Try
ObjContaAC.RollBack()
Catch ex As Exception
End Try
End If
End If
ObjCompra.RollBack()
End Select
Catch ex As Exception
ObjCompra.RollBack()
End Try
If ObjContaAC IsNot Nothing Then
ObjContaAC.Dispose()
End If
ObjCompra.Dispose()
Else
'sino se ha guardado la compra, se registra temporal que anticpos van a cargarle
For Each gvr As GridViewRow In GVAnticipos.Rows
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<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ObjCompra.RollBack()
Case 2
Alert("Ocurrió un error al amortizar la nota de crédito<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ObjCompra.RollBack()
Case 3
Alert("Ocurrió un error al contabilizar la la amortizacion del anticipo.", TipoMensaje.MsgAdvertencia)
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IdPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then
If ObjContaAC IsNot Nothing Then
Try
ObjContaAC.RollBack()
Catch ex As Exception
End Try
End If
End If
ObjCompra.RollBack()
End Select
Catch ex As Exception
ObjCompra.RollBack()
End Try
If ObjContaAC IsNot Nothing Then
ObjContaAC.Dispose()
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
@@ -9350,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

View File

@@ -162,99 +162,124 @@
</asp:Panel>
<br />
<div class="chequesie" style="width: 700px;" runat="server" id="TableExpedirCheque" visible="false">
<div class="chequesie1">
<div class="row">
<label class="col-md-2 truncate" style="width: 130px;">Tipo Movimiento:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlTipoTransaccion" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" ValidationGroup="GrpGuardar">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoTransaccion" runat="server" ControlToValidate="DdlTipoTransaccion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Movimiento''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETipoTransaccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoTransaccion" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:HiddenField ID="HdnTipoTransaccion" runat="server" Value="" />
</div>
</div>
<div class="row">
<label class="col-md-2" style="width: 130px;">Cuenta:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlCuenta" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" ValidationGroup="GrpGuardar">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCuenta" runat="server" ControlToValidate="DdlCuenta" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-4">
<asp:CheckBox ID="ChkAbonoCuenta" ClientIDMode="Static" runat="server" Text="Abono en Cuenta"></asp:CheckBox>
</div>
</div>
</div>
<div class="chequesie2">
<div class="row">
<div class="col-md-7"></div>
<label class="col-md-2 control-label text-right">Fecha:</label>
<div class="col-md-2">
<div class="input-group input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFechaDocumento" runat="server" CssClass="form-control"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgCalendario" class="btn default"><i class="fa fa-calendar"></i></asp:LinkButton>
</span>
<div class="row" runat="server" id="TableExpedirCheque" visible="false" >
<div class="col-lg-8">
<div class="chequesie" style="width: 700px;" >
<div class="chequesie1">
<div class="row">
<label class="col-md-2 truncate" style="width: 130px;">Tipo Movimiento:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlTipoTransaccion" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" ValidationGroup="GrpGuardar">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoTransaccion" runat="server" ControlToValidate="DdlTipoTransaccion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Movimiento''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETipoTransaccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoTransaccion" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:HiddenField ID="HdnTipoTransaccion" runat="server" Value="" />
</div>
</div>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaDocumento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaDocumento" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVTxtFechaDocumento" runat="server" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a la fecha actual" ControlToValidate="TxtFechaDocumento" MinimumValue="01/01/1900" Type="Date" ValidationGroup="GrpGuardar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento3" runat="server" HighlightCssClass="vco" TargetControlID="RVTxtFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
<div class="row">
<label class="col-md-2" style="width: 130px;">Cuenta:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlCuenta" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" ValidationGroup="GrpGuardar">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCuenta" runat="server" ControlToValidate="DdlCuenta" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-4">
<asp:CheckBox ID="ChkAbonoCuenta" ClientIDMode="Static" runat="server" Text="Abono en Cuenta"></asp:CheckBox>
</div>
</div>
</div>
<div class="chequesie2">
<div class="row">
<div class="col-md-7"></div>
<label class="col-md-2 control-label text-right">Fecha:</label>
<div class="col-md-2">
<div class="input-group input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFechaDocumento" runat="server" CssClass="form-control"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgCalendario" class="btn default"><i class="fa fa-calendar"></i></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaDocumento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaDocumento" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVTxtFechaDocumento" runat="server" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a la fecha actual" ControlToValidate="TxtFechaDocumento" MinimumValue="01/01/1900" Type="Date" ValidationGroup="GrpGuardar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento3" runat="server" HighlightCssClass="vco" TargetControlID="RVTxtFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-2 control-label">Folio:</label>
<div class="col-md-3">
<asp:TextBox ID="TxtFolio" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="110px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFolio" runat="server" ControlToValidate="TxtFolio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFolio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolio" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-2"></div>
<label class="col-md-2 control-label text-right">Importe:</label>
<div class="col-md-2 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtImporte" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="140px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftbe" runat="server" TargetControlID="TxtImporte" FilterType="Custom, Numbers" ValidChars="+-.," />
</div>
</div>
<div class="row">
<label class="col-md-2">
<asp:Label ID="LblPagueseA" runat="server" Text="Abónese a"></asp:Label>:</label>
<div class="col-md-10">
<asp:TextBox CssClass="form-control input-sm" ID="TxtAboneA" runat="server" MaxLength="70" Width="394px"></asp:TextBox>
</div>
</div>
<div class="row">
<label class="col-md-2">Observaciones</label>
<div class="col-md-7">
<asp:TextBox ID="TxtObservaciones" CssClass="form-control input-sm" runat="server" MaxLength="500" Width="400px" Rows="3" TextMode="MultiLine" ClientIDMode="Static"></asp:TextBox>
<asp:HiddenField ID="HdnObs" runat="server" ClientIDMode="Static" />
</div>
</div>
</div>
<div class="row">
<label class="col-md-2 control-label">Folio:</label>
<div class="col-md-3">
<asp:TextBox ID="TxtFolio" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="110px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFolio" runat="server" ControlToValidate="TxtFolio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFolio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolio" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-2"></div>
<label class="col-md-2 control-label text-right">Importe:</label>
<div class="col-md-2 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtImporte" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="140px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftbe" runat="server" TargetControlID="TxtImporte" FilterType="Custom, Numbers" ValidChars="+-.," />
</div>
</div>
<div class="row">
<label class="col-md-2">
<asp:Label ID="LblPagueseA" runat="server" Text="Abónese a"></asp:Label>:</label>
<div class="col-md-10">
<asp:TextBox CssClass="form-control input-sm" ID="TxtAboneA" runat="server" MaxLength="70" Width="394px"></asp:TextBox>
</div>
</div>
<div class="row">
<label class="col-md-2">Observaciones</label>
<div class="col-md-7">
<asp:TextBox ID="TxtObservaciones" CssClass="form-control input-sm" runat="server" MaxLength="500" Width="400px" Rows="3" TextMode="MultiLine" ClientIDMode="Static"></asp:TextBox>
<asp:HiddenField ID="HdnObs" runat="server" ClientIDMode="Static" />
</div>
<div class="col-md-2 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtOtrosImportes" runat="server" ReadOnly="true" CssClass="form-control input-sm" Visible="false" MaxLength="12" Width="140px" placeholder="Otros Importes" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTEOtrosImportes" runat="server" TargetControlID="TxtOtrosImportes" FilterType="Custom, Numbers" ValidChars="+-.," />
<asp:RangeValidator ID="RangeValidator1" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue="0" ErrorMessage="Importe Excedido" ControlToValidate="TxtOtrosImportes" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:RangeValidator>
<asp:TextBox ID="TxtTotal" runat="server" CssClass="form-control input-sm" Visible="false" MaxLength="12" Width="140px" placeholder="Total" Enabled="false" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
</div>
</div>
<div class="row" runat="server" >
<label class="col-md-2" runat="server" id="lblpagocomisiones">Otros Ingresos:</label>
<div class="col-md-3">
<asp:CheckBox ID="ChkAjusteOI" runat="server" AutoPostBack="true" />
<div class="col-md-2 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtOtrosImportes" runat="server" ReadOnly="true" CssClass="form-control input-sm" Visible="false" MaxLength="12" Width="140px" placeholder="Otros Importes" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTEOtrosImportes" runat="server" TargetControlID="TxtOtrosImportes" FilterType="Custom, Numbers" ValidChars="+-.," />
<asp:RangeValidator ID="RangeValidator1" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue="0" ErrorMessage="Importe Excedido" ControlToValidate="TxtOtrosImportes" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:RangeValidator>
<asp:TextBox ID="TxtTotal" runat="server" CssClass="form-control input-sm" Visible="false" MaxLength="12" Width="140px" placeholder="Total" Enabled="false" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
</div>
</div>
<div class="row" runat="server" >
<label class="col-md-2" runat="server" id="lblpagocomisiones">Otros Ingresos:</label>
<div class="col-md-3">
<asp:CheckBox ID="ChkAjusteOI" runat="server" AutoPostBack="true" />
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div>
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</td>

View File

@@ -521,6 +521,17 @@ Partial Class Compras_ReembolsosComprobaciones
Next
Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
Dim filemove As String = ""
Dim Comprobante As String = ""
Dim ComprobanteIE = ""
For Each fileItem As Archivo In filesgral
Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
filemove = fileItem.filename
Next
If HdnCheque.Value.ToEntero > 0 AndAlso Not ChkReembolsarSinBancos.Checked Then
CveIERegistrado = DDlCheques.SelectedValue.ToEntero
@@ -569,14 +580,31 @@ Partial Class Compras_ReembolsosComprobaciones
If ChkChequeExcedente.Checked Then
CvePrePolizaExcedente = ObjMov.AddPrePolizas("Compras/Comprobaciones3", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIEExcedente = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaExcedente, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False))
CveIEExcedente = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaExcedente, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False))
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, If(CveCajaChica > 0, 30, 29), TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEExcedente, CvePersonal:=CvePersonal, CveCompra:=-1, CveProveedor:=-1, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
MsgError = "Error al registrar detalle de concepto bancario"
End If
If CveIEExcedente > 0 Then
If filemove <> "" Then
filemove.FilesMove(CveIEExcedente.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
Anexo.Text = ""
End If
End If
End If
ElseIf Not ChkReembolsarSinBancos.Checked Then
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones4", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIERegistrado = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False))
CveIERegistrado = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaIERegistrado, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False))
If CveIERegistrado > 0 Then
If filemove <> "" Then
filemove.FilesMove(CveIERegistrado.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
Anexo.Text = ""
End If
End If
'AGREGO PREPOLIZA IE BANCOS
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=-1, CveProveedor:=-1, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

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

View File

@@ -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

View File

@@ -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

View File

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

View File

@@ -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)

View File

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

View File

@@ -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)