--Porcentaje Utilidad al agregar
This commit is contained in:
@@ -18365,6 +18365,27 @@ Partial Class Ventas
|
||||
|
||||
If UsuarioActual.CveEmpresa = 189 Then
|
||||
AgregarPSAutomaticamente = False
|
||||
Dim PuedeVerCosto As Boolean = UsuarioActual.TienePermisoProceso(201) OrElse UsuarioActual.TienePermisoProceso(385)
|
||||
|
||||
Dim Costo As Decimal = 0
|
||||
|
||||
If (CveVenta <= 0 OrElse EsCreaApartirDe) AndAlso DdlTipoComprobante.SelectedValue = "Cot" AndAlso PuedeVerCosto Then
|
||||
GvPS.Columns(23).Visible = True
|
||||
thCosto.Visible = True
|
||||
thCosto2.Visible = True
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
|
||||
Costo = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
||||
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
|
||||
If Costo <= 0 Then Costo = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
|
||||
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
If Costo > 0 Then
|
||||
LtlHeaderCosto.Text = String.Format("{0:N2} %", ((TxtPrecio.Text.ToDecimal() - Costo) / TxtPrecio.Text.ToDecimal()) * 100D)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If AgregarPSAutomaticamente Then
|
||||
|
||||
Reference in New Issue
Block a user