Beispiel #1
0
        public static OutputDeliveryList GetList(bool childs,
                                                 long oidHolder,
                                                 ETipoEntidad holderType,
                                                 long oidSerie,
                                                 ETipoAlbaranes deliveryType,
                                                 ETipoFactura invoiceType,
                                                 DateTime from,
                                                 DateTime till)
        {
            QueryConditions conditions = new QueryConditions
            {
                Serie         = (oidSerie != 0) ? SerieInfo.New(oidSerie) : null,
                TipoEntidad   = holderType,
                TipoAlbaranes = deliveryType,
                TipoFactura   = invoiceType,
                FechaIni      = from,
                FechaFin      = till,
            };

            switch (holderType)
            {
            case ETipoEntidad.Cliente:
                conditions.Cliente = (oidHolder != 0) ? ClienteInfo.New(oidHolder) : null;
                break;

            case ETipoEntidad.WorkReport:
                conditions.WorkReport = (oidHolder != 0) ? WorkReportInfo.New(oidHolder) : null;
                break;
            }

            return(GetList(childs, SELECT(conditions)));
        }
Beispiel #2
0
        public void OutputInvoiceListHasItemsOnlyFromASerie()
        {
            OutputInvoiceList list       = null;
            QueryConditions   conditions = new QueryConditions {
                Serie = SerieInfo.New(1)
            };

            list = OutputInvoiceList.GetList(conditions, false);
            Assert.IsNull(list.FirstOrDefault(x => x.OidSerie != conditions.Serie.Oid));
        }
Beispiel #3
0
        public static OutputDeliveryList GetNoFacturadosAgrupados(long oidSerie, DateTime from, DateTime till, bool childs)
        {
            QueryConditions conditions = new QueryConditions
            {
                TipoEntidad   = ETipoEntidad.Cliente,
                Serie         = (oidSerie != 0) ? SerieInfo.New(oidSerie) : null,
                TipoAlbaranes = ETipoAlbaranes.Agrupados,
                FechaIni      = from,
                FechaFin      = till,
            };

            return(GetList(childs, OutputDelivery.SELECT_PENDIENTES_CONTADO(conditions, childs)));
        }
