public override void RefreshSecondaryData()
        {
            if (_entity.OidSerie != 0)
            {
                SetSerie(SerieInfo.Get(_entity.OidSerie, false), false);
            }
            PgMng.Grow();

            if (_entity.OidAcreedor != 0)
            {
                SetAcreedor(ProviderBaseInfo.Get(_entity.OidAcreedor, _entity.ETipoAcreedor, false));
            }
            PgMng.Grow();

            if (_entity.OidAlmacen != 0)
            {
                SetAlmacen(StoreInfo.Get(_entity.OidAlmacen, false));
            }
            PgMng.Grow();

            if (_entity.OidExpediente != 0)
            {
                SetExpediente(ExpedientInfo.Get(_entity.OidExpediente, false));
            }
            PgMng.Grow();

            if (_acreedor != null)
            {
                ProductList.GetList(_acreedor, _serie, false, true);
            }
        }
예제 #2
0
        public override void RefreshSecondaryData()
        {
            if (_entity.OidSerie != 0)
            {
                SetSerie(SerieInfo.Get(_entity.OidSerie, false), false);
            }
            PgMng.Grow();

            if (_entity.OidAcreedor != 0)
            {
                SetProvider(ProviderBaseInfo.Get(_entity.OidAcreedor, _entity.ETipoAcreedor, false));
            }
            PgMng.Grow();

            if (_entity.OidAlmacen != 0)
            {
                SetStore(StoreInfo.Get(_entity.OidAlmacen, false));
            }
            PgMng.Grow();

            if (_entity.OidExpediente != 0)
            {
                SetExpedient(ExpedientInfo.Get(_entity.OidExpediente, false), false);
            }
            PgMng.Grow();

            base.RefreshSecondaryData();
        }
        public override void RefreshSecondaryData()
        {
            if (_entity.OidCliente != 0)
            {
                SetCliente(ClienteInfo.Get(_entity.OidCliente, false));
            }
            PgMng.Grow();

            if (_entity.OidSerie != 0)
            {
                SetSerie(SerieInfo.Get(_entity.OidSerie, false), false);
            }
            PgMng.Grow();

            if (_entity.OidAlmacen != 0)
            {
                SetAlmacen(StoreInfo.Get(_entity.OidAlmacen, false, true));
            }
            PgMng.Grow();

            if (_entity.OidExpediente != 0)
            {
                SetExpediente(ExpedientInfo.Get(_entity.OidExpediente, false, true));
            }
            PgMng.Grow();
        }
예제 #4
0
        public override void PrintObject()
        {
            PgMng.Reset(5, 1, Face.Resources.Messages.LOADING_DATA, this);

            OutputDeliveryReportMng reportMng = new OutputDeliveryReportMng(AppContext.ActiveSchema);

            OutputDeliveryInfo item = OutputDeliveryInfo.Get(EntityInfo.Oid, ETipoEntidad.WorkReport, true);

            PgMng.Grow();

            WorkReportInfo work_report = WorkReportInfo.Get(item.OidHolder, false);

            PgMng.Grow();

            ExpedientInfo work = ExpedientInfo.Get((work_report != null) ? work_report.OidExpedient : 0, false);

            PgMng.Grow();

            ReportClass report = reportMng.GetWorkDelivery(item, work);

            PgMng.FillUp();

            if (SettingsMng.Instance.GetUseDefaultPrinter())
            {
                int n_copias = SettingsMng.Instance.GetDefaultNCopies();
                PrintReport(report, n_copias);
            }
            else
            {
                ShowReport(report);
            }
        }
예제 #5
0
        protected override void GetFormSourceData(long oid, object[] parameters)
        {
            _entity = ExpedientInfo.Get(oid, false);
            PgMng.Grow();

            _entity.LoadChilds(typeof(Batch), true, true);
            PgMng.Grow(string.Empty, "Partidas");

            _entity.LoadChilds(typeof(Expense), true, true);
            PgMng.Grow(string.Empty, "Gastos");
        }
        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);
            }
        }
예제 #7
0
        public override void RefreshSecondaryData()
        {
            /*if (_entity.OidAlmacen != 0) SetAlmacen(StoreInfo.Get(_entity.OidAlmacen, false));
             * PgMng.Grow();*/

            if (_entity.OidExpedient != 0)
            {
                SetExpediente(ExpedientInfo.Get(_entity.OidExpedient, false));
            }
            PgMng.Grow();

            base.RefreshSecondaryData();
        }
        public override void DeleteObject(long oid)
        {
            ExpedientInfo exp = ExpedientInfo.Get(oid, false);

            exp.LoadChilds(typeof(Batch), false, true);
            if (exp.Partidas.Count > 0)
            {
                MessageBox.Show("El expediente tiene productos asociados",
                                moleQule.Face.Resources.Labels.ADVISE_TITLE,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);

                _action_result = DialogResult.Ignore;
                return;
            }

            exp.LoadChilds(typeof(Maquinaria), false, true);
            if (exp.Maquinarias != null && exp.Maquinarias.Count > 0)
            {
                MessageBox.Show("El expediente tiene maquinas asociadas",
                                moleQule.Face.Resources.Labels.ADVISE_TITLE,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);

                _action_result = DialogResult.Ignore;
                return;
            }

            Expedient.Delete(oid);
            _action_result = DialogResult.OK;

            ExpedienteList cache = Cache.Instance.Get(typeof(ExpedienteList)) as ExpedienteList;

            if (cache != null)
            {
                cache.RemoveItem(oid);
            }

            //Se eliminan todos los formularios de ese objeto
            foreach (EntityDriverForm form in _list_active_form)
            {
                if (form is ItemMngBaseForm)
                {
                    if (((ItemMngBaseForm)form).Oid == oid)
                    {
                        form.Dispose();
                        break;
                    }
                }
            }
        }
