Validaciones en el punto de venta
This commit is contained in:
@@ -1097,7 +1097,7 @@ Partial Class PV
|
||||
'ImgCerrarEstadoCaja.Attributes.Add("OnClick", "$('#DivEstadoCaja').hide();")
|
||||
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
||||
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();")
|
||||
TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();")
|
||||
'TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();")
|
||||
|
||||
CreaDTmpC()
|
||||
CreaDTmpF()
|
||||
@@ -5917,13 +5917,20 @@ Partial Class PV
|
||||
TxtPrecio.Enabled = Not Dr("CveVenta").ToString.ToEntero > 0
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
|
||||
CalculaMesesUso()
|
||||
End Sub
|
||||
'Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
|
||||
' CalculaMesesUso()
|
||||
'End Sub
|
||||
|
||||
Private Sub CalculaMesesUso()
|
||||
Private Function CalculaMesesUso() As Boolean
|
||||
Dim FechaI As Date = TxtFechaAjuste.Text.ToDate.AddDays(1)
|
||||
Dim FechaF As Date = Now
|
||||
|
||||
If FechaI.AddDays(-1) > FechaF Then
|
||||
TxtFechaAjuste.Text = FechaF.ToString("dd/MM/yyyy")
|
||||
Alert("La fecha de ajuste debe ser menor a la fecha actual", TipoMensaje.ToastAdventencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim Dia As Integer = FechaI.Day
|
||||
Try
|
||||
'validación adicional, para saber si el mes tiene 31 días y el actua es menor.
|
||||
@@ -5941,16 +5948,15 @@ Partial Class PV
|
||||
|
||||
TxtMesesUso.Text = MesesTrascurridos.ToString
|
||||
|
||||
CalculaPorcentajeAjuste()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al calcular los meses de uso", ex)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
|
||||
If DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
Dim Contador As Integer = 1
|
||||
Dim PUFactura As Decimal = 0
|
||||
For Each Dr As DataRow In DtPUFacturas.Rows
|
||||
@@ -5960,7 +5966,6 @@ Partial Class PV
|
||||
Contador += 1
|
||||
Next
|
||||
TxtPUFactura.Text = PUFactura.FormatoNumero(2)
|
||||
|
||||
End If
|
||||
|
||||
If DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero <= 0 Then
|
||||
@@ -6000,8 +6005,9 @@ Partial Class PV
|
||||
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
|
||||
TxtPUFactura.Text = ""
|
||||
End If
|
||||
|
||||
CalculaPorcentajeAjuste()
|
||||
If DdlPSAjuste.SelectedValue.ToEntero() > 0 Then
|
||||
CalculaPorcentajeAjuste()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoUso_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
@@ -6021,6 +6027,9 @@ Partial Class PV
|
||||
Alert("No se ha especificado producto de ajuste a entregar")
|
||||
Exit Sub
|
||||
End If
|
||||
If Not CalculaMesesUso() Then
|
||||
Exit Sub
|
||||
End If
|
||||
Try
|
||||
TxtImporteAjuste.Text = "0.00"
|
||||
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" AndAlso DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
@@ -6282,12 +6291,13 @@ Partial Class PV
|
||||
Dim Retorno As Boolean = True
|
||||
|
||||
If Modalidad = "U" Then
|
||||
If TmpDTRecepcionUsados.Rows.Count > 0 Then
|
||||
If TmpDTPolizaVirtual.Rows.Count > 0 Then
|
||||
Dim Elimino As Boolean = False
|
||||
For Each RowPoliza As DataRow In TmpDTPolizaVirtual.Rows
|
||||
If RowPoliza("CvePS").ToString().ToEntero() = CvePS Then
|
||||
RowPoliza.Delete()
|
||||
Elimino = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Elimino Then
|
||||
|
||||
Reference in New Issue
Block a user