--- Activación de TipoPromocion=4, que toma com base el Costo
This commit is contained in:
@@ -219,8 +219,6 @@ Partial Class Ventas_Promociones
|
||||
|
||||
CargaGvBitacora()
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -279,6 +277,8 @@ Partial Class Ventas_Promociones
|
||||
|
||||
If PermisoAutorizPromocionPorcentaje Then
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlTipoPromocion.Items.Add(New ListItem("Último Costo", "4"))
|
||||
'DdlPS.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
@@ -547,14 +547,14 @@ Partial Class Ventas_Promociones
|
||||
Dim CveTipoPromocion As Integer = DdlTipoPromocion.SelectedValue.ToEntero
|
||||
|
||||
If DdlClasificacion.SelectedValue.ToEntero <= 0 Then
|
||||
If DdlPS.SelectedValue.ToEntero <= 0 Then
|
||||
If DdlPS.SelectedValue.ToEntero <= 0 AndAlso CveTipoPromocion <> 4 Then
|
||||
Alert("Debe seleccionar una clasificacion o un producto y/o servicio", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlPS.SelectedValue.ToEntero <= 0 Then
|
||||
If DdlClasificacion.SelectedValue.ToEntero <= 0 Then
|
||||
If DdlClasificacion.SelectedValue.ToEntero <= 0 AndAlso CveTipoPromocion <> 4 Then
|
||||
Alert("Debe seleccionar una clasificacion o un producto y/o servicio", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -10311,6 +10311,8 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If dr("CvePromocionDetalle").ToString.ToEntero > 0 Then EsValido = True
|
||||
|
||||
'NO DEJA REGISTRAR CON VALIDACION DE COSTO ALMACEN O PROMOCION
|
||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||
If Not EsValido Then
|
||||
@@ -18558,12 +18560,6 @@ Partial Class Ventas
|
||||
ObjInventarios.Dispose()
|
||||
End If
|
||||
|
||||
'RMF código temporal. GDiaz. cliente DICA 7%
|
||||
If CveCliente = 1555244 Then
|
||||
PrecioSugerido = Costo * 1.07D
|
||||
TxtPrecio.Text = PrecioSugerido.ToString("#,##0.####")
|
||||
End If
|
||||
|
||||
If Costo > 0 Then
|
||||
If TxtPrecio.Text.ToDecimal() > 0 Then
|
||||
Dim PorUtilidad = String.Format("{0:N2} %", ((TxtPrecio.Text.ToDecimal() - Costo) / Costo) * 100D)
|
||||
@@ -18734,31 +18730,6 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 189 AndAlso CveCliente = 1555244 Then
|
||||
Dim Costo As Decimal
|
||||
If UsuarioActual.Empresa.Funcionalidad(602) = "UC" Then 'validación sobre el último costo
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetUltimoCosto(UsuarioActual.CveEmpresa, CvePSParametro) Then
|
||||
Dim dr As DataRow = ObjInventarios.DtResultados.FiltroPrimero("")
|
||||
If dr IsNot Nothing Then
|
||||
Costo = dr("UltimoCosto").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
Else
|
||||
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()
|
||||
End If
|
||||
|
||||
If CveCliente = 1555244 Then
|
||||
PrecioSugerido = Costo * 1.07D
|
||||
'TxtPrecio.Text = PrecioSugerido.ToString("#,##0.####")
|
||||
End If
|
||||
End If
|
||||
|
||||
Retorno.PrecioSugerido = PrecioSugerido
|
||||
|
||||
Return Retorno
|
||||
@@ -19762,14 +19733,10 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim VerificarCostos As Boolean = True
|
||||
If CveCliente = 1555244 Then ' GDIAZ - DICA
|
||||
VerificarCostos = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(253) Then VerificarCostos = False
|
||||
|
||||
@@ -20021,6 +19988,12 @@ Partial Class Ventas
|
||||
Else
|
||||
CvePromocionDetalle = -1
|
||||
End If
|
||||
ElseIf TipoPromo = 4 Then 'Promocion por precio base + X%
|
||||
'siempre es sobre PU y toma el último costo
|
||||
Dim Costo As Decimal = DrPS("UltimoCosto").ToString.ToDecimal
|
||||
Descuento = 0
|
||||
SeAjustoPU = True
|
||||
PUModificado = (Costo + (Costo * PromocionPorcentaje / 100D)).RoundSQL(4)
|
||||
End If
|
||||
|
||||
'VERIFICA SI APLICAN CONDICIONES COMERCIALES
|
||||
@@ -33842,10 +33815,10 @@ Partial Class Ventas
|
||||
' Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
|
||||
' CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero(), CveVentaDetalleCotizacion:=Dr("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True)
|
||||
AgregarProductoServicio(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(),
|
||||
Dr("CvePS").ToString().ToEntero(), Dr("PS").ToString(), Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal,
|
||||
Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
|
||||
CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero(), CveVentaDetalleCotizacion:=Dr("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True,
|
||||
PorcentajeIVAFijo:=Dr("PorcentajeIVA").ToString.ToDecimal)
|
||||
Dr("CvePS").ToString.ToEntero(), Dr("PS").ToString, Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal,
|
||||
Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString, Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
|
||||
CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero(), CveVentaDetalleCotizacion:=Dr("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True,
|
||||
PorcentajeIVAFijo:=Dr("PorcentajeIVA").ToString.ToDecimal, CvePromocionDetalle:=Dr("CvePromocionDetalle").ToString().ToEntero())
|
||||
Next
|
||||
'Dim TotalFactura = TmpDT.SUM("TotalImporte").ToDecimal() + TmpDT.SUM("ImporteIVA").ToDecimal() + TmpDT.SUM("ImporteIEPS").ToDecimal() - TmpDT.SUM("ImporteRetIVA").ToDecimal() - TmpDT.SUM("ImporteRetISR").ToDecimal()
|
||||
|
||||
@@ -34171,7 +34144,8 @@ Partial Class Ventas
|
||||
|
||||
AgregarProductoServicio(1, PS("CveUM").ToString().ToEntero(), PS("UnidadMedida").ToString(), PS("CveClasificacion").ToString().ToEntero(),
|
||||
PS("Clasificacion").ToString(), PS("CvePS").ToString().ToEntero(), PS("PS").ToString(), "", PU, 0,
|
||||
rowSP("CveProyecto").ToString().ToEntero(), rowSP("Proyecto").ToString(), rowSP("CveSubProyecto").ToString().ToEntero(), rowSP("SubProyecto").ToString(), RegeneraIEPS:=True)
|
||||
rowSP("CveProyecto").ToString().ToEntero(), rowSP("Proyecto").ToString(), rowSP("CveSubProyecto").ToString().ToEntero(), rowSP("SubProyecto").ToString(),
|
||||
RegeneraIEPS:=True)
|
||||
|
||||
CalculaTotalesVenta()
|
||||
Case "2" 'T O T A L X R E M I S I O N
|
||||
@@ -34449,7 +34423,7 @@ Partial Class Ventas
|
||||
Dr("CvePS").ToString().ToEntero(), Dr("PS").ToString(), Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal,
|
||||
CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero(),
|
||||
CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero(), RegeneraIEPS:=True)
|
||||
CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero(), CvePromocionDetalle:=Dr("CvePromocionDetalle").ToString().ToEntero(), RegeneraIEPS:=True)
|
||||
Next
|
||||
|
||||
If DdlFiltroContrato.SelectedValue.ToEntero() > 0 Then
|
||||
|
||||
Reference in New Issue
Block a user