Пример #1
0
        public override void PrintObject()
        {
            if (Client_BS.Current == null)
            {
                return;
            }

            OutputInvoiceReportMng         reportMng = new OutputInvoiceReportMng(AppContext.ActiveSchema);
            FormatConfFacturaAlbaranReport conf      = new FormatConfFacturaAlbaranReport();

            ClienteInfo client = Client_BS.Current as ClienteInfo;

            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 += EntityInfo.Nota ? Nota_TB.Text : "";

            conf.cuenta_bancaria = Cuenta_TB.Text;

            ReportClass report = reportMng.GetDetailReport((EntityInfo.ConceptoFacturas != null) ? EntityInfo : Entity.GetInfo(true), _serie, client, _transporter, conf);

            if (SettingsMng.Instance.GetUseDefaultPrinter())
            {
                int n_copias = SettingsMng.Instance.GetDefaultNCopies();
                PrintReport(report, n_copias);
            }
            else
            {
                ShowReport(report);
            }
        }
        public override void PrintDetailAction()
        {
            if (ActiveItem == null)
            {
                return;
            }

            InputDeliveryReportMng reportMng = new InputDeliveryReportMng(AppContext.ActiveSchema, Text, FilterValues);
            SerieInfo serie = SerieInfo.Get(ActiveItem.OidSerie, false);

            FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

            conf.nota = ActiveItem.Nota ? serie.Cabecera : "";

            /*AlbaranProveedorRpt report = reportMng.GetAlbaranProveedorReport(InputDeliveryInfo.Get(ActiveOID, true), conf);
             *
             * if (report != null)
             * {
             *      ReportViewer.SetReport(report);
             *      ReportViewer.ShowDialog();
             * }
             * else
             * {
             *      MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS,
             *                                      moleQule.Face.Resources.Labels.ADVISE_TITLE,
             *                                      MessageBoxButtons.OK,
             *                                      MessageBoxIcon.Exclamation);
             * }*/
        }
Пример #3
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 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);
                }
            }
        }
        public AlbaranRecibidoRpt GetDetailRpt(InputDeliveryInfo item, FormatConfFacturaAlbaranReport conf)
        {
            if (item == null)
            {
                return(null);
            }

            AlbaranRecibidoRpt doc = new AlbaranRecibidoRpt();

            List <InputDeliveryLinePrint> conceptos = new List <InputDeliveryLinePrint>();
            List <InputDeliveryPrint>     pList     = new List <InputDeliveryPrint>();

            foreach (InputDeliveryLineInfo cfi in item.ConceptoAlbaranes)
            {
                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(item.GetPrintObject());

            ProductList productos = ProductList.GetList(false);

            foreach (InputDeliveryLinePrint cfp in conceptos)
            {
                if (cfp.OidProducto == 0)
                {
                    continue;
                }
                ProductInfo prod = productos.GetItem(cfp.OidProducto);
                if (prod != null)
                {
                    if (prod.AyudaKilo > 0)
                    {
                        cfp.Concepto += " *";
                    }
                }
            }

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

            doc.SetDataSource(pList);
            CompanyInfo empresa = CompanyInfo.Get(Schema.Oid);

            doc.SetParameterValue("nombreEmpresa", empresa.Name);
            doc.SetParameterValue("dirEmpresa", empresa.Direccion);
            doc.SetParameterValue("CIFEmpresa", empresa.VatNumber);
            doc.SetParameterValue("nota", (conf.nota != null) ? conf.nota : string.Empty);

            return(doc);
        }
        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);
            }
        }
        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();
            }
        }
        public override void PrintDetailAction()
        {
            if (ActiveItem == null)
            {
                return;
            }

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

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

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

            PgMng.Grow();

            ClienteInfo cliente = ClienteInfo.Get(ActiveItem.OidHolder, false);

            PgMng.Grow();

            FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

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

            OutputDeliveryInfo item = OutputDeliveryInfo.Get(ActiveOID, ActiveItem.EEntityType, true);

            PgMng.Grow();

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

            PgMng.FillUp();

            if (SettingsMng.Instance.GetUseDefaultPrinter())
            {
                int n_copias = SettingsMng.Instance.GetDefaultNCopies();
                PrintReport(report, n_copias);
            }
            else
            {
                ShowReport(report);
            }
        }
