示例#1
0
        public override void AgregarProducto(ProductoVenta Producto)
        {
            base.AgregarProducto(Producto);

            // Se marcan todas las filas como seleccionadas
            foreach (DataGridViewRow Fila in this.dgvProductos.Rows)
                Fila.Cells["Aplicar"].Value = true;
            this.CalcularTotal();
        }
示例#2
0
        public override void AgregarProducto(ProductoVenta Producto)
        {
            base.AgregarProducto(Producto);

            // Se marcan todas las filas como seleccionadas
            foreach (DataGridViewRow Fila in this.dgvProductos.Rows)
            {
                Fila.Cells["Aplicar"].Value = true;
            }
            this.CalcularTotal();
        }
示例#3
0
        public virtual void AgregarProducto(ProductoVenta Producto)
        {
            // Se agrega a la lista
            this.oListaVenta.Add(Producto);

            // Se actualiza el Grid
            this.ActualizarListaVenta();

            // Se quitan las negritas de todas las filas, no aparecer seleccionado al cargar datos
            foreach (DataGridViewRow Fila in this.dgvProductos.Rows)
                Fila.Cells["Descripcion"].Style.Font = new Font(this.dgvProductos.Font, FontStyle.Regular);
        }
示例#4
0
        public virtual void AgregarProducto(ProductoVenta Producto)
        {
            // Se agrega a la lista
            this.oListaVenta.Add(Producto);

            // Se actualiza el Grid
            this.ActualizarListaVenta();

            // Se quitan las negritas de todas las filas, no aparecer seleccionado al cargar datos
            foreach (DataGridViewRow Fila in this.dgvProductos.Rows)
            {
                Fila.Cells["Descripcion"].Style.Font = new Font(this.dgvProductos.Font, FontStyle.Regular);
            }
        }
示例#5
0
文件: Ventas.cs 项目: moisesiq/aupaga
 private void CambiarPrecio(ProductoVenta oParteVenta)
 {
     string sMensaje = string.Format("Lista de precios:\n\nPrecio 1: {0}\nPrecio 2: {1}\nPrecio 3: {2}\nPrecio 4: {3}\nPrecio 5: {4}\n"
         , oParteVenta.Precios[0].ToString(GlobalClass.FormatoMoneda)
         , oParteVenta.Precios[1].ToString(GlobalClass.FormatoMoneda)
         , oParteVenta.Precios[2].ToString(GlobalClass.FormatoMoneda)
         , oParteVenta.Precios[3].ToString(GlobalClass.FormatoMoneda)
         , oParteVenta.Precios[4].ToString(GlobalClass.FormatoMoneda));
     var frmPrecio = new MensajeObtenerValor(sMensaje, oParteVenta.PrecioConIva.ToString(), MensajeObtenerValor.Tipo.Decimal);
     if (frmPrecio.ShowDialog(Principal.Instance) == DialogResult.OK)
     {
         decimal mPrecio = Util.Decimal(frmPrecio.Valor);
         // Se valida el precio especificado, cuando aplique
         if (UtilLocal.ValidarPermiso("Ventas.Venta.EditarPreciosLibre"))
         {
             this.AplicarPrecioProducto(oParteVenta, mPrecio);
         }
         else
         {
             if (mPrecio > oParteVenta.Precios[0])
                 UtilLocal.MensajeAdvertencia("El Precio especificado no puede ser mayor que el Precio 1.");
             else if (mPrecio < oParteVenta.Precios[this.Cliente.ListaDePrecios - 1])
                 UtilLocal.MensajeAdvertencia("El Precio especificado no puede ser menor que el precio asignado al Cliente.");
             else
                 this.AplicarPrecioProducto(oParteVenta, mPrecio);
         }
     }
     frmPrecio.Dispose();
 }
