예제 #1
0
        protected void SetExpedient(ExpedientInfo source, bool setToLines = true)
        {
            _expedient = source;

            if (_expedient != null)
            {
                _entity.Expediente    = _expedient.Codigo;
                _entity.OidExpediente = _expedient.Oid;
                Expediente_TB.Text    = _expedient.Codigo;

                AddCacheItem(_expedient);

                //setToLines es para evitar que pregunte al cargar el albarán
                if (_entity.Conceptos.Count > 0 && setToLines)
                {
                    DialogResult result = ProgressInfoMng.ShowQuestion(string.Format("¿Asignar el expediente {0} a todos los conceptos del albarán?", _expedient.Codigo));

                    foreach (InputDeliveryLine item in _entity.Conceptos)
                    {
                        if (result == DialogResult.No && item.OidExpediente != 0)
                        {
                            continue;
                        }
                        item.OidExpediente = source.Oid;
                        item.Expediente    = source.Codigo;
                    }
                }
            }
        }
예제 #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();
        }
예제 #3
0
        protected void SetExpedient(ExpedientInfo expedient)
        {
            _expedient = expedient;

            if (_expedient != null)
            {
                if (_product != null)
                {
                    switch (_expedient.ETipo)
                    {
                    case moleQule.Store.Structs.ETipoExpediente.Ganado:

                        if (_product.ETipoFacturacion != ETipoFacturacion.Unitaria)
                        {
                            PgMng.ShowInfoException(Resources.Messages.NO_UNITS_ALLOWED);
                            return;
                        }

                        break;
                    }
                }

                _entity.OidExpediente = _expedient.Oid;
                _entity.Expediente    = _expedient.Codigo;
            }
            else
            {
                _entity.OidExpediente = 0;
                _entity.Expediente    = string.Empty;
            }

            Expediente_TB.Text = _entity.Expediente;
        }
        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);
            }
        }
        protected void SetExpediente(ExpedientInfo source)
        {
            _expediente = source;

            switch (_expediente.ETipo)
            {
            case moleQule.Store.Structs.ETipoExpediente.Ganado:
            case moleQule.Store.Structs.ETipoExpediente.Maquinaria:

                /*
                 *
                 *                                              if (_producto.ETipoVenta != ETipoVenta.Unitaria)
                 *                                              {
                 *                                                      PgMng.ShowInfoException("No es posible asignar productos no unitarios a este tipo de expediente");
                 *                                                      return;
                 *                                              }*/

                break;
            }

            if (_expediente != null)
            {
                _entity.Expediente    = _expediente.Codigo;
                _entity.OidExpediente = _expediente.Oid;
                Expediente_TB.Text    = _expediente.Codigo;
            }
        }
        protected override void DeleteWorkAction()
        {
            if (Works_DGW.CurrentRow == null)
            {
                return;
            }
            if (Works_DGW.CurrentRow.Index < 0)
            {
                return;
            }
            if (Works_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }

            if (PgMng.ShowDeleteConfirmation() == DialogResult.Yes)
            {
                ExpedientInfo item = (ExpedientInfo)Works_DGW.CurrentRow.DataBoundItem;

                Relation exp = _entity.Relations.GetRelationChild(item);
                if (exp != null)
                {
                    _entity.Relations.Remove(exp);
                }

                LoadData(true);
            }
        }
예제 #7
0
        public static FacREAInfo Get(ExpedienteREAInfo source, ExpedientInfo exp, Charge cobro)
        {
            FacREAInfo obj = new FacREAInfo();

            obj.CopyFrom(source, exp, cobro);
            return(obj);
        }
        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();
        }
예제 #9
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);
            }
        }
        public static OutputInvoiceLineList GetByExpedienteList(ExpedientInfo expediente, bool childs)
        {
            QueryConditions conditions = new QueryConditions {
                Expediente = expediente
            };

            return(GetList(conditions, childs));
        }
        public static OutputInvoiceLineList GetByExpedienteList(long oidExpediente, bool childs)
        {
            QueryConditions conditions = new QueryConditions {
                Expediente = ExpedientInfo.New(oidExpediente)
            };

            return(GetList(conditions, childs));
        }
