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 override void RefreshMainData()
        {
            Datos.DataSource        = _entity;
            Datos_Lineas.DataSource = _entity.Conceptos;
            PgMng.Grow();

            if (_entity.OidAcreedor > 0)
            {
                Datos_Emisor.DataSource = ProviderBaseInfo.Get(_entity.OidAcreedor, _entity.ETipoAcreedor, true);
            }
            PgMng.Grow();

            if (_entity.OidSerie > 0)
            {
                SerieInfo serie = SerieInfo.Get(_entity.OidSerie, false);
                Serie_TB.Text = serie.Nombre;
            }
            PgMng.Grow();

            DiasPago_NTB.Text       = _entity.DiasPago.ToString();
            Fecha_DTP.Value         = _entity.Fecha;
            FechaRegistro_DTP.Value = _entity.FechaRegistro;
            Prevision_TB.Text       = _entity.Prevision.ToShortDateString();

            base.RefreshMainData();
        }
Esempio n. 3
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();
        }
Esempio n. 4
0
        public override void PrintDetailAction()
        {
            if (ActiveItem == null)
            {
                return;
            }

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

            InputInvoiceInfo item = InputInvoiceInfo.Get(ActiveOID, ActiveItem.ETipoAcreedor, true);

            FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

            ProviderBaseInfo provider = ProviderBaseInfo.Get(ActiveItem.OidAcreedor, ActiveItem.ETipoAcreedor, false);
            SerieInfo        serie    = SerieInfo.Get(ActiveItem.OidSerie, false);

            conf.nota            = (provider.OidImpuesto == 1) ? Library.Invoice.Resources.Messages.NOTA_EXENTO_IGIC : string.Empty;
            conf.nota           += (conf.nota != string.Empty) ? Environment.NewLine : string.Empty;
            conf.nota           += (ActiveItem.Nota ? serie.Cabecera : "");
            conf.cuenta_bancaria = ActiveItem.CuentaBancaria;
            PgMng.Grow();

            ReportClass report = reportMng.GetDetailReport(item, conf);

            if (SettingsMng.Instance.GetUseDefaultPrinter())
            {
                int n_copias = SettingsMng.Instance.GetDefaultNCopies();
                PrintReport(report, n_copias);
            }
            else
            {
                ShowReport(report);
            }
        }
        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 void InputInvoiceListHasItemsOnlyFromAClient()
        {
            InputInvoiceList list       = null;
            QueryConditions  conditions = new QueryConditions {
                Acreedor = ProviderBaseInfo.New(1, ETipoAcreedor.Proveedor)
            };

            list = InputInvoiceList.GetList(conditions, false);
            Assert.IsNull(list.FirstOrDefault(x => x.OidAcreedor != conditions.Acreedor.Oid));
        }
        protected void DoAddAlbaran(BackgroundWorker bk)
        {
            Datos.RaiseListChangedEvents        = false;
            Datos_Lineas.RaiseListChangedEvents = false;

            try
            {
                PgMng.Reset(_results.Count + 1, 1, Resources.Messages.IMPORTANDO_ALBARANES, this);

                //Asignamos el titular
                if (_entity.OidAcreedor == 0 || _entity.AlbaranesFacturas.Count == 0)
                {
                    _entity.CopyFrom(_results[0]);
                    SetEmisor(ProviderBaseInfo.Get(_entity.OidAcreedor, _entity.ETipoAcreedor));
                }
                //else
                //{
                //    foreach (InputDeliveryInfo item in _results)
                //    {
                //        if (item.PIRPF != _entity.PIRPF)
                //        {
                //            PgMng.ShowInfoException(Resources.Messages.FACTURA_CON_IRPF_DISTINTO);
                //            return;
                //        }
                //    }
                //}

                foreach (InputDeliveryInfo item in _results)
                {
                    item.LoadChilds(typeof(InputDeliveryLine), true);
                    _entity.Insert(item);
                    _albaranes.Add(item);
                    PgMng.Grow(string.Empty, "Insertar el Albarán");
                }

                Result = BGResult.OK;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                PgMng.FillUp();

                Datos.RaiseListChangedEvents        = true;
                Datos_Lineas.RaiseListChangedEvents = true;
#if TRACE
                PgMng.ShowCronos();
#endif
            }
        }
        protected virtual void SelectEmisorAction()
        {
            ProviderSelectForm form = new ProviderSelectForm(this, moleQule.Base.EEstado.Active);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                ProviderBaseInfo proveedor = form.Selected as ProviderBaseInfo;

                SetEmisor(proveedor);

                CleanError(CodigoE_TB);
            }
        }
        public override void PrintObject()
        {
            /*InputInvoiceReportMng reportMng = new InputInvoiceReportMng(AppContext.ActiveSchema);
             *
             *          FormatConfFacturaProveedorAlbaranReport conf = new FormatConfFacturaProveedorAlbaranReport();
             * conf.nota = EntityInfo.Nota ? Nota_TB.Text : "";
             * conf.cabecera = Cabecera_CB.SelectedItem == null ? "FACTURA" : Cabecera_CB.SelectedItem.ToString();
             * conf.copia = Copia_CKB.Checked ? "COPIA" : "";
             * conf.cuenta_bancaria = Cuenta_TB.Text;
             * conf.forma_pago = "";
             *
             * ReportViewer.SetReport(reportMng.GetFacturaProveedorReport(EntityInfo, conf));
             * ReportViewer.ShowDialog();
             *
             * ReportClass report = reportMng.GetQRCodeReport(EntityInfo);
             *
             * if (SettingsMng.Instance.GetUseDefaultPrinter())
             * {
             *  int n_copias = SettingsMng.Instance.GetDefaultNCopies();
             *  PrintReport(report, n_copias);
             * }
             * else
             *  ShowReport(report);*/

            InputInvoiceReportMng reportMng = new InputInvoiceReportMng(AppContext.ActiveSchema);

            FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

            ProviderBaseInfo provider = ProviderBaseInfo.Get(EntityInfo.OidAcreedor, EntityInfo.ETipoAcreedor, false);
            SerieInfo        serie    = SerieInfo.Get(EntityInfo.OidSerie, false);

            conf.nota            = (provider.OidImpuesto == 1) ? Library.Invoice.Resources.Messages.NOTA_EXENTO_IGIC : string.Empty;
            conf.nota           += (conf.nota != string.Empty) ? Environment.NewLine : string.Empty;
            conf.nota           += (EntityInfo.Nota ? serie.Cabecera : "");
            conf.cuenta_bancaria = EntityInfo.CuentaBancaria;
            PgMng.Grow();

            ReportClass report = reportMng.GetDetailReport(EntityInfo, conf);

            if (SettingsMng.Instance.GetUseDefaultPrinter())
            {
                int n_copias = SettingsMng.Instance.GetDefaultNCopies();
                PrintReport(report, n_copias);
            }
            else
            {
                ShowReport(report);
            }
        }
        protected override void SetRowFormat(DataGridViewRow row)
        {
            if (!row.Displayed)
            {
                return;
            }
            if (row.IsNewRow)
            {
                return;
            }

            ProviderBaseInfo item = row.DataBoundItem as ProviderBaseInfo;

            Face.Common.ControlTools.Instance.SetRowColor(row, item.EEstado);
        }
        public override void RefreshSecondaryData()
        {
            if (_entity.OidAcreedor != 0)
            {
                SetEmisor(ProviderBaseInfo.Get(_entity.OidAcreedor, _entity.ETipoAcreedor, false));
            }
            PgMng.Grow();

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

            base.RefreshSecondaryData();
        }
