From f4394b90bed8658154178cf0041a496abcb99ae7 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 1 Mar 2024 23:46:31 -0700 Subject: [PATCH 1/8] modificar salario detectar cambios --- RH/CalculoSBC.aspx.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RH/CalculoSBC.aspx.cs b/RH/CalculoSBC.aspx.cs index 75e090f23..5f0c0dddc 100644 --- a/RH/CalculoSBC.aspx.cs +++ b/RH/CalculoSBC.aspx.cs @@ -947,7 +947,10 @@ public partial class RH_CalculoSBC : ClsPaginas if (e.Row.RowType == DataControlRowType.DataRow) { - e.Row.FCCheckBox("chkUpdate").Checked = !(string.Format("{0:N2}", e.Row.DBCampo("SalarioDiarioSSNuevo")) == string.Format("{0:N2}", e.Row.DBCampo("SalarioDiarioSS"))); + decimal valueold = e.Row.DBCampo("SalarioDiarioSS").ToString().ToDecimal(); + decimal valuenew = e.Row.DBCampo("SalarioDiarioSSNuevo").ToString().ToDecimal(); + decimal diferencia = Math.Abs(valueold - valuenew); + e.Row.FCCheckBox("chkUpdate").Checked = diferencia > 0.01M; e.Row.FCLabel("lblsalarioDiarioSSf").Text = e.Row.FCCheckBox("chkUpdate").Checked ? "Si" : "No"; } From 37635a919b69abdcc4818e0be0b984e9929af4d5 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 11 Mar 2024 07:28:15 -0700 Subject: [PATCH 2/8] --- App_Code/ClsNominas.vb | 3 ++- Nomina/CalculoISRAnual.aspx.cs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 587854f03..0e34fcd2f 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -308,7 +308,7 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function AutorizaCalculoAnual(CveEmpresa As Integer, CveUsuario As Integer, PersonalXml As String, Optional Numpagos As Integer = 1) As Boolean + Public Function AutorizaCalculoAnual(CveEmpresa As Integer, CveUsuario As Integer, PersonalXml As String, Optional Numpagos As Integer = 1, Optional Ejercicio As Integer = 2023) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Nom_AutorizaCalculoAnual", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -316,6 +316,7 @@ Public Class ClsNominas .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@PersonalXml", SqlDbType.Xml).Value = If(String.IsNullOrEmpty(PersonalXml), DBNull.Value, DirectCast(PersonalXml, Object)) .Add("@Numpagos", SqlDbType.Int).Value = Numpagos + .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio End With Try diff --git a/Nomina/CalculoISRAnual.aspx.cs b/Nomina/CalculoISRAnual.aspx.cs index 5202f795a..82dd5049d 100644 --- a/Nomina/CalculoISRAnual.aspx.cs +++ b/Nomina/CalculoISRAnual.aspx.cs @@ -7,10 +7,21 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Xml.Linq; using Extensiones; +using Profact.TimbraCFDI40; public partial class Nomina_CalculoISRAnual : ClsPaginas { + + protected int Ejercicio + { + get + { + if (ViewState["Ejercicio"] == null) { return 0; } + else { return ViewState["Ejercicio"].ToString().ToEntero(); } + } + set { ViewState["Ejercicio"] = value; } + } protected int CvePersonal { get @@ -51,7 +62,8 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas { using (ClsNominas onom = new ClsNominas()) { - onom.CalculoISRAnual(DdlEjercicios.SelectedValue.ToEntero(), UsuarioActual.Empresa.CveEmpresa); + Ejercicio = DdlEjercicios.SelectedValue.ToEntero(); + onom.CalculoISRAnual(Ejercicio, UsuarioActual.Empresa.CveEmpresa); GVCalculoISRAnual.DataSource = onom.DtResultados; } @@ -250,7 +262,7 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas using (ClsNominas onom = new ClsNominas()) { - continuar = onom.AutorizaCalculoAnual(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, xmlpeople, numpagos); + continuar = onom.AutorizaCalculoAnual(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, xmlpeople, numpagos, Ejercicio); } if (continuar) { From 9a62c8ba735b741f452d653ddff3513956a0af4d Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Tue, 2 Apr 2024 12:16:16 -0700 Subject: [PATCH 3/8] nominas --- App_Code/ClsRH.vb | 10 +- Nomina/Nomina.aspx | 1 + Nomina/Nomina.aspx.cs | 165 ++++++++++++++++++++++++- RH/CatAsistenciasInasistencias.aspx | 17 ++- RH/CatAsistenciasInasistencias.aspx.vb | 11 +- RH/Personal.aspx | 1 + 6 files changed, 189 insertions(+), 16 deletions(-) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index e0ee2474c..8ef0812c4 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -340,7 +340,7 @@ Public Class ClsRH Public Function AddAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, CveUsuario As Integer, CveEmpresa As Integer, chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, - chkAplicaUtilidades As Boolean, aplicaPago As Integer, aplicaPagoDoble As Integer, aplicaPrimaVac As Integer, Optional TipoCorto As String = "-1") As Boolean + chkAplicaUtilidades As Boolean, aplicaPago As Integer, aplicaPagoDoble As Integer, aplicaPrimaVac As Integer, Optional TipoCorto As String = "-1", Optional AplicaPrimaDominical As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_AsistenciasInasistenciasAdd") @@ -361,6 +361,7 @@ Public Class ClsRH .Add("@AplicaPago", SqlDbType.Int).Value = aplicaPago .Add("@AplicaPagoDoble", SqlDbType.Int).Value = aplicaPagoDoble .Add("@AplicaPrimaVac", SqlDbType.Int).Value = aplicaPrimaVac + .Add("@AplicaPrimaDominical", SqlDbType.Int).Value = AplicaPrimaDominical End With @@ -382,7 +383,7 @@ Public Class ClsRH Public Function UpdateAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, Estatus As Boolean, CveAI As Integer, chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, chkAplicaUtilidades As Boolean, - aplicaPago As Integer, aplicaPagoDoble As Integer, aplicaPrimaVac As Integer, Optional TipoCorto As String = "-1") As Boolean + aplicaPago As Integer, aplicaPagoDoble As Integer, aplicaPrimaVac As Integer, Optional TipoCorto As String = "-1", Optional AplicaPrimaDominical As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_AsistenciasInasistenciasUpdate") @@ -403,8 +404,9 @@ Public Class ClsRH .Add("@AplicaPago", SqlDbType.Int).Value = aplicaPago .Add("@AplicaPagoDoble", SqlDbType.Int).Value = aplicaPagoDoble .Add("@AplicaPrimaVac", SqlDbType.Int).Value = aplicaPrimaVac - End With - + .Add("@AplicaPrimaDominical", SqlDbType.Int).Value = AplicaPrimaDominical + End With + Try SqlAdapter.Fill(Data) Retorno = True diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index 187ee7301..57d521871 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -1132,6 +1132,7 @@ + diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 9285ca71e..18ab63109 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -749,6 +749,16 @@ public partial class Nomina_Nomina2 : ClsPaginas GvNominas.Columns[CurrentColumn].Visible = true; CurrentColumn++; + field = (BoundField)GvNominas.Columns[CurrentColumn]; + field.HeaderText = "Especie"; + field.DataField = "SumaEspecie"; + field.ItemStyle.BackColor = System.Drawing.Color.LightGray; + GvNominas.Columns[CurrentColumn].ItemStyle.CssClass = " "; + GvNominas.Columns[CurrentColumn].HeaderStyle.CssClass = " "; + GvNominas.Columns[CurrentColumn].Visible = (dtempleados.SUM("SumaEspecie") != 0); + CurrentColumn++; + + field = (BoundField)GvNominas.Columns[CurrentColumn]; field.HeaderText = "Total"; field.DataField = "Total"; @@ -1118,6 +1128,8 @@ public partial class Nomina_Nomina2 : ClsPaginas dr["SubProyecto"] = drow["SubProyecto"]; dr["SumaPercepciones"] = dtempleados.SUM("SumaPercepciones", filtrogrupo); dr["SumaDeducciones"] = dtempleados.SUM("SumaDeducciones", filtrogrupo); + dr["SumaEspecie"] = dtempleados.SUM("SumaEspecie", filtrogrupo); + dr["Total"] = dtempleados.SUM("Total", filtrogrupo); dr["SumaObligaciones"] = dtempleados.SUM("SumaObligaciones", filtrogrupo); @@ -1142,6 +1154,8 @@ public partial class Nomina_Nomina2 : ClsPaginas dr["Departamento"] = drow["Departamento"]; dr["SumaPercepciones"] = dtempleados.SUM("SumaPercepciones", filtrogrupo); dr["SumaDeducciones"] = dtempleados.SUM("SumaDeducciones", filtrogrupo); + dr["SumaEspecie"] = dtempleados.SUM("SumaEspecie", filtrogrupo); + dr["Total"] = dtempleados.SUM("Total", filtrogrupo); dr["SumaObligaciones"] = dtempleados.SUM("SumaObligaciones", filtrogrupo); @@ -1166,6 +1180,8 @@ public partial class Nomina_Nomina2 : ClsPaginas dr["Turno"] = drow["Turno"]; dr["SumaPercepciones"] = dtempleados.SUM("SumaPercepciones", filtrogrupo); dr["SumaDeducciones"] = dtempleados.SUM("SumaDeducciones", filtrogrupo); + dr["SumaEspecie"] = dtempleados.SUM("SumaEspecie", filtrogrupo); + dr["Total"] = dtempleados.SUM("Total", filtrogrupo); dr["SumaObligaciones"] = dtempleados.SUM("SumaObligaciones", filtrogrupo); @@ -4338,6 +4354,12 @@ public partial class Nomina_Nomina2 : ClsPaginas SubTotales.EstatusD = -2; SubTotales.ImporteD = dtPerEmpleados.SUM("SumaDeducciones", string.Format("CvePersonal = {0}", SRCvePersonal)); + + NConcepto especie = new NConcepto(); + especie.CveConceptoD = 0; + especie.ConceptoD = "Especie"; + especie.EstatusD = -3; + especie.ImporteD = dtPerEmpleados.SUM("SumaEspecie", string.Format("CvePersonal = {0}", SRCvePersonal)); NConcepto Totales = new NConcepto(); Totales.CveConceptoD = 0; Totales.ConceptoD = "Total"; @@ -4345,6 +4367,10 @@ public partial class Nomina_Nomina2 : ClsPaginas Totales.ImporteD = dtPerEmpleados.SUM("Total", string.Format("CvePersonal = {0}", SRCvePersonal)); lconc.Add(SubTotales); + if (especie.ImporteD > 0) + { + lconc.Add(especie); + } lconc.Add(Totales); GvConceptos.DataSource = lconc; GvConceptos.DataBind(); @@ -4455,6 +4481,12 @@ public partial class Nomina_Nomina2 : ClsPaginas SubTotales.EstatusD = -2; SubTotales.ImporteD = dtPerEmpleados.SUM("SumaDeducciones", string.Format("CvePersonal = {0}", SRCvePersonal)); + NConcepto especie = new NConcepto(); + especie.CveConceptoD = 0; + especie.ConceptoD = "Especie"; + especie.EstatusD = -3; + especie.ImporteD = dtPerEmpleados.SUM("SumaEspecie", string.Format("CvePersonal = {0}", SRCvePersonal)); + NConcepto Totales = new NConcepto(); Totales.CveConceptoD = 0; Totales.ConceptoD = "Total"; @@ -4462,6 +4494,10 @@ public partial class Nomina_Nomina2 : ClsPaginas Totales.ImporteD = dtPerEmpleados.SUM("Total", string.Format("CvePersonal = {0}", SRCvePersonal)); lconc.Add(SubTotales); + if (especie.ImporteD > 0) + { + lconc.Add(especie); + } lconc.Add(Totales); DataTable dtCon = new DataTable(); @@ -4969,6 +5005,10 @@ public partial class Nomina_Nomina2 : ClsPaginas libro.Range(filainicio + 1, iniciotipe + 1, filainicio + 1, column).Merge().Value = "Deducciones"; } + column++; + libro.Cell(filainicio + 1, column).Value = " "; + libro.Range(filainicio + 2, column, filainicio + 3, column).Merge().Value = "Despensa"; + libro.Column(column).Width = 15; column++; libro.Cell(filainicio + 1, column).Value = " "; libro.Range(filainicio + 2, column, filainicio + 3, column).Merge().Value = "Total"; @@ -5084,7 +5124,13 @@ public partial class Nomina_Nomina2 : ClsPaginas { libro.Cell(Fila - 3, column).Value = dtempleados.SUM("SumaDeducciones", string.Format("CveSubProyecto ={0} AND CvePersonal > 0 ", oldcveSupProyecto)); } - + column++; + libro.Cell(Fila, column).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(166, 166, 166)); + libro.Cell(Fila, column).Value = erow["SumaEspecie"]; + if (newsubproyecto) + { + libro.Cell(Fila - 3, column).Value = dtempleados.SUM("SumaEspecie", string.Format("CveSubProyecto ={0} AND CvePersonal > 0 ", oldcveSupProyecto)); + } column++; libro.Cell(Fila, column).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(166, 166, 166)); libro.Cell(Fila, column).Value = erow["Total"]; @@ -5352,7 +5398,14 @@ public partial class Nomina_Nomina2 : ClsPaginas { libro.Cell(Fila - 3, column).Value = dtempleados.SUM("SumaDeducciones", string.Format("CveSubProyecto ={0} AND CvePersonal > 0 ", oldcveSupProyecto)); } - + column++; + libro.Cell(Fila, column).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(166, 166, 166)); + libro.Cell(Fila, column).Value = erow["SumaEspecie"]; + if (newsubproyecto) + { + libro.Cell(Fila - 3, column).Value = dtempleados.SUM("SumaEspecie", string.Format("CveSubProyecto ={0} AND CvePersonal > 0 ", oldcveSupProyecto)); + } + column++; libro.Cell(Fila, column).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(166, 166, 166)); libro.Cell(Fila, column).Value = erow["Total"]; @@ -5898,8 +5951,51 @@ public partial class Nomina_Nomina2 : ClsPaginas 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; + + } + } + if(drow2["SumaEspecie"].ToString().ToDecimal()>0) + { + 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, "Especie"); 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["SumaEspecie"])); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + } } { rowx = new GemBox.Document.Tables.TableRow(document); @@ -6225,10 +6321,60 @@ public partial class Nomina_Nomina2 : ClsPaginas 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("CvePersonal > 0 AND CveSubProyecto={0}", CveSubProyecto)))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; paragraphh.ParagraphFormat.Style = styilostrong; - + } } + if(dtempleados.SUM("SumaEspecie", string.Format("CvePersonal > 0 AND CveSubProyecto={0}", CveSubProyecto))>0) + { + 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 = 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, "Especie"); 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("SumaEspecie", string.Format("CvePersonal > 0 AND CveSubProyecto={0}", CveSubProyecto)) )); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; + paragraphh.ParagraphFormat.Style = styilostrong; + //SumaEspecie + } + } //no empleados { @@ -6579,7 +6725,7 @@ public partial class Nomina_Nomina2 : ClsPaginas 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", "CvePersonal > 0 "))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right; paragraphh.ParagraphFormat.Style = styilostrong; - + //SumaEspecie } } { @@ -7918,7 +8064,12 @@ public partial class Nomina_Nomina2 : ClsPaginas SubTotales.ConceptoD = "Total Deducciones"; SubTotales.EstatusD = -2; SubTotales.ImporteD = dtempleadosSimula.SUM("SumaDeducciones", string.Format("CvePersonal = {0}", SRCvePersonal)); - + + NConcepto especie = new NConcepto(); + especie.CveConceptoD = 0; + especie.ConceptoD = "Especie"; + especie.EstatusD = -3; + especie.ImporteD = dtempleadosSimula.SUM("SumaEspecie", string.Format("CvePersonal = {0}", SRCvePersonal)); NConcepto Totales = new NConcepto(); Totales.CveConceptoD = 0; Totales.ConceptoD = "Total"; @@ -7926,6 +8077,10 @@ public partial class Nomina_Nomina2 : ClsPaginas Totales.ImporteD = dtempleadosSimula.SUM("Total", string.Format("CvePersonal = {0}", SRCvePersonal)); lconc.Add(SubTotales); + if (especie.ImporteD > 0) + { + lconc.Add(especie); + } lconc.Add(Totales); DataTable dtCon = new DataTable(); diff --git a/RH/CatAsistenciasInasistencias.aspx b/RH/CatAsistenciasInasistencias.aspx index 4b27fd759..9a89935e4 100644 --- a/RH/CatAsistenciasInasistencias.aspx +++ b/RH/CatAsistenciasInasistencias.aspx @@ -31,7 +31,7 @@ - + @@ -95,6 +95,11 @@ + + + + + a @@ -200,7 +205,7 @@
-
+