示例#6
0
文件: Ventas.cs 项目: moisesiq/aupaga
        private void AplicarCambioProducto(ProductoVenta Producto)
        {
            if (this.Cliente == null) return;

            // Se obtiene el precio correspondiente
            decimal mPrecio = Producto.Precios[this.Cliente.ListaDePrecios - 1];
            // Se evalúa si se debe cobrar el envío
            if (this.Cliente.CobroPorEnvio.Valor())
            {
                if (mPrecio >= this.Cliente.ImporteParaCobroPorEnvio.Valor())
                    mPrecio += this.Cliente.ImporteCobroPorEnvio.Valor();
            }

            this.AplicarPrecioProducto(Producto, mPrecio);
        }
示例#7
0
文件: Ventas.cs 项目: moisesiq/aupaga
        private void AplicarPrecioProducto(ProductoVenta Producto, decimal mPrecio)
        {
            Producto.PrecioUnitario = UtilTheos.ObtenerPrecioSinIva(mPrecio, 3);
            Producto.Iva = UtilTheos.ObtenerIvaDePrecio(mPrecio, 3);
            /* Producto.PrecioConIva = mPrecio;
            Producto.Descripcion = this.DescripcionParteVenta(Producto);
            Producto.Importe = (mPrecio * Producto.Cantidad);
            */

            // Se actualiza el Grid
            this.ActualizarListaVenta();
        }
示例#8
0
文件: Ventas.cs 项目: moisesiq/aupaga
        private void AgregarProductoVenta(PartesVentasView ParteV)
        {
            // Se valida que no sea un producto casco
            if (Datos.Exists<Parte>(c => c.ParteID == ParteV.ParteID && c.EsCascoPara > 0 && c.Estatus))
            {
                UtilLocal.MensajeAdvertencia("El artículo seleccionado está marcado como Casco, por lo cual no se puede vender.");
                return;
            }

            ProductoVenta Producto = null;

            // Se verifica si el producto ya existe
            foreach (ProductoVenta ProductoV in this.ListaVenta) {
                if (ProductoV.ParteID == ParteV.ParteID)
                {
                    Producto = ProductoV;
                    Producto.Cantidad++;
                }
            }

            // Se agrega
            if (Producto == null)
            {
                Producto = new ProductoVenta()
                {
                    ParteID = ParteV.ParteID,
                    NumeroDeParte = ParteV.NumeroParte,
                    NombreDeParte = ParteV.NombreParte,
                    Precios = new decimal[] {
                        ParteV.PrecioUno.Valor()
                        , ParteV.PrecioDos.Valor()
                        , ParteV.PrecioTres.Valor()
                        , ParteV.PrecioCuatro.Valor()
                        , ParteV.PrecioCinco.Valor()
                    },
                    Existencias = new decimal[] {
                        ParteV.ExistenciaSuc01.Valor()
                        , ParteV.ExistenciaSuc02.Valor()
                        , ParteV.ExistenciaSuc03.Valor()
                    },
                    Costo = ParteV.Costo.Valor(),
                    CostoConDescuento = (ParteV.CostoConDescuento ?? ParteV.Costo.Valor()),
                    Cantidad = 1,
                    EsServicio = ParteV.EsServicio.Valor(),
                    Es9500 = ParteV.Es9500.Valor(),
                    AGranel = ParteV.AGranel
                };

                // Si es a granel y la existencia es menor a 1, se ajusta para que pase la validación
                if (Producto.AGranel && Producto.Existencias[GlobalClass.SucursalID - 1] > 0 && Producto.Existencias[GlobalClass.SucursalID - 1] < 1)
                    Producto.Cantidad = Producto.Existencias[GlobalClass.SucursalID - 1];

                // Se agrega a la lista, si tiene existencia
                if (this.EsCotizacion || this.ValidarExistencia(Producto, Producto.Cantidad))
                    this.ListaVenta.Add(Producto);
                else
                    return;
            }
            else
            {
                // Se valida la existencia
                if (!this.EsCotizacion && !this.ValidarExistencia(Producto, Producto.Cantidad))
                {
                    Producto.Cantidad--;
                    return;
                }
            }

            // Se muenstran los cambios
            this.AplicarCambioProducto(Producto);

            // Se agrega para aplicación, si fuera el caso
            this.VerAplicacionProducto(Producto);
        }
