Example #1
0
        protected override void RefreshMainData()
        {
            Datos.DataSource    = _entity;
            Lines_BS.DataSource = _entity.ConceptoFacturas;
            PgMng.Grow();

            if (_entity.OidCliente > 0)
            {
                Client_BS.DataSource = ClienteInfo.Get(_entity.OidCliente, true);
            }
            PgMng.Grow();

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

            if (_entity.OidTransportista > 0)
            {
                _transporter          = TransporterInfo.Get(_entity.OidTransportista, ETipoAcreedor.TransportistaDestino, false);
                Transportista_TB.Text = _transporter.Nombre;
            }
            PgMng.Grow();

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

            base.RefreshMainData();
        }
        protected void CopyValues(OutputDeliveryInfo delivery, ClienteInfo client, TransporterInfo transporter)
        {
            if (delivery == null)
            {
                return;
            }

            Oid = delivery.Oid;
            _base.CopyValues(delivery);

            if (client != null)
            {
                _base._id_cliente = client.Codigo;
                _base._cliente    = client.Nombre;
                _direccion        = client.Direccion;
                _poblacion        = client.Poblacion;
                _provincia        = client.Provincia;
                _telefonos        = client.Telefonos;
                _fax           = client.Fax;
                _municipio     = client.Municipio;
                _codigo_postal = client.CodigoPostal;
            }

            if (transporter != null)
            {
                _nombre_transportista = transporter.Nombre;
            }
        }
