public Lbl.Comprobantes.ColeccionDetalleArticulos ObtenerArticulos(Lbl.Comprobantes.ComprobanteConArticulos comprobante)
        {
            if (m_Articulos == null)
            {
                m_Articulos = new Lbl.Comprobantes.ColeccionDetalleArticulos(comprobante);
            }
            else
            {
                m_Articulos.Clear();
            }

            int i = 1;

            foreach (DetalleCompra Pro in this.ChildControls)
            {
                if (Pro.IsEmpty == false)
                {
                    Lbl.Comprobantes.DetalleArticulo DetArt = new Lbl.Comprobantes.DetalleArticulo(comprobante);
                    DetArt.Articulo           = Pro.Articulo;
                    DetArt.Alicuota           = Pro.Alicuota;
                    DetArt.Nombre             = Pro.TextDetail;
                    DetArt.Orden              = i++;
                    DetArt.Cantidad           = Pro.Cantidad;
                    DetArt.ImporteIvaUnitario = Pro.ImporteIvaUnitario;
                    DetArt.ImporteUnitario    = Pro.ImporteUnitario;
                    DetArt.ImporteNoGravado   = Pro.ImporteNoGravado;
                    DetArt.Descuento          = Pro.Descuento;
                    DetArt.DatosSeguimiento   = Pro.DatosSeguimiento;
                    m_Articulos.Add(DetArt);
                }
            }

            return(m_Articulos);
        }
Example #2
0
        public void EnviarNP(object sender, System.EventArgs e)
        {
            Lbl.Comprobantes.ComprobanteDeCompra Comprob = new Lbl.Comprobantes.ComprobanteDeCompra(this.Connection);

            Comprob.Tipo        = Lbl.Comprobantes.Tipo.TodosPorLetra["NP"];
            Comprob.FormaDePago = new Lbl.Pagos.FormaDePago(this.Connection, 3);

            Lbl.Comprobantes.ColeccionDetalleArticulos newCole = new Lbl.Comprobantes.ColeccionDetalleArticulos(this.Connection);
            foreach (ListViewItem Itm in this.Listado.Items)
            {
                Lbl.Articulos.Articulo           art    = new Lbl.Articulos.Articulo(this.Connection, int.Parse(Itm.SubItems[0].Text));
                Lbl.Comprobantes.DetalleArticulo detArt = new Lbl.Comprobantes.DetalleArticulo(this.Connection);
                detArt.Crear();
                detArt.Articulo = art;
                decimal costoFinal = decimal.Parse(Itm.SubItems["articulos.costo"].Text);
                detArt.ImporteUnitario = costoFinal;
                decimal stockAct = decimal.Parse(Itm.SubItems["articulos.stock_actual"].Text);
                decimal stockMin = decimal.Parse(Itm.SubItems["articulos.stock_minimo"].Text);
                if (stockMin == 0)
                {
                    detArt.Cantidad = 1;
                }
                else
                {
                    detArt.Cantidad = stockMin > stockAct ? stockMin - stockAct : stockMin;
                }
                newCole.Add(detArt);
            }
            Comprob.Articulos.AddRange(newCole);
            Comprob.Estado = 50;

            Lfc.FormularioEdicion FormularioEdicion = Lfc.Instanciador.InstanciarFormularioEdicion(Comprob);
            FormularioEdicion.MdiParent = this.MdiParent; //this.ParentForm.MdiParent;
            FormularioEdicion.Show();

            //Lbl.IElementoDeDatos El = Lbl.Instanciador.Instanciar(this.Definicion.ElementoTipo, Lfx.Workspace.Master.GetNewConnection("Crear " + this.Definicion.ElementoTipo.ToString()) as Lfx.Data.Connection);
            //El.Crear();
        }
        public Lbl.Comprobantes.ColeccionDetalleArticulos ObtenerArticulos(Lfx.Data.IConnection dataBase)
        {
            m_Articulos = new Lbl.Comprobantes.ColeccionDetalleArticulos(dataBase);
            int i = 1;

            foreach (DetalleComprobante Pro in this.ChildControls)
            {
                if (Pro.IsEmpty == false)
                {
                    Lbl.Comprobantes.DetalleArticulo DetArt = new Lbl.Comprobantes.DetalleArticulo(dataBase);
                    DetArt.Articulo         = Pro.Elemento as Lbl.Articulos.Articulo;
                    DetArt.Nombre           = Pro.TextDetail;
                    DetArt.Orden            = i++;
                    DetArt.Cantidad         = Pro.Cantidad;
                    DetArt.ImporteUnitario  = Pro.ImporteUnitario;
                    DetArt.Descuento        = Pro.Descuento;
                    DetArt.DatosSeguimiento = Pro.DatosSeguimiento;
                    m_Articulos.Add(DetArt);
                }
            }

            return(m_Articulos);
        }