@@ -211,8 +216,12 @@
-
- +
+ +
+
+
+
diff --git a/RH/CatAsistenciasInasistencias.aspx.vb b/RH/CatAsistenciasInasistencias.aspx.vb index 6f2ff753a..e280abb9a 100644 --- a/RH/CatAsistenciasInasistencias.aspx.vb +++ b/RH/CatAsistenciasInasistencias.aspx.vb @@ -69,6 +69,9 @@ Partial Class RH_CatAsistenciasInasistencias AplicaRetardo.Checked = False AplicaAguinaldo.Checked = False AplicaUtilidades.Checked = False + ChkAplicaPagoDoble.Checked = False + ChkAplicaPrimaDominical.Checked = False + TipoTxt.Text = "" TxtTipoCorto.Text = "" UpModalTiposD.Update() @@ -88,10 +91,11 @@ Partial Class RH_CatAsistenciasInasistencias Dim aplicaPago As Integer = If(ChkAplicaPago.Checked, 1, 0) Dim aplicaPagoDoble As Integer = If(ChkAplicaPagoDoble.Checked, 1, 0) Dim aplicaPrimaVac As Integer = If(ChkAplicaPrimaVac.Checked, 1, 0) + Dim AplicaPrimaDominical As Integer = If(ChkAplicaPrimaDominical.Checked, 1, 0) If ObjAsistenciasInasistencias.AddAsistenciasInasistencias(TipoTxt.Text.Trim, chkAplicaFalta, chkAplicaNoAplica, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, - chkAplicaVacacion, chkAplicaIncapacidad, chkAplicaRetardo, chkAplicaAguinaldo, chkAplicaUtilidades, aplicaPago, aplicaPagoDoble, aplicaPrimaVac, TxtTipoCorto.Text) Then + chkAplicaVacacion, chkAplicaIncapacidad, chkAplicaRetardo, chkAplicaAguinaldo, chkAplicaUtilidades, aplicaPago, aplicaPagoDoble, aplicaPrimaVac, TxtTipoCorto.Text, AplicaPrimaDominical) Then TipoTxt.Text = "" Alert("El nuevo Tipo Asistencias/Inasistencias se guardó correctamente.", TipoMensaje.MsgInformacion) UpTitulos.Update() @@ -136,7 +140,7 @@ Partial Class RH_CatAsistenciasInasistencias ChkAplicaPago.Checked = If(GvRow.DataKey("AplicaPago") = "Aplica", True, False) ChkAplicaPagoDoble.Checked = If(GvRow.DataKey("AplicaPagoDoble") = "Aplica", True, False) ChkAplicaPrimaVac.Checked = If(GvRow.DataKey("AplicaPrimaVac") = "Aplica", True, False) - + ChkAplicaPrimaDominical.Checked = If(GvRow.DataKey("AplicaPrimaDominical") = "Aplica", True, False) ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False) CveTipoAsisAEditar = Convert.ToInt32(GvRow.DataKey("CveAsistenciasInasistencias")) 'Guardamos en una propiedad el id del registro del cual haremos cambios, se guarda y se utiliza en el metodo "GvDatos_RowUpdating" @@ -170,12 +174,13 @@ Partial Class RH_CatAsistenciasInasistencias Dim aplicaPagoDoble As Integer = If(ChkAplicaPagoDoble.Checked, 1, 0) Dim aplicaPrimaVac As Integer = If(ChkAplicaPrimaVac.Checked, 1, 0) + Dim AplicaPrimaDominical As Integer = If(ChkAplicaPrimaDominical.Checked, 1, 0) If ObjAsistenciasInasistencias.UpdateAsistenciasInasistencias(Tipo, ckAplicaFalta, AplicaAsistencia, Estatus, CveAsistenciasInasistencias, chkAplicaVacacion, chkAplicaIncapacidad, chkAplicaRetardo, chkAplicaAguinaldo, chkAplicaUtilidades, aplicaPago, aplicaPagoDoble, - aplicaPrimaVac, TxtTipoCorto.Text) Then + aplicaPrimaVac, TxtTipoCorto.Text, AplicaPrimaDominical) Then GvDatos.EditIndex = -1 ViewState("DTAsistenciasInasistencias") = ObjAsistenciasInasistencias.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa) = Nothing diff --git a/RH/Personal.aspx b/RH/Personal.aspx index 9053f04f4..eeef32c5e 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -2177,6 +2177,7 @@ +
From 5c1030a7c15cc1a79a826f1300bedca98a0af855 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Wed, 10 Apr 2024 06:28:02 -0700 Subject: [PATCH 4/8] --- App_Code/ClsNominas.vb | 11 +- App_Code/ClsPaginas.vb | 6 +- Nomina/Nomina.aspx | 182 +++++++- Nomina/Nomina.aspx.cs | 942 ++++++++++++++++++++++++----------------- 4 files changed, 753 insertions(+), 388 deletions(-) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 0e34fcd2f..418df87c3 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -372,7 +372,16 @@ Public Class ClsNominas SqlAdapter.Fill(DTSetResultados) retorno = True Catch ex As Exception - OnError("Ocurrió un error al actualizar forma de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Dim msgerror As String = "Ocurrió un error al actualizar forma de pago." + If String.IsNullOrEmpty(BancoNumCuenta) Then + msgerror = "El campo numero de cuenta es necesario" + + End If + If String.IsNullOrEmpty(CLABE) Then + msgerror = "El campo numero de CLABE es necesario" + + End If + OnError(msgerror, ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index b433d440c..487f2a677 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -8267,9 +8267,9 @@ Public Class ClsPaginas filtrop = "AND CveSistema IN(10,11,32)" friltrod = " AND CveSistema =47" End If - DTPercepciones = ObjNomina.DtResultados.FiltraParametros($"((Tipo = 'P' OR (Tipo = 'D' AND Importe <0)) AND Importe <>0 AND EsPadre = 1 AND SoloVisible =0) {filtrop}") - DTDeducciones = ObjNomina.DtResultados.FiltraParametros($"(Tipo = 'D' AND Importe >0 AND EsPadre = 1 AND SoloVisible =0) {friltrod}") - DTDeducciones2 = ObjNomina.DtResultados.FiltraParametros($"((Tipo = 'D' AND Importe >0 AND EsPadre = 1 AND SoloVisible =0) OR CveSistema IN (20,21) OR CveConcepto =4714){friltrod}") + DTPercepciones = ObjNomina.DtResultados.FiltraParametros($"((Tipo = 'P' OR (Tipo = 'D' AND Importe <0)) AND ((Importe <>0 AND EsPadre = 1 AND SoloVisible =0) OR Imprimir =1)) {filtrop}") + DTDeducciones = ObjNomina.DtResultados.FiltraParametros($"(Tipo = 'D' AND ((Importe >0 AND EsPadre = 1 AND SoloVisible =0) OR Imprimir =1) ) {friltrod}") + DTDeducciones2 = ObjNomina.DtResultados.FiltraParametros($"(Tipo = 'D' AND (( Importe >0 AND EsPadre = 1 AND SoloVisible =0) OR Imprimir =1) ){friltrod}") ajusteindemnizacion = ObjNomina.DtResultados.FiltraParametros($"((Tipo = 'P' OR (Tipo = 'D' AND Importe <0)) AND Importe <>0 AND EsPadre = 1 AND SoloVisible =0) AND CveSistema IN(10,11,32)").SUM("Importe") - ObjNomina.DtResultados.FiltraParametros($"(Tipo = 'D' AND Importe >0 AND EsPadre = 1 AND SoloVisible =0) AND CveSistema =47").SUM("Importe") For Each row As DataRow In DTPercepciones.Rows diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index 57d521871..1abdbca12 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -216,6 +216,15 @@ +
  • + Ordenar +
  • +
  • + Ocultar / Mostrar +
  • +
  • + Ordenar +
  • Autorizar
  • @@ -3948,6 +3957,8 @@ Cargar + + @@ -4728,8 +4739,6 @@ diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb index 514f2022a..e12f8af7a 100644 --- a/Inventarios/Kardex.aspx.vb +++ b/Inventarios/Kardex.aspx.vb @@ -25,10 +25,60 @@ Partial Class Inventarios_Kardex ViewState("CveMovimiento") = Value End Set End Property + + + Private Property IndiceNavegacionActual As Integer + Get + + If ViewState("IndiceNavegacionActual") Is Nothing Then + ViewState("IndiceNavegacionActual") = 0 + End If + Return ViewState("IndiceNavegacionActual").ToString.ToEntero + End Get + Set + ViewState("IndiceNavegacionActual") = Value + End Set + End Property + + Private Property DTPSNavegacion As DataTable + Get + If ViewState("DTPSNavegacion") Is Nothing Then + ViewState("DTPSNavegacion") = New DataTable + End If + + Return DirectCast(ViewState("DTPSNavegacion"), DataTable) + + End Get + Set(value As DataTable) + ViewState("DTPSNavegacion") = value + End Set + End Property + + Private Property NavegacionTieneDatos As Boolean + Get + + If ViewState("NavegacionTieneDatos") Is Nothing Then + ViewState("NavegacionTieneDatos") = False + End If + Return Boolean.Parse(ViewState("NavegacionTieneDatos").ToString) + End Get + Set(value As Boolean) + ViewState("NavegacionTieneDatos") = value + End Set + End Property + + + #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then + + If UsuarioActual.CveRol = 1 Then + CreaDTPSNavegacion() + DVNavegar.Visible = True + End If + TxtFechaI.Text = NowADS().AddMonths(-1).ToShortDateString TxtFechaF.Text = NowADS().ToShortDateString CargaCombos() @@ -200,7 +250,7 @@ Partial Class Inventarios_Kardex #Region " CARGA DATOS " Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click - CargaDatos() + CargaDatos(True) Dim almacenes As String = ddlAlmacen.GetSelectedValues() If almacenes = "" Then almacenes = "-1" @@ -208,12 +258,25 @@ Partial Class Inventarios_Kardex ImprimirQR.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=Etiqueta2&CvePS={0}&PS={1}&CveAlmacen={2}&Modalidad={3}", ddlProducto2.SelectedValue.ToEntero, ddlProducto2.SelectedText.ToString, almacenes, "Individual"))) End Sub - Private Sub CargaDatos() + Private Sub CargaDatos(Optional validaInidiceActual As Boolean = False) + + NavegacionTieneDatos = False Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero + If validaInidiceActual Then + EstablecerIndiceActaual(CveProducto) + End If + + If CveProducto > 0 Then Dim DtTemp = CargarKardex(CveProducto) + + If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 1 Then + NavegacionTieneDatos = True + End If + If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then + Dim AplicaSeccion, AplicaLote, AplicaCaducidad, AplicaSerie As Boolean AplicaSerie = DtTemp.MAX("Serie") <> "" AplicaSeccion = DtTemp.MAX("SeccionAlmacen") <> "" @@ -370,8 +433,8 @@ Partial Class Inventarios_Kardex Dim ObjInventarios As New ClsInventarios If ObjInventarios.GetExistenciasCaducidad(ddlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then GvProductoCaducidad.DataSource = ObjInventarios.DtResultados - GvProductoCaducidad.columns(2).visible = ObjInventarios.DtResultados.max("Serie") <> "" - GvProductoCaducidad.columns(3).visible = ObjInventarios.DtResultados.max("Lote") <> "" + GvProductoCaducidad.Columns(2).Visible = ObjInventarios.DtResultados.MAX("Serie") <> "" + GvProductoCaducidad.Columns(3).Visible = ObjInventarios.DtResultados.MAX("Lote") <> "" GvProductoCaducidad.Columns(4).Visible = ObjInventarios.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvProductoCaducidad.Columns(4).HeaderText = UsuarioActual.Empresa.Funcionalidad(147) @@ -535,6 +598,81 @@ Partial Class Inventarios_Kardex End Sub #End Region + Private Sub EstablecerIndiceActaual(CveProducto As Integer) + + IndiceNavegacionActual = 0 + For Each drow As DataRow In DTPSNavegacion.Rows + If drow("CvePS").ToString.ToEntero = CveProducto Then + Exit Sub + End If + IndiceNavegacionActual = IndiceNavegacionActual + 1 + Next + + End Sub + + Private Sub CreaDTPSNavegacion() + DTPSNavegacion = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros("", "Codigo", {"CvePS", "CodigoPS", "Codigo"}) + End Sub + + Protected Sub LnkPSAntyerior_Click(sender As Object, e As EventArgs) + + NavegacionTieneDatos = False + + For x As Integer = IndiceNavegacionActual - 1 To 0 Step -1 + If x <= 0 Or NavegacionTieneDatos Then + IndiceNavegacionActual = x + UPFiltros.Update() + End If + + ddlProducto2.SelectedValue = DTPSNavegacion.Rows(x)("CvePS").ToString + ddlProducto2.SelectedText = DTPSNavegacion.Rows(x)("CodigoPS").ToString + ddlProducto2.txtValue.Value = DTPSNavegacion.Rows(x)("CvePS").ToString + ddlProducto2.txtText.Value = DTPSNavegacion.Rows(x)("CodigoPS").ToString + CargaDatos() + + If x <= 0 Or NavegacionTieneDatos Then + IndiceNavegacionActual = x + UPFiltros.Update() + UPDatos.Update() + Exit Sub + + End If + + + Next + + End Sub + + Protected Sub LnkPSSiguiente_Click(sender As Object, e As EventArgs) + + NavegacionTieneDatos = False + + For x As Integer = IndiceNavegacionActual + 1 To DTPSNavegacion.Rows.Count - 1 Step 1 + + + If x >= DTPSNavegacion.Rows.Count - 1 Or NavegacionTieneDatos Then + IndiceNavegacionActual = x + UPFiltros.Update() + End If + + ddlProducto2.SelectedValue = DTPSNavegacion.Rows(x)("CvePS").ToString + ddlProducto2.SelectedText = DTPSNavegacion.Rows(x)("CodigoPS").ToString + ddlProducto2.txtValue.Value = DTPSNavegacion.Rows(x)("CvePS").ToString + ddlProducto2.txtText.Value = DTPSNavegacion.Rows(x)("CodigoPS").ToString + CargaDatos() + + If x >= DTPSNavegacion.Rows.Count - 1 Or NavegacionTieneDatos Then + IndiceNavegacionActual = x + UPFiltros.Update() + UPDatos.Update() + Exit Sub + + End If + + + Next + + End Sub End Class From c1d75cc8f115c235b3b2cbc5f2ba1965339602f3 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 10 Apr 2024 11:03:12 -0700 Subject: [PATCH 7/8] =?UTF-8?q?Agregar=20logo=20a=20formato=20de=20p=C3=B3?= =?UTF-8?q?lizas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/PopUpVerFactura.aspx.vb | 5 +++++ Empresas/13/Formatos/CartaPorteTimbrado.rdlc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 5810f81d3..119fcbcb2 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -6309,6 +6309,11 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Numero", FolioPoliza)) params.Add(New ReportParameter("Moneda", If(CveMonedaImp = 2, "Dolar", "Peso Mexicano"))) params.Add(New ReportParameter("CodigoPostal", "")) + + If RutaReporte.Contains("Grales\Formatos\") Then + params.Add(New ReportParameter("LogoPath", RutaImagenLogo)) + End If + If UsuarioActual.CveEmpresa.Contiene(141) Then params.Add(New ReportParameter("Fecha", Fecha.ToString("dd/MM/yyyy hh:mm:ss"))) Else diff --git a/Empresas/13/Formatos/CartaPorteTimbrado.rdlc b/Empresas/13/Formatos/CartaPorteTimbrado.rdlc index c0af07228..cf3392514 100644 --- a/Empresas/13/Formatos/CartaPorteTimbrado.rdlc +++ b/Empresas/13/Formatos/CartaPorteTimbrado.rdlc @@ -4119,7 +4119,7 @@ - Carta Porte 2.0 + Carta Porte 3.0