diff --git a/Ventas/FacturacionGlobal.aspx.vb b/Ventas/FacturacionGlobal.aspx.vb index 3d0392dde..44508a862 100644 --- a/Ventas/FacturacionGlobal.aspx.vb +++ b/Ventas/FacturacionGlobal.aspx.vb @@ -110,7 +110,7 @@ Partial Class Ventas_FacturacionGlobal GvDatos.Columns(7).Visible = True End If - Dim CveCliente As Integer = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() + Dim CveCliente As Integer = -1 'UsuarioActual.Empresa.Funcionalidad(714).ToEntero() Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1") Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") @@ -152,7 +152,7 @@ Partial Class Ventas_FacturacionGlobal End Sub Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) - Dim CveCliente As Integer = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() + Dim CveCliente As Integer = -1 'UsuarioActual.Empresa.Funcionalidad(714).ToEntero() Dim CveMoneda As Integer = 1 Dim SbRemisiones As New StringBuilder() @@ -231,8 +231,8 @@ Partial Class Ventas_FacturacionGlobal ObjFactura.PreparaTimbre() - If Math.Abs(ObjFactura.Total.RoundSQL(2) - DtPagosFacturaGlobal.SUMD("Importe").RoundSQL(2)) > 0.01 Then - Alert("Los pagos no coinciden con el total de la factura", TipoMensaje.MsgError) + If Math.Abs(ObjFactura.Total.RoundSQL(2) - DtPagosFacturaGlobal.SUMD("Importe").RoundSQL(2)) > 0.1 Then + Alert($"Los pagos no coinciden con el total de la factura [{ObjFactura.Total.RoundSQL(2)}-{ DtPagosFacturaGlobal.SUMD("Importe").RoundSQL(2)}]", TipoMensaje.MsgError) Exit Sub End If diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 7c1c7fd05..df3f633dd 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -346,6 +346,7 @@ Partial Class Ventas_PVCobranza Dim MsgError As String = "" Dim SaldoPendiente As Decimal = DbRowVenta("Saldo").ToString.ToDecimal + Dim SaldoTotalInicial As Decimal = DbRowVenta("Saldo").ToString.ToDecimal Dim PagoAplicado As Decimal = 0 Dim ObjConta As New ClsContabilidad @@ -384,8 +385,8 @@ Partial Class Ventas_PVCobranza Dim PagoEfectivo As Decimal = TxtImporteEfectivo.Text.ToDecimal PagoAplicado += PagoEfectivo - If PagoAplicado > VentaActual.Total Then - TxtCambio.Text = (PagoAplicado - VentaActual.Total).FormatoNumero + If PagoAplicado >= SaldoTotalInicial Then + TxtCambio.Text = (PagoAplicado - SaldoTotalInicial).FormatoNumero PagoEfectivo = SaldoPendiente End If MsgError = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, PagoEfectivo, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2)