-- descuento de condiciones comerciales en distribuidor, en PV, no solo los generales
This commit is contained in:
@@ -4008,20 +4008,20 @@ Partial Class PV
|
|||||||
DdlUnidadMedida.SelectedValueExist(drPS("CveUnidadMedida").ToString)
|
DdlUnidadMedida.SelectedValueExist(drPS("CveUnidadMedida").ToString)
|
||||||
|
|
||||||
'SUGIERE PRECIO
|
'SUGIERE PRECIO
|
||||||
Dim PrecioSugerido = 0.0
|
Dim PrecioSugerido As Decimal = 0
|
||||||
PrecioSugerido = drPS("Precio").ToString.ToDouble
|
PrecioSugerido = drPS("Precio").ToString.ToDecimal
|
||||||
If UsuarioActual.CveEmpresa.Contiene(80, 119) Then
|
If UsuarioActual.CveEmpresa.Contiene(80, 119) Then
|
||||||
Dim CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero
|
Dim CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero
|
||||||
If CvePrecioListaPS > 0 Then
|
If CvePrecioListaPS > 0 Then
|
||||||
Dim ObjPS As New ClsProductosServicios
|
Dim ObjPS As New ClsProductosServicios
|
||||||
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
|
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
|
||||||
|
|
||||||
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble
|
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
|
||||||
If PrecioSugerido = 0 Then
|
If PrecioSugerido = 0 Then
|
||||||
Dim ObjInventarios As New ClsInventarios
|
Dim ObjInventarios As New ClsInventarios
|
||||||
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero)
|
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero)
|
||||||
ObjInventarios.Dispose()
|
ObjInventarios.Dispose()
|
||||||
Dim PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble
|
Dim PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal
|
||||||
If CostoPS > 0 And PorcentajePrecio > 0 Then
|
If CostoPS > 0 And PorcentajePrecio > 0 Then
|
||||||
PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
|
PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
|
||||||
End If
|
End If
|
||||||
@@ -4034,7 +4034,7 @@ Partial Class PV
|
|||||||
If UsuarioActual.CveEmpresa.Contiene(1) Then
|
If UsuarioActual.CveEmpresa.Contiene(1) Then
|
||||||
Dim ObjPS As New ClsProductosServicios
|
Dim ObjPS As New ClsProductosServicios
|
||||||
If ObjPS.GetPorcentajeProductos(CveCliente) Then
|
If ObjPS.GetPorcentajeProductos(CveCliente) Then
|
||||||
Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDouble
|
Dim PrecioAplicado As Decimal = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDecimal
|
||||||
If PrecioAplicado > 0 Then
|
If PrecioAplicado > 0 Then
|
||||||
PrecioSugerido = PrecioAplicado
|
PrecioSugerido = PrecioAplicado
|
||||||
End If
|
End If
|
||||||
@@ -4046,7 +4046,7 @@ Partial Class PV
|
|||||||
Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero
|
Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero
|
||||||
' si es 10. primero el cliente
|
' si es 10. primero el cliente
|
||||||
Dim CvePrecioListaPS As Integer
|
Dim CvePrecioListaPS As Integer
|
||||||
Dim PorcentajePrecio As Double = 0
|
Dim PorcentajePrecio As Decimal = 0
|
||||||
|
|
||||||
If TipoPrecioLista = 10 Then
|
If TipoPrecioLista = 10 Then
|
||||||
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
|
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
|
||||||
@@ -4063,15 +4063,15 @@ Partial Class PV
|
|||||||
If CvePrecioListaPS > 0 Then
|
If CvePrecioListaPS > 0 Then
|
||||||
Dim ObjPS As New ClsProductosServicios
|
Dim ObjPS As New ClsProductosServicios
|
||||||
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
|
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
|
||||||
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble
|
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
|
||||||
PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble
|
PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal
|
||||||
End If
|
End If
|
||||||
ObjPS.Dispose()
|
ObjPS.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If PrecioSugerido = 0 Then
|
If PrecioSugerido = 0 Then
|
||||||
Dim ObjInventarios As New ClsInventarios
|
Dim ObjInventarios As New ClsInventarios
|
||||||
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
Dim CostoPS As Decimal = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -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
|
'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 CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
|
If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
|
||||||
ObjInventarios.Dispose()
|
ObjInventarios.Dispose()
|
||||||
@@ -4124,9 +4124,13 @@ Partial Class PV
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
'Descuento por clasificación
|
'Descuento por clasificación
|
||||||
If drPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then
|
Dim ObjDescuento As New Descuentos
|
||||||
TxtDescuento.Text = (PrecioSugerido * ClasificacionesDescuentos(drPS("CveClasificacion").ToString.ToEntero)).ToString("F2")
|
|
||||||
|
ObjDescuento = CalcularDescuentos(CvePSParametro, TxtCantidad.Text.Trim.ToDecimal, PrecioSugerido)
|
||||||
|
If ObjDescuento.EsPUModificado Then
|
||||||
|
PrecioSugerido = ObjDescuento.PU
|
||||||
End If
|
End If
|
||||||
|
TxtDescuento.Text = ObjDescuento.ImporteDescuento.ToString("N2")
|
||||||
|
|
||||||
HdnDescuentoOriginal.Value = TxtDescuento.Text.ToDecimal().ToString()
|
HdnDescuentoOriginal.Value = TxtDescuento.Text.ToDecimal().ToString()
|
||||||
LblDescuentoIncluido.Text = TxtDescuento.Text.ToDecimal().FormatoNumero(2)
|
LblDescuentoIncluido.Text = TxtDescuento.Text.ToDecimal().FormatoNumero(2)
|
||||||
@@ -4317,6 +4321,10 @@ Partial Class PV
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then
|
||||||
|
Descuento = PU * ClasificacionesDescuentos(DrPS("CveClasificacion").ToString.ToEntero)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjDescuento.ImporteDescuento = Descuento
|
ObjDescuento.ImporteDescuento = Descuento
|
||||||
|
|||||||
Reference in New Issue
Block a user