-- ver el costo, por CvePS
This commit is contained in:
@@ -6283,12 +6283,13 @@ Public Class ClsInventarios
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetUltimoCosto(CveEmpresa As Integer) As Boolean
|
Public Function GetUltimoCosto(CveEmpresa As Integer, Optional CvePS As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Inv_UltimoCostoGet")
|
DataAdapter("PA_Inv_UltimoCostoGet")
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -513,6 +513,15 @@ Partial Class Ventas_Promociones
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' validación de %minimo considerado 02580104V
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||||
|
Dim tuc As Decimal = LblUltimoCosto.Text.ToDecimal
|
||||||
|
Dim tpu As Decimal = TxtPromocionConcepto.Text.ToDecimal
|
||||||
|
If (tpu - tuc) / tuc < UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100 Then
|
||||||
|
Alert("El producto está debajo de la utilidad permitida, la promoción requerirá autorización.", TipoMensaje.MsgAdvertencia.ToastAdventencia)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If TxtCantMinima.Text.ToEntero <= 0 Then
|
If TxtCantMinima.Text.ToEntero <= 0 Then
|
||||||
Alert("La cantidad minima debe ser de 1", TipoMensaje.MsgAdvertencia)
|
Alert("La cantidad minima debe ser de 1", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -1416,13 +1425,13 @@ Partial Class Ventas_Promociones
|
|||||||
Dim DTPSUltimoCosto = New DataTable
|
Dim DTPSUltimoCosto = New DataTable
|
||||||
|
|
||||||
Dim ObjInv As New ClsInventarios
|
Dim ObjInv As New ClsInventarios
|
||||||
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero) Then
|
||||||
DTPSUltimoCosto = ObjInv.DtResultados
|
DTPSUltimoCosto = ObjInv.DtResultados
|
||||||
End If
|
End If
|
||||||
ObjInv.Dispose()
|
ObjInv.Dispose()
|
||||||
|
|
||||||
LblUltimoCosto.Text = DTPSUltimoCosto.FiltroPrimeroValor("UltimoCosto", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero
|
LblUltimoCosto.Text = DTPSUltimoCosto.FiltroPrimeroValor("UltimoCosto", "").FormatoNumero(4)
|
||||||
LblCostoPromedio.Text = DTPSUltimoCosto.FiltroPrimeroValor("CostoPromedio", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero
|
LblCostoPromedio.Text = DTPSUltimoCosto.FiltroPrimeroValor("CostoPromedio", "").FormatoNumero(4)
|
||||||
|
|
||||||
UpAgregar.Update()
|
UpAgregar.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user