Esempio n. 1
0
        protected virtual void LoadIncomes(long oidExpediente)
        {
            if (_facturas_ingresos_list != null)
            {
                return;
            }

            try
            {
                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);

                _facturas_ingresos_list    = OutputInvoiceList.GetByExpedienteList(oidExpediente, false);
                Datos_FIngresos.DataSource = _facturas_ingresos_list;
                PgMng.Grow();

                TotalPendienteFacturasE_NTB.Text  = _facturas_ingresos_list.TotalPendiente().ToString("N2");
                TotalFacturasE_NTB.Text           = _facturas_ingresos_list.Total().ToString("N2");
                TotalExpedienteFacturasE_NTB.Text = _facturas_ingresos_list.TotalExpediente().ToString("N2");

                BePurchases_NTB.Text = TotalExpedienteFacturasE_NTB.DecimalValue.ToString("C2");

                _conceptos_ingresos_list   = OutputInvoiceLineList.GetByExpedienteList(oidExpediente, false);
                Datos_CIngresos.DataSource = _conceptos_ingresos_list;
                PgMng.Grow();

                CalculateBeneficios();
            }
            finally
            {
                PgMng.FillUp();
            }
        }
Esempio n. 2
0
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "ConceptoFactura");

            _selectedOid = ActiveOID;

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

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de OutputInvoiceLines");
        }
        public static OutputInvoiceLineListViewModel Get(OutputInvoiceLineList sourceList)
        {
            OutputInvoiceLineListViewModel list = new OutputInvoiceLineListViewModel();

            foreach (OutputInvoiceLineInfo item in sourceList)
            {
                list.Add(OutputInvoiceLineViewModel.New(item));
            }

            return(list);
        }
Esempio n. 4
0
        public InvoiceLineMngForm(bool isModal, Form parent, OutputInvoiceLineList lista)
            : base(isModal, parent, lista)
        {
            InitializeComponent();

            SetView(molView.Normal);

            // Parche para poder abrir el formulario en modo diseño y no perder la configuracion de columnas
            DatosLocal_BS    = Datos;
            Tabla.DataSource = DatosLocal_BS;

            SetMainDataGridView(Tabla);
            Datos.DataSource = OutputInvoiceLineList.NewList().GetSortedList();
            SortProperty     = FechaFactura.DataPropertyName;
            SortDirection    = ListSortDirection.Descending;
        }
Esempio n. 5
0
        protected virtual void Beneficios()
        {
            if (EntityInfo == null)
            {
                return;
            }

            OutputInvoiceLineList list = OutputInvoiceLineList.GetListByExpediente(EntityInfo.Oid, false);

            decimal suma = 0.0m;

            foreach (OutputInvoiceLineInfo c in list)
            {
                suma += (c.Precio - c.Gastos) * c.CantidadKilos;
            }

            //BeneficioReal_NTB.Text = suma.ToString("N2");
        }
Esempio n. 6
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
                if (_entity == null)
                {
                    return;
                }
                if (List.GetItem(_entity.Oid) != null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    OutputInvoiceLineList listA = OutputInvoiceLineList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.GetSortedList();
                }
                break;

            case molAction.CustomAction1:
            case molAction.CustomAction2:
            case molAction.Edit:
            case molAction.Lock:
            case molAction.Unlock:

                if (_selected != null)
                {
                    List <OutputInvoiceLineInfo> entities = (List <OutputInvoiceLineInfo>)_selected;
                    foreach (OutputInvoiceLineInfo item in entities)
                    {
                        List.GetItem(item.Oid).CopyFrom(item);
                        if (FilterType == IFilterType.Filter)
                        {
                            OutputInvoiceLineList list   = OutputInvoiceLineList.GetList(_filter_results);
                            OutputInvoiceLineInfo entity = list.GetItem(item.Oid);
                            if (entity != null)
                            {
                                entity.CopyFrom(item);
                            }
                            _filter_results = list.GetSortedList();
                        }
                    }
                }

                if (_entity == null)
                {
                    return;
                }
                ActiveItem.CopyFrom(_entity);

                break;

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

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }