SMS - 2024.01.23 OS en viar Solicitar paciente y Episodio
This commit is contained in:
@@ -17605,7 +17605,7 @@ Partial Class Ventas
|
||||
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
|
||||
AgregarPS()
|
||||
End Sub
|
||||
Private Function ValidaAgregarPS(CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer) As Boolean 'NO TOCAR - IPP
|
||||
Private Function ValidaAgregarPS(CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, Optional CantidadModal As Decimal = 0D, Optional PSValidarModal As String = "") As Boolean 'NO TOCAR - IPP
|
||||
|
||||
'VALIDA PARAMETROS
|
||||
If CvePS <= 0 Or CveUM <= 0 Then
|
||||
@@ -17613,6 +17613,10 @@ Partial Class Ventas
|
||||
Return False
|
||||
End If
|
||||
|
||||
If PSValidarModal.Trim.Length > 0 Then
|
||||
HdnPS.Value = PSValidarModal
|
||||
End If
|
||||
|
||||
If HdnPS.Value = "" Or HdnPS.Value = "-1" Then
|
||||
Alert("Es necesario seleccionar el Producto o Servicio a facturar.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
@@ -17697,7 +17701,7 @@ Partial Class Ventas
|
||||
'VALIDA EXISTENCIA
|
||||
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 153, 140, 186}) Then
|
||||
If CveVenta <= 0 OrElse Me.EsCreaApartirDe Then
|
||||
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
|
||||
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < (If(CantidadModal > 0, CantidadModal, TxtCantidad.Text.ToDouble)) Then
|
||||
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
@@ -17712,7 +17716,7 @@ Partial Class Ventas
|
||||
|
||||
'SUMA LO YA RESTADO EN PENDIENTE POR SURTIR QUE PERTENESCA A LA VENTA.
|
||||
'PARA QUE NO RESTE LA EXISTENCIA 2 VECES Y PUEDAS COMPARAR LO REAL
|
||||
If (Existencia + CantidadVenta) - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} And (EntregaDirecta Is NULL Or EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
|
||||
If (Existencia + CantidadVenta) - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} And (EntregaDirecta Is NULL Or EntregaDirecta < 1)") < (If(CantidadModal > 0, CantidadModal, TxtCantidad.Text.ToDouble)) Then
|
||||
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
@@ -36365,15 +36369,15 @@ Partial Class Ventas
|
||||
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero
|
||||
Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString
|
||||
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||
Dim CodigoPS As String = GvRow.DataKey("CodigoPS")
|
||||
|
||||
If Cantidad > 0 Then
|
||||
|
||||
If Not ValidaAgregarPS(CvePS, CveUnidadMedida, PU, 2) Then
|
||||
If Not ValidaAgregarPS(CvePS, CveUnidadMedida, PU, 2, Cantidad, CodigoPS) Then
|
||||
Alert("No hay existencia.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked
|
||||
|
||||
Reference in New Issue
Block a user