Ejemplo n.º 1
0
        public void ExpenseListHasItems()
        {
            ExpenseList list = null;

            list = ExpenseList.GetList(false);
            Assert.IsTrue(list.Count > 0);
        }
Ejemplo n.º 2
0
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "Gasto");

            _selectedOid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                if (moleQule.Common.ModulePrincipal.GetUseActiveYear())
                {
                    List = ExpenseList.GetList(_categoria, moleQule.Common.ModulePrincipal.GetActiveYear().Year, false);
                }
                else
                {
                    List = ExpenseList.GetList(_categoria, false);
                }
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de Gastos");
        }
Ejemplo n.º 3
0
        public void ExpenseListHasItemsOnlyFromBankCategory()
        {
            ExpenseList list = null;

            list = ExpenseList.GetList(ECategoriaGasto.Bancario, 2013, false);
            Assert.IsTrue(list.Count > 0);
            Assert.IsNull(list.FirstOrDefault(x => x.Fecha.Year != 2013 || x.ECategoriaGasto != ECategoriaGasto.Bancario));
        }
Ejemplo n.º 4
0
        public void ExpenseListHasItemsOnlyFromAYear()
        {
            ExpenseList list = null;

            list = ExpenseList.GetList(ECategoriaGasto.Todos, 2013, false);
            Assert.IsTrue(list.Count > 0);
            Assert.IsNull(list.FirstOrDefault(x => x.Fecha.Year != 2013));
        }
Ejemplo n.º 5
0
        public void ExpenseListNotIsNull()
        {
            ExpenseList list = null;

            list = ExpenseList.GetList(ECategoriaGasto.Todos, 2000, false);
            Assert.IsNotNull(list);
            Assert.AreEqual(list.Count, 0);
        }
Ejemplo n.º 6
0
        public override void PrintList()
        {
            PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
            ExpenseReportMng reportMng = new ExpenseReportMng(AppContext.ActiveSchema, this.Text, FilterValues);

            PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT);
            ExpenseListRpt report = reportMng.GetListReport(ExpenseList.GetList((IList <ExpenseInfo>)Datos.List));

            PgMng.FillUp();
            ShowReport(report);
        }
Ejemplo n.º 7
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
            case molAction.Copy:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    ExpenseList listA = ExpenseList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    //_filter_results.Clear();
                    _filter_results = listA.GetSortedList();
                }
                break;

            case molAction.Edit:
            case molAction.ChangeStateContabilizado:
            case molAction.Unlock:
                if (_entity == null)
                {
                    return;
                }
                ActiveItem.CopyFrom(_entity);
                break;

            case molAction.Delete:
                if (ActiveItem == null)
                {
                    return;
                }
                List.RemoveItem(ActiveOID);
                if (FilterType == IFilterType.Filter)
                {
                    ExpenseList listD = ExpenseList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    //_filter_results.Clear();
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }
Ejemplo n.º 8
0
        protected override void SetUnlinkedGridValues(string gridName)
        {
            SortedBindingList <ExpenseInfo> gastos = Datos_Lineas.DataSource as Csla.SortedBindingList <ExpenseInfo>;
            ExpenseList list = ExpenseList.GetList(gastos);

            if (gastos != null)
            {
                list.UpdatePagoValues(_entity);
            }
            Datos_Lineas.DataSource = list.GetSortedList();
            UpdateAllocated();
        }
        protected override void PrintAction()
        {
            PgMng.Reset(4, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

            if (Seleccion_RB.Checked && (_expediente == null))
            {
                return;
            }
            if (Rango_RB.Checked && ((_expediente_ini == null) || (_expediente_fin == null)))
            {
                return;
            }

            Library.Store.QueryConditions conditions = new Library.Store.QueryConditions
            {
                Expedient      = Seleccion_RB.Checked ? _expediente : null,
                TipoExpediente = TodosExpediente_RB.Checked ? (moleQule.Store.Structs.ETipoExpediente)(long) TipoExpediente_CB.SelectedValue : moleQule.Store.Structs.ETipoExpediente.Todos,
                FechaIni       = FInicial_DTP.Checked ? FInicial_DTP.Value : DateTime.MinValue,
                FechaFin       = FFinal_DTP.Checked ? FFinal_DTP.Value : DateTime.MaxValue,
                CategoriaGasto = ECategoriaGasto.Expediente,
                TipoAcreedor   = new ETipoAcreedor[1] {
                    (ETipoAcreedor)(long)TipoAcreedor_CB.SelectedValue
                },
            };

            ExpedientInfo expediente_ini = Rango_RB.Checked ? _expediente_ini : null;
            ExpedientInfo expediente_fin = Rango_RB.Checked ? _expediente_fin : null;

            _filter.SoloIncompletos = Incompletos_CkB.Checked;

            ReportFormat format = new ReportFormat();

            if (Agrupado_RB.Checked)
            {
                format.Vista = EReportVista.Agrupado;
            }
            else if (Lista_RB.Checked)
            {
                format.Vista = EReportVista.ListaCompleta;
            }
            else if (Resumido_RB.Checked)
            {
                format.Vista = EReportVista.Resumido;
            }

            string filtro = GetFilterValues();

            PgMng.Grow();

            ExpenseList           gastos      = null;
            ExpedienteList        expedientes = null;
            InputDeliveryLineList conceptos   = null;

            if (TodosExpediente_RB.Checked)
            {
                if (format.Vista == EReportVista.Resumido)
                {
                    gastos = ExpenseList.GetByFacturaExpedienteList(conditions, null, null);
                }
                else
                {
                    gastos = ExpenseList.GetList(conditions, null, null);
                }
                expedientes = ExpedienteList.GetList(conditions, null, null);
                conceptos   = InputDeliveryLineList.GetByExpedienteList(conditions, null, null);
            }
            else if (Seleccion_RB.Checked)
            {
                if (format.Vista == EReportVista.Resumido)
                {
                    gastos = ExpenseList.GetByFacturaExpedienteList(conditions, null, null);
                }
                else
                {
                    gastos = ExpenseList.GetList(conditions, null, null);
                }
                expedientes = ExpedienteList.GetList(conditions, null, null);
                conceptos   = InputDeliveryLineList.GetByExpedienteList(conditions, null, null);
            }
            else if (Rango_RB.Checked)
            {
                if (format.Vista == EReportVista.Resumido)
                {
                    gastos = ExpenseList.GetByFacturaExpedienteList(conditions, expediente_ini, expediente_fin);
                }
                else
                {
                    gastos = ExpenseList.GetList(conditions, expediente_ini, expediente_fin);
                }
                expedientes = ExpedienteList.GetList(conditions, expediente_ini, expediente_fin);
                conceptos   = InputDeliveryLineList.GetByExpedienteList(conditions, expediente_ini, expediente_fin);
            }

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

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

            if (format.Vista == EReportVista.Resumido)
            {
                ExpensesReportVerticalRpt rpt = reportMng.GetInformeGastoVerticalListReport(gastos, expedientes, _filter, conceptos);
                PgMng.FillUp();

                ShowReport(rpt);
            }
            else
            {
                ExpensesReportRpt rpt = reportMng.GetInformeGastoListReport(gastos, expedientes, _filter, format);
                PgMng.FillUp();

                ShowReport(rpt);
            }

            _action_result = DialogResult.Ignore;
        }