From 41fc269dc964add2d144d03b0cde10b4c2f9b2a4 Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Wed, 6 Nov 2019 12:01:19 -0700 Subject: [PATCH] Cambios de BDH --- Ventas/PV.aspx.vb | 8 +++++++- Ventas/Ventas.aspx.vb | 29 +++++++++++++++++------------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index e9d5dff51..744d270c0 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -2828,6 +2828,7 @@ Partial Class PV End If If PrecioSugerido > 0 Then TxtPrecio.Text = PrecioSugerido.FormatoNumero() + RegistraScript("$get('LblPrecio1').innerText = formato_numero(" + PrecioSugerido.ToString + ", 2, '.', ',');") End If @@ -4294,7 +4295,7 @@ Partial Class PV Private Sub CargaCuentas() - DdlCuentaEfectivo.Items.Clear() + 'DdlCuentaEfectivo.Items.Clear() DdlCuentaTarjetaCredito.Items.Clear() DdlCuentaTarjetaDebito.Items.Clear() DdlCuentaCheque.Items.Clear() @@ -4351,6 +4352,11 @@ Partial Class PV If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub + If TxtCambio.Text.ToDecimal > 0 And TxtImporteEfectivo.Text.ToDecimal < TxtCambio.Text.ToDecimal Then + Alert("Debe haber un pago en efectivo y ser mayor que el cambio. Si no, ser pago exacto.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + If (DtPagos.SUM("Importe").ToString.ToDecimal + total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) Exit Sub diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7b9a65473..cb789b33b 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -10304,9 +10304,9 @@ Partial Class Ventas Exit For End If - If DrPago("CveTipoMovimiento").ToString.ToEntero = 8 Then '13 - DrPago("Importe") = DrPago("Importe").ToString.ToDecimal - TxtCambio.Text.ToDecimal - End If + 'If DrPago("CveTipoMovimiento").ToString.ToEntero = 8 Then '13 + ' DrPago("Importe") = DrPago("Importe").ToString.ToDecimal - TxtCambio.Text.ToDecimal + 'End If CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero, Fecha, FolioIE.ToString, String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString.ToDouble, DdlMoneda.SelectedValue.ToEntero, tipoCambio, DrPago("Observaciones").ToString, "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte, MesesSinIntereses:=DrPago("MesesSinIntereses").ToString.ToEntero) @@ -16464,10 +16464,15 @@ Partial Class Ventas If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub - 'If DtPagos.SUM("Importe").ToString.ToDecimal + total > TxtTotal.Text.ToDecimal Then - ' Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) - ' Exit Sub - 'End If + If TxtCambio.Text.ToDecimal > 0 And TxtImporteEfectivo.Text.ToDecimal < TxtCambio.Text.ToDecimal Then + Alert("Debe haber un pago en efectivo y ser mayor que el cambio. Si no, ser pago exacto.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If (DtPagos.SUM("Importe").ToString.ToDecimal + total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then + Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If 'Pago en Efectivo If TxtImporteEfectivo.Text.ToDecimal > 0 Then @@ -16477,7 +16482,7 @@ Partial Class Ventas DrEfectivo("TipoMovimiento") = "Pago en Efectivo" DrEfectivo("CveCuenta") = DdlCuentaEfectivo.SelectedValue DrEfectivo("Cuenta") = DdlCuentaEfectivo.SelectedItem.Text - DrEfectivo("Importe") = TxtImporteEfectivo.Text + DrEfectivo("Importe") = TxtImporteEfectivo.Text.ToDecimal - TxtCambio.Text.ToDecimal DrEfectivo("Folio") = CargaFolioContado(DdlCuentaEfectivo.SelectedValue.ToEntero, 6) DrEfectivo("Observaciones") = "" DrEfectivo("Tipo") = "Caja Chica" @@ -16679,10 +16684,10 @@ Partial Class Ventas Retorno = True End If - 'If DtPagos.SUM("Importe").ToString.ToDecimal > TxtTotal.Text.ToDecimal Then - ' Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) - ' Retorno = True - 'End If + If (DtPagos.SUM("Importe").ToString.ToDecimal + Total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then + Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) + Retorno = True + End If Return Retorno End Function