Пример #9
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 PrintObject()
        {
            _action_result = SaveObject() ? DialogResult.OK : DialogResult.Ignore;

            if (_action_result == DialogResult.OK)
            {
                FormMngBase.Instance.RefreshFormsData();

                OutputDeliveryReportMng        reportMng = new OutputDeliveryReportMng(AppContext.ActiveSchema);
                FormatConfFacturaAlbaranReport conf      = new FormatConfFacturaAlbaranReport();
                conf.nota            = EntityInfo.Nota ? Nota_TB.Text : "";
                conf.cabecera        = "ALBARAN";
                conf.copia           = "";
                conf.cuenta_bancaria = "";

                ReportViewer.SetReport(reportMng.GetDetailReport(EntityInfo, conf));
                ReportViewer.ShowDialog();

                ExecuteAction(molAction.Close);
            }
        }
        public override void ExportPDFAction()
        {
            if (ActiveItem == null)
            {
                return;
            }

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

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

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

                ClienteInfo cliente = ClienteInfo.Get(ActiveItem.OidHolder, false);
                PgMng.Grow();

                FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

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

                OutputDeliveryInfo item = OutputDeliveryInfo.Get(ActiveOID, ActiveItem.EHolderType, true);
                PgMng.Grow();

                ReportClass rpt = reportMng.GetDetailReport(item, conf);
                PgMng.Grow();

                ExportPDF(rpt, ActiveItem.FileName);
            }
            finally
            {
                PgMng.FillUp();
            }
        }
Пример #12
0
        public override void PrintObject()
        {
            BudgetReportMng reportMng           = new BudgetReportMng(AppContext.ActiveSchema);
            FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

            ClienteInfo cliente = ClienteInfo.Get(Entity.OidCliente, false);

            conf.nota  = (cliente.OidImpuesto == 1) ? Library.Invoice.Resources.Messages.NOTA_EXENTO_IGIC : string.Empty;
            conf.nota += Environment.NewLine + (EntityInfo.Nota ? Nota_TB.Text : "");

            ReportClass report = reportMng.GetDetailReport((EntityInfo.Conceptos != null) ? EntityInfo : Entity.GetInfo(true), conf);

            if (SettingsMng.Instance.GetUseDefaultPrinter())
            {
                int n_copias = SettingsMng.Instance.GetDefaultNCopies();
                PrintReport(report, n_copias);
            }
            else
            {
                ShowReport(report);
            }
        }
        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();
            }
        }
Пример #14
0
        public ReportClass GetDetailReport(InputInvoiceInfo item, FormatConfFacturaAlbaranReport conf)
        {
            if (item == null)
            {
                return(null);
            }

            List <InputInvoiceLinePrint> conceptos = new List <InputInvoiceLinePrint>();
            List <InputInvoicePrint>     pList     = new List <InputInvoicePrint>();

            foreach (InputInvoiceLineInfo cfi in item.Conceptos)
            {
                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(item.GetPrintObject());

            ProductList productos = ProductList.GetList(false);

            foreach (InputInvoiceLinePrint cfp in conceptos)
            {
                if (cfp.OidProducto == 0)
                {
                    continue;
                }
                ProductInfo prod = productos.GetItem(cfp.OidProducto);
                if (prod != null)
                {
                    if (prod.AyudaKilo > 0)
                    {
                        cfp.Concepto += " *";
                    }
                }
            }

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

            foreach (DictionaryEntry irpf in item.GetIRPF())
            {
                irpf_list.Add((ImpuestoResumen)irpf.Value);
            }

            ReportClass doc = null;

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

            doc.Subreports["LinesSubRpt"].SetDataSource(conceptos);
            if (doc.Subreports["IRPFSubListRpt"] != null)
            {
                doc.Subreports["IRPFSubListRpt"].SetDataSource(irpf_list);
            }

            doc.SetDataSource(pList);
            CompanyInfo company = CompanyInfo.Get(Schema.Oid, false);

            doc.SetParameterValue("nombreEmpresa", company.Name);
            doc.SetParameterValue("dirEmpresa", company.Direccion);
            doc.SetParameterValue("dir2Empresa", company.CodPostal + ". " + company.Municipio + ". " + company.Provincia);
            doc.SetParameterValue("CIFEmpresa", company.VatNumber);
            doc.SetParameterValue("nota", conf.nota);
            doc.SetParameterValue("copia", (conf.copia != null) ? conf.copia : string.Empty);
            doc.SetParameterValue("cuentaBancaria", (conf.cuenta_bancaria != string.Empty) ? conf.cuenta_bancaria : company.CuentaBancaria);

            return(doc);
        }