Beispiel #1
0
        private void detalle_venta_DoubleClick(object sender, EventArgs e)
        {
            var CurrentDet = (P.Estructuras.DisplayVentaPrecio)detalle_venta.SelectedObject;
            var origen     = CurrentDetailSource;
            int indice     = origen.IndexOf(CurrentDet);

            var box    = new Busquedas.PriceQuantitySetter(CurrentDet.Cantidad);
            var result = box.ShowDialogFrom(this);

            if (result == DialogResult.OK)
            {
                if (CurrentDet.PrecioTotal != box.TotalPrice || CurrentDet.PrecioUnitario != box.UnitPrice)
                {
                    CurrentDet.PrecioTotal    = box.TotalPrice;
                    CurrentDet.PrecioUnitario = box.UnitPrice;
                    origen[indice]            = CurrentDet;
                    detalle_venta.RefreshObjects(origen);
                    SetTotalFactura();
                }
            }
        }
Beispiel #2
0
        private void AgregarDetalleFactura(DETAIL_PROCESS datos)
        {
            decimal costo_ext, cost_uni;

            costo_ext = 0;//colchon.Rows(0).Item("val_libro")
            cost_uni  = costo_ext / datos.cantidad;
            //reviso si la fila pertene a una otra factura en el sistema
            int esta = P.Consultas.ventas.CheckArticlePartUsed(datos.cod_articulo, datos.parte);

            if (esta > 0)
            {
                //fila esta asociada al menos a una factura
                P.Mensaje.Advert("Venta ya ha sido ingresada a otra factura en el sistema");
            }
            else
            {
                //obtenemos valores de precios
                var caja = new Busquedas.PriceQuantitySetter(datos.cantidad);
                var res  = caja.ShowDialogFrom(this);
                //fila puede ser procesada para esta factura
                var newfila = new P.Estructuras.DisplayVentaPrecio();
                newfila.rowIndex       = datos.PartId;
                newfila.CodArticulo    = datos.cod_articulo;
                newfila.Parte          = datos.parte;
                newfila.DescripArt     = datos.descrip_complete;
                newfila.Cantidad       = datos.cantidad;
                newfila.CostoUnitario  = cost_uni;
                newfila.CostoExtend    = costo_ext;
                newfila.PrecioUnitario = caja.UnitPrice;
                newfila.PrecioTotal    = caja.TotalPrice;
                newfila.Zona           = datos.zona;
                newfila.Subzona        = datos.subzona;
                newfila.Clase          = datos.clase;
                newfila.UoE            = caja.UoE;

                detalle_venta.SetObjects(AddFila(newfila));
                SetTotalFactura();
            }
        }