Correcion de validacion de pagos

This commit is contained in:
2020-03-24 14:39:57 -07:00
parent 514724b119
commit 575c85e432

View File

@@ -17736,20 +17736,20 @@ Partial Class Ventas
End Sub End Sub
Private Function ValidaPagosContado() As Boolean Private Function ValidaPagosContado() As Boolean
Dim Retorno = False Dim Retorno = False
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO 'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO
If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso Total > 0 Then If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso TxtTotal.Text.ToDecimal > 0 Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = True Retorno = True
Return Retorno Return Retorno
End If End If
If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso Total > 0 Then If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso TxtTotal.Text.ToDecimal > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then If TotalPago < TxtTotal.Text.ToDecimal Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
Retorno = True Retorno = True
Return Retorno Return Retorno
@@ -17767,11 +17767,10 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso Total > 0 Then If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso TxtTotal.Text.ToDecimal > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then If TotalPago < TxtTotal.Text.ToDecimal Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
Retorno = True Retorno = True
Return Retorno Return Retorno