public static Ent_Configuracion getConfiguracion() { Ent_Configuracion ent_configuracion = new Ent_Configuracion(); con = Conexion.getConnection(); MySqlCommand cmd = new MySqlCommand(); con.Open(); cmd.Connection = con; cmd.CommandText = "SP_SEGT_GET_CONFIGURACION"; cmd.CommandType = CommandType.StoredProcedure; MySqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { ent_configuracion.RUC = Convert.ToString(dr["RUC"]); ent_configuracion.RAZON_SOCIAL = Convert.ToString(dr["RAZON_SOCIAL"]); ent_configuracion.DIRECCION = Convert.ToString(dr["DIRECCION"]); ent_configuracion.TELEFONO = Convert.ToString(dr["TELEFONO"]); ent_configuracion.IGV = Convert.ToDouble(dr["IGV"]); ent_configuracion.TIPO_CAMBIO = Convert.ToDouble(dr["TIPO_CAMBIO"]); ent_configuracion.TIENDA = Convert.ToString(dr["TIENDA"]); } con.Close(); return(ent_configuracion); }
public frmCotizacion(String tienda, String user, Ent_Tienda ent_tienda) { InitializeComponent(); fillMonedas(); _ent_tienda = ent_tienda; ent_configuracion = new Ent_Configuracion(); ent_configuracion = BL_Configuracion.getConfiguracion(); ent_tienda = BL_Tienda.getTienda(ent_configuracion.TIENDA); correlativo = BL_Mantenimiento.getCorrelativo(); lblSerie.Text = "N° 001-" + correlativo.PadLeft(6, '0'); tipo_venta = "FA"; cod_tienda = tienda; usuario = user; Image logo = Image.FromFile("logo.png"); pbLogo.Image = logo; adjunto = ""; Dictionary <string, string> lista_tipo = new Dictionary <string, string>(); lista_tipo.Add("CO", "COMPRA"); lista_tipo.Add("AL", "ALQUILER"); cboTipo.DataSource = new BindingSource(lista_tipo, null); cboTipo.DisplayMember = "Value"; cboTipo.ValueMember = "Key"; alquiler = "0"; lbldias.Visible = false; txtDias.Visible = false; txtDias.Text = "1"; }
private void InicializarSistema() { fillMenuTipoVenta(); fillMenuTienda(); fillFormaPago(); fillMonedas(); ent_configuracion = new Ent_Configuracion(); ent_configuracion = BL_Configuracion.getConfiguracion(); ent_tienda = BL_Tienda.getTienda(ent_configuracion.TIENDA); lblRUC.Text = "R.U.C. " + ent_configuracion.RUC; lblRazonSocial.Text = ent_configuracion.RAZON_SOCIAL; Image logo = Image.FromFile("logo.png"); pbLogo.Image = logo; correlativo = BL_Ventas.getCorrelativo(tipo_venta); lblBienvenido.Text = "Bienvenid@ " + ent_usuario.nombres; lblRango.Text = (ent_usuario.rango == "A") ? "(Administrador)" : "(Cajero)"; lblTienda.Text = "Tienda: " + des_tienda; lblSerie.Text = "N° 001-" + correlativo; lblFecha.Text = DateTime.Now.ToString("dd/MM/yyyy"); dgvProductos.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvProductos.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvProductos.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvProductos.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; cboFormaPago.SelectedIndex = 0; menuAdmin(); }
private void fillDatosVenta() { Ent_Venta entity = BL_Ventas.getCabeceraVenta(id_venta); if (entity.tipo_venta == "FA") { lblDNI.Text = "RUC"; lblNombres.Text = "Razón Social"; } else { lblDNI.Text = "DNI"; lblNombres.Text = "Nombres"; } txtTipoVenta.Text = entity.tipo_venta_des; txtNroDoc.Text = entity.nro_doc_str; txtDNI.Text = entity.cliente_doc; txtNombres.Text = entity.cliente; txtDireccion.Text = entity.direccion; txtFecha.Text = entity.emision; txtFormaPago.Text = entity.forma_pago_des; txtTelefono.Text = entity.telefono; txtUsuario.Text = entity.usuario; txtAnulado.Text = (entity.anulado == "1") ? "SI" : "NO"; txtMotivo.Text = entity.motivo_anul; txtFechaAnul.Text = entity.fecha_anul; txtusuarioAnul.Text = entity.usuario_anul; lblTotal.Text = entity.monto_total.ToString("#0.00"); Ent_Configuracion ent_configuracion = BL_Configuracion.getConfiguracion(); if (entity.tipo_venta.Equals("FA")) { txtSubTotal.Text = (Convert.ToDouble(lblTotal.Text) / Convert.ToDouble(ent_configuracion.IGV + 1)).ToString("#0.00"); txtIGV.Text = (Convert.ToDouble(lblTotal.Text) - Convert.ToDouble(txtSubTotal.Text)).ToString("#0.00"); } else { txtSubTotal.Text = "0.00"; txtIGV.Text = "0.00"; } txtRecibido.Text = entity.monto_recibido.ToString("#0.00"); if (entity.forma_pago == "CR") { lblVuelto.Text = "Saldo"; txtVuelto.Text = (entity.monto_total - entity.monto_recibido).ToString("#0.00"); } else { txtVuelto.Text = entity.monto_vuelto.ToString("#0.00"); } fillDetalles(); }
public frmCreditos(string _cod_tienda, string _usuario) { InitializeComponent(); fillTipoVenta(); cod_tienda = _cod_tienda; usuario = _usuario; txtFecha.Text = DateTime.Now.ToString("dd/MM/yyyy"); dgvDetalleVenta.Columns["PRECIO"].DefaultCellStyle.Format = "f"; dgvDetalleVenta.Columns["IMPORTE"].DefaultCellStyle.Format = "f"; dgvAbonos.Columns["MONTO"].DefaultCellStyle.Format = "f"; ent_configuracion = new Ent_Configuracion(); ent_configuracion = BL_Configuracion.getConfiguracion(); }
public frmConsultarMantenimiento() { InitializeComponent(); fillDocumento(); ent_configuracion = new Ent_Configuracion(); ent_configuracion = BL_Configuracion.getConfiguracion(); prog = new Ent_Prog_Mantenimiento(); Dictionary <string, string> lista_tipo = new Dictionary <string, string>(); lista_tipo.Add("RE", "REALIZADO"); lista_tipo.Add("NR", "NO REALIZADO"); lista_tipo.Add("RP", "EN REPARACIÓN"); cboEstado.DataSource = new BindingSource(lista_tipo, null); cboEstado.DisplayMember = "Value"; cboEstado.ValueMember = "Key"; }
public frmConsultaVentas(string _tienda, bool _auto_close = false, bool doc_credito = false) { ent_configuracion = new Ent_Configuracion(); ent_configuracion = BL_Configuracion.getConfiguracion(); tienda = _tienda; auto_close = _auto_close; InitializeComponent(); txtFecha.Text = DateTime.Now.ToString("dd/MM/yyyy"); fillComboEstados(); fillTipoVenta(); fillFormaPago(); if (doc_credito) { cboFormaPago.SelectedValue = "CR"; cboFormaPago.Enabled = false; } fillVentas(); }
public frmConsultarCotizacion(string tienda) { InitializeComponent(); cod_tienda = tienda; ent_configuracion = new Ent_Configuracion(); ent_configuracion = BL_Configuracion.getConfiguracion(); cotizacion = new Ent_Venta(); Dictionary <string, string> lista_tipo = new Dictionary <string, string>(); lista_tipo.Add("", ":: TODAS ::"); lista_tipo.Add("CO", "COMPRA"); lista_tipo.Add("AL", "ALQUILER"); cboTipo.DataSource = new BindingSource(lista_tipo, null); cboTipo.DisplayMember = "Value"; cboTipo.ValueMember = "Key"; btnBuscar_Click(new object(), new EventArgs()); }
public frmGuiaRemision(string _cod_tienda) { InitializeComponent(); cod_tienda = _cod_tienda; ent_configuracion = new Ent_Configuracion(); ent_configuracion = BL_Configuracion.getConfiguracion(); lblRUC.Text = "R.U.C. " + ent_configuracion.RUC; lblRazonSocial.Text = ent_configuracion.RAZON_SOCIAL; txtDireccionPartida.Text = ent_configuracion.DIRECCION; txtTransRuc.Text = ent_configuracion.RUC; txtTransCliente.Text = ent_configuracion.RAZON_SOCIAL; Image logo = Image.FromFile("logo.png"); pbLogo.Image = logo; txtFechaEmision.Text = DateTime.Now.ToString("dd/MM/yyyy"); txtFechaTraslado.Text = DateTime.Now.ToString("dd/MM/yyyy"); correlativo = BL_Ventas.getCorrelativo("GR"); lblNroDoc.Text = "001-" + correlativo; fillTipoDocumento(); fillMotivos(); fillNroDoc(); }
public string Send_Email(Ent_Venta venta, Ent_Tienda ent_tienda, Ent_Configuracion ent_configuracion, string observacion, string adjunto) { string send = "1"; try { obser = observacion; _ent_configuracion = ent_configuracion; _ent_tienda = ent_tienda; MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("gator4068.hostgator.com"); mail.From = new MailAddress("*****@*****.**", "Osmosis Perú"); if (!adjunto.Equals(String.Empty)) { Attachment attachment = new Attachment(adjunto); mail.Attachments.Add(attachment); } //mail.To.Add("*****@*****.**"); mail.To.Add(venta.email); mail.Subject = "Cotización"; mail.IsBodyHtml = true; //mail.Body = Armar_Cotizacion_hmtl(venta); mail.AlternateViews.Add(Armar_Cotizacion_hmtl(venta)); SmtpServer.Port = 587; SmtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "info190792"); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); } catch (Exception ex) { send = ex.Message; } return(send); }
public frmProgMantenimiento(string tienda, string user) { InitializeComponent(); ent_configuracion = new Ent_Configuracion(); ent_configuracion = BL_Configuracion.getConfiguracion(); correlativo = BL_Mantenimiento.getCorrelativo(); lblSerie.Text = "N° 001-" + correlativo.PadLeft(6, '0'); cod_tienda = tienda; usuario = user; txtFechaEmision.Text = DateTime.Now.ToString("dd/MM/yyyy"); dtpFechaSalida.Value = DateTime.Now; fillTipoMantenimiento(); Dictionary <string, string> lista_tipo = new Dictionary <string, string>(); lista_tipo.Add("", "SELECCIONE"); lista_tipo.Add("RE", "REALIZADO"); lista_tipo.Add("NR", "NO REALIZADO"); lista_tipo.Add("RP", "EN REPARACIÓN"); cboEstado.DataSource = new BindingSource(lista_tipo, null); cboEstado.DisplayMember = "Value"; cboEstado.ValueMember = "Key"; }
public void createCotizacion(Ent_Configuracion ent_configuracion, Ent_Venta venta) { PdfDocument document = new PdfDocument(); PdfPage page = document.AddPage(); XGraphics gfx = XGraphics.FromPdfPage(page); //XImage image = XImage.FromFile(logo); //gfx.DrawImage(image, 0, marginTop, 256, 80); XFont font = new XFont(fontName, 10); XFont fontBox = new XFont(fontName, 15); XFont fontNota = new XFont(fontName, 7); int yPosHeader1 = marginTop + 20; gfx.DrawString(ent_configuracion.RAZON_SOCIAL, font, XBrushes.Black, marginLeft, yPosHeader1); yPosHeader1 = yPosHeader1 + 15; gfx.DrawString(ent_configuracion.DIRECCION, font, XBrushes.Black, marginLeft, yPosHeader1); yPosHeader1 = yPosHeader1 + 15; gfx.DrawString("Cel. " + ent_configuracion.TELEFONO, font, XBrushes.Black, marginLeft, yPosHeader1); yPosHeader1 = yPosHeader1 + 15; gfx.DrawString("[email protected] / www.osmosisperu.com", font, XBrushes.Black, marginLeft, yPosHeader1); int yPosHeader2 = marginTop; drawBox(gfx, Convert.ToInt32(page.Width / 1.5), marginTop, Convert.ToInt32(page.Width / 2.9 - marginRight * 2), 80); yPosHeader2 = yPosHeader2 + 20; gfx.DrawString("R.U.C. " + ent_configuracion.RUC, fontBox, XBrushes.Black, Convert.ToInt32(page.Width / 1.5) + 15, yPosHeader2); gfx.DrawRectangle(XBrushes.Black, Convert.ToInt32(page.Width / 1.5), 40, Convert.ToInt32(page.Width / 2.9 - marginRight * 2), 20); yPosHeader2 = yPosHeader2 + 25; gfx.DrawString("COTIZACIÓN", fontBox, XBrushes.White, Convert.ToInt32(page.Width / 1.5) + 45, yPosHeader2); yPosHeader2 = yPosHeader2 + 25; gfx.DrawString("001-" + venta.id_cab.ToString().PadLeft(6, '0'), fontBox, XBrushes.Black, Convert.ToInt32(page.Width / 1.5) + 45, yPosHeader2); int yPosCustomerDetails = yPosHeader2 + 40; gfx.DrawString("Lima, " + DateTime.Now.ToString("d 'de' MMMM 'del' yyyy"), font, XBrushes.Black, marginLeft, yPosCustomerDetails); yPosCustomerDetails = yPosCustomerDetails + 20; gfx.DrawString("Cliente: " + venta.cliente, font, XBrushes.Black, marginLeft, yPosCustomerDetails); yPosCustomerDetails = yPosCustomerDetails + 20; gfx.DrawString("Dirección: " + venta.direccion, font, XBrushes.Black, marginLeft, yPosCustomerDetails); gfx.DrawString("DNI/RUC: " + venta.cliente_doc, font, XBrushes.Black, page.Width / 1.35, yPosCustomerDetails); if (venta.tipo_cotizacion.Equals("AL")) { yPosCustomerDetails = yPosCustomerDetails + 20; gfx.DrawString("Días Alquiler: " + venta.dias_alquiler, font, XBrushes.Black, marginLeft, yPosCustomerDetails); } int totalItems = venta.lstProductos.Count; int yPosBoxItems = yPosCustomerDetails + 25; int yPosBoxTitle = yPosBoxItems + 15; int boxHeight = yPosBoxTitle + 20 * totalItems - yPosBoxItems + 10; //ITEMS BOX drawBox(gfx, marginLeft, yPosBoxItems, Convert.ToInt32(page.Width - marginRight * 2), boxHeight); //TITLE BOX drawBox(gfx, marginLeft, yPosBoxItems, Convert.ToInt32(page.Width - marginRight * 2), 20); int xPosCant = marginLeft + 10; int xPosDesc = marginLeft + 60; int xPosPUnit = Convert.ToInt32(page.Width - 150); int xPosImporte = Convert.ToInt32(page.Width - 80); gfx.DrawString("CANT.", font, XBrushes.Black, xPosCant, yPosBoxTitle); gfx.DrawString("DESCRIPCIÓN", font, XBrushes.Black, xPosDesc, yPosBoxTitle); gfx.DrawString("P. UNIT", font, XBrushes.Black, xPosPUnit, yPosBoxTitle); gfx.DrawString("IMPORTE", font, XBrushes.Black, xPosImporte, yPosBoxTitle); int yPosBoxTitleWMargin = yPosBoxTitle + 20; int yPosLastItem = 0; int i = 0; venta.lstProductos.ForEach(delegate(Ent_Productos m) { yPosLastItem = yPosBoxTitleWMargin + 20 * i; gfx.DrawString(Convert.ToString(m.cantidad), font, XBrushes.Black, xPosCant, yPosLastItem); gfx.DrawString(m.nombre, font, XBrushes.Black, xPosDesc, yPosLastItem); gfx.DrawString(m.precio.ToString("#0.00"), font, XBrushes.Black, xPosPUnit, yPosLastItem); gfx.DrawString((m.cantidad * m.precio).ToString("#0.00"), font, XBrushes.Black, xPosImporte, yPosLastItem); i++; }); int totalTextWidth = xPosImporte - xPosPUnit; int totalWidth = Convert.ToInt32(page.Width - marginRight) - xPosImporte + 1; //drawBox(gfx, xPosPUnit, yPosLastItem + 9, totalTextWidth, 20); int yPosTotalesBox = yPosLastItem + 9; drawBox(gfx, xPosImporte - 1, yPosTotalesBox, totalWidth, 15); yPosTotalesBox = yPosTotalesBox + 15; drawBox(gfx, xPosImporte - 1, yPosTotalesBox, totalWidth, 15); yPosTotalesBox = yPosTotalesBox + 15; drawBox(gfx, xPosImporte - 1, yPosTotalesBox, totalWidth, 15); String intPart = venta.monto_total.ToString().Split('.')[0]; String totalString = Convert.ToInt32(intPart).ToWords().ToUpper(); var decimalPart = (int)(((decimal)venta.monto_total % 1) * 100); int yPosTotales = yPosLastItem + 20; gfx.DrawString("SubTotal", font, XBrushes.Black, xPosPUnit, yPosTotales); gfx.DrawString(venta.monto_subtotal.ToString("#0.00"), font, XBrushes.Black, xPosImporte + 5, yPosTotales); yPosTotales = yPosTotales + 15; gfx.DrawString("IGV", font, XBrushes.Black, xPosPUnit, yPosTotales); gfx.DrawString(venta.monto_igv.ToString("#0.00"), font, XBrushes.Black, xPosImporte + 5, yPosTotales); yPosTotales = yPosTotales + 15; gfx.DrawString("TOTAL", font, XBrushes.Black, xPosPUnit, yPosTotales); gfx.DrawString(venta.monto_total.ToString("#0.00"), font, XBrushes.Black, xPosImporte + 5, yPosTotales); yPosTotales = yPosTotales + 15; gfx.DrawString("Son " + totalString + " Y " + decimalPart.ToString().PadLeft(2, '0') + "/100 " + ((venta.moneda == "PEN") ? "Soles" : "Dólares Americanos"), font, XBrushes.Black, marginLeft, yPosTotales); int yPosNota = yPosTotales + 100; gfx.DrawString(venta.observacion, fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("SOLO PAGO POR TRANSFERENCIA BANCARIA", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("RECOGER CON BAUCHER DE DEPOSITO", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("INVERSIONES GUTIERREZ Y DOMINGUEZ EIRL", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("RUC: 20512225048 - DANIEL PORTOCARRERO 376 URB. LOS LAURELES - CHORRILLOS", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("CUENTA BBVA", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("SOLES: 0011-0117-0100097865 INTERBANCARIO SOLES: 011-117-000100097865-98", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("DOLARES: 0011-0117-01-00095641 INTERBANCARIO DOLARES: 011-117-000100095641-95", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 40; gfx.DrawString("NOTA IMPORTANTE DE INSTALACIÓN: OSMOSISPERU NO SE HACE RESPONSABLE POR DESPERFECTOS", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("PRODUCIDO POR ACCIONES AJENAS A NUESTRA INSTALACIÓN COMO POR EJEMPLO, TUBERIAS ANTIGUAS,", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("TUBOS DE ABASTO VIEJOS, O DESPERFECTOS EN SUS DESAGÜES, ASI TAMBIÉN NO NOS HACEMOS", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("RESPONSABLES POR ALGUNA MODIFICACIÓN QUE SE HAYA REALIZADO AL MOMENTO DE INSTALARLO.", fontNota, XBrushes.Black, marginLeft, yPosNota); /*yPosNota = yPosNota + 15; * gfx.DrawString("DEBE EXISTIR UN PUNTO DE CORRIENTE EN LOS MUEBLES BAJOS A NO MAS DE 2 MT.", fontNota, XBrushes.Black, marginLeft, yPosNota); * yPosNota = yPosNota + 15; * gfx.DrawString("SI ESTA A MAS, SE COTIZARÁ 20 SOLES POR METRO O DE LO CONTRARIO DEBERÁ REALIZARLO", fontNota, XBrushes.Black, marginLeft, yPosNota); * yPosNota = yPosNota + 15; * gfx.DrawString("CON SU ELECTRICISTA. EN ESTE CASO EL TÉCNICO EBE DEJAR INSTALADO Y PROBADO CON UNA", fontNota, XBrushes.Black, marginLeft, yPosNota); * yPosNota = yPosNota + 15; * gfx.DrawString("EXTENCIÓN QUE USTED TENGA.", fontNota, XBrushes.Black, marginLeft, yPosNota);*/ yPosNota = yPosNota + 30; gfx.DrawString("SI NO ESTUVIERA CONFORME CON EL EQUIPO TIENE DENTRO DE LOS 07 DÍAS NATURALES PARA", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("REALIZAR LA DEVOLUCIÓN DEL EQUIPO DEBIDAMENTE EMBALADO Y CON SU RESPECTIVA CAJA", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("PREVIA REVISIÓN DEL MISMO. SI TODO ESTA CONFORME PASAREMOS A REALIZAR LA DEVOLUCIÓN", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("DEL COSTO DEL EQUIPO, MAS NO DE LA INSTALACIÓN NI DE LOS FILTROS, PUES YA ESTAN USADOS", fontNota, XBrushes.Black, marginLeft, yPosNota); yPosNota = yPosNota + 15; gfx.DrawString("Y SE TIENEN QUE DESHECHAR, SE CONSIDERA COMO PÉRDIDA. EL COSTO DE LOS FILTROS", fontNota, XBrushes.Black, marginLeft, yPosNota); /*yPosNota = yPosNota + 15; * gfx.DrawString("ES $50.00 DÓLARES AMERICANOS QUE SE DESCONTARAN DEL COSTO DEL EQUIPO.", fontNota, XBrushes.Black, marginLeft, yPosNota); * * yPosNota = yPosNota + 30; * gfx.DrawString("COSTO DEL EQUIPO $250 DÓLARES AMERICANOS.", fontNota, XBrushes.Black, marginLeft, yPosNota); * yPosNota = yPosNota + 15; * gfx.DrawString("COSTO DE INSTALACIÓN $50 DÓLARES AMERICANOS DENTRO DE LIMA METROPOLITANA.", fontNota, XBrushes.Black, marginLeft, yPosNota);*/ String filename = "invoices\\cotizacion_" + venta.id_cab + ".pdf"; document.Save(filename); Process.Start(filename); }
public void createServicioTecnico(Ent_Configuracion ent_configuracion, Ent_Prog_Mantenimiento prog) { PdfDocument document = new PdfDocument(); PdfPage page = document.AddPage(); XGraphics gfx = XGraphics.FromPdfPage(page); //XImage image = XImage.FromFile(logo); //gfx.DrawImage(image, 0, marginTop, 256, 80); XFont font = new XFont(fontName, 10); XFont fontBox = new XFont(fontName, 15); int yPosHeader1 = marginTop + 20; gfx.DrawString(ent_configuracion.RAZON_SOCIAL, font, XBrushes.Black, marginLeft, yPosHeader1); yPosHeader1 = yPosHeader1 + 15; gfx.DrawString(ent_configuracion.DIRECCION, font, XBrushes.Black, marginLeft, yPosHeader1); yPosHeader1 = yPosHeader1 + 15; gfx.DrawString("Cel. " + ent_configuracion.TELEFONO, font, XBrushes.Black, marginLeft, yPosHeader1); yPosHeader1 = yPosHeader1 + 15; gfx.DrawString("[email protected] / www.osmosisperu.com", font, XBrushes.Black, marginLeft, yPosHeader1); int yPosHeader2 = marginTop; drawBox(gfx, Convert.ToInt32(page.Width / 1.5), marginTop, Convert.ToInt32(page.Width / 2.9 - marginRight * 2), 80); yPosHeader2 = yPosHeader2 + 20; gfx.DrawString("R.U.C. " + ent_configuracion.RUC, fontBox, XBrushes.Black, Convert.ToInt32(page.Width / 1.5) + 15, yPosHeader2); gfx.DrawRectangle(XBrushes.Black, Convert.ToInt32(page.Width / 1.5), 40, Convert.ToInt32(page.Width / 2.9 - marginRight * 2), 20); yPosHeader2 = yPosHeader2 + 25; gfx.DrawString("SERVICIO TÉCNICO", fontBox, XBrushes.White, Convert.ToInt32(page.Width / 1.5) + 15, yPosHeader2); yPosHeader2 = yPosHeader2 + 25; gfx.DrawString(prog.documento_des, fontBox, XBrushes.Black, Convert.ToInt32(page.Width / 1.5) + 15, yPosHeader2); int yPosCustomerDetails = yPosHeader2 + 40; gfx.DrawString("Lima, " + DateTime.Now.ToString("d 'de' MMMM 'del' yyyy"), font, XBrushes.Black, marginLeft, yPosCustomerDetails); yPosCustomerDetails = yPosCustomerDetails + 20; gfx.DrawString("Cliente: " + prog.cliente_des, font, XBrushes.Black, marginLeft, yPosCustomerDetails); gfx.DrawString("Solicitante: _______________________________", font, XBrushes.Black, page.Width / 2, yPosCustomerDetails); yPosCustomerDetails = yPosCustomerDetails + 20; gfx.DrawString("Dirección: " + prog.cliente.direccion, font, XBrushes.Black, marginLeft, yPosCustomerDetails); gfx.DrawString("RUC: " + prog.cliente.dni, font, XBrushes.Black, page.Width / 1.35, yPosCustomerDetails); int yPosBoxMoreDetails = yPosCustomerDetails + 10; drawBox(gfx, marginLeft, yPosBoxMoreDetails, Convert.ToInt32(page.Width - marginRight * 2), 75); int yPosBoxMoreDetailsContent = yPosBoxMoreDetails + 20; gfx.DrawString("Llamada: Fecha: ___/___/____ Hora: ___/___", font, XBrushes.Black, marginLeft + 10, yPosBoxMoreDetailsContent); yPosBoxMoreDetailsContent = yPosBoxMoreDetailsContent + 20; gfx.DrawString("Servicio: Fecha: ___/___/____ Hora: ___/___", font, XBrushes.Black, marginLeft + 10, yPosBoxMoreDetailsContent); yPosBoxMoreDetailsContent = yPosBoxMoreDetailsContent + 20; gfx.DrawString("Persona Contacto: ________________________________________ Teléfono Contacto: _____________", font, XBrushes.Black, marginLeft + 10, yPosBoxMoreDetailsContent); int totalItems = prog.mantenimiento.Count; int yPosBoxItems = yPosBoxMoreDetailsContent + 25; int yPosBoxTitle = yPosBoxItems + 15; int boxHeight = yPosBoxTitle + 20 * totalItems - yPosBoxItems + 10; //ITEMS BOX drawBox(gfx, marginLeft, yPosBoxItems, Convert.ToInt32(page.Width - marginRight * 2), boxHeight); //TITLE BOX drawBox(gfx, marginLeft, yPosBoxItems, Convert.ToInt32(page.Width - marginRight * 2), 20); int xPosDesc = marginLeft + 10; gfx.DrawString("DESCRIPCIÓN", font, XBrushes.Black, xPosDesc, yPosBoxTitle); int yPosBoxTitleWMargin = yPosBoxTitle + 20; int yPosLastItem = 0; int i = 0; prog.mantenimiento.ForEach(delegate(Ent_Tipo_Mantenimiento m) { yPosLastItem = yPosBoxTitleWMargin + 20 * i; gfx.DrawString(m.descripcion, font, XBrushes.Black, xPosDesc, yPosLastItem); i++; }); String filename = "invoices\\serviciotecnico_" + prog.documento + ".pdf"; document.Save(filename); Process.Start(filename); }