--FIX precio libre
This commit is contained in:
@@ -9016,8 +9016,15 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 189 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
|
If UsuarioActual.CveEmpresa = 189 Then
|
||||||
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
|
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.NewEditIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("")
|
||||||
|
|
||||||
|
If CBool(DrPS("PrecioLibre")) Then
|
||||||
|
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = True
|
||||||
|
Else
|
||||||
|
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
@@ -9072,6 +9079,7 @@ Partial Class Ventas
|
|||||||
Dim DatarowPS As DataRow = Nothing
|
Dim DatarowPS As DataRow = Nothing
|
||||||
DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("") ' Estado = -1
|
DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("") ' Estado = -1
|
||||||
|
|
||||||
|
Dim PrecioLibre As Boolean = False
|
||||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||||
If DdlTipoComprobante.SelectedValue = "Cot" Then
|
If DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||||
If PU < DatarowPS("PrecioMinimo").ToString().ToDecimal() Then
|
If PU < DatarowPS("PrecioMinimo").ToString().ToDecimal() Then
|
||||||
@@ -9080,6 +9088,8 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
PrecioLibre = CBool(DatarowPS("PrecioLibre"))
|
||||||
|
|
||||||
If DdlTipoComprobante.SelectedValue = "Ant" Then
|
If DdlTipoComprobante.SelectedValue = "Ant" Then
|
||||||
Dim PSCodigoSAT As String = DatarowPS("SATClavePS").ToString
|
Dim PSCodigoSAT As String = DatarowPS("SATClavePS").ToString
|
||||||
If PSCodigoSAT <> "84111506" Then
|
If PSCodigoSAT <> "84111506" Then
|
||||||
@@ -9248,35 +9258,39 @@ Partial Class Ventas
|
|||||||
'NO DEJA REGISTRAR MENOS AL PRECIO MINIMO
|
'NO DEJA REGISTRAR MENOS AL PRECIO MINIMO
|
||||||
Dim MensajeCosto As New StringBuilder
|
Dim MensajeCosto As New StringBuilder
|
||||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||||
If Not EsValido Then
|
|
||||||
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo <br/>", DatarowPS("PS").ToString())
|
If Not PrecioLibre Then
|
||||||
If TienePermisoImportes Then
|
If Not EsValido Then
|
||||||
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
|
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo <br/>", DatarowPS("PS").ToString())
|
||||||
MensajeCosto.AppendFormat("El rango menor aceptado es: {0:#,###.00}% <b>${1}</b> <br/>", PorcentajeMinimoCostoEmpresa, CostoMenor)
|
If TienePermisoImportes Then
|
||||||
MensajeCosto.AppendFormat("El precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
|
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
|
||||||
|
MensajeCosto.AppendFormat("El rango menor aceptado es: {0:#,###.00}% <b>${1}</b> <br/>", PorcentajeMinimoCostoEmpresa, CostoMenor)
|
||||||
|
MensajeCosto.AppendFormat("El precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Alert(String.Format(MensajeCosto.ToString()), TipoMensaje.MsgAdvertencia)
|
||||||
|
MensajeCosto.Clear()
|
||||||
|
e.Cancel = True
|
||||||
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'NO DEJA REGISTRAR MAS AL PRECIO MAXIMO
|
||||||
Alert(String.Format(MensajeCosto.ToString()), TipoMensaje.MsgAdvertencia)
|
If Not EsValidoMayor Then
|
||||||
MensajeCosto.Clear()
|
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", HdnPS.Value)
|
||||||
e.Cancel = True
|
If TienePermisoImportes Then
|
||||||
Exit Sub
|
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
|
||||||
End If
|
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0}% <b>${1:#,###.00}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor)
|
||||||
|
MensajeCosto.AppendFormat("El precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
|
||||||
'NO DEJA REGISTRAR MAS AL PRECIO MAXIMO
|
End If
|
||||||
If Not EsValidoMayor Then
|
Alert(MensajeCosto.ToString(), TipoMensaje.MsgAdvertencia)
|
||||||
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", HdnPS.Value)
|
MensajeCosto.Clear()
|
||||||
If TienePermisoImportes Then
|
e.Cancel = True
|
||||||
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
|
Exit Sub
|
||||||
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0}% <b>${1:#,###.00}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor)
|
|
||||||
MensajeCosto.AppendFormat("El precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
|
|
||||||
End If
|
End If
|
||||||
Alert(MensajeCosto.ToString(), TipoMensaje.MsgAdvertencia)
|
|
||||||
MensajeCosto.Clear()
|
|
||||||
e.Cancel = True
|
|
||||||
Exit Sub
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -18381,7 +18395,10 @@ Partial Class Ventas
|
|||||||
tPrecioSugerido = 0
|
tPrecioSugerido = 0
|
||||||
PrecioSugerido = 0
|
PrecioSugerido = 0
|
||||||
|
|
||||||
Alert("No se encontro una lista de precios permitida en la sucursal actual", TipoMensaje.MsgAdvertencia)
|
If Not CBool(drPS("PrecioLibre")) Then
|
||||||
|
Alert("No se encontro una lista de precios permitida en la sucursal actual", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
ObjPrecioSugerido.CvePrecioLista = -1
|
ObjPrecioSugerido.CvePrecioLista = -1
|
||||||
@@ -18389,7 +18406,10 @@ Partial Class Ventas
|
|||||||
tPrecioSugerido = 0
|
tPrecioSugerido = 0
|
||||||
PrecioSugerido = 0
|
PrecioSugerido = 0
|
||||||
|
|
||||||
Alert("No se encontraron listas de precio disponibles", TipoMensaje.MsgAdvertencia)
|
If Not CBool(drPS("PrecioLibre")) Then
|
||||||
|
Alert("No se encontraron listas de precio disponibles", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -18410,11 +18430,10 @@ Partial Class Ventas
|
|||||||
tPrecioSugerido = 0
|
tPrecioSugerido = 0
|
||||||
PrecioSugerido = 0
|
PrecioSugerido = 0
|
||||||
|
|
||||||
TxtPrecio.Enabled = True
|
TxtPrecio.Enabled = CBool(drPS("PrecioLibre"))
|
||||||
Else
|
Else
|
||||||
TxtPrecio.Enabled = False
|
TxtPrecio.Enabled = CBool(drPS("PrecioLibre"))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido
|
If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido
|
||||||
@@ -19439,6 +19458,8 @@ Partial Class Ventas
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim PrecioLibre As Boolean = False
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||||
Dim DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
Dim DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||||
If DatarowPS IsNot Nothing Then
|
If DatarowPS IsNot Nothing Then
|
||||||
@@ -19457,6 +19478,8 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
PrecioLibre = CBool(DatarowPS("PrecioLibre"))
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -19675,30 +19698,33 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'NO DEJA REGISTRAR MENOS AL PRECIO MINIMO
|
'NO DEJA REGISTRAR MENOS AL PRECIO MINIMO
|
||||||
Dim MensajeCosto As New StringBuilder
|
If Not PrecioLibre Then
|
||||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
Dim MensajeCosto As New StringBuilder
|
||||||
If Not EsValido Then
|
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||||
MensajeCosto.AppendFormat("El Producto <b>{0}-{1}</b>. No se puede vender a un precio menor de su Costo <br/>", HdnCodigoPS.Value, HdnPS.Value)
|
|
||||||
If TienePermisoImportes Then
|
If Not EsValido Then
|
||||||
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
|
MensajeCosto.AppendFormat("El Producto <b>{0}-{1}</b>. No se puede vender a un precio menor de su Costo <br/>", HdnCodigoPS.Value, HdnPS.Value)
|
||||||
MensajeCosto.AppendFormat("El rango menor aceptado es: {0}% <b>${1:#,###.00}</b> <br/>", PorcentajeMinimoCostoEmpresa, CostoMenor)
|
If TienePermisoImportes Then
|
||||||
MensajeCosto.AppendFormat("El precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
|
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
|
||||||
|
MensajeCosto.AppendFormat("El rango menor aceptado es: {0}% <b>${1:#,###.00}</b> <br/>", PorcentajeMinimoCostoEmpresa, CostoMenor)
|
||||||
|
MensajeCosto.AppendFormat("El precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Alert(String.Format(MensajeCosto.ToString()), TipoMensaje.MsgAdvertencia)
|
||||||
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Alert(String.Format(MensajeCosto.ToString()), TipoMensaje.MsgAdvertencia)
|
'NO DEJA REGISTRAR MAS AL PRECIO MAXIMO
|
||||||
Return False
|
If Not EsValidoMayor Then
|
||||||
End If
|
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", HdnPS.Value)
|
||||||
|
If TienePermisoImportes Then
|
||||||
'NO DEJA REGISTRAR MAS AL PRECIO MAXIMO
|
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
|
||||||
If Not EsValidoMayor Then
|
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0}% <b>${1:#,###.00}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor)
|
||||||
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", HdnPS.Value)
|
MensajeCosto.AppendFormat("El precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
|
||||||
If TienePermisoImportes Then
|
End If
|
||||||
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
|
Alert(MensajeCosto.ToString(), TipoMensaje.MsgAdvertencia)
|
||||||
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0}% <b>${1:#,###.00}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor)
|
Return False
|
||||||
MensajeCosto.AppendFormat("El precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
|
|
||||||
End If
|
End If
|
||||||
Alert(MensajeCosto.ToString(), TipoMensaje.MsgAdvertencia)
|
|
||||||
Return False
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -19977,9 +20003,14 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
'sino es la seleccionada se recalcula de nuevo
|
|
||||||
CargaPrecioLista(DdlPS.SelectedValue.ToEntero)
|
Dim PermiteEdicion = UsuarioActual.CveEmpresa = 189 AndAlso TxtPrecio.Enabled
|
||||||
Exit Sub
|
If Not PermiteEdicion Then
|
||||||
|
'sino es la seleccionada se recalcula de nuevo
|
||||||
|
CargaPrecioLista(DdlPS.SelectedValue.ToEntero)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If Me.CvePrecioLista > 0 Then
|
If Me.CvePrecioLista > 0 Then
|
||||||
|
|||||||
Reference in New Issue
Block a user