Esempio n. 12
0
        protected void DoAddOrder(BackgroundWorker bk)
        {
            Datos.RaiseListChangedEvents    = false;
            Lines_BS.RaiseListChangedEvents = false;

            try
            {
                PgMng.Reset(_results.Count + 1, 1, Resources.Messages.IMPORTANDO_ALBARANES, this);

                //Asignamos el ACREEDOR
                if (_entity.OidAcreedor == 0)
                {
                    _entity.CopyFrom(_results[0]);
                    SetProvider(ProviderBaseInfo.Get(_results[0].OidAcreedor, _results[0].ETipoAcreedor));
                }

                foreach (PedidoProveedorInfo item in _results)
                {
                    _entity.Insert(item);
                    _orders.RemoveItem(item.Oid);
                }

                PgMng.Grow(string.Empty, "Insertar el Pedido");

                Result = BGResult.OK;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                PgMng.FillUp();

                Datos.RaiseListChangedEvents    = true;
                Lines_BS.RaiseListChangedEvents = true;
#if TRACE
                PgMng.ShowCronos();
#endif
            }
        }
Esempio n. 13
0
        public static WorkReport GetByResource(long oidResource, ETipoEntidad entityType, bool childs = true)
        {
            QueryConditions conditions = new QueryConditions();

            switch (entityType)
            {
            case ETipoEntidad.Empleado:
                conditions.Acreedor = ProviderBaseInfo.New(oidResource, ETipoAcreedor.Empleado);
                break;

            case ETipoEntidad.OutputDelivery:
                conditions.OutputDelivery = OutputDeliveryInfo.New(oidResource);
                break;

            case ETipoEntidad.Tool:
                conditions.Tool = ToolInfo.New(oidResource);
                break;
            }

            return(Get(SELECT(conditions, true), childs));
        }
Esempio n. 14
0
        public static OutputInvoiceList GetByBranchList(long oidPartner, long oidBranch, DateTime from, DateTime till, EStepGraph step, CriteriaEx criteria, bool childs)
        {
            QueryConditions conditions = new QueryConditions()
            {
                PagingInfo = (criteria != null) ? criteria.PagingInfo : null,
                Filters    = (criteria != null) ? criteria.Filters : null,
                Orders     = (criteria != null) ? criteria.Orders : null,
                IAcreedor  = ProviderBaseInfo.New(oidPartner, ETipoAcreedor.Partner),
                OidEntity  = oidBranch,
                FechaIni   = from,
                FechaFin   = till,
                Step       = step,
            };

            string query = OutputInvoice.SELECT_BY_BRANCH(conditions, false);

            if (criteria != null)
            {
                criteria.PagingInfo = conditions.PagingInfo;
            }

            return(GetList(query, criteria, childs));
        }