예제 #12
0
        public static WorkReportList GetByExpedientList(long oidExpedient, bool childs)
        {
            QueryConditions conditions = new QueryConditions {
                Expedient = ExpedientInfo.New(oidExpedient)
            };

            return(GetList(SELECT(conditions), childs));
        }
 protected void AddCacheItem(ExpedientInfo item)
 {
     if (item == null)
     {
         return;
     }
     _oidExpedientes.Add(item.Oid);
 }
 protected void SetExpediente(ExpedientInfo source)
 {
     if (source != null)
     {
         _entity.Expediente    = source.Codigo;
         _entity.OidExpediente = source.Oid;
         Expediente_TB.Text    = source.Codigo;
     }
 }
예제 #15
0
        public static Charges GetListByExpediente(long oidExpedient, bool childs)
        {
            Library.Invoice.QueryConditions conditions = new Library.Invoice.QueryConditions
            {
                Expediente = ExpedientInfo.New(oidExpedient),
                TipoCobro  = ETipoCobro.REA
            };

            return(GetList(childs, SELECT(conditions)));
        }
        private void Expediente_BT_Click(object sender, EventArgs e)
        {
            ExpedienteSelectForm form = new ExpedienteSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _expediente        = form.Selected as ExpedientInfo;
                Expediente_TB.Text = _expediente.Codigo;
            }
        }
        /// Constructor
        /// </summary>
        public ConceptoKitUIForm(Product product, FamiliaInfo familia, ExpedientInfo exp)
            : base(true)
        {
            InitializeComponent();

            _product   = product;
            _familia   = familia;
            _expedient = exp;
            SetFormData();
        }
        protected void SetExpediente(ExpedientInfo source)
        {
            if (source == null)
            {
                return;
            }

            _expedient = source;

            Expediente_TB.Text = _expedient.Codigo;
        }
        private void Expediente_BT_Click(object sender, EventArgs e)
        {
            ExpedienteSelectForm form = new ExpedienteSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _expediente        = form.Selected as ExpedientInfo;
                _tipo_expediente   = moleQule.Store.Structs.ETipoExpediente.Todos;
                Expediente_TB.Text = _expediente.Codigo;
            }
        }
예제 #20
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 override void PrintAction()
        {
            PgMng.Reset(4, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

            if (!TodosExpediente_CkB.Checked && (_expediente == null))
            {
                return;
            }
            if (!TodosProducto_CkB.Checked && (_producto == null))
            {
                return;
            }

            ProductInfo producto = TodosProducto_CkB.Checked ? null : _producto;

            moleQule.Store.Structs.ETipoExpediente tipo = !TodosExpediente_CkB.Checked ? _expediente.ETipo : ETipoExpediente;
            ExpedientInfo expediente = TodosExpediente_CkB.Checked ? null : _expediente;
            DateTime      fecha      = FFinal_DTP.Checked ? FFinal_DTP.Value : DateTime.Today;

            InventarioValoradoList list;

            string filtro = GetFilterValues();

            PgMng.Grow();

            //if (Stock_CkB.Checked)
            list = InventarioValoradoList.GetListStock(tipo, expediente, fecha);
            //else
            //list = InventarioValoradoList.GetList(producto, tipo, expediente, fecha);

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

            ProductReportMng      reportMng = new ProductReportMng(AppContext.ActiveSchema, string.Empty, filtro);
            InventarioValoradoRpt rpt       = reportMng.GetInventarioValoradoReport(list, fecha);

            PgMng.FillUp();

            if (rpt != null)
            {
                ReportViewer.SetReport(rpt);
                ReportViewer.ShowDialog();
            }
            else
            {
                MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS,
                                moleQule.Face.Resources.Labels.ADVISE_TITLE,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
            }

            _action_result = DialogResult.Ignore;
        }
        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);
            }
        }
        protected void SetExpediente(ExpedientInfo source)
        {
            _expediente = source;

            if (_expediente != null)
            {
                _entity.Expediente    = _expediente.Codigo;
                _entity.OidExpediente = _expediente.Oid;
                Expediente_TB.Text    = source.Codigo;

                //AddCacheItem(source);*/
            }
        }
