From 08f740980a380271696d580b33e3b02fed96f0b6 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 6 Dec 2019 12:17:08 -0700 Subject: [PATCH] Nominas --- App_Code/clsGemBoxDocument.vb | 4 +- Nomina/Nomina2.aspx | 12 +- Nomina/Nomina2.aspx.cs | 1515 +++++++++++++++++++++++++++- Nomina/RepConceptosAcumulados.aspx | 105 +- RH/Personal.aspx | 2 +- Scripts/custom.js | 2 +- Site.master.vb | 2 +- 7 files changed, 1576 insertions(+), 66 deletions(-) diff --git a/App_Code/clsGemBoxDocument.vb b/App_Code/clsGemBoxDocument.vb index 6177426df..ea81a4af3 100644 --- a/App_Code/clsGemBoxDocument.vb +++ b/App_Code/clsGemBoxDocument.vb @@ -7,8 +7,8 @@ Public Class clsGemBoxDocument Implements IDisposable - Private documento As DocumentModel - Private rutaSalvado As String + Public documento As DocumentModel + Public rutaSalvado As String Public StremFile As String Public memoryStream As New MemoryStream() diff --git a/Nomina/Nomina2.aspx b/Nomina/Nomina2.aspx index e6577b557..29bbe7a6f 100644 --- a/Nomina/Nomina2.aspx +++ b/Nomina/Nomina2.aspx @@ -73,6 +73,10 @@ + +
  • + Lista de Raya +
  • @@ -890,12 +894,14 @@ @@ -904,7 +910,7 @@ Formato Formato - cargar y autorizar + cargar diff --git a/Nomina/Nomina2.aspx.cs b/Nomina/Nomina2.aspx.cs index b07e6318c..679f76b00 100644 --- a/Nomina/Nomina2.aspx.cs +++ b/Nomina/Nomina2.aspx.cs @@ -31,6 +31,17 @@ public partial class Nomina_Nomina2 : ClsPaginas set { ViewState["dtConceptos"] = value; } } + + private DataTable dtempleadosConceptos + { + get + { + if (ViewState["dtempleadosConceptos"] == null) { return null; } + else { return (DataTable)ViewState["dtempleadosConceptos"]; } + } + + set { ViewState["dtempleadosConceptos"] = value; } + } private DataTable dtempleados { get @@ -227,6 +238,7 @@ public partial class Nomina_Nomina2 : ClsPaginas if (objnom.GetNominaEmpleado(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, CveEmpresa, Agrupador) && objnom.DTSetResultados.Tables.Count > 1) { dtempleados = objnom.DTSetResultados.Tables[3]; + dtempleadosConceptos = objnom.DTSetResultados.Tables[4]; dtConceptos = objnom.DTSetResultados.Tables[0]; dtPeriodo = objnom.DTSetResultados.Tables[1]; dtasistencia = objnom.DTSetResultados.Tables[2]; @@ -282,7 +294,7 @@ public partial class Nomina_Nomina2 : ClsPaginas GvNominas.Columns[CurrentColumn].Visible = (dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0); bf = (BoundField)GvNominas.Columns[CurrentColumn]; bf.DataField = string.Format("V_{0}", CveConcepto); - bf.HeaderText = Concepto; + bf.HeaderText = Concepto; if (GvNominas.Columns[CurrentColumn].Visible) { CurrentColumn++; @@ -748,15 +760,15 @@ public partial class Nomina_Nomina2 : ClsPaginas { using (ClsNominas objNomina = new ClsNominas(objpersonal.IniciaTransacSQL())) { - foreach (DataRow row in DTEXcel.Rows) + foreach (DataRow row in DTEXcel.FiltraParametros("CvePersonal>0").Rows) { string Codigo = row["Codigo"].ToString(); - int CvePersonal = 0; + int CvePersonal = row["CvePersonal"].ToString().ToEntero(); int CveNomina = 0; double SubTotal = 0; double Total = 0; int CveMetodoPago = 0; - if (Codigo != "-1" && objpersonal.GetPersonal(-1, Codigo, "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) && + if (Codigo != "-1" && objpersonal.GetPersonal(CvePersonal, Codigo, "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) && objpersonal.DtResultados.Rows.Count == 1) { CvePersonal = objpersonal.CvePersonal; @@ -794,21 +806,48 @@ public partial class Nomina_Nomina2 : ClsPaginas } if (CveNomina > 0) { - foreach (int CveConcepto in lConceptos) + //foreach (int CveConcepto in lConceptos) + //{ + // decimal Importe = 0; + // decimal ImporteGravado = 0; + // decimal ImporteExento = 0; + // Importe = row[CveConcepto.ToString()].ToString().ToDecimal(); + // //try + // //{ + // // ImporteExento = row[string.Format("E{0}", CveConcepto)].ToString().ToDecimal(); + // //} + // //catch (Exception) { } + // ImporteGravado = Importe - ImporteExento; + // objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, UsuarioActual.CveUsuario); + + //} + for (int i = 3; i < DTEXcel.Columns.Count; i++) { + int CveConcepto = DTEXcel.Columns[i].ColumnName.ToEntero(); decimal Importe = 0; decimal ImporteGravado = 0; decimal ImporteExento = 0; - Importe = row[CveConcepto.ToString()].ToString().ToDecimal(); - try - { - ImporteExento = row[string.Format("E{0}", CveConcepto)].ToString().ToDecimal(); - } - catch (Exception) { } + bool dontsaveconcepto = ((row[i].ToString().ToUpper() == "N") || (DTEXcel.Rows[0][i].ToString().ToUpper() == "N")); + Importe = row[i].ToString().ToDecimal(); ImporteGravado = Importe - ImporteExento; - objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, UsuarioActual.CveUsuario); + if (CveConcepto > 0) + { + if (!dontsaveconcepto)//el usuario definira si desea actualizar o no el concepto en el periodo + { + if (!objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, UsuarioActual.CveUsuario)) + { + rollback = true; + } + } + } + else + { + rollback = false; + stringError = "ocurrio un error al procesar el archivo favor de intentar de nuevo volviendo a descargar el archivo.
    si el problema Persiste Contacte a soporte."; + } } + } } if (rollback) @@ -1199,7 +1238,11 @@ public partial class Nomina_Nomina2 : ClsPaginas var libro = wb.AddWorksheet("Nomina"); int column = 1; libro.Row(1).Hide(); + libro.Column(1).Hide(); + libro.Cell(1, column).Value = "CvePersonal"; + libro.Cell(2, column).Value = "CvePersonal"; + column++; libro.Cell(1, column).Value = "Codigo"; libro.Cell(2, column).Value = "Codigo"; column++; @@ -1214,12 +1257,12 @@ public partial class Nomina_Nomina2 : ClsPaginas libro.Cell(1, column).Value = CveConcepto; libro.Cell(2, column).Value = Concepto; libro.Column(column).Width = 15; - column++; - CveConcepto = string.Format("E{0}", row["CveConcepto"]); - Concepto = string.Format("Exento {0}", row["Concepto"]); - libro.Cell(1, column).Value = CveConcepto; - libro.Cell(2, column).Value = Concepto; - libro.Column(column).Width = 15; + //column++; + //CveConcepto = string.Format("E{0}", row["CveConcepto"]); + //Concepto = string.Format("Exento {0}", row["Concepto"]); + //libro.Cell(1, column).Value = CveConcepto; + //libro.Cell(2, column).Value = Concepto; + //libro.Column(column).Width = 15; } libro.Row(1).CellsUsed().Style.Font.FontColor = ClosedXML.Excel.XLColor.White; @@ -1229,22 +1272,40 @@ public partial class Nomina_Nomina2 : ClsPaginas //libro.Row(1).Cell(13).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(247, 150, 70)); //libro.Row(1).Cell(14).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 240)); //libro.Row(1).Cell(15).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(177, 160, 199)); - int Fila = 2; + + libro.Cell(3, 1).Value = 0; + libro.Range(3, 2, 3, 3).Merge().Value = "¿Modificar SI(S)/NO(N)?"; + column = 3; + foreach (DataRow row in dtConceptos.FiltraParametros("Tipo IN ('P','D','O') AND EsPadre = 1 ").Rows) + { + column++; + string Concepto = string.Format("V_{0}", row["CveConcepto"]); + libro.Cell(3, column).Value = "N"; + //column++; + //string ConceptoG = string.Format("VG_{0}", row["CveConcepto"]); + //libro.Cell(3, column).Value = "N"; + + } + libro.Row(3).CellsUsed().Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(177, 160, 199)); + + int Fila = 3; foreach (DataRow erow in dtempleados.FiltraParametros("CvePersonal>0").Rows) { Fila++; column = 1; + libro.Cell(Fila, column).Value = erow["CvePersonal"]; + column++; libro.Cell(Fila, column).Value = erow["Codigo"]; column++; libro.Cell(Fila, column).Value = erow["Nombre"]; foreach (DataRow row in dtConceptos.FiltraParametros("Tipo IN ('P','D','O') AND EsPadre = 1 ").Rows) { column++; - string Concepto = row["CveConcepto"].ToString(); - libro.Cell(Fila, column).Value = erow[Concepto]; - column++; - Concepto = string.Format("{0}-E", row["CveConcepto"]); + string Concepto = string.Format("V_{0}", row["CveConcepto"]); libro.Cell(Fila, column).Value = erow[Concepto]; + //column++; + //string ConceptoG = string.Format("VG_{0}", row["CveConcepto"]); + //libro.Cell(Fila, column).Value = erow[Concepto].ToString().ToDecimal() - erow[ConceptoG].ToString().ToDecimal(); } } @@ -1383,4 +1444,1412 @@ public partial class Nomina_Nomina2 : ClsPaginas UpModalTablas.Update(); RegistraScript("$('#ModalTablas').modal();"); } + + private void ImprimirReporte() + { + string RutaDocumento = System.IO.Path.Combine(Server.MapPath("/"), "Empresas/Grales/Lista de Raya.docx"); + if (dtempleados != null && dtempleados.Rows.Count > 0) + { + if (System.IO.File.Exists(RutaDocumento)) + { + try + { + clsGemBoxDocument GemDocumen = new clsGemBoxDocument(RutaDocumento); + List listaTags = new List(); + string strEmpresa = UsuarioActual.Empresa.Empresa; + string strFechaInicio = ""; + string strFechaFin = ""; + string strTipo = ""; + string strPeriodoNum = ""; + string strUbicacion = string.Format ("{0}, {1}, {2}, {3}",UsuarioActual.Empresa.Direccion, UsuarioActual.Empresa.Colonia, UsuarioActual.Empresa.Ciudad, UsuarioActual.Empresa.Estado ); + string strRegPatImss = ""; + string strRFC = UsuarioActual.Empresa.RFC; + string strfecha = DateTime.Now.ToString("dd/MMM/yyyy", System.Globalization.CultureInfo.CreateSpecificCulture("es-MX")); + string strhora = DateTime.Now.ToString("HH:mm:ss", System.Globalization.CultureInfo.CreateSpecificCulture("es-MX")); + + + int CvePeriodo = DdlPeriodo.SelectedValue.ToEntero(); + DataRow rperiodo = dtPeriodos.FiltroPrimero(string.Format("CvePeriodo = {0}", CvePeriodo)); + if (rperiodo != null) + { + strFechaInicio =string.Format("{0:dd/MM/yyyy}", rperiodo["FechaInicio"]); + strFechaFin = string.Format("{0:dd/MM/yyyy}", rperiodo["FechaFin"]); + strPeriodoNum = rperiodo["Numero"].ToString(); + + strTipo = DdlTipoPeriodo.SelectedItem.Text ; + } + listaTags.Add(new TagsDocumentos("[Empresa]", strEmpresa)); + listaTags.Add(new TagsDocumentos("[FechaInicio]", strFechaInicio)); + listaTags.Add(new TagsDocumentos("[FechaFin]", strFechaFin)); + listaTags.Add(new TagsDocumentos("[Tipo]", strTipo)); + listaTags.Add(new TagsDocumentos("[PeriodoNum]", strPeriodoNum)); + listaTags.Add(new TagsDocumentos("[Ubicacion]", strUbicacion)); + listaTags.Add(new TagsDocumentos("[RegPatImss]", strRegPatImss)); + listaTags.Add(new TagsDocumentos("[RFC]", strRFC)); + listaTags.Add(new TagsDocumentos("[fecha]", strfecha)); + listaTags.Add(new TagsDocumentos("[hora]", strhora)); + + GemBox.Document.DocumentModel document = GemDocumen.documento; + var section = document.Sections[0]; + GemBox.Document.Tables.TableRow row; + GemBox.Document.Tables.Table sobrereciboTable; + GemBox.Document.Tables.Table tconeptos; + GemBox.Document.Paragraph paragraphh; + int CveDepartamento = 0; + string Departamento = ""; + GemBox.Document.ParagraphStyle styilo = (GemBox.Document.ParagraphStyle)document.Styles.GetOrAdd(GemBox.Document.StyleTemplateType.Normal); + GemBox.Document.ParagraphStyle styilostrong = (GemBox.Document.ParagraphStyle)document.Styles.GetOrAdd(GemBox.Document.StyleTemplateType.NoSpacing); + //GemBox.Document.Style styilonegrita = GemBox.Document.Style.CreateStyle(GemBox.Document.StyleTemplateType.Strong, document); + //document.Styles.Add(styilonegrita); + foreach (DataRow drow in dtempleados.FiltraParametros("", "", new string[] { "CveDepartamento", "Departamento" }).Rows) + { + CveDepartamento = drow["CveDepartamento"].ToString().ToEntero(); + Departamento = drow["Departamento"].ToString(); + + paragraphh = new GemBox.Document.Paragraph(document, Departamento); + paragraphh.ParagraphFormat.Style = styilostrong; + section.Blocks.Add(paragraphh); + paragraphh = new GemBox.Document.Paragraph(document, "........................................................................................................................................................................"); + section.Blocks.Add(paragraphh); + foreach (DataRow drow2 in dtempleados.FiltraParametros(string.Format("CveDepartamento={0}", CveDepartamento)).Rows) + { + + sobrereciboTable = new GemBox.Document.Tables.Table(document); + sobrereciboTable.TableFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(100, GemBox.Document.Tables.TableWidthUnit.Percentage); + section.Blocks.Add(sobrereciboTable); + + row = new GemBox.Document.Tables.TableRow(document); + sobrereciboTable.Rows.Add(row); + var cell = new GemBox.Document.Tables.TableCell(document); + row.Cells.Add(cell); + /* + string SalarioDiariop = ""; + string FechaIngreso = "", Nombre = "", DiasLaborados = "";*/ + + paragraphh = new GemBox.Document.Paragraph(document,string.Format("{1} : {0}", drow2["Nombre"].ToString(), drow2["Codigo"].ToString())); cell.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilostrong; + + paragraphh = new GemBox.Document.Paragraph(document, string.Format("Fecha Ingr:{0:dd/MM/yyyy}, S.D.:{1:N2} ", drow2["FechaIngreso"], drow2["SalarioDiario"])); cell.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + paragraphh = new GemBox.Document.Paragraph(document, string.Format("Días pagados:{0}, Retardos: {1}, Ausencias:{2} ", drow2["DiasPago"], drow2["DiasRetardos"], drow2["DiasFaltados"])); cell.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + /* + Gonzalez Gaitan Jorge + DIRECTOR OPERATIVO RFC: GOGJ-720331-TZ3 Afiliación IMSS: 11-96-72-1082-1 + Fecha Ingr: 01/03/2019 Sal. diario: 3849.84 S.D.I: 4023.87 S.B.C: 2112.25 Cotiza Fijo + Días pagados: 15.00 Tot Hrs trab: 120.00 Hrs día: 8.00 Hrs extras: 0.00 CURP: GOGJ-720331-HMCNTR09 + */ + + row = new GemBox.Document.Tables.TableRow(document); + sobrereciboTable.Rows.Add(row); + cell = new GemBox.Document.Tables.TableCell(document); + row.Cells.Add(cell); + + tconeptos = new GemBox.Document.Tables.Table(document); + tconeptos.TableFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(100, GemBox.Document.Tables.TableWidthUnit.Percentage); + cell.Blocks.Add(tconeptos); + GemBox.Document.Tables.TableRow rowx; GemBox.Document.Tables.TableCell cellx; + + + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Percepción"); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Valor"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Importe"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Deducción"); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Valor"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Importe"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + //Percepción Valor Importe Deducción Valor Importe + bool gonext = true; + int cindex = 0; + int CvePersonal = 1; + while (gonext) + { + cindex = cindex + 1; + CvePersonal = drow2["CvePersonal"].ToString().ToEntero(); + int CveConcepto; string Concepto = ""; string Codigo = ""; string importe = ""; string valor = ""; + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + DataRow rowconcept = dtempleadosConceptos.FiltroPrimero(string.Format("CvePersonal={0} AND Tipo =1 AND Fila ={1}", CvePersonal, cindex)); + if (rowconcept != null) + { + CveConcepto = rowconcept["CveConcepto"].ToString().ToEntero(); + importe = string.Format("${0:N2}", rowconcept["Importe"]); + valor = string.Format("{0:#,###.##}", rowconcept["Valor"]); + + Concepto = ""; + + rowconcept = dtConceptos.FiltroPrimero(string.Format("CveConcepto={0}", CveConcepto)); + if (rowconcept != null) + { + Concepto = rowconcept["Concepto"].ToString(); + Codigo = rowconcept["Codigo"].ToString(); + } + } + else + { + gonext = false; + } + //percepciones + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Codigo); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Concepto); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, valor); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, importe); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + } + + + + CveConcepto = 0; Concepto = ""; importe = ""; Codigo = "";valor = ""; + + + rowconcept = dtempleadosConceptos.FiltroPrimero(string.Format("CvePersonal={0} AND Tipo =2 AND Fila ={1}", CvePersonal, cindex)); + if (rowconcept != null) + { + + CveConcepto = rowconcept["CveConcepto"].ToString().ToEntero(); + importe = string.Format("${0:N2}", rowconcept["Importe"]); + valor = string.Format("{0:#,###.##}", rowconcept["Valor"]); + //string valor = ""; + Concepto = ""; + + rowconcept = dtConceptos.FiltroPrimero(string.Format("CveConcepto={0}", CveConcepto)); + if (rowconcept != null) + { + Concepto = rowconcept["Concepto"].ToString(); + Codigo = rowconcept["Codigo"].ToString(); + } + gonext = true; + } + + //deducciones + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Codigo); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Concepto); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, valor); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, importe); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + } + } + { + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + } + //Total Percepciones y deducciones + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Total Percepciones"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", drow2["SumaPercepciones"])); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Total Deducciones"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", drow2["SumaDeducciones"])); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + //Neto a Pagar + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Neto a Pagar"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", drow2["Total"])); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + + + setborderclear(tconeptos); + keeptablesamepage(sobrereciboTable); + } + + paragraphh = new GemBox.Document.Paragraph(document, "........................................................................................................................................................................"); + section.Blocks.Add(paragraphh); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("Total Departamento {0}", Departamento.ToUpper())); + paragraphh.ParagraphFormat.Style = styilostrong; + section.Blocks.Add(paragraphh); + + #region "totaldepto" + { + + sobrereciboTable = new GemBox.Document.Tables.Table(document); + sobrereciboTable.TableFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(100, GemBox.Document.Tables.TableWidthUnit.Percentage); + section.Blocks.Add(sobrereciboTable); + row = new GemBox.Document.Tables.TableRow(document); + sobrereciboTable.Rows.Add(row); + var cell = new GemBox.Document.Tables.TableCell(document); + row.Cells.Add(cell); + tconeptos = new GemBox.Document.Tables.Table(document); + tconeptos.TableFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(100, GemBox.Document.Tables.TableWidthUnit.Percentage); + cell.Blocks.Add(tconeptos); + GemBox.Document.Tables.TableRow rowx; GemBox.Document.Tables.TableCell cellx; + //Percepción Valor Importe Deducción Valor Importe + bool gonext = true; + int cindex = 0; + int OrdenP = -999; + int ordenD = -999; + #region "Titulos" + + { + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Percepción"); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Valor"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Importe"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Deducción"); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Valor"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Importe"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + #endregion + #region "Titulos" + + while (gonext) + { + cindex = cindex + 1; + int CveConcepto; string Concepto = ""; string Codigo = ""; string importe = ""; + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + DataRow rowconcept; + while ((rowconcept = dtConceptos.FiltroPrimero(string.Format("Orden>{0} AND Tipo ='P'", OrdenP))) != null && importe == "") + { + double sumaimporte = dtempleadosConceptos.SUM("Importe", string.Format("CveDepartamento={0} AND CveConcepto={1}", CveDepartamento, rowconcept["CveConcepto"])); + OrdenP = rowconcept["Orden"].ToString().ToEntero(); + if (sumaimporte > 0) + { + CveConcepto = rowconcept["CveConcepto"].ToString().ToEntero(); + importe = string.Format("${0:N2}", sumaimporte); + Concepto = rowconcept["Concepto"].ToString(); + Codigo = rowconcept["Codigo"].ToString(); + + } + } + if (importe == "") + { + gonext = false; + } + //percepciones + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Codigo); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Concepto); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, importe); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + } + + + + CveConcepto = 0; Concepto = ""; importe = ""; Codigo = ""; + + while ((rowconcept = dtConceptos.FiltroPrimero(string.Format("Orden>{0} AND Tipo ='D'", ordenD))) != null && importe == "") + { + double sumaimporte = dtempleadosConceptos.SUM("Importe", string.Format("CveDepartamento={0} AND CveConcepto={1}", CveDepartamento, rowconcept["CveConcepto"])); + ordenD = rowconcept["Orden"].ToString().ToEntero(); + if (sumaimporte > 0) + { + CveConcepto = rowconcept["CveConcepto"].ToString().ToEntero(); + importe = string.Format("${0:N2}", sumaimporte); + Concepto = rowconcept["Concepto"].ToString(); + Codigo = rowconcept["Codigo"].ToString(); + + } + } + if (importe != "") + { + gonext = true; + } + + + //deducciones + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Codigo); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Concepto); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, importe); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + } + } + #endregion + + { + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + } + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Total Percepciones"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", dtempleados.SUM("SumaPercepciones", string.Format("CveDepartamento={0}", CveDepartamento)))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Total Deducciones"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", dtempleados.SUM("SumaDeducciones", string.Format("CveDepartamento={0}", CveDepartamento)))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + + //no empleados + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Total de empleados"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("{0:N0}", dtempleados.COUNT("CvePersonal", string.Format("CveDepartamento={0}", CveDepartamento)))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + } + } + //Neto depto + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Neto del departamento"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", dtempleados.SUM("Total", string.Format("CveDepartamento={0}", CveDepartamento)))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + + + setborderclear(tconeptos); + keeptablesamepage(sobrereciboTable); + } + #endregion + + } + + paragraphh = new GemBox.Document.Paragraph(document, "TOTAL "); + paragraphh.ParagraphFormat.Style = styilostrong; + section.Blocks.Add(paragraphh); + + #region "total" + { + + sobrereciboTable = new GemBox.Document.Tables.Table(document); + sobrereciboTable.TableFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(100, GemBox.Document.Tables.TableWidthUnit.Percentage); + section.Blocks.Add(sobrereciboTable); + row = new GemBox.Document.Tables.TableRow(document); + sobrereciboTable.Rows.Add(row); + var cell = new GemBox.Document.Tables.TableCell(document); + row.Cells.Add(cell); + tconeptos = new GemBox.Document.Tables.Table(document); + tconeptos.TableFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(100, GemBox.Document.Tables.TableWidthUnit.Percentage); + cell.Blocks.Add(tconeptos); + GemBox.Document.Tables.TableRow rowx; GemBox.Document.Tables.TableCell cellx; + //Percepción Valor Importe Deducción Valor Importe + bool gonext = true; + int cindex = 0; + int OrdenP = -999; + int ordenD = -999; + //Titulos + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Percepción"); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Valor"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Importe"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Deducción"); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Valor"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Importe"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + //conceptos percep,deduc + while (gonext) + { + cindex = cindex + 1; + int CveConcepto; string Concepto = ""; string Codigo = ""; string importe = ""; + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + DataRow rowconcept; + while ((rowconcept = dtConceptos.FiltroPrimero(string.Format("Orden>{0} AND Tipo ='P'", OrdenP))) != null && importe == "") + { + double sumaimporte = dtempleadosConceptos.SUM("Importe", string.Format(" CveConcepto={0}", rowconcept["CveConcepto"])); + OrdenP = rowconcept["Orden"].ToString().ToEntero(); + if (sumaimporte > 0) + { + CveConcepto = rowconcept["CveConcepto"].ToString().ToEntero(); + importe = string.Format("${0:N2}", sumaimporte); + Concepto = rowconcept["Concepto"].ToString(); + Codigo = rowconcept["Codigo"].ToString(); + + } + } + if (importe == "") + { + gonext = false; + } + //percepciones + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Codigo); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Concepto); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, importe); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + } + + + + CveConcepto = 0; Concepto = ""; importe = ""; Codigo = ""; + + while ((rowconcept = dtConceptos.FiltroPrimero(string.Format("Orden>{0} AND Tipo ='D'", ordenD))) != null && importe == "") + { + double sumaimporte = dtempleadosConceptos.SUM("Importe", string.Format(" CveConcepto={0}", rowconcept["CveConcepto"])); + ordenD = rowconcept["Orden"].ToString().ToEntero(); + if (sumaimporte > 0) + { + CveConcepto = rowconcept["CveConcepto"].ToString().ToEntero(); + importe = string.Format("${0:N2}", sumaimporte); + Concepto = rowconcept["Concepto"].ToString(); + Codigo = rowconcept["Codigo"].ToString(); + + } + } + if (importe != "") + { + gonext = true; + } + + + //deducciones + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Codigo); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Concepto); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, importe); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + } + } + { + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + } + //Totales perceciones deducciones + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Total Percepciones"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", dtempleados.SUM("SumaPercepciones"))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Total Deducciones"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", dtempleados.SUM("SumaDeducciones"))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Total de empleados general"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("{0:N0}", dtempleados.COUNT("CvePersonal"))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + } + } + //neto empresa + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Neto general"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", dtempleados.SUM("Total"))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + gonext = true; + int OrdenO = -999; + + //basura para espacio + { + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, " "); cellx.Blocks.Add(paragraphh); + } + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, " "); cellx.Blocks.Add(paragraphh); + } + } + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Obligación"); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Importe"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + while (gonext) + { + cindex = cindex + 1; + int CveConcepto; string Concepto = ""; string Codigo = ""; string importe = ""; + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + { + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Codigo); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.ColumnSpan = 2; + paragraphh = new GemBox.Document.Paragraph(document, Concepto); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + //cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + //cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + //paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + //paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, importe); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + } + } + DataRow rowconcept; + while ((rowconcept = dtConceptos.FiltroPrimero(string.Format("Orden>{0} AND Tipo ='O'", OrdenO))) != null && importe == "") + { + double sumaimporte = dtempleadosConceptos.SUM("Valor", string.Format(" CveConcepto={0}", rowconcept["CveConcepto"])); + OrdenO = rowconcept["Orden"].ToString().ToEntero(); + if (sumaimporte > 0) + { + CveConcepto = rowconcept["CveConcepto"].ToString().ToEntero(); + importe = string.Format("${0:N2}", sumaimporte); + Concepto = rowconcept["Concepto"].ToString(); + Codigo = rowconcept["Codigo"].ToString(); + + } + } + if (importe == "") + { + gonext = false; + } + //Obligaciones + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Codigo); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, Concepto); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, importe); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + } + + + } + + { + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + } + { + + rowx = new GemBox.Document.Tables.TableRow(document); + tconeptos.Rows.Add(rowx); + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, " "); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + + { + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(3, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(30, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, "Total Obligaciones"); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(6, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, ""); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilo; + + + cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx); + cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage); + paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", dtempleados.SUM("SumaObligaciones"))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + + } + } + setborderclear(tconeptos); + keeptablesamepage(tconeptos); + keeptablesamepage(sobrereciboTable); + } + #endregion + + + + GemDocumen.SustituirTags(listaTags); + GemDocumen.GuardarStreamPDF(); + //GemDocumen.GuardarStream(); + + System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(GemDocumen.GetBytesDocumento()); + GemDocumen.Dispose(); + Response.Clear(); + Response.ContentType = "application/pdf"; + Response.AddHeader("content-disposition", $"attachment;filename=Lista de Raya.pdf"); + //Response.AddHeader("content-disposition", $"attachment;filename=Lista de Raya.docx"); + Response.Buffer = true; + memoryStream.WriteTo(Response.OutputStream); + Response.End(); + } + + + + catch (Exception e) + { + + Extensiones.ModExtensiones.GuardaLog(string.Format("Nomina2(errorLayout):{0} ", e.ToString())); + Alert("No se pudo generar la lista de raya favor de contactar a soporte tecnico.", Extensiones.ModExtensiones.TipoMensaje.ToastError); + + } + } + else + { + Alert("No se encontro la plantilla.", Extensiones.ModExtensiones.TipoMensaje.ToastAdventencia); + } + + } + else + { + Alert("es necesario calcular el periodo primero.", Extensiones.ModExtensiones.TipoMensaje.ToastAdventencia); + } + } + + #region "Gembox" + private void keeptablesamepage(GemBox.Document.Tables.Table table) + { + //Mantener tabla unida + { + // Get all Paragraph formats in a Table element. + IEnumerable formats = table.GetChildElements(true, GemBox.Document.ElementType.TableCell) + .Cast() + .SelectMany(cell => + { + if (cell.Blocks.Count == 0) + cell.Blocks.Add(new GemBox.Document.Paragraph(cell.Document)); + return cell.GetChildElements(true, GemBox.Document.ElementType.Paragraph); + }) + .Cast() + .Select(p => p.ParagraphFormat); + + // Set KeepLinesTogether and KeepWithNext properties. + foreach (GemBox.Document.ParagraphFormat format in formats) + { + format.KeepLinesTogether = true; + format.KeepWithNext = true; + } + } + } + private void setborderclear(GemBox.Document.Tables.Table table) + { + table.TableFormat.Borders.SetBorders(GemBox.Document.MultipleBorderTypes.All, GemBox.Document.BorderStyle.None, GemBox.Document.Color.Empty, 0); + foreach (var row in table.Rows) + { + foreach (var cell in row.Cells) + { + cell.CellFormat.Borders.ClearBorders(); + } + } + } + #endregion + protected void LnkListaRaya_Click(object sender, EventArgs e) + { + ImprimirReporte(); + } } \ No newline at end of file diff --git a/Nomina/RepConceptosAcumulados.aspx b/Nomina/RepConceptosAcumulados.aspx index 0a44eeeb9..bbd16b73a 100644 --- a/Nomina/RepConceptosAcumulados.aspx +++ b/Nomina/RepConceptosAcumulados.aspx @@ -3,6 +3,11 @@ + @@ -14,9 +19,50 @@ +
    + + +
    +
    +
    +
    + +
    + + + +
    + + +
    + + + + + + +
    + + +
    + + + +
    + +
    + + + +
    +
    +
    +
    +
    + - + @@ -86,12 +116,14 @@
    - + Nombre + @@ -100,15 +132,17 @@ Acumulado Actual + - + Acumulado Anterior + @@ -118,6 +152,7 @@ Acumulado Anual + diff --git a/RH/Personal.aspx b/RH/Personal.aspx index 76e79d612..e1ae3ceb6 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -2270,7 +2270,7 @@ diff --git a/Scripts/custom.js b/Scripts/custom.js index 034aef08c..39e2ae95b 100644 --- a/Scripts/custom.js +++ b/Scripts/custom.js @@ -1769,7 +1769,7 @@ jQuery(document).ready(function () { loadsortadscroll(); QuickSidebar.init(); - MoveFixedDiv(); + MoveFixedDiv(); setswitch(); function ocultarbtnmaster() { if ($('#btnmaster_actionssidebar + ul').text().trim() == "") { $('#btnmaster_actionssidebar').css('display', 'none'); } else { $('#btnmaster_actionssidebar').css('display', 'block'); } } diff --git a/Site.master.vb b/Site.master.vb index 6afa57abc..bd03f5832 100644 --- a/Site.master.vb +++ b/Site.master.vb @@ -405,7 +405,7 @@ Partial Class Site Case 8 Return "" Case 9 - Return "" + Return "" Case 10 Return "" Case Else
    @@ -24,58 +70,42 @@ Datos del Concepto - + + + - - - - - +
    Concepto: Tipo: - - - - Codigo:
    Tipo: - +
    + +
    Datos del Periodo - - + + + - + - - - - - + + + + +
    Ejercicio:
    - - - - - - -
    Tipo Periodo: - - -
    Periodo: - - -