Example #1
0
 public void CargarVentasSinCalcular(Ccaja_diaria caja)
 {
     if (caja.LISTAVENTAS() == null)
     {
         caja.InstanciarVentasSinCalcular();
         DataTable         DT        = Cdatos_ventas.Devolver(caja);
         Ctrl_formas_pagos admformas = Ctrl_formas_pagos.ClaseActiva();
         if (DT.Rows.Count != 0)
         {
             Cpago  pago;
             int    idventa;
             int    anterior = 0;
             Cventa oventa   = new Cventa();
             foreach (DataRow DR in DT.Rows)
             {
                 pago    = new Cpago(admformas.BuscarPorID(Convert.ToInt32(DR[3])), Convert.ToDecimal(DR[4]), DR[5].ToString(), Convert.ToDecimal(DR[6]));
                 idventa = Convert.ToInt32(DR[0]);
                 if (anterior == idventa)
                 {
                     oventa.Pago2        = pago;
                     oventa.DescRecargo += pago.Descuento;
                 }
                 else
                 {
                     oventa = new Cventa(idventa, Convert.ToDecimal(DR[1]), Convert.ToDecimal(DR[2]), pago.Descuento, pago);
                     caja.LISTAVENTAS().Add(oventa);
                 }
                 anterior = idventa;
             }
         }
     }
 }
Example #2
0
        private void R_Venta_Load(object sender, EventArgs e)
        {
            Microsoft.Reporting.WinForms.ReportParameter Fecha       = new Microsoft.Reporting.WinForms.ReportParameter("Fecha", _Fecha.ToShortDateString());
            Microsoft.Reporting.WinForms.ReportParameter NumeroVenta = new Microsoft.Reporting.WinForms.ReportParameter("NumeroVenta", oVenta.ID.ToString());
            Microsoft.Reporting.WinForms.ReportParameter NumCaja     = new Microsoft.Reporting.WinForms.ReportParameter("NumCaja", id_Caja_diaria.ToString());
            Microsoft.Reporting.WinForms.ReportParameter Subtotal    = new Microsoft.Reporting.WinForms.ReportParameter("Subtotal", oVenta.Subtotal.ToString());
            Microsoft.Reporting.WinForms.ReportParameter Descuento   = new Microsoft.Reporting.WinForms.ReportParameter("Descuento", oVenta.DescRecargo.ToString());
            Microsoft.Reporting.WinForms.ReportParameter Total       = new Microsoft.Reporting.WinForms.ReportParameter("Total", oVenta.Total.ToString());
            Microsoft.Reporting.WinForms.ReportParameter FormaDePago = new Microsoft.Reporting.WinForms.ReportParameter("FormaDePago", oVenta.Pago.FormaPago.Descripcion);
            reportViewer1.LocalReport.SetParameters(FormaDePago);
            reportViewer1.LocalReport.SetParameters(Fecha);
            reportViewer1.LocalReport.SetParameters(NumeroVenta);
            reportViewer1.LocalReport.SetParameters(NumCaja);
            reportViewer1.LocalReport.SetParameters(Subtotal);
            reportViewer1.LocalReport.SetParameters(Descuento);
            reportViewer1.LocalReport.SetParameters(Total);
            ItemsBindingSource.DataSource = Cdatos_ventas.DevolverItemsVenta(oVenta, id_Caja_diaria);
            System.Drawing.Printing.PageSettings page = new System.Drawing.Printing.PageSettings();

            /*System.Drawing.Printing.PaperSize size = new System.Drawing.Printing.PaperSize();
             * size.RawKind = (int)System.Drawing.Printing.PaperKind.A5; ;
             * page.PaperSize = size;*/
            page.Margins = new System.Drawing.Printing.Margins(50, 50, 50, 50);
            reportViewer1.SetPageSettings(page);
            this.reportViewer1.RefreshReport();
        }
Example #3
0
 public void GuardarItems(Cventa obj, Ccaja_diaria caja)
 {
     foreach (Citem aux in obj.Items())
     {
         Cdatos_ventas.RegistrarItem(aux, obj, caja);
     }
 }
Example #4
0
 public void AgregarVenta(Cventa obj, Cusuario objusu, Ccaja_diaria caja)
 {
     ultimaventa++;
     obj.ID = ultimaventa;
     Cdatos_ventas.Agregar(obj, caja, objusu);
     Cdatos_ventas.RegistrarPago(obj, caja, obj.Pago);
     if (obj.Pago2 != null)
     {
         Cdatos_ventas.RegistrarPago(obj, caja, obj.Pago2);
     }
     caja.AgregarVenta(obj);
 }
Example #5
0
        public void CargarItems(Cventa oVenta, int caja_diaria)
        {
            DataTable      DT     = Cdatos_ventas.DevolverArticulosVenta(oVenta, caja_diaria);
            Ctrl_articulos admArt = Ctrl_articulos.ClaseActiva();

            admArt.DevolverListaVigentes();
            foreach (DataRow DR in DT.Rows)
            {
                Carticulo obj = admArt.BuscarEnVigentes(DR[0].ToString());
                oVenta.Items().Add(new Citem(obj, Convert.ToDecimal(DR[1]), Convert.ToDecimal(DR[2])));
            }
        }
Example #6
0
        public void EliminarVenta(Cventa obj, Ccaja_diaria caja)
        {
            foreach (Citem aux in obj.Items())
            {
                Cdatos_ventas.EliminarItem(aux, obj, caja);
            }
            Cdatos_ventas.EliminarPagos(obj, caja);
            Cdatos_ventas.Eliminar(obj, caja);

            caja.EliminarVenta(obj);
            if (Cdatos_cajas_diarias.CajaCerrada(caja))
            {
                Cdatos_cajas_diarias.Modificar(caja);
            }
        }
Example #7
0
 public decimal CantidadDeArtHistorico(Carticulo oArt)
 {
     return(Cdatos_ventas.CantHistoricaArt(oArt));
 }