コード例 #1
0
        public static ProviderListViewModel Get(ProviderBaseList sourceList)
        {
            ProviderListViewModel list = new ProviderListViewModel();

            foreach (ProviderBaseInfo item in sourceList)
            {
                list.Add(ProviderViewModel.New(item));
            }

            return(list);
        }
コード例 #2
0
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "Proveedor");

            _selectedOid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                List = ProviderBaseList.GetList(_estado, false);
                break;
            }
            PgMng.Grow(string.Empty, "Lista de Proveedores");
        }
コード例 #3
0
        public override void PrintList()
        {
            PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);

            InputInvoiceReportMng reportMng = new InputInvoiceReportMng(AppContext.ActiveSchema, this.Text, FilterValues);

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

            InputInvoiceListRpt report = reportMng.GetListReport(InputInvoiceList.GetList(Datos.DataSource as IList <InputInvoiceInfo>),
                                                                 ProviderBaseList.GetList(false));

            PgMng.FillUp();

            ShowReport(report);
        }
コード例 #4
0
        protected virtual void PrintPendienteListAction()
        {
            if (Pendientes_DGW.CurrentRow == null)
            {
                return;
            }

            InputInvoiceInfo factura = Pendientes_DGW.CurrentRow.DataBoundItem as InputInvoiceInfo;

            InputInvoiceReportMng reportMng = new InputInvoiceReportMng(AppContext.ActiveSchema, this.Text, "Acreedor = " + factura.Acreedor);

            InputInvoiceListRpt report = reportMng.GetListReport(Datos_Pendientes.DataSource as InputInvoiceList,
                                                                 ProviderBaseList.GetList(false));

            ShowReport(report);
        }
コード例 #5
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    ProviderBaseList listA = ProviderBaseList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.GetSortedList();
                }
                break;

            case molAction.Edit:
            case molAction.Lock:
            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)
                {
                    ProviderBaseList listD = ProviderBaseList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            _entity = null;
            RefreshSources();
        }
コード例 #6
0
        public override void PrintList()
        {
            PgMng.Reset(4, 1, Face.Resources.Messages.LOADING_DATA, this);

            ProviderBaseList acreedores = ProviderBaseList.GetList(false);

            PgMng.Grow();

            SerieList series = SerieList.GetList(false);

            PgMng.Grow();

            InputDeliveryReportMng rptMng = new InputDeliveryReportMng(AppContext.ActiveSchema, Text, FilterValues);

            AlbaranRecibidoListRpt report = rptMng.GetListReport(InputDeliveryList.GetList(Datos.DataSource as IList <InputDeliveryInfo>),
                                                                 series,
                                                                 acreedores);

            PgMng.FillUp();

            ShowReport(report);
        }
コード例 #7
0
        public virtual void ExportPayments()
        {
            Payments payments2 = null;

            try
            {
                _store_conditions.Orders.Clear();
                _store_conditions.Orders.NewOrder("Vencimiento", System.ComponentModel.ListSortDirection.Ascending, typeof(Payment));

                PaymentList payments = PaymentList.GetOrderedByFechaList(_store_conditions, true);

                //if (pagos.Count == 0) return; // throw new iQException(Library.Resources.Messages.NO_RESULTS);

                //Hacen falta todas porque un pago puede estar asociado a una factura que no este en las condiciones del filtro
                _input_invoices = InputInvoiceList.GetList(false);
                _providers      = (_providers == null) ? ProviderBaseList.GetList(false) : _providers;
                _employees      = (_employees == null) ? EmployeeList.GetList(false) : _employees;
                _expense_types  = (_expense_types == null) ? TipoGastoList.GetList(false) : _expense_types;
                _payrolls       = (_payrolls == null) ? PayrollList.GetList(false) : _payrolls;

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

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

                    switch (item.ETipoPago)
                    {
                    case ETipoPago.Factura:
                    {
                        BuildInvoicePaymentAccountingEntry(item, lr);
                        BuildFinancialCashBookPaymentAccountingEntry(item);
                    }
                    break;

                    case ETipoPago.Nomina:
                    {
                        BuildPayrollPaymentAccountingEntry(item, lr);
                    }
                    break;

                    case ETipoPago.Gasto:
                    {
                        BuildExpensePaymentAccountingEntry(item, lr);
                    }
                    break;

                    case ETipoPago.ExtractoTarjeta:
                    {
                        BuildCreditCardStatementPaymentAccountingEntry(item, lr);
                    }
                    break;
                    }

                    _accounting_entry++;
                }

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

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

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

                payments2.Save();
            }
            catch (iQException ex)
            {
                _registry = null;
                throw ex;
            }
            catch (Exception ex)
            {
                _registry = null;
                throw ex;
            }
            finally
            {
                if (payments2 != null)
                {
                    payments2.CloseSession();
                }
            }
        }
コード例 #8
0
        public virtual void ExportInputInvoices()
        {
            InputInvoices invoices = null;

            try
            {
                _store_conditions.Orders.Clear();
                _store_conditions.Orders.NewOrder("Acreedor", System.ComponentModel.ListSortDirection.Ascending, typeof(InputInvoice));
                _store_conditions.Orders.NewOrder("Fecha", System.ComponentModel.ListSortDirection.Ascending, typeof(InputInvoice));

                _input_invoices = InputInvoiceList.GetList(_store_conditions, true);
                _providers      = (_providers == null) ? ProviderBaseList.GetList(false) : _providers;

                foreach (InputInvoiceInfo item in _input_invoices)
                {
                    LineaRegistro lr = _registry.LineaRegistros.NewItem(_registry, item);

                    BuildInputInvoiceAccountingEntry(item, lr);
                    BuildTaxBookSoportadoAccountingEntry(item);

                    _accounting_entry++;
                }

                //Cambiamos el estado de las facturas contabilizadas
                invoices = InputInvoices.GetList(_store_conditions, false);

                foreach (InputInvoice item in invoices)
                {
                    item.LoadChilds(typeof(InputInvoiceLine), false);
                }

                foreach (InputInvoice item in invoices)
                {
                    if (item.EEstado == EEstado.Anulado)
                    {
                        continue;
                    }

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

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