This commit is contained in:
2025-04-23 08:02:08 -07:00
2 changed files with 37 additions and 2 deletions

View File

@@ -4,7 +4,6 @@
Imports System.Data Imports System.Data
Imports ADSTimbrado Imports ADSTimbrado
Imports Extensiones Imports Extensiones
Imports Org.BouncyCastle.Ocsp
Partial Class Ventas_ClientesAbonar Partial Class Ventas_ClientesAbonar
Inherits ClsPaginas Inherits ClsPaginas
@@ -743,6 +742,36 @@ Partial Class Ventas_ClientesAbonar
Exit Sub Exit Sub
End If End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso RblTipoPago.SelectedValue = "3" Then
Dim DtSaldo As DataTable = Nothing
Dim ObjMovto As New ClsMovimientos
If ObjMovto.GetIngresosSaldosDetalle(CveCliente, -1, UsuarioActual.CveEmpresa) Then
DtSaldo = ObjMovto.DtResultados.FiltraParametros($"CveIE={DdlIngreso.SelectedValue.ToEntero()}")
End If
ObjMovto.Dispose()
If DtSaldo IsNot Nothing AndAlso DtSaldo.Rows.Count = 1 Then
Dim ImporteRef As Decimal = DtSaldo.SUM("Saldo", $"CveIE={DdlIngreso.SelectedValue.ToEntero()}")
Dim ImporteAbonar As Decimal = 0
For Each gvr As GridViewRow In GvCxC.Rows
If gvr.FCCheckBox("Chk").Checked Then
ImporteAbonar += gvr.FCTextBox("TxtAbonar").Text.ToDecimal()
End If
Next
ImporteAbonar += TxtAnticipo.Text.ToDecimal()
If ImporteRef.RoundSQL(2) <> ImporteAbonar.RoundSQL(2) Then
Alert("El importe abonado es diferente al saldo del ingreso", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Else
Alert("No se pudieron validar los saldos", TipoMensaje.MsgError)
Exit Sub
End If
End If
Dim Cuenta As String = "" Dim Cuenta As String = ""
Dim CuentaDeposito As String = "" Dim CuentaDeposito As String = ""

View File

@@ -674,6 +674,12 @@ Partial Class Ventas_PVCobranza
End If End If
Dim tCveCorte As Integer = CveCorte Dim tCveCorte As Integer = CveCorte
If tCveCorte <= 0 Then
Alert("No se puede realizar el pago. Debe tener un corte activo", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero
Dim CveVentaRemision As Integer = -1 Dim CveVentaRemision As Integer = -1
@@ -712,7 +718,7 @@ Partial Class Ventas_PVCobranza
Dim PedidoContrato = DbRowVenta("PedidoContrato").ToString() Dim PedidoContrato = DbRowVenta("PedidoContrato").ToString()
Dim OrdenCompra = DbRowVenta("OrdenCompra").ToString() Dim OrdenCompra = DbRowVenta("OrdenCompra").ToString()
If tCveCorte <= 0 AndAlso DbRowVenta("CveCorte").ToString.ToEntero > 0 Then tCveCorte = DbRowVenta("CveCorte").ToString.ToEntero 'If tCveCorte <= 0 AndAlso DbRowVenta("CveCorte").ToString.ToEntero > 0 Then tCveCorte = DbRowVenta("CveCorte").ToString.ToEntero
Dim CvePrePoliza As Integer = -1 Dim CvePrePoliza As Integer = -1
Dim Fecha As Date = DbRowVenta("Fecha").ToString.ToDate 'NowADS() Dim Fecha As Date = DbRowVenta("Fecha").ToString.ToDate 'NowADS()