Example #4
0
        public virtual Lazaro.Pres.Spreadsheet.Workbook ToWorkbookDetalle(int IDComprobante)
        {
            Lbl.Comprobantes.Factura selComprobante = new Lbl.Comprobantes.Factura(this.Connection, IDComprobante);

            Lazaro.Pres.Spreadsheet.Workbook Res   = new Lazaro.Pres.Spreadsheet.Workbook();
            Lazaro.Pres.Spreadsheet.Sheet    Sheet = new Lazaro.Pres.Spreadsheet.Sheet(this.Text + " Comprobante");
            Res.Sheets.Add(Sheet);


            int OrderColumn = -1;

            if (selComprobante != null)
            {
                for (int i = 0; i < 9; i++)
                {
                    ExcelReg nexc = new ExcelReg();
                    switch (i)
                    {
                    case 0:
                        nexc.name      = "id_articulo";
                        nexc.desc      = "Código";
                        nexc.alig      = Lfx.Types.StringAlignment.Near;
                        nexc.width     = 100;
                        nexc.fieldtype = Lfx.Data.InputFieldTypes.Integer;
                        break;

                    case 1:
                        nexc.name      = "nombre";
                        nexc.desc      = "Nombre";
                        nexc.alig      = Lfx.Types.StringAlignment.Near;
                        nexc.width     = 300;
                        nexc.fieldtype = Lfx.Data.InputFieldTypes.Text;
                        break;

                    case 2:
                        nexc.name      = "descripcion";
                        nexc.desc      = "Descripción";
                        nexc.alig      = Lfx.Types.StringAlignment.Near;
                        nexc.width     = 150;
                        nexc.fieldtype = Lfx.Data.InputFieldTypes.Text;
                        break;

                    case 3:
                        nexc.name      = "cantidad";
                        nexc.desc      = "Cantidad";
                        nexc.alig      = Lfx.Types.StringAlignment.Near;
                        nexc.width     = 80;
                        nexc.fieldtype = Lfx.Data.InputFieldTypes.Numeric;
                        break;

                    case 4:
                        nexc.name      = "costo";
                        nexc.desc      = "Costo";
                        nexc.alig      = Lfx.Types.StringAlignment.Near;
                        nexc.width     = 90;
                        nexc.fieldtype = Lfx.Data.InputFieldTypes.Currency;
                        break;

                    case 5:
                        nexc.name      = "precio";
                        nexc.desc      = "Precio Uni.";
                        nexc.alig      = Lfx.Types.StringAlignment.Near;
                        nexc.width     = 120;
                        nexc.fieldtype = Lfx.Data.InputFieldTypes.Currency;
                        break;

                    case 6:
                        nexc.name      = "importe";
                        nexc.desc      = "Importe";
                        nexc.alig      = Lfx.Types.StringAlignment.Near;
                        nexc.width     = 120;
                        nexc.fieldtype = Lfx.Data.InputFieldTypes.Currency;
                        break;

                    case 7:
                        nexc.name      = "recargo";
                        nexc.desc      = "Recargo";
                        nexc.alig      = Lfx.Types.StringAlignment.Near;
                        nexc.width     = 100;
                        nexc.fieldtype = Lfx.Data.InputFieldTypes.Currency;
                        break;

                    case 8:
                        nexc.name      = "total";
                        nexc.desc      = "Total";
                        nexc.alig      = Lfx.Types.StringAlignment.Near;
                        nexc.width     = 120;
                        nexc.fieldtype = Lfx.Data.InputFieldTypes.Currency;

                        break;
                    }
                    Lazaro.Pres.Spreadsheet.ColumnHeader ColHead = new Lazaro.Pres.Spreadsheet.ColumnHeader(nexc.desc, nexc.width);
                    ColHead.Name          = Lazaro.Orm.Data.ColumnValue.GetNameOnly(nexc.name);
                    ColHead.TextAlignment = nexc.alig; ColHead.DataType = nexc.fieldtype; ColHead.Format = nexc.format; ColHead.Printable = true;
                    if (i == 8)
                    {
                        ColHead.TotalFunction = Lazaro.Pres.Spreadsheet.QuickFunctions.Sum;
                    }
                    Sheet.ColumnHeaders.Add(ColHead);
                    excReg.Add(nexc);
                }
            }

            // Exporto los renglones
            Lbl.Comprobantes.ColeccionDetalleArticulos detArt = selComprobante.Articulos;
            foreach (Lbl.Comprobantes.DetalleArticulo DtRow in detArt)
            {
                Lazaro.Pres.Spreadsheet.Row Reng = this.FormatArt(Sheet, DtRow);
                Sheet.Rows.Add(Reng);
            }

            if (OrderColumn >= 0)
            {
                if (m_GroupingColumnName != null)
                {
                    Sheet.SortByGroupAndColumn(OrderColumn, true);
                }
                else
                {
                    if (OrderColumn >= 0)
                    {
                        Sheet.Sort(OrderColumn, true);
                    }
                }
            }

            return(Res);
        }
                public Lbl.Comprobantes.ColeccionDetalleArticulos ObtenerArticulos(Lbl.Comprobantes.ComprobanteConArticulos comprobante)
                {
                        if (m_Articulos == null)
                                m_Articulos = new Lbl.Comprobantes.ColeccionDetalleArticulos(comprobante);
                        else
                                m_Articulos.Clear();

                        int i = 1;
                        foreach (DetalleComprobante Pro in this.ChildControls) {
                                if (Pro.IsEmpty == false) {
                                        Lbl.Comprobantes.DetalleArticulo DetArt = new Lbl.Comprobantes.DetalleArticulo(comprobante);
                                        DetArt.Articulo = Pro.Articulo;
                                        DetArt.Nombre = Pro.TextDetail;
                                        DetArt.Orden = i++;
                                        DetArt.Cantidad = Pro.Cantidad;
                                        DetArt.Unitario = Pro.Unitario;
                                        DetArt.Descuento = Pro.Descuento;
                                        DetArt.DatosSeguimiento = Pro.DatosSeguimiento;
                                        m_Articulos.Add(DetArt);
                                }
                        }
                        
                        return m_Articulos;
                }
                public Lbl.Comprobantes.ColeccionDetalleArticulos ObtenerArticulos(Lfx.Data.Connection dataBase)
                {
                        m_Articulos = new Lbl.Comprobantes.ColeccionDetalleArticulos(dataBase);
                        int i = 1;
                        foreach (DetalleComprobante Pro in this.ChildControls) {
                                if (Pro.IsEmpty == false) {
                                        Lbl.Comprobantes.DetalleArticulo DetArt = new Lbl.Comprobantes.DetalleArticulo(dataBase);
                                        DetArt.Articulo = Pro.Elemento as Lbl.Articulos.Articulo;
                                        DetArt.Nombre = Pro.TextDetail;
                                        DetArt.Orden = i++;
                                        DetArt.Cantidad = Pro.Cantidad;
                                        DetArt.Unitario = Pro.Unitario;
                                        DetArt.Descuento = Pro.Descuento;
                                        DetArt.DatosSeguimiento = Pro.DatosSeguimiento;
                                        m_Articulos.Add(DetArt);
                                }
                        }

                        return m_Articulos;
                }