diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index c2289f545..2c3753280 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -2593,7 +2593,7 @@ Public Class ClsNominas Return retorno End Function #End Region - Public Function GetCalculoSBC(CveEmpresa As Integer, Tipo As Integer, FechaCalculo As String) As Boolean + Public Function GetCalculoSBC(CveEmpresa As Integer, Tipo As Integer, FechaCalculo As String, Optional CveRegistroPatronal As Integer = -1) As Boolean Dim retorno As Boolean = False Try DTSet = New DataSet() @@ -2601,6 +2601,7 @@ Public Class ClsNominas With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Tipo", SqlDbType.Int).Value = Tipo + .Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal .Add("@Fecha", SqlDbType.Date).Value = FechaCalculo End With SqlAdapter.Fill(DTSet) diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index 6fee37f4c..8f2cafafa 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -19,7 +19,7 @@ Public Class LogicNominas sw.Start() End If - Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual, False, CvePAC) 'CvePersonal, CvePeriodo, + Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual, False) 'CvePersonal, CvePeriodo, If cfdi IsNot Nothing AndAlso cfdi.Mensaje = "" Then If Not cfdi.Timbrado Then Dim ObjTimbrado As New Timbrado @@ -81,7 +81,7 @@ Public Class LogicNominas Return Retorno End Function Dim hasfiniquito As Boolean - Public Function PreTimbrar(CveNomina As Integer, UsuarioActual As Usuario, TimbreIndemnizacion As Boolean, Optional CvePAC As Integer = 4) As CFDITimbre + Public Function PreTimbrar(CveNomina As Integer, UsuarioActual As Usuario, TimbreIndemnizacion As Boolean) As CFDITimbre Dim continuar As Boolean = True hasfiniquito = False Dim CvePersonal As Integer = -1 @@ -439,7 +439,7 @@ Public Class LogicNominas cfdi.Comprobante.TipoComprobante = "N" cfdi.Comprobante.TipoDocto = "Egs" cfdi.Comprobante.MetodoPago = "PUE" - cfdi.Comprobante.CondicionesdePago = If(CvePAC < 4, "CONTADO", "") '"" '"" + cfdi.Comprobante.CondicionesdePago = "" '"CONTADO" cfdi.Comprobante.FormadePago = If(UsuarioActual.Empresa.Funcionalidad(350).Contiene("1"), "", "99") cfdi.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString() ' AHORITA SOLO SE REQUIERE ESPECIFICAR EL CODIGO POSTAL cfdi.Comprobante.NumCuentaPago = "" 'objPersonal.BancoNumCuenta diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index ba53c315f..e37d222e5 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -71,7 +71,7 @@ Namespace Extensiones Dim dataTable As DataTable = New DataTable() Dim worksheet As GemBox.Spreadsheet.ExcelWorksheet = excelFile.Worksheets(0) - For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1 + For cols = 0 To worksheet.Rows(curRow).AllocatedCells.Count - 1 If firstRowHasHeaders Then @@ -80,12 +80,14 @@ Namespace Extensiones Else dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) End If + Else dataTable.Columns.Add("Column " & (cols + 1)) End If Next - If firstRowHasHeaders Then curRow += 1 - + If firstRowHasHeaders Then + curRow = curRow + 1 + End If While curRow < worksheet.Rows.Count columns = New String(cols - 1) {} diff --git a/Bin/GoCfdi.dll b/Bin/GoCfdi.dll index 3656903b0..e25ec6628 100644 Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 50deab8a5..3b3e942db 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -2360,7 +2360,7 @@ Partial Class ContabilidadC_RegPrePolizaS Dim ErrorArchivo = False Dim ErrorExcel = False DdlPlantilla.SelectedValue = DdlPlantilla2.SelectedValue - dt = ReadExcelFile(Ruta + FileName, True) + dt = ReadExcelFile(Ruta + FileName, True, 0) If Not ErrorArchivo Then diff --git a/GPS/PalletEtiqueta.rdlc b/GPS/PalletEtiqueta.rdlc index bdfd61a05..0151edb60 100644 --- a/GPS/PalletEtiqueta.rdlc +++ b/GPS/PalletEtiqueta.rdlc @@ -1606,7 +1606,7 @@ KM12 HERMOSILLO, SONORA 5.84433in @@ -23,7 +23,9 @@
  • - + Cargar archivo SUA +
  • +
  • Descargar
  • @@ -32,7 +34,7 @@
  • Mostrar archivos
  • -
  • +
  • Descargar Archivos IDSE
  • @@ -55,7 +57,7 @@
    Tipo : -
    +
    @@ -63,7 +65,7 @@
    Fecha : -
    +
    @@ -77,7 +79,14 @@
    -
    + + +
    + + + +
    +
    @@ -86,18 +95,23 @@
    +
    + + +
    - + + <%----%> - @@ -112,13 +126,13 @@ - + - + - + @@ -179,6 +193,15 @@ + + + Salario +
    SUA +
    + + + +
    @@ -186,7 +209,7 @@ integrado - + @@ -196,7 +219,7 @@ variable - + @@ -206,7 +229,7 @@ cotización - + @@ -214,7 +237,15 @@ Modificación - + + + + + + +
    + +
    @@ -224,7 +255,7 @@ - @@ -331,7 +362,7 @@ - @@ -344,9 +375,10 @@ - + - Fecha alta
    + Fecha alta +
    o reingreso
    @@ -373,18 +405,20 @@
    - + - Percepciones
    + Percepciones +
    variables
    - + - Días
    + Días +
    incapacidad
    @@ -417,7 +451,7 @@
    - +
    @@ -580,7 +614,223 @@
    + @@ -600,6 +850,32 @@ document.body.removeChild(elem); } } + + + function showResult() { + /* + setTimeout(function () { + let collapse = $('#cargaarchivoprocesasua .expand'); + let body = $('#cargaarchivoprocesasua .portlet-body'); + if (collapse && collapse.length > 0) { + collapse.removeClass('collapse'); + collapse.addClass('expand'); + } + if (body && body.length > 0) { + body.css('display', 'none'); + } + collapse = $('#resultadoprocesasua .collapse'); + body = $('#resultadoprocesasua .portlet-body'); + if (collapse && collapse.length > 0) { + collapse.addClass('collapse'); + collapse.removeClass('expand'); + } + if (body && body.length > 0) { + body.css('display', ''); + } + setTimeout(function () { loadadscroll(); }, 50); + }, 400);*/ + } diff --git a/RH/CalculoSBC.aspx.cs b/RH/CalculoSBC.aspx.cs index b5f629625..cd627e747 100644 --- a/RH/CalculoSBC.aspx.cs +++ b/RH/CalculoSBC.aspx.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Data; using System.Linq; +using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; @@ -23,6 +24,17 @@ public partial class RH_CalculoSBC : ClsPaginas if (!IsPostBack) { TxtFechaPago.Text = String.Format("{0:01/MM/yyyy}", DateTime.Now); + + + ClsRH ObjRH = new ClsRH(); + + if (ObjRH.GetRegistrosPatronales(-1, UsuarioActual.CveEmpresa, 1)) + DdlRegistroPatronal.DataSource = ObjRH.DtResultados; + else + DdlRegistroPatronal.DataSource = null; + + DdlRegistroPatronal.DataBind(); + ObjRH.Dispose(); //string rutarchivos = string.Format("{0}modificacionsalarios\\", UsuarioActual.Empresa.RutaArchivos); //Alert(rutarchivos); //ADSNetLibrary.SIGAPI.Services.Agropecuaria.IAgropecuariaService servicioAgro = new ADSNetLibrary.SIGAPI.Services.Agropecuaria.AgropecuariaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); @@ -34,11 +46,157 @@ public partial class RH_CalculoSBC : ClsPaginas } } + protected void LnkDownExcelSua_Click(object sender, EventArgs e) + { + } + protected void LnkUpSuamodal_Click(object sender, EventArgs e) + { + TxtArchivoSua.Text = ""; + GVProcesarSUA.DataSource = null; + GVProcesarSUA.DataBind(); + RegistraScript("$('#DmodalCompareSua').modal();shownew();"); + UpArchivoSua.Update(); + } + protected void LnkUpSuaFile_Click(object sender, EventArgs e) + { + string fileurl = ""; + GVProcesarSUA.DataSource = null; + Files archivos = TxtArchivoSua.getfiles(); + if (archivos.Archivos.Count > 0) + { + fileurl = archivos.Archivos[0].FileUrl; + string SuaFiletext = System.IO.File.ReadAllText(fileurl, Encoding.GetEncoding("iso-8859-1")); + using (ClsNominas ObjPersonal = new ClsNominas()) + { + if (ObjPersonal.ProcesarSUA(SuaFiletext, UsuarioActual.CveEmpresa)) + { + if (ObjPersonal.DTSetResultados.Tables.Count > 4) + { + DateTime dateperiodo; + DateTime.TryParseExact(string.Format("{0}01", ObjPersonal.DTSetResultados.Tables[1].Rows[0]["Periodo"]), "yyyyMMdd", new System.Globalization.CultureInfo("es-MX"), System.Globalization.DateTimeStyles.None, out dateperiodo); + LtlPeriodo.Text = dateperiodo.Date.ToString("MMMM yyyy", new System.Globalization.CultureInfo("es-MX")); + //DtSuaProcesado = ObjPersonal.DTSetResultados.Tables[3]; + GVProcesarSUA.DataSource = ObjPersonal.DTSetResultados.Tables[3]; + } + } + } + + } + GVProcesarSUA.DataBind(); + TxtArchivoSua.Text = ""; + //RegistraScript("showResult();"); + RegistraScript("$('#DmodalCompareSua').modal('hide');shownew();"); + Alert("El archivo se a procesado Correctamente"); + LnkCalcular_Click(null,null); + UpArchivoSua.Update(); + } + + protected void GVProcesarSUA_RowDataBound(object sender, GridViewRowEventArgs e) + { + + if (e.Row.RowType == DataControlRowType.DataRow) + { + if (e.Row.RowIndex == 0) + { + e.Row.CssClass = "Totales"; + } + string SalarioSUA = string.Format("{0:N2}", e.Row.DataKey("SalarioSUA").ToDecimal()); + string SalarioSIG = string.Format("{0:N2}", e.Row.DataKey("SalarioSIG").ToDecimal()); + int celda = 1; + if (Math.Abs(SalarioSUA.ToDecimal() - SalarioSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + celda = celda + 4; + string CuotaExcedenteSUA = string.Format("{0:N2}", e.Row.DataKey("CuotaExcedenteSUA").ToDecimal()); + string CuotaExcedenteSIG = string.Format("{0:N2}", e.Row.DataKey("CuotaExcedenteSIG").ToDecimal()); + if (Math.Abs(CuotaExcedenteSUA.ToDecimal() - CuotaExcedenteSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + celda = celda + 2; + string PrestacionesDineroSUA = string.Format("{0:N2}", e.Row.DataKey("PrestacionesDineroSUA").ToDecimal()); + string PrestacionesSIG = string.Format("{0:N2}", e.Row.DataKey("PrestacionesSIG").ToDecimal()); + if (Math.Abs(PrestacionesDineroSUA.ToDecimal() - PrestacionesSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + celda = celda + 2; + string GastosMedPenSUA = string.Format("{0:N2}", e.Row.DataKey("GastosMedPenSUA").ToDecimal()); + string GastosMedicosSIG = string.Format("{0:N2}", e.Row.DataKey("GastosMedicosSIG").ToDecimal()); + if (Math.Abs(GastosMedPenSUA.ToDecimal() - GastosMedicosSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + celda = celda + 2; + string InvalidezyVidaSUA = string.Format("{0:N2}", e.Row.DataKey("InvalidezyVidaSUA").ToDecimal()); + string InvalidezyVidaSIG = string.Format("{0:N2}", e.Row.DataKey("InvalidezyVidaSIG").ToDecimal()); + if (Math.Abs(InvalidezyVidaSUA.ToDecimal() - InvalidezyVidaSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + celda = celda + 2; + string CesantiayVejezObreraSUA = string.Format("{0:N2}", e.Row.DataKey("CesantiayVejezObreraSUA").ToDecimal()); + string CesantiayVejezObreraSIG = string.Format("{0:N2}", e.Row.DataKey("CesantiayVejezObreraSIG").ToDecimal()); + if (Math.Abs(CesantiayVejezObreraSUA.ToDecimal() - CesantiayVejezObreraSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + celda = celda + 2; + string CuotaFijaSUA = string.Format("{0:N2}", e.Row.DataKey("CuotaFijaSUA").ToDecimal()); + string CuotaFijaSIG = string.Format("{0:N2}", e.Row.DataKey("CuotaFijaSIG").ToDecimal()); + if (Math.Abs(CuotaFijaSUA.ToDecimal() - CuotaFijaSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + celda = celda + 2; + string RiesgosdeTrabajoSUA = string.Format("{0:N2}", e.Row.DataKey("RiesgosdeTrabajoSUA").ToDecimal()); + string RiesgoTrabajoSIG = string.Format("{0:N2}", e.Row.DataKey("RiesgoTrabajoSIG").ToDecimal()); + if (Math.Abs(RiesgosdeTrabajoSUA.ToDecimal() - RiesgoTrabajoSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + celda = celda + 2; + string GuarderiaSUA = string.Format("{0:N2}", e.Row.DataKey("GuarderiaSUA").ToDecimal()); + string GuarderiaSIG = string.Format("{0:N2}", e.Row.DataKey("GuarderiaSIG").ToDecimal()); + if (Math.Abs(GuarderiaSUA.ToDecimal() - GuarderiaSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + celda = celda + 2; + string RetiroSUA = string.Format("{0:N2}", e.Row.DataKey("RetiroSUA").ToDecimal()); + string RetiroSIG = string.Format("{0:N2}", e.Row.DataKey("RetiroSIG").ToDecimal()); + if (Math.Abs(RetiroSUA.ToDecimal() - RetiroSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + celda = celda + 2; + string CesantiayVejezPatronalSUA = string.Format("{0:N2}", e.Row.DataKey("CesantiayVejezPatronalSUA").ToDecimal()); + string CesantiayVejezPatronalSIG = string.Format("{0:N2}", e.Row.DataKey("CesantiayVejezPatronalSIG").ToDecimal()); + if (Math.Abs(CesantiayVejezPatronalSUA.ToDecimal() - CesantiayVejezPatronalSIG.ToDecimal()) > 1) + { + e.Row.Cells[celda].CssClass = "cellFail"; + e.Row.Cells[celda + 1].CssClass = "cellFail"; + } + + } + } + protected void LnkCalcular_Click(object sender, EventArgs e) { using (ClsNominas objnom = new ClsNominas()) { - if (objnom.GetCalculoSBC(UsuarioActual.CveEmpresa, DdlTipo.SelectedValue.ToEntero(), TxtFechaPago.Text)) + if (objnom.GetCalculoSBC(UsuarioActual.CveEmpresa, DdlTipo.SelectedValue.ToEntero(), TxtFechaPago.Text,DdlRegistroPatronal.SelectedValue.ToEntero())) { GVCalculosSBC.DataSource = objnom.DTSetResultados.Tables[0]; GVCFija.DataSource = objnom.DTSetResultados.Tables[0]; @@ -92,7 +250,7 @@ public partial class RH_CalculoSBC : ClsPaginas double SalarioDiarioSSNuevo = Math.Round(item.DataKey("SalarioDiarioSSNuevo").ToDouble(), 2); double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2); string RegistroPatronal = item.DataKey("RegistroPatronal"); - if(oldRegistroPatronal != "-1" && oldRegistroPatronal != RegistroPatronal) + if(oldRegistroPatronal != "-1" && oldRegistroPatronal != RegistroPatronal ) { MovtosmodSalario = string.Format("{0}{1}{2}", MovtosmodSalario, concater, $"************* 00{(contador < 1000 ? "0" : "")}{(contador < 100 ? "0" : "")}{(contador < 10 ? "0" : "")}{contador} 00001 9"); @@ -103,7 +261,7 @@ public partial class RH_CalculoSBC : ClsPaginas concater = ""; contador = 0; } - if (SalarioDiarioSSNuevo != SalarioDiarioSS) + if (SalarioDiarioSSNuevo != SalarioDiarioSS || item.FCCheckBox("chkCon").Checked) { MovtosmodSalario = string.Format("{0}{1}{2}", MovtosmodSalario, concater, item.DataKey("Movtotxt")); concater = "\\r\\n"; @@ -249,18 +407,18 @@ public partial class RH_CalculoSBC : ClsPaginas //libro.Range(3, 2, 3, 6).Merge().Value = $"del {fechai:dd/MM/yyyy} al {fechaf:dd/MM/yyyy}"; libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now:dd/MM/yyyy}"; libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now:HH:mm}"; - libro.Range(5, 8, 5, 11).Merge().Value = "Actual"; - libro.Range(5, 12, 5, 14).Merge().Value = "Nuevo"; + libro.Range(5, 8, 5, 12).Merge().Value = "Actual"; + libro.Range(5, 13, 5, 15).Merge().Value = "Nuevo"; libro.Range(5, 1, 6, 14).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center; - libro.Range(5, 1, 6, 13).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)); - libro.Range(5, 1, 5, 13).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.None; + libro.Range(5, 1, 6, 16).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)); + libro.Range(5, 1, 5, 16).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.None; - libro.Range(5, 8, 6, 11).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(128, 100, 162)); - libro.Range(5, 8, 6, 11).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; - libro.Range(5, 12, 6, 14).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(136, 214, 205)); - libro.Range(5, 12, 6, 14).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; + libro.Range(5, 8, 6, 12).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(128, 100, 162)); + libro.Range(5, 8, 6, 12).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; + libro.Range(5, 13, 6, 15).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(136, 214, 205)); + libro.Range(5, 13, 6, 15).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; libro.Range(7, 8, 7 + dt.Rows.Count, 12).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right; diff --git a/RH/CatDocumentos.aspx b/RH/CatDocumentos.aspx index daa2bf274..f01accffd 100644 --- a/RH/CatDocumentos.aspx +++ b/RH/CatDocumentos.aspx @@ -381,7 +381,7 @@

    Etiquetas

    -