Exemplo n.º 1
0
        protected override void PrintAction()
        {
            PgMng.Reset(4, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

            Library.Invoice.QueryConditions conditions = new Library.Invoice.QueryConditions();

            conditions.Cliente        = TodosCliente_CkB.Checked ? null : _client;
            conditions.Producto       = TodosProducto_CkB.Checked ? null : _product;
            conditions.TipoProducto   = TodosProducto_CkB.Checked ? (ETipoProducto)(long)TipoProducto_CB.SelectedValue : ETipoProducto.Todos;
            conditions.Serie          = TodosSerie_CkB.Checked ? null : _serie;
            conditions.Expediente     = TodosExpediente_CkB.Checked ? null : _expedient;
            conditions.TipoExpediente = TodosExpediente_CkB.Checked ? (ETipoExpediente)(long)TipoExpediente_CB.SelectedValue : ETipoExpediente.Todos;
            conditions.FechaIni       = FInicial_DTP.Checked ? FInicial_DTP.Value : DateTime.MinValue;
            conditions.FechaFin       = FFinal_DTP.Checked ? FFinal_DTP.Value : DateTime.MaxValue;

            bool detalle = TipoDetallado_RB.Checked;

            string filtro = GetFilterValues();

            PgMng.Grow();

            CommonReportMng reportMng = new CommonReportMng(AppContext.ActiveSchema, this.Text, filtro);

            if (Cliente_RB.Checked)
            {
                VentasList list = VentasList.GetListByCliente(conditions, detalle);

                PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT);

                InformeVentasClientesRpt rpt = reportMng.GetVentasClientesReport(list, detalle);
                PgMng.FillUp();

                ShowReport(rpt);
            }
            else if (Producto_RB.Checked)
            {
                VentasList list = VentasList.GetListByProducto(conditions, detalle);

                PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT);

                InformeVentasProductosRpt rpt = reportMng.GetVentasProductosReport(list, detalle);
                PgMng.FillUp();

                ShowReport(rpt);
            }
            else
            {
                VentasList list = VentasList.GetListByExpediente(conditions, detalle);
                PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT);

                InformeVentasExpedientesRpt rpt = reportMng.GetVentasExpedienteReport(list, detalle);
                PgMng.FillUp();

                ShowReport(rpt);
            }

            _action_result = DialogResult.Ignore;
        }
Exemplo n.º 2
0
        protected virtual void ViewInformeVentasAction()
        {
            PgMng.Reset(3, 1, Face.Resources.Messages.RETRIEVING_DATA, this);
            PgMng.Grow();

            Library.Invoice.QueryConditions conditions = new Library.Invoice.QueryConditions {
                Expediente = EntityInfoNoChilds
            };

            VentasList list = VentasList.GetListByExpediente(conditions, true);

            PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT);

            Library.Invoice.CommonReportMng reportMng = new Library.Invoice.CommonReportMng(AppContext.ActiveSchema, Resources.Labels.VENTAS_EXPEDIENTE_REPORT_TITLE, "Expediente = " + EntityInfoNoChilds.Codigo);
            InformeVentasExpedientesRpt     report    = reportMng.GetVentasExpedienteReport(list, true);

            PgMng.FillUp();
            ShowReport(report);
        }