Example #3
0
        protected void CopyValues(OutputInvoiceInfo factura, ClienteInfo cliente, TransporterInfo transporte, SerieInfo serie, bool get_QRCode)
        {
            if (factura == null)
            {
                return;
            }

            _base.CopyValues(factura);

            if (cliente != null)
            {
                _base._id_cliente = cliente.Codigo;
                _telefonos        = cliente.Telefonos;
                _fax = cliente.Fax;
            }

            if (transporte != null)
            {
                _nombre_transportista = transporte.Nombre;
            }

            if (serie != null)
            {
                _serie         = serie.Identificador;
                _nombre_serie  = serie.Nombre;
                _base._n_serie = serie.Identificador;
            }

            _conceptos = factura.ConceptoFacturas;

            if (get_QRCode)
            {
                _qr_code_print.LoadQRCode(_qr_code_print.Encode(QREncodeVersion.v1, ETipoEntidad.FacturaEmitida, this), QRCodeVersion.v8);
            }
        }
        public override void PrintDetailAction()
        {
            if (ActiveItem == null)
            {
                return;
            }

            PgMng.Reset(6, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

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

            SerieInfo serie = SerieInfo.Get(ActiveItem.OidSerie, false);

            PgMng.Grow();

            ClienteInfo client = ClienteInfo.Get(ActiveItem.OidCliente, false);

            PgMng.Grow();

            TransporterInfo transporter = TransporterInfo.Get(ActiveItem.OidTransportista, ETipoAcreedor.TransportistaDestino, false);

            PgMng.Grow();

            FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

            conf.nota            = (client.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();

            OutputInvoiceInfo item = OutputInvoiceInfo.Get(ActiveOID, true);

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

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

            PgMng.FillUp();

            if (report != null)
            {
                if (SettingsMng.Instance.GetUseDefaultPrinter())
                {
                    int n_copias = SettingsMng.Instance.GetDefaultNCopies();
                    PrintReport(report, n_copias);
                }
                else
                {
                    ShowReport(report);
                }

                if (item.EEstado == EEstado.Abierto)
                {
                    ChangeStateAction(EEstadoItem.Emitido);
                }
            }
        }
        protected void SetTransportista(TransporterInfo source)
        {
            if (source == null)
            {
                return;
            }

            _entity.OidTransportista = source.Oid;
            Transporter_TB.Text      = source.Nombre;
        }
        protected void SetTransporter(TransporterInfo source)
        {
            if (source == null)
            {
                return;
            }

            _transporter = source;

            _entity.OidTransportista = _transporter.Oid;
            Transportista_TB.Text    = _transporter.Nombre;
        }
        private void TransDestino_BT_Click(object sender, EventArgs e)
        {
            TransporterSelectForm form = new TransporterSelectForm(this, TransporterList.GetList(ETipoTransportista.Destino, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _destination_transporter = form.Selected as TransporterInfo;
                _entity.OidTransDestino  = _destination_transporter.Oid;
                _entity.NombreTransDest  = _destination_transporter.Nombre;

                Datos.ResetBindings(false);
            }
        }
Example #8
0
        protected override void SetRowFormat(DataGridViewRow row)
        {
            if (!row.Displayed)
            {
                return;
            }
            if (row.IsNewRow)
            {
                return;
            }

            TransporterInfo item = row.DataBoundItem as TransporterInfo;

            Face.Common.ControlTools.Instance.SetRowColor(row, item.EEstado);
        }
Example #9
0
        protected override void RefreshMainData()
        {
            if (_entity.OidSerie > 0)
            {
                SetSerie(SerieInfo.Get(_entity.OidSerie, false), false);
            }
            PgMng.Grow();

            if (_entity.OidTransportista > 0)
            {
                SetTransportista(TransporterInfo.Get(_entity.OidTransportista, ETipoAcreedor.TransportistaDestino, false));
            }
            PgMng.Grow();

            base.RefreshMainData();
        }
        public override void ExportPDFAction()
        {
            if (ActiveItem == null)
            {
                return;
            }

            try
            {
                PgMng.Reset(9, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

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

                SerieInfo serie = SerieInfo.Get(ActiveItem.OidSerie, false);
                PgMng.Grow();

                ClienteInfo client = ClienteInfo.Get(ActiveItem.OidCliente, false);
                PgMng.Grow();

                TransporterInfo transporter = TransporterInfo.Get(ActiveItem.OidTransportista, ETipoAcreedor.TransportistaDestino, false);
                PgMng.Grow();

                FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

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

                OutputInvoiceInfo item = OutputInvoiceInfo.Get(ActiveOID, true);
                PgMng.Grow();

                ReportClass report = reportMng.GetDetailReport(item, serie, client, transporter, conf);
                PgMng.Grow();

                ExportPDF(report, ActiveItem.FileName);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                PgMng.FillUp();
            }
        }
Example #11
0
        protected virtual void PrintPendienteAction()
        {
            if (Pendientes_DGW.CurrentRow == null)
            {
                return;
            }

            OutputInvoiceInfo in_invoice = Pendientes_DGW.CurrentRow.DataBoundItem as OutputInvoiceInfo;

            PgMng.Reset(6, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

            OutputInvoiceReportMng reportMng = new OutputInvoiceReportMng(AppContext.ActiveSchema, this.Text, string.Empty);

            SerieInfo serie = SerieInfo.Get(in_invoice.OidSerie, false);

            PgMng.Grow();

            ClienteInfo client = ClienteInfo.Get(in_invoice.OidCliente, false);

            PgMng.Grow();

            TransporterInfo transporter = TransporterInfo.Get(in_invoice.OidTransportista, ETipoAcreedor.TransportistaDestino, false);

            PgMng.Grow();

            FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

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

            OutputInvoiceInfo item = OutputInvoiceInfo.Get(in_invoice.Oid, true);

            PgMng.Grow();

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

            PgMng.FillUp();

            ShowReport(report);
        }
        public override void RefreshSecondaryData()
        {
            base.RefreshSecondaryData();

            if (_entity.OidCliente != 0)
            {
                SetClient(ClienteInfo.Get(_entity.OidCliente, false));
            }
            PgMng.Grow();

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

            if (_entity.OidTransportista > 0)
            {
                SetTransporter(TransporterInfo.Get(_entity.OidTransportista, ETipoAcreedor.TransportistaDestino, false));
            }
            PgMng.Grow();
        }
        public override void ShowDocumentsAction()
        {
            switch (ActiveItem.ETipoAcreedor)
            {
            case ETipoAcreedor.Acreedor:
            case ETipoAcreedor.Proveedor:
            {
                ProveedorInfo agente = ProveedorInfo.Get(ActiveItem.Oid, ActiveItem.ETipoAcreedor, false);

                try
                {
                    AgenteInfo     agent = AgenteInfo.Get(typeof(Proveedor), agente);
                    AgenteEditForm form  = new AgenteEditForm(typeof(Proveedor), agente, this);
                    AddForm(form);
                }
                catch (HipatiaException ex)
                {
                    if (ex.Code == HipatiaCode.NO_AGENTE)
                    {
                        AgenteAddForm form = new AgenteAddForm(typeof(Proveedor), agente, this);
                        AddForm(form);
                    }
                }
            }
            break;

            case ETipoAcreedor.Naviera:
            {
                NavieraInfo agente = NavieraInfo.Get(ActiveItem.Oid, false);

                try
                {
                    AgenteInfo     agent = AgenteInfo.Get(typeof(Naviera), agente);
                    AgenteEditForm form  = new AgenteEditForm(typeof(Naviera), agente, this);
                    AddForm(form);
                }
                catch (HipatiaException ex)
                {
                    if (ex.Code == HipatiaCode.NO_AGENTE)
                    {
                        AgenteAddForm form = new AgenteAddForm(typeof(Naviera), agente, this);
                        AddForm(form);
                    }
                }
            }
            break;

            case ETipoAcreedor.Despachante:
            {
                DespachanteInfo agente = DespachanteInfo.Get(ActiveItem.Oid, false);

                try
                {
                    AgenteInfo     agent = AgenteInfo.Get(typeof(Despachante), agente);
                    AgenteEditForm form  = new AgenteEditForm(typeof(Despachante), agente, this);
                    AddForm(form);
                }
                catch (HipatiaException ex)
                {
                    if (ex.Code == HipatiaCode.NO_AGENTE)
                    {
                        AgenteAddForm form = new AgenteAddForm(typeof(Despachante), agente, this);
                        AddForm(form);
                    }
                }
            }
            break;

            case ETipoAcreedor.TransportistaOrigen:
            case ETipoAcreedor.TransportistaDestino:
            {
                TransporterInfo agente = TransporterInfo.Get(ActiveItem.Oid, ActiveItem.ETipoAcreedor, false);

                try
                {
                    AgenteInfo     agent = AgenteInfo.Get(typeof(Transporter), agente);
                    AgenteEditForm form  = new AgenteEditForm(typeof(Transporter), agente, this);
                    AddForm(form);
                }
                catch (HipatiaException ex)
                {
                    if (ex.Code == HipatiaCode.NO_AGENTE)
                    {
                        AgenteAddForm form = new AgenteAddForm(typeof(Transporter), agente, this);
                        AddForm(form);
                    }
                }
            }
            break;
            }
        }
Example #14
0
        public void GoToSourceAction()
        {
            if (ActiveItem == null)
            {
                return;
            }
            if (ActiveItem.EEstado == EEstado.Anulado)
            {
                return;
            }

            switch (ActiveItem.ETipoMovimientoBanco)
            {
            case EBankLineType.Cobro:
            {
                switch (ActiveItem.ETipoTitular)
                {
                case ETipoTitular.Cliente:
                {
                    ClienteInfo   cliente = ClienteInfo.Get(ActiveItem.OidTitular, true);
                    ChargeSummary item    = ChargeSummary.Get(cliente);
                    CobroEditForm form    = new CobroEditForm(cliente.Oid, item, null, this);
                    form.ShowDialog(this);
                }
                break;

                case ETipoTitular.Fomento:
                {
                    ChargeInfo            cobro = ChargeInfo.Get(ActiveItem.OidTitular, ETipoCobro.Fomento, false);
                    CobrosFomentoEditForm form  = new CobrosFomentoEditForm(cobro, this);
                    form.ShowDialog(this);
                }
                break;

                case ETipoTitular.REA:
                {
                    ChargeInfo        cobro = ChargeInfo.Get(ActiveItem.OidTitular, ETipoCobro.REA, false);
                    CobrosREAEditForm form  = new CobrosREAEditForm(cobro, this);
                    form.ShowDialog();
                }
                break;
                }
            }
            break;

            case EBankLineType.PagoFactura:
            {
                ETipoAcreedor tipo = moleQule.Library.Store.EnumConvert.ToETipoAcreedor(ActiveItem.ETipoTitular);

                if ((new List <ETipoTitular> {
                        ETipoTitular.TransportistaOrigen, ETipoTitular.TransportistaOrigen
                    }).Contains(ActiveItem.ETipoTitular))
                {
                    TransporterInfo transporter = TransporterInfo.Get(ActiveItem.OidTitular, moleQule.Library.Store.EnumConvert.ToETipoAcreedor(ActiveItem.ETipoTitular), false);
                    tipo = transporter.ETipoAcreedor;
                }

                PaymentSummary  item = PaymentSummary.Get(tipo, ActiveItem.OidTitular);
                PaymentEditForm form = new PaymentEditForm(this, ActiveItem.OidTitular, item);
                form.ShowDialog(this);
            }
            break;

            case EBankLineType.PagoGasto:
            {
                ExpensePaymentEditForm form = new ExpensePaymentEditForm(ActiveItem.OidTitular, ETipoPago.Gasto, this);
                form.ShowDialog();
            }
            break;

            case EBankLineType.PagoNomina:
            {
                PaymentSummary          item = PaymentSummary.Get(ETipoAcreedor.Empleado, ActiveItem.OidTitular);
                EmployeePaymentEditForm form = new EmployeePaymentEditForm(this, ActiveItem.OidTitular, item);
                form.ShowDialog();
            }
            break;

            case EBankLineType.PagoPrestamo:
            {
                LoanPaymentEditForm form = new LoanPaymentEditForm(ActiveItem.OidTitular, ETipoPago.Prestamo, this);
                form.ShowDialog();
            }
            break;

            case EBankLineType.Prestamo:
            {
                LoanEditForm form = new LoanEditForm(ActiveItem.OidTitular, this);
                form.ShowDialog();
            }
            break;

            case EBankLineType.EntradaCaja:
            case EBankLineType.SalidaCaja:
            {
                CashLineInfo linea = CashLineInfo.Get(ActiveItem.OidOperacion);

                if (linea.OidCierre != 0)
                {
                    CashCountEditForm form = new CashCountEditForm(linea.OidCierre, this);
                    form.ShowDialog();
                }
                else
                {
                    CashEditForm form = new CashEditForm(linea.OidCaja, this);
                    form.ShowDialog();
                }
            }
            break;

            case EBankLineType.Traspaso:
            {
                TraspasoEditForm form = new TraspasoEditForm(ActiveItem.OidTitular, this);
                form.ShowDialog();
            }
            break;

            case EBankLineType.ExtractoTarjeta:
            {
                CreditCardPaymentEditForm form = new CreditCardPaymentEditForm(ActiveItem.OidOperacion, ETipoPago.ExtractoTarjeta, this);
                form.Show();
            }
            break;
            }
        }
 protected override void GetFormSourceData(long oid, object[] parameters)
 {
     _entity = TransporterInfo.Get(oid, (ETipoAcreedor)parameters[0], true);
 }
Example #16
0
        public ReportClass GetDetailReport(OutputInvoiceInfo item,
                                           SerieInfo serie,
                                           ClienteInfo cliente,
                                           TransporterInfo transporter,
                                           FormatConfFacturaAlbaranReport conf)
        {
            if (item == null)
            {
                return(null);
            }

            List <OutputInvoiceLinePrint> conceptos = new List <OutputInvoiceLinePrint>();
            List <OutputInvoicePrint>     pList     = new List <OutputInvoicePrint>();

            foreach (OutputInvoiceLineInfo cfi in item.ConceptoFacturas)
            {
                conceptos.Add(cfi.GetPrintObject());
            }

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

            pList.Add(OutputInvoicePrint.New(item, cliente, transporter, serie));

            ProductList productos = ProductList.GetList(false);

            foreach (OutputInvoiceLinePrint cfp in conceptos)
            {
                if (cfp.OidProducto == 0)
                {
                    continue;
                }

                ProductInfo prod = productos.GetItem(cfp.OidProducto);
                if (prod != null)
                {
                    continue;
                }

                if (prod.AyudaKilo > 0)
                {
                    cfp.Concepto += " *";
                }
            }

            List <ImpuestoResumen> impuestos = new List <ImpuestoResumen>();

            foreach (DictionaryEntry impuesto in item.GetImpuestos())
            {
                impuestos.Add((ImpuestoResumen)impuesto.Value);
            }

            ReportClass doc = null;

            try
            {
                doc = GetReportFromName("Invoice", "OutputInvoiceRpt");
            }
            catch
            {
                doc = new OutputInvoiceRpt();
            }

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

            if (doc.Subreports["ImpuestoResumenRpt"] != null)
            {
                doc.Subreports["ImpuestoResumenRpt"].SetDataSource(impuestos);
            }

            Library.Common.CompanyInfo empresa = Library.Common.CompanyInfo.Get(Schema.Oid, false);
            doc.SetParameterValue("nombreEmpresa", empresa.Name);
            doc.SetParameterValue("dirEmpresa", empresa.Direccion);
            doc.SetParameterValue("dir2Empresa", empresa.CodPostal + ". " + empresa.Municipio + ". " + empresa.Provincia);
            doc.SetParameterValue("CIFEmpresa", empresa.VatNumber);
            doc.SetParameterValue("TlfEmpresa", empresa.Telefonos);
            doc.SetParameterValue("FaxEmpresa", empresa.Fax);
            doc.SetParameterValue("WebEmpresa", empresa.Url);
            doc.SetParameterValue("nota", conf.nota);
            doc.SetParameterValue("ACuenta", (item.CobroFacturas != null) ? item.CobroFacturas.GetTotal() : 0);
            doc.SetParameterValue("CPEmpresa", empresa.CodPostal);
            doc.SetParameterValue("municipioEmpresa", empresa.Municipio);

            return(doc);
        }
        private void Detalle_BT_Click(object sender, EventArgs e)
        {
            switch ((ETipoInforme)(long)TipoAcreedor_CB.SelectedValue)
            {
            case ETipoInforme.Despachante:
            {
                CustomAgentSelectForm form = new CustomAgentSelectForm(this, moleQule.Base.EEstado.Active);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    DespachanteInfo d = form.Selected as DespachanteInfo;
                    Acreedores_TB.Text = d.Nombre;
                    _report_filter.objeto_detallado = form.Selected;
                }
            }
            break;

            case ETipoInforme.Naviera:
            {
                ShippingCompanySelectForm form = new ShippingCompanySelectForm(this, moleQule.Base.EEstado.Active);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    NavieraInfo n = form.Selected as NavieraInfo;
                    Acreedores_TB.Text = n.Codigo + " - " + n.Nombre;
                    _report_filter.objeto_detallado = form.Selected;
                }
            }
            break;

            case ETipoInforme.Proveedor:
            {
                ProveedorList      list = ProveedorList.GetList(moleQule.Base.EEstado.Active, false);
                SupplierSelectForm form = new SupplierSelectForm(this, list);

                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    ProveedorInfo p = form.Selected as ProveedorInfo;
                    Acreedores_TB.Text = p.Codigo + " - " + p.Nombre;
                    _report_filter.objeto_detallado = form.Selected;
                }
            }
            break;

            case ETipoInforme.TransportistaDestino:
            {
                TransporterSelectForm form = new TransporterSelectForm(this, TransporterList.GetList(ETipoTransportista.Destino, false));
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    TransporterInfo t = (TransporterInfo)form.Selected;
                    Acreedores_TB.Text = t.Codigo + " - " + t.Nombre;
                    _report_filter.objeto_detallado = form.Selected;
                }
            }
            break;

            case ETipoInforme.TransportistaOrigen:
            {
                TransporterSelectForm form = new TransporterSelectForm(this, TransporterList.GetList(ETipoTransportista.Origen, false));
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    TransporterInfo t = (TransporterInfo)form.Selected;
                    Acreedores_TB.Text = t.Codigo + " - " + t.Nombre;
                    _report_filter.objeto_detallado = form.Selected;
                }
            }
            break;
            }
        }
        public override void EmailPDFAction()
        {
            if (ActiveItem == null)
            {
                return;
            }

            PgMng.Reset(10, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

            SerieInfo serie = SerieInfo.Get(ActiveItem.OidSerie, false);

            PgMng.Grow();

            ClienteInfo client = ClienteInfo.Get(ActiveItem.OidCliente, false);

            PgMng.Grow();

            TransporterInfo transporter = TransporterInfo.Get(ActiveItem.OidTransportista, ETipoAcreedor.TransportistaDestino, false);

            PgMng.Grow();

            CompanyInfo company = CompanyInfo.Get(AppContext.ActiveSchema.Oid);

            PgMng.Grow();

            FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

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

            OutputInvoiceInfo item = OutputInvoiceInfo.Get(ActiveOID, true);

            PgMng.Grow();

            OutputInvoiceReportMng reportMng = new OutputInvoiceReportMng(AppContext.ActiveSchema, this.Text, this.FilterValues);
            ReportClass            report    = reportMng.GetDetailReport(item, serie, client, transporter, conf);

            PgMng.Grow();

            if (report != null)
            {
                ExportOptions options = new ExportOptions();
                DiskFileDestinationOptions diskFileDestinationOptions = new DiskFileDestinationOptions();

                string fileName = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                fileName += "\\" + ActiveItem.FileName;

                PgMng.Grow(String.Format(Face.Resources.Messages.EXPORTING_PDF, fileName), string.Empty);

                diskFileDestinationOptions.DiskFileName = fileName;
                options.ExportFormatType         = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
                options.ExportDestinationType    = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
                options.ExportDestinationOptions = diskFileDestinationOptions;

                PgMng.Grow();

                report.Export(options);

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

                System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();

                mail.To.Add(new MailAddress(client.Email, client.Nombre));
                mail.From    = new MailAddress(SettingsMng.Instance.GetSMTPMail(), company.Name);
                mail.Body    = String.Format(Library.Invoice.Resources.Messages.FACTURA_EMAIL_ATTACHMENT_BODY, company.Name);
                mail.Subject = Library.Invoice.Resources.Messages.FACTURA_EMAIL_SUBJECT;
                mail.Attachments.Add(new Attachment(fileName));

                try
                {
                    PgMng.Grow(moleQule.Face.Resources.Messages.SENDING_EMAIL, string.Empty);

                    EMailClient.Instance.SmtpCliente.Send(mail);

                    if (item.EEstado == EEstado.Abierto)
                    {
                        ChangeStateAction(EEstadoItem.Emitido);
                    }

                    PgMng.ShowInfoException("Mensaje enviado con éxito");
                }
                catch (Exception ex)
                {
                    PgMng.ShowInfoException(ex.Message + Environment.NewLine + Environment.NewLine + moleQule.Library.Resources.Errors.SMTP_SETTINGS);
                }
                finally
                {
                    mail.Dispose();
                    PgMng.FillUp();
                }
            }
            else
            {
                PgMng.ShowInfoException(Face.Resources.Messages.NO_DATA_REPORTS);

                PgMng.FillUp();
            }
        }