예제 #24
0
        protected void SetExpediente(ExpedientInfo source)
        {
            _expedient = source;

            Expedient_BS.DataSource = _expedient;

            if (_expedient != null)
            {
                _entity.OidExpedient = _expedient.Oid;
                _entity.Expedient    = _expedient.Codigo;
                Expediente_TB.Text   = _expedient.Codigo;
            }
        }
예제 #25
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;
                    }
                }
            }
        }
        public ReportClass GetWorkDelivery(OutputDeliveryInfo item, ExpedientInfo work)
        {
            if (item == null)
            {
                return(null);
            }

            List <OutputDeliveryLinePrint> conceptos = new List <OutputDeliveryLinePrint>();
            List <OutputDeliveryPrint>     pList     = new List <OutputDeliveryPrint>();

            foreach (OutputDeliveryLineInfo line in item.Conceptos)
            {
                conceptos.Add(OutputDeliveryLinePrint.New(line));
            }

            //Si no existen conceptos, no tiene sentido un informe detallado. Además, falla en Crystal Reports
            if (conceptos.Count <= 0)
            {
                return(null);
            }

            pList.Add(item.GetPrintObject());

            ReportClass doc = null;

            try
            {
                doc = GetReportFromName("Delivery", "WorkDeliveryRpt");
            }
            catch
            {
                doc = new WorkDeliveryRpt();
            }

            doc.SetDataSource(pList);
            doc.Subreports["LinesClientCopySubRpt"].SetDataSource(conceptos);
            doc.Subreports["LinesCompanyCopySubRpt"].SetDataSource(conceptos);

            CompanyInfo empresa = CompanyInfo.Get(Schema.Oid);

            doc.SetParameterValue("nombreEmpresa", empresa.Name);
            doc.SetParameterValue("dirEmpresa", empresa.Direccion);
            doc.SetParameterValue("CIFEmpresa", empresa.VatNumber);
            doc.SetParameterValue("TlfEmpresa", empresa.Telefonos);
            doc.SetParameterValue("WebEmpresa", empresa.Url);
            doc.SetParameterValue("WorkCode", (work != null) ? work.Codigo : string.Empty);
            doc.SetParameterValue("WorkDescription", (work != null) ? work.Description : string.Empty);

            return(doc);
        }
예제 #28
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();
        }
        protected string GetGrantAccount(ETipoAyuda grantType, ExpedientInfo expedient)
        {
            AyudaInfo ayuda  = null;
            string    cuenta = string.Empty;
            string    info   = string.Empty;

            try
            {
                switch (grantType)
                {
                case ETipoAyuda.REA:

                    switch (expedient.ETipoExpediente)
                    {
                    case ETipoExpediente.Alimentacion: ayuda = _ayudas.GetItem(Store.ModulePrincipal.GetAyudaREASetting()); break;

                    case ETipoExpediente.Ganado: ayuda = _ayudas.GetItem(Store.ModulePrincipal.GetAyudaPOSEISetting()); break;
                    }

                    cuenta = ayuda.CuentaContable;
                    info   = ayuda.Nombre;
                    break;

                case ETipoAyuda.Fomento:
                    ayuda  = _ayudas.GetItem(Store.ModulePrincipal.GetAyudaFomentoSetting());
                    cuenta = ayuda.CuentaContable;
                    info   = ayuda.Nombre;
                    break;
                }
            }
            catch (Exception ex)
            {
                if (ex is iQException)
                {
                    throw ex;
                }
                else
                {
                    throw new iQException(string.Format(Resources.Messages.NO_AYUDA_ACCOUNT, ayuda.Nombre));
                }
            }

            if (cuenta == string.Empty)
            {
                throw new iQException(string.Format(Resources.Messages.NO_AYUDA_ACCOUNT, ayuda.Nombre));
            }

            return(cuenta);
        }
예제 #30
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));
            }
        }