예제 #9
0
        public override void RefreshSecondaryData()
        {
            if (_delivery.OidAlmacen != 0)
            {
                _delivery_store = StoreInfo.Get(_delivery.OidAlmacen, false, true);
            }
            PgMng.Grow();

            if (_delivery.OidExpediente != 0)
            {
                _delivery_expedient = ExpedientInfo.Get(_delivery.OidExpediente, false, true);
            }
            PgMng.Grow();
        }
예제 #10
0
        protected virtual void SelectBatchAction()
        {
            BatchList list = BatchList.GetByProductStockList(_product.Oid, _provider.OidAcreedor, _provider.ETipoAcreedor, false);

            BatchSelectForm form = new BatchSelectForm(this, _serie, list);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BatchInfo batch = form.Selected as BatchInfo;
                _entity.CopyFrom(_delivery, batch);

                SetStore(StoreInfo.Get(_entity.OidAlmacen, false, true));
                SetExpedient(ExpedientInfo.Get(_entity.OidExpediente, false, true));
            }
        }
예제 #11
0
        private REAResumen(long oid_expediente)
        {
            ExpedientInfo p      = ExpedientInfo.Get(oid_expediente);
            Charges       cobros = Charges.GetListByExpediente(oid_expediente, true);

            Oid             = p.Oid;
            _oid_expediente = p.Oid;
            _codigo         = p.Codigo;
            //_cuenta = p.CuentaRea;
            //_expediente_rea = p.ExpedienteRea;
            //_certificado_rea = p.CertificadoRea;
            //_fecha_cobro_rea = p.CobroRea;
            _cobrado        = cobros.GetTotalREA();
            _ayuda_estimada = p.AyudaEstimada;
            _pendiente      = _ayuda_estimada - _cobrado;
        }
        public override void RefreshSecondaryData()
        {
            if (_entity.OidSerie != 0)
            {
                SetSerie(SerieInfo.Get(_entity.OidSerie, false), false);
            }
            PgMng.Grow();

            if (_entity.OidAlmacen != 0)
            {
                SetAlmacen(StoreInfo.Get(_entity.OidAlmacen, false));
            }
            PgMng.Grow();

            switch (_entity.EHolderType)
            {
            case ETipoEntidad.WorkReport:
            {
                if (_work_report == null)
                {
                    _work_report = WorkReportInfo.GetByResource(_entity.Oid, ETipoEntidad.OutputDelivery, false);
                }
                SetWorkReport(_work_report);
            }
            break;

            case ETipoEntidad.Cliente:
            {
                if (_entity.OidHolder != 0)
                {
                    SetCliente(ClienteInfo.Get(_entity.OidHolder, false));
                }
                PgMng.Grow();

                if (_entity.OidExpediente != 0)
                {
                    SetExpediente(ExpedientInfo.Get(_entity.OidExpediente, false));
                }
                PgMng.Grow();
            }
            break;
            }

            base.RefreshSecondaryData();
        }
        protected void SetWorkReport(WorkReportInfo source)
        {
            if (source == null)
            {
                return;
            }

            _entity.OidHolder = source.Oid;

            WorkReport_BS.DataSource = source;

            ExpedientInfo expedient = ExpedientInfo.Get(source.OidExpedient, false);

            Expedient_BS.DataSource = expedient;

            _entity.IDCliente     = (expedient != null) ? expedient.Codigo : string.Empty;
            _entity.NombreCliente = (expedient != null) ? expedient.TipoMercancia : string.Empty;
        }
        protected override void GetFormSourceData(long oid, object[] parameters)
        {
            _entity = ExpedientInfo.Get(oid, false);
            PgMng.Grow();

            _entity.LoadChilds(typeof(Batch), true, true);
            PgMng.Grow(string.Empty, "Partidas");

            try
            {
                _entity.LoadChilds(typeof(Expense), true, true);
                PgMng.Grow(string.Empty, "Gastos");
            }
            catch
            {
                PgMng.ShowWarningException(Resources.Messages.DUPLICATED_EXPENSE_LINE);
            }
        }
        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);
            }
        }