예제 #1
0
        public void PaymentListHasItems()
        {
            PaymentList list = null;

            list = PaymentList.GetList(2014, false);
            Assert.IsTrue(list.Count > 0);
        }
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "Pago");

            _selectedOid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:

                if (moleQule.Common.ModulePrincipal.GetUseActiveYear())
                {
                    List = PaymentList.GetList(_tipo, moleQule.Common.ModulePrincipal.GetActiveYear().Year, false);
                }
                else
                {
                    List = PaymentList.GetList(_tipo, false);
                }
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de Pagos");
        }
예제 #3
0
        public void PaymentListNotIsNull()
        {
            PaymentList list = null;

            list = PaymentList.GetList(2015, false);
            Assert.IsNotNull(list);
            Assert.AreEqual(list.Count, 0);
        }
예제 #4
0
        public void PaymentListHasItemsOnlyFromAEmployee()
        {
            PaymentList     list       = null;
            QueryConditions conditions = new QueryConditions {
                Acreedor = ProviderBaseInfo.New(1, ETipoAcreedor.Empleado)
            };

            list = PaymentList.GetList(conditions, false);
            Assert.IsNull(list.FirstOrDefault(x => x.OidAgente != conditions.Acreedor.Oid || x.ETipoAcreedor != ETipoAcreedor.Empleado));
        }
        public static PaymentListViewModel Get()
        {
            PaymentListViewModel list = new PaymentListViewModel();

            PaymentList sourceList = PaymentList.GetList(false);

            foreach (PagoInfo item in sourceList)
            {
                list.Add(PaymentViewModel.New(item));
            }

            return(list);
        }
        public override void PrintList()
        {
            PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
            PaymentReportMng reportMng = new PaymentReportMng(AppContext.ActiveSchema, this.Text, FilterValues);

            reportMng.ShowQRCode = false;

            PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT);
            PaymentListRpt report = reportMng.GetListReport(PaymentList.GetList((IList <PaymentInfo>)Datos.List), null);

            PgMng.FillUp();

            ShowReport(report);
        }
        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)
                {
                    PaymentList listA = PaymentList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.GetSortedList();
                }
                break;

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

            case molAction.Delete:
                break;
            }

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }
        public virtual void ExportExpenses()
        {
            Payments pagos2 = null;

            try
            {
                _store_conditions.TipoPago       = ETipoPago.Gasto;
                _store_conditions.CategoriaGasto = ECategoriaGasto.Generales;
                _store_conditions.Orders.Clear();
                _store_conditions.Orders.NewOrder("Vencimiento", System.ComponentModel.ListSortDirection.Ascending, typeof(Payment));

                PaymentList pagos = PaymentList.GetList(_store_conditions, true);

                foreach (PaymentInfo item in pagos)
                {
                    if (item.EEstado == EEstado.Anulado)
                    {
                        continue;
                    }

                    LineaRegistro lr = _registry.LineaRegistros.NewItem(_registry, item);

                    BuildExpenseAccountingEntry(item, lr);

                    _accounting_entry++;
                }

                //Cambiamos el estado de los elementos contabilizados
                pagos2 = Payments.GetList(_store_conditions, false);

                foreach (Payment item in pagos2)
                {
                    if (item.EEstado == EEstado.Anulado)
                    {
                        continue;
                    }

                    if (item.EEstado != EEstado.Exportado)
                    {
                        if (item.EEstadoPago == EEstado.Pagado)
                        {
                            item.EEstado = EEstado.Exportado;
                        }
                    }
                }

                pagos2.Save();
            }
            catch (iQException ex)
            {
                _registry = null;
                throw ex;
            }
            catch (Exception ex)
            {
                _registry = null;
                throw ex;
            }
            finally
            {
                if (pagos2 != null)
                {
                    pagos2.CloseSession();
                }
            }
        }