示例#9
0
文件: Ventas.cs 项目: moisesiq/aupaga
        private void VerAplicacionProducto(ProductoVenta oParte)
        {
            // Se verifica si fue búsqueda por aplicación
            if (!this.chkBusquedaPorAplicacion.Checked || (this.cmbModelo.SelectedValue == null && this.cmbAnio.SelectedValue == null && this.cmbMotor.SelectedValue == null))
                return;

            // Se verifica si ya existe la parte
            var oAplicacion = this.oAplicaciones.FirstOrDefault(c => c.ParteID == oParte.ParteID);
            if (oAplicacion == null)
                oAplicacion = new VentaParteAplicacion() { ParteID = oParte.ParteID };
            // Se restauran los valores para mantener el último filtro
            oAplicacion.ModeloID = null;
            oAplicacion.Anio = null;
            oAplicacion.MotorID = null;

            // Se agrega la aplicación
            if (this.cmbModelo.SelectedValue != null)
                oAplicacion.ModeloID = Util.Entero(this.cmbModelo.SelectedValue);
            if (this.cmbAnio.SelectedValue != null)
                oAplicacion.Anio = Util.Entero(this.cmbAnio.SelectedValue);
            if (this.cmbMotor.SelectedValue != null)
                oAplicacion.MotorID = Util.Entero(this.cmbMotor.SelectedValue);

            this.oAplicaciones.Add(oAplicacion);
        }
示例#10
0
文件: Ventas.cs 项目: moisesiq/aupaga
        private bool ValidarExistencia(ProductoVenta Producto, decimal mCantidad)
        {
            if (!Producto.EsServicio && mCantidad > Producto.Existencias[GlobalClass.SucursalID - 1])
            {
                if (MessageBox.Show("No hay suficiente existencia para agregar el producto seleccionado. ¿Deseas reportar el incidente a Compras?",
                    "Existencia insuficiente", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    this.ReporteDeFaltante(Producto.ParteID);
                return false;
            }

            return true;
        }
示例#11
0
文件: Ventas.cs 项目: moisesiq/aupaga
 private string DescripcionParteVenta(ProductoVenta Producto)
 {
     return (Producto.NumeroDeParte + "    " + Producto.NombreDeParte + "\n" +
         Producto.Cantidad.ToString() + " PIEZA" + (Producto.Cantidad == 1 ? "" : "S") + "        P.U. " +
         (Producto.PrecioUnitario + Producto.Iva).ToString(GlobalClass.FormatoMoneda));
 }
示例#12
0
        private void MostrarDetalle(int iCotizacion9500ID)
        {
            this.o9500.ctlComDetalle.LimpiarDetalle();
            ProductoVenta oProductoV;
            var Detalle = Datos.GetListOf<Cotizaciones9500DetalleView>(q => q.Cotizacion9500ID == iCotizacion9500ID);
            foreach (var Producto in Detalle)
            {
                oProductoV = new ProductoVenta()
                {
                    ParteID = Producto.ParteID,
                    NumeroDeParte = Producto.NumeroParte,
                    NombreDeParte = Producto.NombreParte,
                    Cantidad = Producto.Cantidad,
                    PrecioUnitario = UtilTheos.ObtenerPrecioSinIva(Producto.PrecioAlCliente, 3),
                    Iva = UtilTheos.ObtenerIvaDePrecio(Producto.PrecioAlCliente, 3)
                    // PrecioConIva = Producto.PrecioAlCliente
                };
                this.o9500.ctlComDetalle.AgregarProducto(oProductoV);
            }
            this.o9500.ctlComDetalle.VerExistenciaLista();

            // Se actualiza el Cliente
            this.oCotizacion9500 = Datos.GetEntity<Cotizacion9500>(q => q.Cotizacion9500ID == iCotizacion9500ID && q.Estatus);
            this.ComCliente = Datos.GetEntity<ClientesDatosView>(q => q.ClienteID == oCotizacion9500.ClienteID);
            this.o9500.ClienteCompletar(this.ComCliente);
            // Se guarda el anticipo
            this.ComAnticipoSel = oCotizacion9500.Anticipo;
        }