This commit is contained in:
@@ -97,7 +97,7 @@
|
||||
|
||||
|
||||
<asp:GridView ID="GVCalculoISRAnual" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD GVCalculoISRAnual Widthall" AutoGenerateColumns="False"
|
||||
DataKeyNames="CvePersonal,Codigo,NombreCompleto,TipoIngreso,FechaInicio,IngresosTotales,BaseGravada,Deducciones,ISRRetenido,Art152,SubsCorrespondiente,LimiteInferior,LimiteSuperior,CuotaFija,Porcentaje,ImpuestoAnual,Acargo,Acompensar">
|
||||
DataKeyNames="CvePersonal,Codigo,NombreCompleto,TipoIngreso,FechaInicio,FechaFin,IngresosTotales,BaseGravada,Deducciones,ISRRetenido,Art152,SubsCorrespondiente,LimiteInferior,LimiteSuperior,CuotaFija,Porcentaje,ImpuestoAnual,Acargo,Acompensar">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Aplica">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -72,15 +72,30 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas
|
||||
|
||||
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
|
||||
var libro = wb.AddWorksheet("Asistencia");
|
||||
int column = 1;
|
||||
|
||||
int row = 1;
|
||||
string imagePath = string.Format("{0}{1}\\Logo.png", ModExtensiones.DirectorioEmpresas, UsuarioActual.CveEmpresa);
|
||||
if (System.IO.File.Exists(imagePath))
|
||||
{
|
||||
var image = libro.AddPicture(imagePath)
|
||||
.MoveTo(libro.Cell(row, 2))//, libro.Cell(row, 5));
|
||||
.Scale(.8);
|
||||
}
|
||||
row++;
|
||||
libro.Range(row, 3, row, 5).Merge().Value = UsuarioActual.Empresa.Empresa;
|
||||
row++;
|
||||
libro.Range(row, 3, row, 5).Merge().Value = string.Format("Calculo I.S.R anual del ejercicio {0}", DdlEjercicios.SelectedValue);
|
||||
|
||||
row++;
|
||||
row++;
|
||||
int column = 1;
|
||||
libro.Cell(row, column++).Value = "Aplica";
|
||||
libro.Cell(row, column++).Value = "Causa";
|
||||
libro.Cell(row, column++).Value = "Código";
|
||||
libro.Cell(row, column++).Value = "Nombre";
|
||||
libro.Cell(row, column++).Value = "Tipo ingreso";
|
||||
libro.Cell(row, column++).Value = "Fecha ingreso";
|
||||
libro.Cell(row, column++).Value = "Fecha baja";
|
||||
libro.Cell(row, column++).Value = "Ingresos totales";
|
||||
libro.Cell(row, column++).Value = "Base gravada";
|
||||
libro.Cell(row, column++).Value = "Base exenta";
|
||||
@@ -93,6 +108,7 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas
|
||||
libro.Range(row, 1, row, column - 1).CellsUsed().Style.Font.FontColor = ClosedXML.Excel.XLColor.White;
|
||||
libro.Range(row, 1, row, column - 1).CellsUsed().Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189));
|
||||
row++;
|
||||
int initrowdata = row;
|
||||
using (ClsNominas onom = new ClsNominas())
|
||||
{
|
||||
if (onom.CalculoISRAnual(DdlEjercicios.SelectedValue.ToEntero(), UsuarioActual.Empresa.CveEmpresa) && onom.DtResultados.Rows.Count > 0)
|
||||
@@ -105,7 +121,9 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas
|
||||
libro.Cell(row, column++).Value = drow["causa"];
|
||||
libro.Cell(row, column++).Value = drow["Codigo"];
|
||||
libro.Cell(row, column++).Value = drow["NombreCompleto"];
|
||||
libro.Cell(row, column++).Value = string.Format("{0} - {1:dd/MM/yyyy}", drow["TipoIngreso"], drow["FechaInicio"]);
|
||||
libro.Cell(row, column++).Value = string.Format("{0}", drow["TipoIngreso"], drow["FechaInicio"]);
|
||||
libro.Cell(row, column++).Value = string.Format("{0:dd/MM/yyyy}", drow["FechaInicio"]);
|
||||
libro.Cell(row, column++).Value = string.Format("{0:dd/MM/yyyy}", drow["FechaFin"]);
|
||||
libro.Cell(row, column++).Value = drow["IngresosTotales"];
|
||||
libro.Cell(row, column++).Value = drow["BaseGravada"];
|
||||
libro.Cell(row, column++).Value = drow["BaseExcenta"];
|
||||
@@ -120,12 +138,12 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas
|
||||
}
|
||||
}
|
||||
|
||||
libro.SheetView.Freeze(1, 4);
|
||||
libro.SheetView.Freeze(initrowdata-1, 5);
|
||||
libro.ColumnsUsed().AdjustToContents();
|
||||
libro.Range(1, 6, 1, column).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center;
|
||||
libro.Range(2, 6, row, column).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right;
|
||||
libro.Range(2, 6, row, column).SetDataType(ClosedXML.Excel.XLDataType.Number);
|
||||
libro.Range(2, 6, row, column).Style.NumberFormat.Format = "$#,###,###,###,###,###,0.00";
|
||||
libro.Range(initrowdata-1, 6, initrowdata-1, column).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center;
|
||||
libro.Range(initrowdata, 8, row, column).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right;
|
||||
libro.Range(initrowdata, 8, row, column).SetDataType(ClosedXML.Excel.XLDataType.Number);
|
||||
libro.Range(initrowdata, 8, row, column).Style.NumberFormat.Format = "$#,###,###,###,###,###,0.00";
|
||||
|
||||
|
||||
System.IO.Stream fs = new System.IO.MemoryStream();
|
||||
@@ -146,6 +164,7 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas
|
||||
Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.xlsx", "Calculo Anual"));
|
||||
Response.BinaryWrite(memoryStream.ToArray());
|
||||
Response.End();
|
||||
//Alert(string.Format("<pre> {0} {1}</pre>",imagePath, System.IO.File.Exists(imagePath)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user