Beispiel #4
0
        public static OutputDeliveryList GetListBySerie(bool childs, long oidSerie, int year, ETipoAlbaranes tipo, ETipoFactura invoiceType)
        {
            QueryConditions conditions = new QueryConditions
            {
                Serie         = SerieInfo.New(oidSerie),
                TipoAlbaranes = tipo,
                TipoFactura   = invoiceType,
                FechaIni      = DateAndTime.FirstDay(year),
                FechaFin      = DateAndTime.LastDay(year)
            };

            return(GetList(childs, SELECT(conditions)));
        }
        protected void ShowStoreFileReport(Library.Store.QueryConditions conditions)
        {
            ExpedientInfo expediente_ini = Rango_RB.Checked ? _expediente_ini : null;
            ExpedientInfo expediente_fin = Rango_RB.Checked ? _expediente_fin : null;

            if (PorExpediente_RB.Checked)
            {
                ExpedientReportMng reportMng = new ExpedientReportMng(AppContext.ActiveSchema, this.Text, GetFilterValues());

                MovimientosStockListPorExpedienteRpt rpt = null;

                if (TodosExpediente_RB.Checked)
                {
                    rpt = reportMng.GetMovimientosStockListAgrupado(ExpedienteList.GetList(conditions.TipoExpediente, false), conditions.Producto, SerieInfo.New(conditions.Serie.Oid), _report_filter, _report_format);
                }
                else if (Seleccion_RB.Checked)
                {
                    rpt = reportMng.GetMovimientosStockListAgrupado(ExpedientInfo.Get(conditions.Expedient.Oid, false), conditions.Producto, SerieInfo.New(conditions.Serie.Oid), _report_filter, _report_format, false);
                }
                else if (Rango_RB.Checked)
                {
                    rpt = reportMng.GetMovimientosStockListAgrupado(ExpedienteList.GetListByRango(expediente_ini, expediente_fin, false), conditions.Producto, SerieInfo.New(conditions.Serie.Oid), _report_filter, _report_format);
                }

                PgMng.FillUp();

                ShowReport(rpt);
            }
            else if (PorProducto_RB.Checked)
            {
                StoreReportMng reportMng = new StoreReportMng(AppContext.ActiveSchema, this.Text, GetFilterValues());

                StockList stocks = null;

                if (TodosExpediente_RB.Checked)
                {
                    stocks = StockList.GetReportList(conditions, null, null, _report_filter.SoloStock, false);
                }
                else if (Seleccion_RB.Checked)
                {
                    stocks = StockList.GetReportList(conditions, null, null, _report_filter.SoloStock, false);
                }
                else if (Rango_RB.Checked)
                {
                    stocks = StockList.GetReportList(conditions, expediente_ini, expediente_fin, _report_filter.SoloStock, false);
                }

                stocks.FillPurchasePrices();

                string stock_purchase_price_type = string.Empty;

                if (LastPurchasePrice_RB.Checked)
                {
                    stock_purchase_price_type = "Last";
                }
                else if (AveragePrice_RB.Checked)
                {
                    stock_purchase_price_type = "Average";
                }

                StoreFileRpt rpt = reportMng.GetStoreFile(stocks
                                                          , _report_filter
                                                          , _report_format
                                                          , StoreFileKg_RB.Checked
                                                          , stock_purchase_price_type);

                PgMng.FillUp();

                ShowReport(rpt);
            }
        }
        protected void ShowStandardReport(Library.Store.QueryConditions conditions)
        {
            ExpedientInfo expediente_ini = Rango_RB.Checked ? _expediente_ini : null;
            ExpedientInfo expediente_fin = Rango_RB.Checked ? _expediente_fin : null;

            ExpedientReportMng reportMng = new ExpedientReportMng(AppContext.ActiveSchema, this.Text, GetFilterValues());

            if (PorExpediente_RB.Checked)
            {
                MovimientosStockListPorExpedienteRpt rpt = null;

                if (TodosExpediente_RB.Checked)
                {
                    rpt = reportMng.GetMovimientosStockListAgrupado(ExpedienteList.GetList(conditions.TipoExpediente, false), conditions.Producto, SerieInfo.New(conditions.Serie.Oid), _report_filter, _report_format);
                }
                else if (Seleccion_RB.Checked)
                {
                    rpt = reportMng.GetMovimientosStockListAgrupado(ExpedientInfo.Get(conditions.Expedient.Oid, false), conditions.Producto, SerieInfo.New(conditions.Serie.Oid), _report_filter, _report_format, false);
                }
                else if (Rango_RB.Checked)
                {
                    rpt = reportMng.GetMovimientosStockListAgrupado(ExpedienteList.GetListByRango(expediente_ini, expediente_fin, false), conditions.Producto, SerieInfo.New(conditions.Serie.Oid), _report_filter, _report_format);
                }

                PgMng.FillUp();

                ShowReport(rpt);
            }
            else if (PorProducto_RB.Checked)
            {
                StockList stocks = null;

                if (TodosExpediente_RB.Checked)
                {
                    stocks = StockList.GetReportList(conditions, null, null, _report_filter.SoloStock, false);
                }
                else if (Seleccion_RB.Checked)
                {
                    stocks = StockList.GetReportList(conditions, null, null, _report_filter.SoloStock, false);
                }
                else if (Rango_RB.Checked)
                {
                    stocks = StockList.GetReportList(conditions, expediente_ini, expediente_fin, _report_filter.SoloStock, false);
                }

                StockLineListRpt rpt = reportMng.GetStockLineList(stocks, _report_filter, _report_format);

                PgMng.FillUp();

                ShowReport(rpt);
            }
        }