From 6609a96e2e37f459f620f6e9de842f99ac047d3b Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Wed, 19 May 2021 10:28:31 -0700 Subject: [PATCH 1/4] --- App_Code/CFDITimbre.vb | 5 + App_Code/ClsNominas.vb | 24 +- App_Code/ClsPaginas.vb | 48 +- App_Code/ClsRH.vb | 72 +- App_Code/LogicNominas.vb | 174 +- App_Code/Timbrado.vb | 93 +- ...ft.IdentityModel.JsonWebTokens.dll.refresh | Bin 302 -> 0 bytes ...icrosoft.IdentityModel.Logging.dll.refresh | 1 - ...Microsoft.IdentityModel.Tokens.dll.refresh | Bin 274 -> 0 bytes ...ystem.IdentityModel.Tokens.Jwt.dll.refresh | Bin 278 -> 0 bytes Bin/System.Net.Http.Formatting.dll.refresh | Bin 262 -> 0 bytes Bin/System.Web.Cors.dll.refresh | Bin 266 -> 0 bytes Bin/System.Web.Http.Cors.dll.refresh | Bin 290 -> 0 bytes Bin/System.Web.Http.WebHost.dll.refresh | 1 - Bin/System.Web.Http.dll.refresh | Bin 236 -> 0 bytes Contabilidad/RegPrePoliza.aspx | 67 +- Contabilidad/RegPrePoliza.aspx.vb | 774 +++-- Empresas/119/Formatos/Nomina.rdlc | 263 +- Empresas/Grales/Formatos/SobreRecibo.rdlc | 2588 ++++++----------- General/SaldosIniciales.aspx.vb | 1054 +++++-- Nomina/ConceptoNomina.aspx | 62 +- Nomina/ConceptoNomina.aspx.cs | 49 + Nomina/Finiquito.aspx | 261 +- Nomina/Finiquito.aspx.cs | 591 +++- Nomina/Nomina2.aspx | 438 ++- Nomina/Nomina2.aspx.cs | 458 ++- RH/CalculoSBC.aspx.cs | 133 +- RH/CatPersonal.aspx | 4 + RH/CatPersonal.aspx.vb | 362 +++ RH/DiasFestivos.aspx | 79 + RH/DiasFestivos.aspx.cs | 74 + vwd.webinfo | 12 + 32 files changed, 5049 insertions(+), 2638 deletions(-) delete mode 100644 Bin/Microsoft.IdentityModel.JsonWebTokens.dll.refresh delete mode 100644 Bin/Microsoft.IdentityModel.Logging.dll.refresh delete mode 100644 Bin/Microsoft.IdentityModel.Tokens.dll.refresh delete mode 100644 Bin/System.IdentityModel.Tokens.Jwt.dll.refresh delete mode 100644 Bin/System.Net.Http.Formatting.dll.refresh delete mode 100644 Bin/System.Web.Cors.dll.refresh delete mode 100644 Bin/System.Web.Http.Cors.dll.refresh delete mode 100644 Bin/System.Web.Http.WebHost.dll.refresh delete mode 100644 Bin/System.Web.Http.dll.refresh create mode 100644 RH/DiasFestivos.aspx create mode 100644 RH/DiasFestivos.aspx.cs diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index da170c392..6600b448e 100644 --- a/App_Code/CFDITimbre.vb +++ b/App_Code/CFDITimbre.vb @@ -16,6 +16,9 @@ Public Class CFDITimbre Public Property Nomina As CFDINomina Public Property ComplementoPagos As CFDIComplementoPagos Public Property Complementos As CFDIComplementos + Public Property Timbrado As Boolean + Public Property IStimbreFiniquito As Boolean + Public ReadOnly Property TotalImpuestosRetenidos As Decimal Get Return (From c In Conceptos @@ -128,6 +131,8 @@ Public Class CFDINomina Public Property OtrosPagos As List(Of CFDINominaOtrosPagos) Public Property HorasExtras As List(Of CFDINominaHorasExtras) Public Property CveNomina As Integer + Public Property Antiguedad As Integer + Public Property UltimoSueldoOrdinario As Decimal Public ReadOnly Property TotalPercepciones As Double Get diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index c65001d7d..78496ee91 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -215,6 +215,24 @@ Public Class ClsNominas End Function + Public Function ReportedePercepcionesDeduccionesGet(cveEmpresa As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveTipoPeriodo As Integer) As Boolean + Dim retorno As Boolean = False + DTSet = New DataSet() + DataAdapter("[PA_RH_ReportedePercepcionesDeducciones]", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@TipoPeriodo", SqlDbType.Int).Value = CveTipoPeriodo + End With + Try + SqlAdapter.Fill(DTSet) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de Percepciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function Public Function ReportedeincidenciasGET(cveEmpresa As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveTipoPeriodo As Integer) As Boolean Dim retorno As Boolean = False DTSet = New DataSet() @@ -834,7 +852,7 @@ Public Class ClsNominas Return Retorno End Function - Public Function UpdateEstatusNomNominas(Estatus As Integer, CvePAC As Integer, FolioFiscal As String, SelloSAT As String, FechaCancelacion As DateTime, CveNomina As Integer, Optional SubTotal As Double = -1, Optional Descuento As Double = -1, Optional ISR As Double = -1, Optional Total As Double = -1, Optional DiasPagados As Double = -1) As Boolean + Public Function UpdateEstatusNomNominas(Estatus As Integer, CvePAC As Integer, FolioFiscal As String, SelloSAT As String, FechaCancelacion As DateTime, CveNomina As Integer, Optional SubTotal As Double = -1, Optional Descuento As Double = -1, Optional ISR As Double = -1, Optional Total As Double = -1, Optional DiasPagados As Double = -1, Optional isFiniquito As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_NominasUpdateEstatus") @@ -852,6 +870,7 @@ Public Class ClsNominas .Add("@Total", SqlDbType.Money).Value = Total .Add("@DiasPagados", SqlDbType.Int).Value = DiasPagados .Add("@CveNomina", SqlDbType.Int).Value = CveNomina + .Add("@isFiniquito", SqlDbType.Bit).Value = isFiniquito End With Try @@ -2164,7 +2183,7 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function GetNominaEmpleado(CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodo As Integer, CveEmpresa As Integer, Agrupador As Integer, Optional RegimenContratacion As Integer = 1, Optional CvePersonal As Integer = -1) As Boolean + Public Function GetNominaEmpleado(CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodo As Integer, CveEmpresa As Integer, Agrupador As Integer, Optional RegimenContratacion As Integer = 1, Optional CvePersonal As Integer = -1, Optional SalarioDiario As Decimal = 0) As Boolean Dim retorno As Boolean = False Try DTSet = New DataSet() @@ -2178,6 +2197,7 @@ Public Class ClsNominas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@RegimenContratacion", SqlDbType.Int).Value = RegimenContratacion .Add("@CvePersonal", SqlDbType.Decimal).Value = CvePersonal + .Add("@SalarioDiario", SqlDbType.Decimal).Value = SalarioDiario End With diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index c8e653938..15411ebe9 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3855,6 +3855,7 @@ Public Class ClsPaginas PaginaDict.Add("/Nomina/CatConceptos2.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/Aguinaldo.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/RepInversiondeNomina.aspx".ToUpper(), 906) + PaginaDict.Add("/RH/DiasFestivos.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/FiniquitoB.aspx".ToUpper(), -1) ''CONFIGURACIONES GENERALES PaginaDict.Add("/Sistemas/SistemaSIG.aspx".ToUpper(), 9999) @@ -7836,7 +7837,7 @@ Public Class ClsPaginas #Region "PDF NOMINA" - Public Function GeneraPDFNomina(CvePersonal As Integer, CvePeriodo As Integer, CveEmpresa As Integer, RutaEmpresa As String) As Byte() + Public Function GeneraPDFNomina(CvePersonal As Integer, CvePeriodo As Integer, CveEmpresa As Integer, RutaEmpresa As String, Optional indemnizacion As Boolean = False) As Byte() Dim ObjNomina As New ClsNominas Dim ObjPersonal As New ClsRH @@ -7856,7 +7857,7 @@ Public Class ClsPaginas Dim DTDeducciones2 As New Data.DataTable Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\" - Dim PathXML As String = $"{Ruta}XML\Nomina\{ObjNomina.SerieFolio}.xml" + Dim PathXML As String = $"{Ruta}XML\Nomina\{ObjNomina.Serie }{If(indemnizacion, "F", "")}-{ObjNomina.Folio}.xml" Dim FechaEmision, FechaCertificacion As DateTime Dim FolioFiscal, NoSerieCertificado, NoSerieCertificadoContribuyente, SelloCFDi, SelloSAT As String FolioFiscal = "" @@ -7936,7 +7937,32 @@ Public Class ClsPaginas 'Datos Empresa RptParametro.Add(New ReportParameter("RegistroPatronal", ObjNomina.RegistroPatronal)) + Dim ajusteindemnizacion As Double = 0 + 'PERCECIONES - DEDUCCIONES + If ObjNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then + Dim filtrop As String = " AND CveSistema NOT IN(10,11,32)" + Dim friltrod As String = " AND CveSistema <>47" + If indemnizacion Then + 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)){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 + If row("Tipo").ToString() = "D" Then + row("Codigo") = row("Codigo").ToString().Replace("D", "OP") + row("Importe") = row("Importe").ToString().ToDecimal() * -1 + End If + Next + + Else + DTPercepciones = Nothing + DTDeducciones = Nothing + End If 'DATOS DEL EMPLEADO If ObjPersonal.GetPersonal(CvePersonal, CveEmpresa) Then @@ -7978,7 +8004,7 @@ Public Class ClsPaginas RptParametro.Add(New ReportParameter("Cantidad", "1")) RptParametro.Add(New ReportParameter("Unidad", "ACT")) RptParametro.Add(New ReportParameter("Descripcion", "PAGO DE NÓMINA")) - RptParametro.Add(New ReportParameter("Total", ObjNomina.Total.ToString())) + RptParametro.Add(New ReportParameter("Total", If(indemnizacion, ajusteindemnizacion, ObjNomina.Total - ajusteindemnizacion).ToString())) Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() cQr = CBB.GenerarCBBBytes(UsuarioActual.Empresa.RFC, ObjPersonal.RFC, ObjNomina.Total.ToString().ToDecimal(), FolioFiscal) @@ -8000,22 +8026,6 @@ Public Class ClsPaginas End If End If - 'PERCECIONES - DEDUCCIONES - If ObjNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then - DTPercepciones = ObjNomina.DtResultados.FiltraParametros("(Tipo = 'P' OR (Tipo = 'D' AND Importe <0)) AND Importe <>0 AND EsPadre = 1 AND SoloVisible =0") - DTDeducciones = ObjNomina.DtResultados.FiltraParametros("Tipo = 'D' AND Importe >0 AND EsPadre = 1 AND SoloVisible =0") - DTDeducciones2 = ObjNomina.DtResultados.FiltraParametros("(Tipo = 'D' AND Importe >0 AND EsPadre = 1 AND SoloVisible =0) OR CveConcepto IN (1471,1491)") - For Each row As DataRow In DTPercepciones.Rows - If row("Tipo").ToString() = "D" Then - row("Codigo") = row("Codigo").ToString().Replace("D", "OP") - row("Importe") = row("Importe").ToString().ToDecimal() * -1 - End If - Next - - Else - DTPercepciones = Nothing - DTDeducciones = Nothing - End If RptParametro.Add(New ReportParameter("PU", DTPercepciones.SUM("Importe").ToString())) RptParametro.Add(New ReportParameter("Importe", DTPercepciones.SUM("Importe").ToString())) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 678bccbbc..196f5f3bf 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -122,9 +122,74 @@ Public Class ClsRH CveConexion = 0 End If - End Sub + End Sub #End Region + +#Region "DiasFestivos" + + Public Function DiasFestivosGet(CveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_RH_DiasFestivosGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error al obtener los días festivos", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al Guardar el Tipo de A-I", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function DiasFestivosAdd(fecha As DateTime, cveEmpresa As Int32, CveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_RH_DiasFestivosAdd", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Fecha", SqlDbType.DateTime).Value = fecha + End With + + Try + SqlAdapter.Fill(Data) + retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert($"Ya existe un día festivo con fecha '{fecha:dd/MM/yyyy}'.", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al guardar el día festivo.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al Guardar el Tipo de A-I", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function DiasFestivosRemove(fecha As DateTime, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_RH_DiasFestivosRemove", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Fecha", SqlDbType.DateTime).Value = fecha + End With + + Try + SqlAdapter.Fill(Data) + retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al eliminar el día festivo.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al eliminar el día festivo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function +#End Region + #Region "ClsRHAsistenciasInasistencias" Public Function GetAsistenciasInasistencias() As Boolean Dim Retorno As Boolean = False @@ -2145,7 +2210,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Return Retorno End Function - Public Function UpPersonalAltas(CvePersonal As Integer, fechaInicio As String, fechaFin As String, CvePeriodoFiniquito As Integer, CveMotivoBaja As Integer, esLiquidacion As Boolean) As Boolean + Public Function UpPersonalAltas(CvePersonal As Integer, fechaInicio As String, fechaFin As String, CvePeriodoFiniquito As Integer, CveMotivoBaja As Integer, esLiquidacion As Boolean, ValIndemnizacion As Boolean, ValSeparacionunica As Boolean, ValPrimadeantiguedad As Boolean) As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_RH_PersonalAltasUp") @@ -2156,6 +2221,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@CvePeriodoFiniquito", SqlDbType.Int).Value = CvePeriodoFiniquito .Add("@CveMotivoBaja", SqlDbType.Int).Value = CveMotivoBaja .Add("@esLiquidacion", SqlDbType.Int).Value = If(esLiquidacion, 1, 0) + .Add("@ValIndemnizacion", SqlDbType.Bit).Value = If(ValIndemnizacion, 1, 0) + .Add("@ValSeparacionunica", SqlDbType.Bit).Value = If(ValSeparacionunica, 1, 0) + .Add("@ValPrimadeantiguedad", SqlDbType.Bit).Value = If(ValPrimadeantiguedad, 1, 0) End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index ae2fbadef..6ac889921 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -20,20 +20,53 @@ Public Class LogicNominas sw.Start() End If - Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual) 'CvePersonal, CvePeriodo, + Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual, False) 'CvePersonal, CvePeriodo, If cfdi IsNot Nothing AndAlso cfdi.Mensaje = "" Then - Dim ObjTimbrado As New Timbrado - Dim ObjFactura As New Modelos.Factura - ObjFactura.TipoDocto = "Nomina" - ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero() - ObjFactura.Serie = cfdi.Comprobante.Serie - ObjFactura.Timbre = cfdi - If Not ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura, CvePAC) Then - Retorno = ObjTimbrado.MensajeErrorCFDI + If Not cfdi.Timbrado Then + Dim ObjTimbrado As New Timbrado + Dim ObjFactura As New Modelos.Factura + ObjFactura.TipoDocto = "Nomina" + ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero() + ObjFactura.Serie = cfdi.Comprobante.Serie + ObjFactura.Timbre = cfdi + If Not ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura, CvePAC) Then + Retorno = ObjTimbrado.MensajeErrorCFDI + End If End If If Retorno <> "" Then Retorno = $"{Retorno} - {cfdi.Receptor.Nombre}" Else + If hasfiniquito Then + + cfdi = PreTimbrar(CveNomina, UsuarioActual, True) 'CvePersonal, CvePeriodo, + If cfdi IsNot Nothing AndAlso cfdi.Mensaje = "" Then + + If Not cfdi.Timbrado Then + Dim ObjTimbrado As New Timbrado + Dim ObjFactura As New Modelos.Factura + ObjFactura.TipoDocto = "Nomina" + ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero() + ObjFactura.Serie = cfdi.Comprobante.Serie + ObjFactura.Timbre = cfdi + If Not ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura, CvePAC) Then + Retorno = ObjTimbrado.MensajeErrorCFDI + End If + If Retorno <> "" Then + Retorno = $"{Retorno} - {cfdi.Receptor.Nombre}" + Else + + End If + + End If + Else + If cfdi Is Nothing Then + Retorno = $"No se pudo generar el pretimbre(GetError):
{GetError}" + Else + Retorno = $"No se pudo generar el pretimbre:
{cfdi.Mensaje}" + End If + End If + + End If End If Else If cfdi Is Nothing Then @@ -48,10 +81,10 @@ Public Class LogicNominas End If Return Retorno End Function - - Private Function PreTimbrar(CveNomina As Integer, UsuarioActual As Usuario) As CFDITimbre + Dim hasfiniquito As Boolean + Private 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 Dim CvePeriodo As Integer = -1 Dim DtPercepciones As Data.DataTable = Nothing @@ -107,13 +140,26 @@ Public Class LogicNominas Dim ObjIncapacidades As New List(Of CFDINominaIncapacidades) 'Conexiones a la Base de Datos + Dim cfdi As New CFDITimbre + cfdi.Nomina = New CFDINomina Using objNomina As ClsNominas = New ClsNominas() Using objPersonal As ClsRH = New ClsRH() If objNomina.GetNom_Nominas(CveNomina, -1, -1, -1, UsuarioActual.CveEmpresa) AndAlso objNomina.DtResultados.Rows.Count > 0 Then - CvePersonal = objNomina.DtResultados.Rows(0)("CvePersonal").ToString().ToEntero() - CvePeriodo = objNomina.DtResultados.Rows(0)("CvePeriodo").ToString().ToEntero() + Dim drow As DataRow = objNomina.DtResultados.Rows(0) + CvePersonal = drow("CvePersonal").ToString().ToEntero() + CvePeriodo = drow("CvePeriodo").ToString().ToEntero() + cfdi.Nomina.Antiguedad = drow("Antiguedad").ToString().ToEntero() + cfdi.Nomina.UltimoSueldoOrdinario = drow("UltimoSueldoOrdinario").ToString().ToDecimal() Serie = objNomina.Serie Folio = objNomina.Folio.ToString() + If TimbreIndemnizacion Then + cfdi.Timbrado = drow("SeTimbroFiniquitoVal").ToString().ToEntero() = 1 + cfdi.IStimbreFiniquito = True + Serie = $"{objNomina.Serie}F" + Else + cfdi.Timbrado = drow("SeTimbroVal").ToString().ToEntero() = 1 + cfdi.IStimbreFiniquito = False + End If Else If continuar Then GetError = "No se pudo obtener la información de la nomina" 'si continuar= true el error se origino en este nodo y se le asigno el error continuar = False @@ -148,18 +194,27 @@ Public Class LogicNominas End If If continuar AndAlso objNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then If objNomina.DtResultados.Rows.Count > 0 Then - Dim filtropercepciones As String = "Tipo = 'P' AND EsPadre = 1 AND SoloVisible =0" + Dim filtropercepciones As String = "Tipo = 'P' AND EsPadre = 1 AND SoloVisible =0 AND SATCveConcepto NOT IN ('022', '023','025')" + If TimbreIndemnizacion Then + filtropercepciones = " Tipo = 'P' AND SATCveConcepto IN ('022', '023','025')" + End If DtPercepciones = objNomina.DtResultados.FiltraParametros(filtropercepciones) - Dim filtrodeduc As String = "Tipo = 'D' AND EsPadre = 1 AND SoloVisible =0 AND (TipoConceptoSAT<>'O' OR TipoConceptoSAT IS NULL)" + Dim filtrodeduc As String = "Tipo = 'D' AND EsPadre = 1 AND SoloVisible =0 AND (TipoConceptoSAT<>'O' OR TipoConceptoSAT IS NULL) AND CveSistema <> 47" + If TimbreIndemnizacion Then + filtrodeduc = " Tipo = 'D' AND CveSistema =47" + End If DtDeducciones = objNomina.DtResultados.FiltraParametros(filtrodeduc) - DtOtrosPagos = objNomina.DtResultados.FiltraParametros(" TipoConceptoSAT='O'") + If Not TimbreIndemnizacion Then + DtOtrosPagos = objNomina.DtResultados.FiltraParametros(" TipoConceptoSAT='O'") + + End If Dim disrcomp As DataRow = DtOtrosPagos.FiltroPrimero("Codigo ='D999'") For Each drow As DataRow In DtDeducciones.Rows If drow("Codigo").ToString() = "D038" Then End If Next - + hasfiniquito = objNomina.DtResultados.COUNT("SATCveConcepto", "(Tipo = 'P' AND SATCveConcepto IN ('022', '023','025')) OR (Tipo = 'D' AND SATCveConcepto = '101')") > 0 TotalPercepciones = DtPercepciones.SUM("Importe").ToString().ToDecimal() @@ -170,53 +225,70 @@ Public Class LogicNominas If continuar Then GetError = "No se pudo obtener el detalle de la nomina" 'si continuar= true el error se origino en este nodo y le asigno el error continuar = False End If - If continuar AndAlso objNomina.GetHorasExtras(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then - DtHorasExtras = objNomina.DtResultados + If Not TimbreIndemnizacion Then + If continuar AndAlso objNomina.GetHorasExtras(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then + DtHorasExtras = objNomina.DtResultados + Else + continuar = False + End If Else - continuar = False + DtHorasExtras = New DataTable() End If If continuar AndAlso objNomina.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, CvePeriodo) AndAlso objNomina.DtResultados.Rows().Count > 0 Then Dim DrPeriodo As DataRow = objNomina.DtResultados.Rows(0) - FechaInicio = DrPeriodo("FechaInicio").ToString().ToDate - FechaFin = DrPeriodo("FechaFin").ToString().ToDate - FechaPago = DrPeriodo("FechaPago").ToString().ToDate - TipoNomina = If(objNomina.CveTipoPeriodo = 6, "E", "O") + FechaFin = DrPeriodo("FechaFin").ToString().ToDate() + FechaPago = DrPeriodo("FechaPago").ToString().ToDate() + + If Not TimbreIndemnizacion Then + FechaInicio = DrPeriodo("FechaInicio").ToString().ToDate() + TipoNomina = If(objNomina.CveTipoPeriodo = 6, "E", "O") + Else + FechaInicio = FechaFin + TipoNomina = "E" + End If Else If continuar Then GetError = "No se pudo obtener la información del periodo" 'si continuar= true el error se origino en este nodo y le asigno el error continuar = False End If - If continuar AndAlso objPersonal.GetAsistencias(CvePersonal, -1, -1, -1, -1, -1, FechaInicio, FechaFin, UsuarioActual.CveEmpresa) Then + If Not TimbreIndemnizacion Then + If continuar AndAlso objPersonal.GetAsistencias(CvePersonal, -1, -1, -1, -1, -1, FechaInicio, FechaFin, UsuarioActual.CveEmpresa) Then - Dim Asistencias As Integer = objPersonal.DtResultados.SUM("AplicaAsistencia").ToEntero() - 'If Asistencias > 15 Then - ' Asistencias = 15 - 'End If - Dim Vacaciones As Integer = objPersonal.DtResultados.SUM("AplicaVacacion").ToEntero() - DiasIncapacitados = objPersonal.DtResultados.SUM("AplicaIncapacidad").ToEntero() - DiasPagados = Asistencias - Vacaciones - If DiasPagados < 0 Then DiasPagados = 0 - Else - continuar = False - End If - If DiasIncapacitados > 0 Then - If objNomina.GetIncapacidades(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then - If objNomina.DtResultados IsNot Nothing AndAlso objNomina.DtResultados.Rows.Count > 0 Then - For Each dr As DataRow In objNomina.DtResultados.Rows - ObjIncapacidades.Add(New CFDINominaIncapacidades With {.DiasIncapacidad = dr("Dias").ToString().ToEntero().ToString(), .TipoIncapacidad = dr("ClaveTipoIncapacidad").ToString(), .Importe = dr("Descuento").ToString().ToDecimal}) - Next - End If + + Dim Asistencias As Integer = objPersonal.DtResultados.SUM("AplicaAsistencia").ToEntero() + 'If Asistencias > 15 Then + ' Asistencias = 15 + 'End If + Dim Vacaciones As Integer = objPersonal.DtResultados.SUM("AplicaVacacion").ToEntero() + DiasIncapacitados = objPersonal.DtResultados.SUM("AplicaIncapacidad").ToEntero() + DiasPagados = Asistencias - Vacaciones + If DiasPagados < 0 Then DiasPagados = 0 Else - If continuar Then GetError = "No se pudo obtener las incapacidades del periodo" 'si continuar= true el error se origino en este nodo y le asigno el error continuar = False End If + Else + DiasPagados = 1 + DiasIncapacitados = 0 + End If + If continuar AndAlso DiasIncapacitados > 0 Then + If Not TimbreIndemnizacion Then + + If objNomina.GetIncapacidades(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then + If objNomina.DtResultados IsNot Nothing AndAlso objNomina.DtResultados.Rows.Count > 0 Then + For Each dr As DataRow In objNomina.DtResultados.Rows + ObjIncapacidades.Add(New CFDINominaIncapacidades With {.DiasIncapacidad = dr("Dias").ToString().ToEntero().ToString(), .TipoIncapacidad = dr("ClaveTipoIncapacidad").ToString(), .Importe = dr("Descuento").ToString().ToDecimal}) + Next + End If + Else + If continuar Then GetError = "No se pudo obtener las incapacidades del periodo" 'si continuar= true el error se origino en este nodo y le asigno el error + continuar = False + End If + End If End If End Using End Using - 'Lnado del CFDITimbre - Dim cfdi As New CFDITimbre - cfdi.Nomina = New CFDINomina + 'Lnado del CFDITimbre cfdi.Nomina.Version = "1.2" cfdi.Nomina.TipoNomina = TipoNomina cfdi.Nomina.FechaPago = FechaPago @@ -326,7 +398,7 @@ Public Class LogicNominas Next End If - If CveRegimenContratacion.ToEntero() = 2 AndAlso ((ObjOtrosPagos.FirstOrDefault(Function(m) m.TipoOtroPago.ToEntero().Contiene(2, 7, 8))) Is Nothing) Then + If Not TimbreIndemnizacion AndAlso CveRegimenContratacion.ToEntero() = 2 AndAlso ((ObjOtrosPagos.FirstOrDefault(Function(m) m.TipoOtroPago.ToEntero().Contiene(2, 7, 8))) Is Nothing) Then ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser referente a subsidio al empleo .Clave = "D051", .Concepto = "Subs al Empleo acreditado", .Importe = 0D, .Subsidiocausado = 0D}) @@ -361,9 +433,9 @@ Public Class LogicNominas cfdi.Nomina.Receptor.NSS = NumeroSS cfdi.Nomina.Receptor.FechaInicioContrato = FechaInicioContrato cfdi.Nomina.Receptor.Antiguedad = $"P{AntiguedadSemanas}W" - cfdi.Nomina.Receptor.TipoContrato = CodigoTipoContrato + cfdi.Nomina.Receptor.TipoContrato = If(TimbreIndemnizacion, "99", CodigoTipoContrato) cfdi.Nomina.Receptor.CodigoTipoJornada = ClaveTipoJornada - cfdi.Nomina.Receptor.CodigoRegimenContratacion = CveRegimenContratacion + cfdi.Nomina.Receptor.CodigoRegimenContratacion = If(TimbreIndemnizacion, "13", CveRegimenContratacion) cfdi.Nomina.Receptor.CodigoEmpleado = Codigo cfdi.Nomina.Receptor.Departamento = Departamento cfdi.Nomina.Receptor.Puesto = Puesto diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index b7d9bbabb..6dba27799 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -2021,57 +2021,66 @@ Public Class Timbrado End If #End Region If ObjCFDITimbre.Nomina IsNot Nothing Then - + 'If cfdi.Nomina12SeparacionIndemnizacion Then If ObjCFDITimbre.Nomina.Percepciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Percepciones.Count > 0 Then - cfdi.Nomina12Percepciones(ObjCFDITimbre.Nomina.TotalSueldos, ObjCFDITimbre.Nomina.TotalIndemnizacion, ObjCFDITimbre.Nomina.TotalJubilacion, ObjCFDITimbre.Nomina.TotalPercepcionesGravado, ObjCFDITimbre.Nomina.TotalPercepcionesExento) - For Each percep As CFDINominaPercepciones In ObjCFDITimbre.Nomina.Percepciones - cfdi.Nomina12Percepcion(percep.TipoPercepcion, percep.Clave, percep.Concepto, Math.Round(percep.ImporteGravado, 2), Math.Round(percep.ImporteExento, 2)) - If percep.TipoPercepcion.ToEntero() = 19 Then + cfdi.Nomina12Percepciones(ObjCFDITimbre.Nomina.TotalSueldos, ObjCFDITimbre.Nomina.TotalIndemnizacion, ObjCFDITimbre.Nomina.TotalJubilacion, ObjCFDITimbre.Nomina.TotalPercepcionesGravado, ObjCFDITimbre.Nomina.TotalPercepcionesExento) + For Each percep As CFDINominaPercepciones In ObjCFDITimbre.Nomina.Percepciones + cfdi.Nomina12Percepcion(percep.TipoPercepcion, percep.Clave, percep.Concepto, Math.Round(percep.ImporteGravado, 2), Math.Round(percep.ImporteExento, 2)) + If percep.TipoPercepcion.ToEntero() = 19 Then - If ObjCFDITimbre.Nomina.HorasExtras IsNot Nothing AndAlso ObjCFDITimbre.Nomina.HorasExtras.Count > 0 Then - For Each HoraExtra As CFDINominaHorasExtras In ObjCFDITimbre.Nomina.HorasExtras - cfdi.Nomina12HorasExtra(HoraExtra.Dias.ToEntero, HoraExtra.TipoHoras, HoraExtra.HorasExtra, HoraExtra.ImportePagado) - Next - End If - End If - Next - End If - - 'deducciones al final - If ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0 Then - cfdi.Nomina12Deducciones(ObjCFDITimbre.Nomina.TotalDeduccionesOtras, Math.Round(ObjCFDITimbre.Nomina.TotalDeduccionesImpuestosRetenidos, 2)) - For Each deduc As CFDINominaDeducciones In ObjCFDITimbre.Nomina.Deducciones - cfdi.Nomina12Deduccion(deduc.TipoDeduccion, deduc.Clave, deduc.Concepto, Math.Round(deduc.Importe, 2)) - Next - End If - If ObjCFDITimbre.Nomina.OtrosPagos IsNot Nothing Then - ' cfdi.agregarNominaOtrosPagosOtroPago12("002", "002", "Subsidio", "10.00"); - ' cfdi.agregarNominaOtrosPagosOtroPagoSubsidioAlEmpleo12("10.00"); - If ObjCFDITimbre.Nomina.OtrosPagos IsNot Nothing AndAlso ObjCFDITimbre.Nomina.OtrosPagos.Count > 0 Then - For Each otpag As CFDINominaOtrosPagos In ObjCFDITimbre.Nomina.OtrosPagos - cfdi.Nomina12OtroPago(otpag.TipoOtroPago, otpag.Clave, otpag.Concepto, otpag.Importe) - If otpag.TipoOtroPago = "002" Then - cfdi.Nomina12SubsidioAlEmpleo(otpag.Subsidiocausado) - End If - - If otpag.TipoOtroPago = "004" AndAlso otpag.Importe > 0 Then - If otpag.ejercicio > 0 Then - cfdi.CompensacionSaldosAFavor(otpag.SaldoAFavor, otpag.ejercicio, otpag.RemanenteSalFav) 'otpag.SaldoAFavor + If ObjCFDITimbre.Nomina.HorasExtras IsNot Nothing AndAlso ObjCFDITimbre.Nomina.HorasExtras.Count > 0 Then + For Each HoraExtra As CFDINominaHorasExtras In ObjCFDITimbre.Nomina.HorasExtras + cfdi.Nomina12HorasExtra(HoraExtra.Dias.ToEntero, HoraExtra.TipoHoras, HoraExtra.HorasExtra, HoraExtra.ImportePagado) + Next End If End If + Next + End If + If ObjCFDITimbre.IStimbreFiniquito Then + 'ObjCFDITimbre.Nomina. + Dim UltimoSueldoOrdinario As Double = ObjCFDITimbre.Nomina.UltimoSueldoOrdinario.ToString().ToDouble() + Dim TotalIndemnizacion As Double = ObjCFDITimbre.Nomina.TotalIndemnizacion + Dim t1 As Double = If(UltimoSueldoOrdinario < TotalIndemnizacion, UltimoSueldoOrdinario, TotalIndemnizacion) + Dim t2 As Double = If(UltimoSueldoOrdinario < TotalIndemnizacion, TotalIndemnizacion, UltimoSueldoOrdinario) + cfdi.Nomina12SeparacionIndemnizacion(TotalIndemnizacion, ObjCFDITimbre.Nomina.Antiguedad, UltimoSueldoOrdinario, t1, t2 - t1) + + End If + 'deducciones al final + If ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0 Then + cfdi.Nomina12Deducciones(ObjCFDITimbre.Nomina.TotalDeduccionesOtras, Math.Round(ObjCFDITimbre.Nomina.TotalDeduccionesImpuestosRetenidos, 2)) + For Each deduc As CFDINominaDeducciones In ObjCFDITimbre.Nomina.Deducciones + cfdi.Nomina12Deduccion(deduc.TipoDeduccion, deduc.Clave, deduc.Concepto, Math.Round(deduc.Importe, 2)) + Next + End If + If ObjCFDITimbre.Nomina.OtrosPagos IsNot Nothing Then + ' cfdi.agregarNominaOtrosPagosOtroPago12("002", "002", "Subsidio", "10.00"); + ' cfdi.agregarNominaOtrosPagosOtroPagoSubsidioAlEmpleo12("10.00"); + If ObjCFDITimbre.Nomina.OtrosPagos IsNot Nothing AndAlso ObjCFDITimbre.Nomina.OtrosPagos.Count > 0 Then + For Each otpag As CFDINominaOtrosPagos In ObjCFDITimbre.Nomina.OtrosPagos + cfdi.Nomina12OtroPago(otpag.TipoOtroPago, otpag.Clave, otpag.Concepto, otpag.Importe) + If otpag.TipoOtroPago = "002" Then + cfdi.Nomina12SubsidioAlEmpleo(otpag.Subsidiocausado) + End If + + If otpag.TipoOtroPago = "004" AndAlso otpag.Importe > 0 Then + If otpag.ejercicio > 0 Then + cfdi.CompensacionSaldosAFavor(otpag.SaldoAFavor, otpag.ejercicio, otpag.RemanenteSalFav) 'otpag.SaldoAFavor + End If + End If + + Next + End If + End If + If ObjCFDITimbre.Nomina.Incapacidades IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Incapacidades.Count > 0 Then + For Each Incap As CFDINominaIncapacidades In ObjCFDITimbre.Nomina.Incapacidades + cfdi.Nomina12Incapacidad(Incap.DiasIncapacidad.ToEntero, Incap.TipoIncapacidad, Incap.Importe) Next End If End If - If ObjCFDITimbre.Nomina.Incapacidades IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Incapacidades.Count > 0 Then - For Each Incap As CFDINominaIncapacidades In ObjCFDITimbre.Nomina.Incapacidades - cfdi.Nomina12Incapacidad(Incap.DiasIncapacidad.ToEntero, Incap.TipoIncapacidad, Incap.Importe) - Next - End If - End If #End Region - sw.Stop() + sw.Stop() swTiempo.AppendFormat("Armado: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds) swmili = sw.ElapsedMilliseconds sw.Start() @@ -2150,7 +2159,7 @@ Public Class Timbrado If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then Using ObjNomina2 As New ClsNominas() - If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then + If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0, isFiniquito:=Ventas.Timbre.IStimbreFiniquito) Then Retorno = "" Else Retorno = "Error" diff --git a/Bin/Microsoft.IdentityModel.JsonWebTokens.dll.refresh b/Bin/Microsoft.IdentityModel.JsonWebTokens.dll.refresh deleted file mode 100644 index e8ab0af2cffaa5befd2a0f756f448fd645fd4ac6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 302 zcmb`DK?=e!5JmrqiUk#M+m(Vl#Z5pojT#!-V%mk5S6}7~GR!3W|7IrS`)Rb5(@9xD zFRD|ct7f%|O2mMYsWYyJahyRTN@0ud;gg=GOuA^J70!t2)lnbtg*`CQ(_K0T-8HGw wjy*v=_ej2B22&E=-nd?8h?|Z$ov|5jP1Z!Eg}ov|IOYVVEOF~U?`!QZek|BJrvLx| diff --git a/Bin/Microsoft.IdentityModel.Logging.dll.refresh b/Bin/Microsoft.IdentityModel.Logging.dll.refresh deleted file mode 100644 index 62ecc0c56..000000000 --- a/Bin/Microsoft.IdentityModel.Logging.dll.refresh +++ /dev/null @@ -1 +0,0 @@ -C:\Users\Caudillo\source\repos\localhost_85\packages\Microsoft.IdentityModel.Logging.6.11.0\lib\net461\Microsoft.IdentityModel.Logging.dll \ No newline at end of file diff --git a/Bin/Microsoft.IdentityModel.Tokens.dll.refresh b/Bin/Microsoft.IdentityModel.Tokens.dll.refresh deleted file mode 100644 index fd11383f497897599331063991329dc016d77b13..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 274 zcmbu4%?g4*6h_YzNkT=mb=9I>?S!b&N)(mUMK52SnOBJ6{>*p2JD2%>3igzonW%Z0 zOA4+mR5Wy+L1i*8(x9ib){H9A8+p**@l49hg&iBos2XU^5B<@5^u^$GoE*3_lW}lQ oO>f^AZ#_d&I@!s-O?2|MHF8hJD(!8!S$p}+TAKg8p-TV#0q?^#Hvj+t diff --git a/Bin/System.IdentityModel.Tokens.Jwt.dll.refresh b/Bin/System.IdentityModel.Tokens.Jwt.dll.refresh deleted file mode 100644 index c2fd62bfdccac6c7797734df97a62120488ab772..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 278 zcmb`A!3u&v6h+S$NkT=mbyd)++6hr6B~B)(gg;-M@f%`z_szTa%)IX>V@=MHj*^#} zlW}I?N=5KIbvku0Eo5?gNvjjtm>2Sa`{eYTSg|l^bqi|sCLh^7qrG=}kg#z>N#k5u qBRk(mCzu_)*HhX#ZFx&1EUlE;q;Ye_#a|n_p1EoIhaFe{4g3JGA~l-; diff --git a/Bin/System.Net.Http.Formatting.dll.refresh b/Bin/System.Net.Http.Formatting.dll.refresh deleted file mode 100644 index 1b363176e762e4b4d9435293c86315b29572fad2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262 zcmXwz!3x4K5JcyTdJrq(O$y>gFCtz7Qqx$Au?=l{@aNT+fRyZ}Z)SJ${Z!h>=&VUj zBh{!-wIa9C(rO^Ua*xP7ACDfD@50`RQ(KCj# XZ2F9^=KSWDVzeT&BkMmY!|(M0E`&B> diff --git a/Bin/System.Web.Http.WebHost.dll.refresh b/Bin/System.Web.Http.WebHost.dll.refresh deleted file mode 100644 index 4f2702c6a..000000000 --- a/Bin/System.Web.Http.WebHost.dll.refresh +++ /dev/null @@ -1 +0,0 @@ -C:\Users\Caudillo\source\repos\localhost_85\packages\Microsoft.AspNet.WebApi.WebHost.5.2.4\lib\net45\System.Web.Http.WebHost.dll \ No newline at end of file diff --git a/Bin/System.Web.Http.dll.refresh b/Bin/System.Web.Http.dll.refresh deleted file mode 100644 index 8f16a752afc51b6d066ce332da4d894a0580a002..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 236 zcmX|+u@1s83`FmXJRm@b4Rv9G1)(mH5QG91g+??T_<7(t1BzlN=jU_s{Zv{iXs - - +
  • - Cargar Excel + Cargar Excel
  • Crear Complemento de Pago
  • -
    -
    +
  • + Paquete Egresos +
  • +
  • + Cargar Comprobante +
  • + + +
    @@ -136,7 +142,7 @@
    - +
    @@ -151,7 +157,7 @@
    - +
    @@ -401,7 +407,7 @@
    - + Movimiento @@ -613,7 +619,7 @@
    - +
    @@ -783,7 +789,50 @@
    +
    diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index c5225c895..259ae97cc 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -5,6 +5,9 @@ Imports Extensiones Imports System.Linq Imports System.Web.Services Imports GemBox.Spreadsheet +Imports System.IO +Imports iTextSharp.text.pdf +Imports Microsoft.Reporting.WebForms Partial Class ContabilidadC_RegPrePoliza Inherits ClsPaginas @@ -53,14 +56,14 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private ReadOnly Property CvePrePoliza As Integer Get - Return ViewState("CvePrePoliza").ToString.ToEntero + Return ViewState("CvePrePoliza").ToString().ToEntero() End Get End Property 'PARA CREAR IE Private Property CveConcepto As Integer Get - Return ViewState("CveConcepto").ToString.ToEntero + Return ViewState("CveConcepto").ToString().ToEntero() End Get Set(value As Integer) ViewState("CveConcepto") = value @@ -68,7 +71,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property CveTipoTransaccion As Integer Get - Return ViewState("CveTipoTransaccion").ToString.ToEntero + Return ViewState("CveTipoTransaccion").ToString().ToEntero() End Get Set(value As Integer) ViewState("CveTipoTransaccion") = value @@ -76,7 +79,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property CveCuenta As Integer Get - Return ViewState("CveCuenta").ToString.ToEntero + Return ViewState("CveCuenta").ToString().ToEntero() End Get Set(value As Integer) ViewState("CveCuenta") = value @@ -84,7 +87,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property Folio As String Get - Return ViewState("Folio").ToString + Return ViewState("Folio").ToString() End Get Set(value As String) ViewState("Folio") = value @@ -92,7 +95,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property ImporteDocumento As Decimal Get - Return ViewState("ImporteDocumento").ToString.ToDecimal + Return ViewState("ImporteDocumento").ToString().ToDecimal() End Get Set(value As Decimal) ViewState("ImporteDocumento") = value @@ -100,7 +103,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property Observaciones As String Get - Return ViewState("Observaciones").ToString + Return ViewState("Observaciones").ToString() End Get Set(value As String) ViewState("Observaciones") = value @@ -108,7 +111,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property Beneficiario As String Get - Return ViewState("Beneficiario").ToString + Return ViewState("Beneficiario").ToString() End Get Set(value As String) ViewState("Beneficiario") = value @@ -116,7 +119,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property RowIndex As Integer Get - Return ViewState("RowIndex").ToString.ToEntero + Return ViewState("RowIndex").ToString().ToEntero() End Get Set(value As Integer) ViewState("RowIndex") = value @@ -124,7 +127,7 @@ Partial Class ContabilidadC_RegPrePoliza End Property Private Property Actualizar As Boolean Get - Return CBool(ViewState("Actualizar").ToString) + Return CBool(ViewState("Actualizar").ToString()) End Get Set(value As Boolean) ViewState("Actualizar") = value @@ -167,12 +170,39 @@ Partial Class ContabilidadC_RegPrePoliza ViewState("IdPoliza") = value End Set End Property + + Public Property Tick As String + Get + Return CType(ViewState("Tick"), String) + End Get + Set(value As String) + ViewState("Tick") = value + End Set + End Property + + Public Property CveIE As Integer + Get + Return CType(ViewState("CveIE"), Integer) + End Get + Set(value As Integer) + ViewState("CveIE") = value + End Set + End Property + + Public Property TipoPoliza As String + Get + Return CType(ViewState("TipoPoliza"), String) + End Get + Set(value As String) + ViewState("TipoPoliza") = value + End Set + End Property #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then - + Tick = DateTime.Now.Ticks.ToString() If UsuarioActual.Empresa.TipoContabilizacion = 1 OrElse UsuarioActual.Empresa.TipoContabilidad = 1 Then Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS")) @@ -205,24 +235,24 @@ Partial Class ContabilidadC_RegPrePoliza End If - If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then + If IfNull(Request("Tipo"), "").ToString() = "NOMPROV" Then DivTipoGasto.Visible = True ThTipoGasto.Visible = True CargaTiposGasto() End If - If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero > 0 Then - ViewState("CvePrePoliza") = Request("CvePrePoliza").ToEntero + If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero() > 0 Then + ViewState("CvePrePoliza") = Request("CvePrePoliza").ToEntero() CreaDT() CargaPrePoliza() CargaGvBitacora() - If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then + If IfNull(Request("Tipo"), "").ToString() <> "NOMPROV" Then GvPrePoliza.Columns(4).Visible = False GvConcepto.Columns(4).Visible = False GvMov.Columns(5).Visible = False End If - If IfNull(Request("Conta"), "").ToString = "1" Then + If IfNull(Request("Conta"), "").ToString() = "1" Then Contabilizar() End If Exit Sub @@ -241,7 +271,7 @@ Partial Class ContabilidadC_RegPrePoliza TipoPlantilla = 0 - If IfNull(Request("Tipo"), "").ToString = "Ing" Then + If IfNull(Request("Tipo"), "").ToString() = "Ing" Then TipoPlantilla = 1 LblEncabezado.Text = "Otros Ingresos" End If @@ -259,14 +289,14 @@ Partial Class ContabilidadC_RegPrePoliza CargaCuentas() - If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero > 0 Then - ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero - ViewState("CveProyecto") = Request("CveProyecto").ToEntero - ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero - ViewState("CveTurno") = Request("CveTurno").ToEntero + If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero() > 0 Then + ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero() + ViewState("CveProyecto") = Request("CveProyecto").ToEntero() + ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero() + ViewState("CveTurno") = Request("CveTurno").ToEntero() - DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61")) - DdlPlantilla.SelectedValue = "61" + 'DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61")) + 'DdlPlantilla.SelectedValue = "61" DdlPlantilla.Enabled = False DivAgregarConceptos.Visible = False @@ -277,7 +307,7 @@ Partial Class ContabilidadC_RegPrePoliza RegistraScript("$(document).ready(function () { comparar(); Sys.Application.add_load(function (s, e) { comparar(); }); } );", 3) End If - If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then + If IfNull(Request("Tipo"), "").ToString() <> "NOMPROV" Then GvPrePoliza.Columns(3).Visible = False GvConcepto.Columns(3).Visible = False GvMov.Columns(4).Visible = False @@ -331,7 +361,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub CargaNomina() - Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero + Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero() Dim ObjNomina As New ClsNominas Dim ObjConta As New ClsContabilidad @@ -353,18 +383,18 @@ Partial Class ContabilidadC_RegPrePoliza For Each drt As DataRow In Dt.Rows Dim dr As DataRow = DtMovimientos.NewRow - If drt("NombreCompleto").ToString = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then + If drt("NombreCompleto").ToString() = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then CveConcepto = 98 Cuenta = "Nominas por Pagar" - IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString.ToEntero + IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString().ToEntero() Concepto = "Pago Nomina" Referencia = "Pago Nomina" Else Concepto = drt("NombreCompleto") Referencia = "" - CveConcepto = drt("CveConceptoContable").ToString.ToEntero - Cuenta = drt("ConceptoContable").ToString - IdCuenta = drt("IdCtaContable").ToString.ToEntero + CveConcepto = drt("CveConceptoContable").ToString().ToEntero() + Cuenta = drt("ConceptoContable").ToString() + IdCuenta = drt("IdCtaContable").ToString().ToEntero() End If Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}") @@ -374,11 +404,11 @@ Partial Class ContabilidadC_RegPrePoliza TipoMovto = drt("TipoMovto") If TipoMovto = 0 Then - dr("Cargo") = Math.Abs(drt("Importe").ToString.ToDecimal) + dr("Cargo") = Math.Abs(drt("Importe").ToString().ToDecimal()) dr("Abono") = 0 Else dr("Cargo") = 0 - dr("Abono") = Math.Abs(drt("Importe").ToString.ToDecimal) + dr("Abono") = Math.Abs(drt("Importe").ToString().ToDecimal()) End If dr("IdCuenta") = IdCuenta @@ -418,6 +448,9 @@ Partial Class ContabilidadC_RegPrePoliza TxtFechaDocumento.Text = dr("Fecha") TxtConcepto.Text = dr("Concepto") DivDatosPoliza.Visible = True + TipoPoliza = DdlTipoPoliza.SelectedItem.Text + Folio = dr("FolioPoliza").ToString() + If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then DivAgregarConceptos.Visible = True @@ -436,8 +469,8 @@ Partial Class ContabilidadC_RegPrePoliza LnkComplementoPago.Visible = True End If - IdPoliza = dr("IdPoliza").ToString.ToEntero - If dr("IdPoliza").ToString.ToEntero > 0 Then + IdPoliza = dr("IdPoliza").ToString().ToEntero() + If dr("IdPoliza").ToString().ToEntero() > 0 Then HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza")) divContabilziada.Visible = True BtnEliminar.Visible = False @@ -459,7 +492,7 @@ Partial Class ContabilidadC_RegPrePoliza RegistraScript("comparar();") - If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then + If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero() = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then For Each row As GridViewRow In GvPrePoliza.Rows row.FCTextBox("TxtCargo").Enabled = False row.FCTextBox("TxtAbono").Enabled = False @@ -485,25 +518,25 @@ Partial Class ContabilidadC_RegPrePoliza 'Asignamos los Subproyectos e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlSubProyecto").DataBind() - e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) + 'e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto")) 'Asignamos los Tipos de Gasto e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlTipoGasto").DataBind() - e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) + 'e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto")) 'ASignamos las CuentasContables e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas") e.Row.FCDropDownList("DdlCtaContable").DataBind() - e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0")) + 'e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0")) e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable")) - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString.FormatoNumero - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString().FormatoNumero + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).ToString().FormatoNumero - Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero + Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero() If CveConceptoContable.Contiene(1, 2, 12, 13, 38, 207, 203, 39, 61, 62, 63, 150, 251, 226) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) @@ -511,6 +544,11 @@ Partial Class ContabilidadC_RegPrePoliza If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) If CveConceptoContable.Contiene(30, 204) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) + If CveConceptoContable.Contiene(30) Then + LnkImprimirPDF.Visible = True + LnkComprobante.Visible = True + CveIE = e.Row.DBCampo("CveIE").ToString().ToEntero() + End If 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable @@ -553,7 +591,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 205, 206, 14, 15, 16, 19, 25, 26, 21, 18, 60) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(5, 17, 201, 205, 206, 14, 15, 16, 19, 25, 26, 21, 18, 60) Then CargaProveedores() DdlProveedores.Visible = True DdlCompras.Visible = True @@ -562,13 +600,13 @@ Partial Class ContabilidadC_RegPrePoliza DdlCompras.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(28, 29) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(28, 29) Then CargaPersonal() DdlPersonal.Visible = True Else DdlPersonal.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then CargaClientes() DdlClientes.Visible = True DdlVentas.Visible = True @@ -577,14 +615,14 @@ Partial Class ContabilidadC_RegPrePoliza DdlVentas.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(51) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(51) Then CargaClasificacionesE() DdlClasificacionesE.Visible = True Else DdlClasificacionesE.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(201, 202, 203, 204, 206, 207, 226, 227, 229, 233, 234, 235, 239, 242, 256, 266) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(201, 202, 203, 204, 206, 207, 226, 227, 229, 233, 234, 235, 239, 242, 256, 266) Then TxtTC.Text = "2" TxtTC.Visible = True Else @@ -592,7 +630,7 @@ Partial Class ContabilidadC_RegPrePoliza TxtTC.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(69) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(69) Then CargaClasificaciones() DdlClasificaciones.Visible = True Else @@ -605,19 +643,19 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then - CargaNotasCreditoCompras(DdlProveedores.SelectedValue.ToEntero, DdlCompras) + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(18, 60) Then + CargaNotasCreditoCompras(DdlProveedores.SelectedValue.ToEntero(), DdlCompras) Else - CargaCompras(DdlProveedores.SelectedValue.ToEntero) + CargaCompras(DdlProveedores.SelectedValue.ToEntero()) End If End Sub Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(12, 91) Then - CargaVentas(DdlClientes.SelectedValue.ToEntero) + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(12, 91) Then + CargaVentas(DdlClientes.SelectedValue.ToEntero()) Else - CargaVentas(DdlClientes.SelectedValue.ToEntero) + CargaVentas(DdlClientes.SelectedValue.ToEntero()) End If End Sub @@ -650,7 +688,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub CargaCompras(CveProveedor As Integer) - If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then + If Not DdlConceptosContables.SelectedValue.ToEntero().Contiene(21) Then Dim ObjCompras As New ClsCompras DdlCompras.ClearSelection() @@ -668,7 +706,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub CargaNotasCreditoCompras(CveProveedor As Integer, ddl As DropDownList) - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(18, 60) Then Dim ObjCompras As New ClsCompras ddl.ClearSelection() @@ -747,13 +785,13 @@ Partial Class ContabilidadC_RegPrePoliza TxtTotalAbonos.Text = "" TxtTotalCargos.Text = "" - If DdlPlantilla.SelectedValue.ToEntero <= 0 Then + If DdlPlantilla.SelectedValue.ToEntero() <= 0 Then Alert("Seleccione un Movimiento Válido", TipoMensaje.MsgAdvertencia) DdlPlantilla.SelectedValue = "-1" Exit Sub End If - If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada + If DdlPlantilla.SelectedValue.ToEntero() = 53 Then 'Plantilla Personalizada DivAgregarConceptos.Visible = True Else DivAgregarConceptos.Visible = False @@ -761,7 +799,7 @@ Partial Class ContabilidadC_RegPrePoliza - Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero + Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero() Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") Dim Cuenta As String = "" @@ -773,23 +811,23 @@ Partial Class ContabilidadC_RegPrePoliza For Each drt As DataRow In Dt.Rows - Cuenta = drt("ConceptoContable").ToString + Cuenta = drt("ConceptoContable").ToString() IdCuenta = 0 CodigoCuenta = "" NombreCuenta = "" - If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) + If drt("IdCtaContable").ToString().ToEntero() > 0 Then 'DtCuentasContables + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString())) If drr IsNot Nothing Then - IdCuenta = drt("IdCtaContable").ToString.ToEntero + IdCuenta = drt("IdCtaContable").ToString().ToEntero() CodigoCuenta = drr("CuentaFormato").ToString() NombreCuenta = drr("Nombre").ToString() - 'Cuenta = drr("Nombre").ToString() + 'Cuenta = drr("Nombre").Tostring() NombreCuenta = CodigoCuenta & "
    " & NombreCuenta End If EsComodin = 0 End If - If drt("CveCuenta").ToString.ToEntero > 0 Then + If drt("CveCuenta").ToString().ToEntero() > 0 Then NombreCuenta = String.Format("{0}
    {1}", drt("Codigo"), drt("Nombre")) End If @@ -797,9 +835,9 @@ Partial Class ContabilidadC_RegPrePoliza dr("IdCuenta") = IdCuenta dr("CodigoCuenta") = NombreCuenta dr("Cuenta") = Cuenta 'TxtCuentaContable.Text - dr("Referencia") = If(drt("CveConcepto").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial")) + dr("Referencia") = If(drt("CveConcepto").ToString().Contiene("29", "130"), drt("Personal"), drt("RazonSocial")) dr("Concepto") = TxtObservaciones.Text - dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1) + dr("TipoMovto") = If(drt("TipoMovto").ToString() = "False", 0, 1) dr("EsComodin") = EsComodin dr("CveConcepto") = drt("CveConcepto") dr("CveSubProyecto") = drt("CveSubProyectoNegativo") @@ -811,6 +849,8 @@ Partial Class ContabilidadC_RegPrePoliza dr("MultipleSubProyecto") = drt("MultipleSubProyecto") dr("PorcentajeImpuesto") = drt("PorcentajeImpuesto") dr("CveCuenta") = drt("CveCuenta") + dr("FolioPoliza") = drt("FolioPoliza") + DtMovimientos.Rows.Add(dr) @@ -856,7 +896,7 @@ Partial Class ContabilidadC_RegPrePoliza e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) e.Row.FCDropDownList("DdlTipoGasto").SelectedValue = e.Row.DBCampo("CveTipoGasto") - If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada + If DdlPlantilla.SelectedValue.ToEntero() = 53 Then 'Plantilla Personalizada e.Row.FCDropDownList("DdlSubProyecto").Enabled = True e.Row.FCImageButton("imgD").Visible = True Else @@ -868,17 +908,17 @@ Partial Class ContabilidadC_RegPrePoliza End If 'Agregamos la opcion para vincular los movimientos bancarios - If e.Row.DataKey("CveConcepto").ToEntero.Contiene(41) Then + If e.Row.DataKey("CveConcepto").ToEntero().Contiene(41) Then Dim ObjMovimientos As New ClsMovimientos Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos") - Select Case e.Row.DataKey("CveConcepto").ToEntero + Select Case e.Row.DataKey("CveConcepto").ToEntero() 'Acreedores Case 41 If (ObjMovimientos.GetAcreedoresSaldosDetalles(-1, CveMoneda, UsuarioActual.CveEmpresa)) Then DdlSaldos.Visible = True - DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero}") + DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero()}") DdlSaldos.DataBind() DdlSaldos.Items.Insert(0, New ListItem("Seleccione", "-1")) End If @@ -888,16 +928,15 @@ Partial Class ContabilidadC_RegPrePoliza ObjMovimientos.Dispose() End If - If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then + If e.Row.DataKey("CveConcepto").ToEntero().Contiene(30) Then e.Row.FCLinkButton("ImgBancos").Visible = True - If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then e.Row.FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green" End If End If - If e.Row.DataKey("CveConcepto").ToEntero.Contiene(17) Then + If e.Row.DataKey("CveConcepto").ToEntero().Contiene(17) Then e.Row.FCDropDownList("DdlProveedores").Visible = True e.Row.FCDropDownList("DdlProveedores").DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlProveedores").DataBind() @@ -915,12 +954,12 @@ Partial Class ContabilidadC_RegPrePoliza Dim TotalCargos, TotalAbonos As Decimal If CvePrePoliza > 0 Then - TotalCargos = TxtTotalCargos.Text.ToDecimal - TotalAbonos = TxtTotalAbonos.Text.ToDecimal + TotalCargos = TxtTotalCargos.Text.ToDecimal() + TotalAbonos = TxtTotalAbonos.Text.ToDecimal() Else For Each Gvr As GridViewRow In GvMov.Rows - TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal - TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal + TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal() + TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal() Next End If @@ -951,7 +990,7 @@ Partial Class ContabilidadC_RegPrePoliza Try Dim CvePrePoliza As Integer Dim ConceptoPoliza As String = TxtObservaciones.Text - CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) + CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero(), TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate(), ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero()) If CvePrePoliza > 0 Then Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

    " @@ -970,12 +1009,12 @@ Partial Class ContabilidadC_RegPrePoliza 'inserto las compras que voy a pagarDdlSaldos For Each gvr As GridViewRow In GvMov.Rows - If gvr.DataKey("IDCuenta").ToEntero > 0 Then + If gvr.DataKey("IDCuenta").ToEntero() > 0 Then IdCtaContable = gvr.DataKey("IDCuenta") End If - CveProveedor = gvr.DataKey("CveProveedor").ToEntero - CveCompra = gvr.DataKey("CveCompra").ToEntero - CveConcepto = gvr.DataKey("CveConcepto").ToEntero + CveProveedor = gvr.DataKey("CveProveedor").ToEntero() + CveCompra = gvr.DataKey("CveCompra").ToEntero() + CveConcepto = gvr.DataKey("CveConcepto").ToEntero() If gvr.DataKey("TipoMovto").ToDouble <> 0 Then Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble @@ -986,12 +1025,12 @@ Partial Class ContabilidadC_RegPrePoliza End If 'Registra pago de compra If CveConcepto = 17 Then - CveProveedor = gvr.FCDropDownList("DdlProveedores").SelectedValue.ToEntero - CveCompra = gvr.FCDropDownList("DdlCompras").SelectedValue.ToEntero + CveProveedor = gvr.FCDropDownList("DdlProveedores").SelectedValue.ToEntero() + CveCompra = gvr.FCDropDownList("DdlCompras").SelectedValue.ToEntero() End If If CveConcepto = 41 Then - CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero + CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero() Else If CveConcepto = 30 AndAlso Importe <> 0 Then 'Registra movimieno bancario @@ -1017,14 +1056,14 @@ Partial Class ContabilidadC_RegPrePoliza End If If Importe <> 0 Then - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero, gvr.FCTextBox("TxtConcepto").Text, - TxtFecha.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE, + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero(), gvr.FCTextBox("TxtConcepto").Text, + TxtFecha.Text.ToDate(), IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), CveIE:=CveIE, CveProveedor:=CveProveedor, CveCompra:=CveCompra, - CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero, - ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, - CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=If(gvr.DataKey("TC").ToString.ToDecimal > 0, gvr.DataKey("TC").ToString.ToDecimal, 1), - ImporteME:=If(gvr.DataKey("TC").ToString.ToDecimal > 0, (Importe / (gvr.DataKey("TC").ToString.ToDecimal - 1)).RoundSQL, 0), - PorcentajeImpuesto:=gvr.DataKey("PorcentajeImpuesto").ToDecimal, CveCuenta:=gvr.DataKey("CveCuenta").ToEntero) Then + CvePersonal:=gvr.DataKey("CvePersonal").ToEntero(), CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero(), + ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), + CveCliente:=gvr.DataKey("CveCliente").ToEntero(), CveVenta:=gvr.DataKey("CveVenta").ToEntero(), TipoCambio:=If(gvr.DataKey("TC").ToString().ToDecimal() > 0, gvr.DataKey("TC").ToString().ToDecimal(), 1), + ImporteME:=If(gvr.DataKey("TC").ToString().ToDecimal() > 0, (Importe / (gvr.DataKey("TC").ToString().ToDecimal() - 1)).RoundSQL, 0), + PorcentajeImpuesto:=gvr.DataKey("PorcentajeImpuesto").ToDecimal(), CveCuenta:=gvr.DataKey("CveCuenta").ToEntero()) Then Else MsgError = "No se pudo insertar el detalle de la póliza2" Exit For @@ -1054,7 +1093,7 @@ Partial Class ContabilidadC_RegPrePoliza 'MENSAJE PRINCIPAL MensajeAlert.AppendFormat("

    Folio de Póliza: {1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) MensajeAlert.AppendFormat("

    Prepóliza: {1}", CvePrePoliza, ObjMov.ContaFolio) - 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion) + 'Alert(MensajeAlert.Tostring(), ModExtensiones.TipoMensaje.MsgInformacion) Else Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico") End If @@ -1072,9 +1111,9 @@ Partial Class ContabilidadC_RegPrePoliza 'MENSAJE IE If CveIE > 0 Then MensajeAlert.AppendFormat("

    Folio Bancario: {1}", CveIE, FolioIE) - Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()") + Alert(MensajeAlert.ToString(), ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()") Else - Alert(If(MensajeAlert.ToString = "", "Se registro con exito.", MensajeAlert.ToString), TipoMensaje.MsgInformacion, "window.location.reload()") + Alert(If(MensajeAlert.ToString() = "", "Se registro con exito.", MensajeAlert.ToString()), TipoMensaje.MsgInformacion, "window.location.reload()") End If ObjIE.Commit() @@ -1107,62 +1146,79 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub ActualizarPrePoliza() - + Dim contador As Integer = 0 + 'Dim diferencia As String = "" Dim OcurrioError As Boolean = False - Dim ObjContabilidad As New ClsContabilidad - ObjContabilidad.IniciaTransacSQL() + Using ObjContabilidad As New ClsContabilidad + + ObjContabilidad.IniciaTransacSQL() - If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then - OcurrioError = True - End If + If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + OcurrioError = True + End If + If ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero(), -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate(), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then - If ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + For Each row As GridViewRow In GvPrePoliza.Rows + Dim CvePrePolizaDetalle As Integer = row.DataKey("CvePrePolizaDetalle").ToEntero() + Dim Concepto As String = row.FCTextBox("TxtConcepto").Text + Dim CveSubProyecto As Integer = row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() + Dim CtaContable As Integer = row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero() + Dim TipoMovto As Boolean = If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, False, True) + Dim TipoMovtoOld As Boolean = (row.DataKey("TipoMovto").ToString = "True") + Dim ImporteMN As Decimal = If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, row.FCTextBox("TxtCargo").Text.ToDecimal(), row.FCTextBox("TxtAbono").Text.ToDecimal()) + Dim CveTipoGastonew As Integer = If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), row.DataKey("CveTipoGasto").ToEntero()) - - - For Each row As GridViewRow In GvPrePoliza.Rows - If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then - If Not ObjContabilidad.UpdatePrepolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCTextBox("TxtConcepto").Text, row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, - row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, - row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, row.DataKey("CveTipoGasto").ToEntero), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then - OcurrioError = True - Exit For + If row.DataKey("CvePrePolizaDetalle").ToEntero() > 0 Then + Dim actualizar As Boolean + actualizar = (Concepto <> row.DataKey("Concepto") OrElse CveSubProyecto <> row.DataKey("CveSubProyecto").ToEntero() OrElse CtaContable <> row.DataKey("IdCtaContable").ToEntero() OrElse + TipoMovto <> TipoMovtoOld OrElse ImporteMN <> row.DataKey("ImporteMN").ToDecimal() OrElse CveTipoGastonew <> row.DataKey("CveTipoGasto").ToEntero()) + 'diferencia = $"{diferencia}\r\n /*{actualizar}*/actualizar = '{Concepto}' <> '{row.DataKey("Concepto")}' || '{CveSubProyecto}' <> '{row.DataKey("CveSubProyecto").ToEntero()}' || '{CtaContable}' <> '{row.DataKey("IdCtaContable").ToEntero()}' ||" + 'diferencia = $"{diferencia} '{TipoMovto}' <> '{TipoMovtoOld}' OrElse '{ImporteMN}' <> '{row.DataKey("ImporteMN").ToEntero()}' OrElse '{CveTipoGastonew}' <> '{row.DataKey("CveTipoGasto").ToEntero()}'" + If actualizar Then + contador = contador + 1 + If Not ObjContabilidad.UpdatePrepolizasDetalle(CvePrePolizaDetalle, Concepto, CveSubProyecto, + CtaContable, TipoMovto, ImporteMN, CveTipoGasto:=CveTipoGastonew, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + OcurrioError = True + Exit For + End If + End If + Else + contador = contador + 1 + If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, + row.FCTextBox("TxtCargo").Text.ToDecimal(), row.FCTextBox("TxtAbono").Text.ToDecimal()), row.DataKey("Referencia").ToString(), + row.DataKey("CveConceptoContable").ToEntero(), row.FCTextBox("TxtConcepto").Text, Now, + row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero(), 0, CveSubProyecto:=row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), + CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), row.DataKey("CveTipoGasto").ToEntero()), + ImporteMX:=If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, + row.FCTextBox("TxtCargo").Text.ToDecimal(), row.FCTextBox("TxtAbono").Text.ToDecimal()), CveProveedor:=DdlProveedores.SelectedValue.ToEntero()) Then + OcurrioError = True + Exit For + End If End If - Else - If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, - row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString, - row.DataKey("CveConceptoContable").ToEntero, row.FCTextBox("TxtConcepto").Text, Now, - row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, 0, CveSubProyecto:=row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, - CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, row.DataKey("CveTipoGasto").ToEntero), - ImporteMX:=If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, - row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveProveedor:=DdlProveedores.SelectedValue.ToEntero) Then - OcurrioError = True - Exit For - End If - End If - Next - Else - OcurrioError = True - End If + Next + Else + OcurrioError = True + End If - If Not OcurrioError Then - ObjContabilidad.Commit() - Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion) - Else - ObjContabilidad.RollBack() - Alert("Ocurrio un error al actualizar la PrePoliza.", TipoMensaje.MsgError) - End If + If Not OcurrioError Then + ObjContabilidad.Commit() + Alert($"La Prepoliza se actualizó correctamente.
    se actualizaron {contador} registros.", TipoMensaje.MsgInformacion) + Else + ObjContabilidad.RollBack() + Alert($"Ocurrio un error al actualizar la PrePoliza.
    {contador} registros.", TipoMensaje.MsgError) + End If + 'RegistraScript($"console.log(""{diferencia}"")".Replace("'", "\'")) + End Using - ObjContabilidad.Dispose() CargaPrePoliza() If Not OcurrioError Then - If IdPoliza > 0 Then + If IdPoliza > 0 AndAlso contador Then BtnContabilizar_Click(Nothing, Nothing) End If @@ -1186,9 +1242,9 @@ Partial Class ContabilidadC_RegPrePoliza Dim ConceptoContable As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("LtlConceptoContable").Text Dim FolioFactura As String = GvPrePoliza.Rows(IndiceGrid).FCHyperLink("HlReferencia").Text Dim Concepto As String = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtConcepto").Text - Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero - Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero - Dim Id As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlCtaContable").SelectedValue.ToEntero + Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() + Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero() + Dim Id As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlCtaContable").SelectedValue.ToEntero() Dim Cargo As Double = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtCargo").Text.ToDouble Dim Abono As Double = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtAbono").Text.ToDouble @@ -1235,10 +1291,10 @@ Partial Class ContabilidadC_RegPrePoliza - 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString.FormatoNumero - 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).ToString.FormatoNumero + 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).Tostring().FormatoNumero + 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).Tostring().FormatoNumero - 'Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero + 'Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero() 'If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) 'If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) @@ -1262,7 +1318,7 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting - Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero + Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString().ToEntero() Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & idMov) If Rows.Count > 0 Then @@ -1294,7 +1350,7 @@ Partial Class ContabilidadC_RegPrePoliza Dim NombreCuenta As String = "" dr("IdCuenta") = DdlCtaContable.SelectedValue - If DdlCtaContable.SelectedValue.ToEntero > 0 Then + If DdlCtaContable.SelectedValue.ToEntero() > 0 Then Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) If drr IsNot Nothing Then CodigoCuenta = drr("CuentaFormato").ToString() @@ -1313,12 +1369,12 @@ Partial Class ContabilidadC_RegPrePoliza dr("Abono") = TxtAbono.Text.ToDouble dr("Descripcion") = TxtDescripcion.Text dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero - dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero() + dr("CveCompra") = DdlCompras.SelectedValue.ToEntero() + dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero() + dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero() + dr("CveCliente") = DdlClientes.SelectedValue.ToEntero() + dr("CveVenta") = DdlVentas.SelectedValue.ToEntero() End If GvMov.DataSource = DtMovimientos @@ -1344,8 +1400,8 @@ Partial Class ContabilidadC_RegPrePoliza dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString().FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString().FormatoNumero DtMovimientos.Rows.Add(dr) DtMovimientos.AcceptChanges() @@ -1361,7 +1417,7 @@ Partial Class ContabilidadC_RegPrePoliza dr("IdCuenta") = DdlCtaContable.SelectedValue - If DdlCtaContable.SelectedValue.ToEntero > 0 Then + If DdlCtaContable.SelectedValue.ToEntero() > 0 Then Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) If drr IsNot Nothing Then CodigoCuenta = drr("CuentaFormato").ToString() @@ -1382,16 +1438,16 @@ Partial Class ContabilidadC_RegPrePoliza dr("Abono") = TxtAbono.Text.ToDouble dr("Descripcion") = TxtDescripcion.Text dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero - dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero() + dr("CveCompra") = DdlCompras.SelectedValue.ToEntero() + dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero() + dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero() + dr("CveCliente") = DdlClientes.SelectedValue.ToEntero() + dr("CveVenta") = DdlVentas.SelectedValue.ToEntero() dr("TC") = TxtTC.Text.ToDouble - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString().FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString().FormatoNumero DtMovimientos.Rows.Add(dr) DtMovimientos.AcceptChanges() @@ -1446,10 +1502,10 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub BtnContado_Click(sender As Object, e As EventArgs) Handles BtnContado.Click CveConcepto = 30 - CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero - CveCuenta = DdlCuenta.SelectedValue.ToEntero + CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero() + CveCuenta = DdlCuenta.SelectedValue.ToEntero() Folio = TxtDocumentoFolio.Text - ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal + ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal() Observaciones = TxtDocumentoObservaciones.Text Beneficiario = TxtDocumentoBeneficiario.Text RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal")) @@ -1506,8 +1562,8 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub DdlSubProyectoFiltro_SelectedIndexChanged(sender As Object, e As EventArgs) Dim Ddl As DropDownList = CType(sender, DropDownList) For Each Gvr As GridViewRow In GvPrePoliza.Rows - If Ddl.SelectedValue.ToEntero > 0 Then - If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = Ddl.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then + If Ddl.SelectedValue.ToEntero() > 0 Then + If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() = Ddl.SelectedValue.ToEntero() Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then Gvr.Visible = True Gvr.FCDropDownList("DdlSubProyecto").SelectedValueExist(Ddl.SelectedValue) Else @@ -1524,8 +1580,8 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Protected Sub DdlSubProyectoFiltroMov_SelectedIndexChanged(sender As Object, e As EventArgs) For Each Gvr As GridViewRow In GvMov.Rows - If DdlSubProyectoFiltroMov.SelectedValue.ToEntero > 0 Then - If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = DdlSubProyectoFiltroMov.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then + If DdlSubProyectoFiltroMov.SelectedValue.ToEntero() > 0 Then + If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() = DdlSubProyectoFiltroMov.SelectedValue.ToEntero() Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero() > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then Gvr.Visible = True Gvr.FCDropDownList("DdlSubProyecto").SelectedValueExist(DdlSubProyectoFiltroMov.SelectedValue) Else @@ -1543,22 +1599,22 @@ Partial Class ContabilidadC_RegPrePoliza Private Sub GvMov_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvMov.RowEditing Actualizar = True - GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero - Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero + GvMov.DataKeys(e.NewEditIndex).Value.ToString().ToEntero() + Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString().ToEntero() Dim DrM As DataRow = DtMovimientos.Rows(e.NewEditIndex) If DrM IsNot Nothing Then - HdnCve.Value = idMov.ToString + HdnCve.Value = idMov.ToString() DdlCtaContable.SelectedValue = DrM("IdCuenta") TxtReferencia.Text = DrM("Referencia") TxtObservaciones.Text = DrM("Concepto") ' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto") DrM("EsComodin") = 0 - DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString - TxtCargo.Text = DrM("Cargo").ToString - TxtAbono.Text = DrM("Abono").ToString + DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString() + TxtCargo.Text = DrM("Cargo").ToString() + TxtAbono.Text = DrM("Abono").ToString() TxtDescripcion.Text = DrM("Descripcion") DdlSubProyecto.SelectedValue = DrM("CveSubProyecto") DdlProveedores.SelectedValue = DrM("CveProveedor") @@ -1584,11 +1640,11 @@ Partial Class ContabilidadC_RegPrePoliza 'dr("IdCuenta") = DdlCtaContable.SelectedValue - 'If DdlCtaContable.SelectedValue.ToEntero > 0 Then + 'If DdlCtaContable.SelectedValue.ToEntero() > 0 Then ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) ' If drr IsNot Nothing Then - ' CodigoCuenta = drr("CuentaFormato").ToString() - ' NombreCuenta = drr("Nombre").ToString() + ' CodigoCuenta = drr("CuentaFormato").Tostring() + ' NombreCuenta = drr("Nombre").Tostring() ' End If 'End If @@ -1603,15 +1659,15 @@ Partial Class ContabilidadC_RegPrePoliza 'dr("Abono") = TxtAbono.Text.ToDouble 'dr("Descripcion") = TxtDescripcion.Text 'dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero + 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero() + 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero() + 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero() 'dr("CveClasificacion") = -1 - 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero() + 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero() - 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).Tostring().FormatoNumero + 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).Tostring().FormatoNumero 'DtMovimientos.Rows.Add(dr) 'If CvePrePoliza > 0 Then @@ -1653,7 +1709,7 @@ Partial Class ContabilidadC_RegPrePoliza ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) End If - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime) Then + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then Alert(String.Format("Prepóliza contabilizada.

    Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) Else @@ -1685,7 +1741,7 @@ Partial Class ContabilidadC_RegPrePoliza Str.AppendFormat("No se genero complemento por el siguiente motivo: {0}", Banco.Mensaje) End If Banco.Dispose() - Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") + Alert(Str.ToString(), TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") End Sub Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True) @@ -1724,6 +1780,239 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs) GeneraTimbre(CvePrePoliza) End Sub + + Protected Sub LnkImprimirPDF_Click(sender As Object, e As EventArgs) + Dim filtro() As String = {"CveCompra", "CveIE", "CveConceptoContable"} + Dim filtroComplemento() As String = {"CveIE"} + Dim Pathpdf As New List(Of String) + Dim pdfs = New List(Of Byte()) + Dim Path As String + Dim dt As DataTable = DtMovimientos.FiltraParametros("", "", filtro) + Dim ObjCompra As New ClsCompras + Dim ObjIE As New ClsBancos() + Dim pathPoliza As String = "" + Dim TieneComprobante As Boolean + + Try + TieneComprobante = VerificarComprobante() + If TieneComprobante Then + + Path = ImprimirPolizaPDF(IdPoliza) + pathPoliza = Path + If File.Exists(Path) Then + Pathpdf.Add(Path) + End If + + For Each Row As DataRow In dt.Rows + If Row("CveConceptoContable").ToString().ToEntero() = 30 Then + If Row("CveIE").ToString().ToEntero() > 0 Then + If ObjIE.GetBancosIE(Row("CveIE").ToString().ToEntero(), UsuarioActual.CveEmpresa) Then + If ObjIE.DtResultados.Rows.Count > 0 Then + Path = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ObjIE.Comprobante.ToString()) + If File.Exists(Path) Then + Dim formato As String = System.IO.Path.GetExtension(Path) + If formato.ToLower.Contiene(".jpg", ".png", ".jpeg") Then + Dim ComprobantePDF As String = String.Format("{0}\{1}\comprobante.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick) + Using crea_archivo = New iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 18, 18, 18, 18) + PdfWriter.GetInstance(crea_archivo, New FileStream(ComprobantePDF, FileMode.Create)) + crea_archivo.Open() + Dim image As iTextSharp.text.Image = iTextSharp.text.Image.GetInstance(Path) + If image.Height > image.Width Then + Dim percentage As Double = 0.0F + percentage = 700 / image.Height + image.ScalePercent(percentage * 100) + Else + Dim percentage As Double = 0.0F + percentage = 540 / image.Width + image.ScalePercent(percentage * 100) + End If + crea_archivo.Add(image) + End Using + Pathpdf.Add(ComprobantePDF) + Else + Pathpdf.Add(Path) + End If + End If + End If + End If + End If + End If + If Row("CveConceptoContable").ToString().ToEntero().Contiene(17, 309, 312, 308) Then + If ObjCompra.GetCompras(Row("CveCompra").ToString().ToEntero(), "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then + If ObjCompra.DtResultados IsNot Nothing AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then + Dim dr As DataRow = ObjCompra.DtResultados.Rows(0) + Dim RFC As String = dr("RFC").ToString() + Dim CveFactura As String = dr("CveFactura").ToString() + Path = String.Format("{0}Compras\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, RFC, CveFactura) + If File.Exists(Path) Then + + Pathpdf.Add(Path) + End If + End If + End If + End If + Next + + + dt = DtMovimientos.FiltraParametros("", "", filtroComplemento) + For Each Row As DataRow In dt.Rows + If ObjCompra.GetCompraComplementoPago(-1, UsuarioActual.CveEmpresa, Row("CveIE").ToString().ToEntero()) Then + Console.WriteLine(Row("CveIE").ToString()) + If ObjCompra.DtResultados IsNot Nothing AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then + Dim dr As DataRow = ObjCompra.DtResultados.Rows(0) + Dim RFC As String = dr("RFCde").ToString() + Dim CveFactura As String = dr("CveFactura").ToString() + Console.WriteLine(RFC & CveFactura) + If CveFactura <> "" Then + Path = String.Format("{0}Compras\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, RFC, CveFactura) + Console.WriteLine(Path) + If File.Exists(Path) Then + Pathpdf.Add(Path) + End If + End If + End If + End If + Next + + MergePdfFiles(Pathpdf.ToArray) + If File.Exists(pathPoliza) Then + Directory.Delete(String.Format("{0}{1}", AppDomain.CurrentDomain.BaseDirectory, Tick), True) + End If + + Else + Alert("No se tiene cargado comprobante de pago", TipoMensaje.MsgAdvertencia) + End If + + + Catch ex As Exception + Alert("Error al descargar el paquete", TipoMensaje.MsgError) + End Try + ObjCompra.Dispose() + ObjIE.Dispose() + End Sub + Private Function ImprimirPolizaPDF(IdPoliza As Integer) As String + Dim ObjConta As New ClsContabilidad + 'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa) + + Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) + Dim params As New List(Of ReportParameter) + Dim Bytes As Byte() = Nothing + + + 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then + If ObjConta.GetPrePolizasDetalle(CvePrePoliza) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then + Dim dtVC As DataTable + Dim dr As DataRow + dtVC = ObjConta.DtResultados + dr = dtVC.Rows(0) + Dim ruta As String = "" + params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString())) + params.Add(New ReportParameter("Finicio", dr("Fecha").ToString().ToDate().ToShortDateString)) + params.Add(New ReportParameter("FFin", dr("Fecha").ToString().ToDate().ToShortDateString)) + params.Add(New ReportParameter("Fecha", dr("Fecha").ToString().ToDate().ToShortDateString)) + 'params.Add(New ReportParameter("Nombre", dr("Cuenta").Tostring())) + 'params.Add(New ReportParameter("Cuenta", dr("Codigo").Tostring())) + params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString())) + params.Add(New ReportParameter("Moneda", "")) + params.Add(New ReportParameter("CodigoPostal", "")) + If UsuarioActual.CveEmpresa = 119 Then + params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("CveUsuario").ToString().ToEntero()).FiltroPrimeroValor("Nombre"))) + End If + If Archivo.Exists Then + ruta = UsuarioActual.Empresa.Ruta & "Formatos/Polizas.rdlc" + Else + ruta = "Empresas/Grales/Formatos/Polizas.rdlc" + End If + Bytes = StreamPDF(ruta, dtVC, params, "ppoliza") + If Not File.Exists(String.Format("{0}{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString())) Then + DirectoryExistsCreate(String.Format("{0}{1}", AppDomain.CurrentDomain.BaseDirectory, Tick)) + File.WriteAllBytes(String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString()), Bytes) + End If + End If + Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString()) + ObjConta.Dispose() + + End Function + Private Sub MergePdfFiles(ByVal pdfFiles() As String) + Dim result As Boolean = False + Dim pdfCount As Integer = 0 + Dim f As Integer = 0 + Dim fileName As String + Dim reader As iTextSharp.text.pdf.PdfReader = Nothing + Dim pageCount As Integer = 0 + Dim pdfDoc As iTextSharp.text.Document = Nothing + Dim writer As PdfWriter = Nothing + Dim cb As PdfContentByte = Nothing + + Dim page As PdfImportedPage = Nothing + Dim rotation As Integer = 0 + + + Try + pdfCount = pdfFiles.Length + If pdfCount > 0 Then + fileName = pdfFiles(f) + reader = New iTextSharp.text.pdf.PdfReader(fileName) + pageCount = reader.NumberOfPages + pdfDoc = New iTextSharp.text.Document(reader.GetPageSizeWithRotation(1), 18, 18, 18, 18) + writer = PdfWriter.GetInstance(pdfDoc, New FileStream(String.Format("{0}\{1}\{2}-{3}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, TipoPoliza, Folio), FileMode.Create)) + + With pdfDoc + .Open() + End With + cb = writer.DirectContent + While f < pdfCount + Dim i As Integer = 0 + While i < pageCount + i += 1 + pdfDoc.SetPageSize(reader.GetPageSizeWithRotation(i)) + pdfDoc.NewPage() + page = writer.GetImportedPage(reader, i) + rotation = reader.GetPageRotation(i) + If rotation = 90 Then + cb.AddTemplate(page, 0, -1.0F, 1.0F, 0, 0, reader.GetPageSizeWithRotation(i).Height) + ElseIf rotation = 270 Then + cb.AddTemplate(page, 0, 1.0F, -1.0F, 0, reader.GetPageSizeWithRotation(i).Width + 60, -30) + Else + cb.AddTemplate(page, 1.0F, 0, 0, 1.0F, 0, 0) + End If + End While + f += 1 + If f < pdfCount Then + fileName = pdfFiles(f) + reader = New iTextSharp.text.pdf.PdfReader(fileName) + pageCount = reader.NumberOfPages + End If + End While + + + pdfDoc.Close() + + Dim Archivo As New System.IO.FileInfo(String.Format("{0}\{1}\{2}-{3}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, TipoPoliza, Folio)) + + If Archivo.Exists Then + HttpContext.Current.Response.Clear() + HttpContext.Current.Response.ClearContent() + HttpContext.Current.Response.ContentType = "application/octet-stream" + HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name)) + HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) + HttpContext.Current.Response.TransmitFile(String.Format("{0}\{1}\{2}-{3}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, TipoPoliza, Folio)) + Response.Flush() ' send it to the client to download + HttpContext.Current.Response.SuppressContent = True + HttpContext.Current.ApplicationInstance.CompleteRequest() + Response.End() + + End If + result = True + End If + Catch ex As Exception + End Try + + + + End Sub + #End Region @@ -1731,10 +2020,10 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub DdlProveedores_SelectedIndexChanged1(sender As Object, e As EventArgs) Dim ddl As DropDownList = CType(sender, DropDownList) Dim ddl2 As DropDownList = DirectCast(ddl.BindingContainer, GridViewRow).FCDropDownList("DdlCompras") - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then - CargaNotasCreditoCompras(ddl.SelectedValue.ToEntero, ddl2) + If DdlConceptosContables.SelectedValue.ToEntero().Contiene(18, 60) Then + CargaNotasCreditoCompras(ddl.SelectedValue.ToEntero(), ddl2) Else - CargaCompras2(ddl.SelectedValue.ToEntero, ddl2) + CargaCompras2(ddl.SelectedValue.ToEntero(), ddl2) End If End Sub @@ -1777,9 +2066,9 @@ Partial Class ContabilidadC_RegPrePoliza Dim NombreArchivo As String SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) Dim workbook As New ExcelFile() - Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString) + Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString()) - Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero + Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero() Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") Dim DtExcel As DataTable = (From row As DataRow In Dt.Rows @@ -1794,8 +2083,8 @@ Partial Class ContabilidadC_RegPrePoliza .Concepto = "", .SubProyecto = row.Item("SubProyecto"), .CveConceptoContable = row.Item("CveConcepto"), - .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1), - .IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1) + .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString().ToEntero() > 0, row.Item("CveSubProyecto"), -1), + .IdCtaContable = IIf(row.Item("IdCtaContable").ToString().ToEntero() > 0, row.Item("IdCtaContable"), -1) }).QueryToDataTable(True) worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With @@ -1814,7 +2103,7 @@ Partial Class ContabilidadC_RegPrePoliza worksheet.Columns("K").Hidden = True - NombreArchivo = DdlPlantilla2.SelectedItem.Text.ToString + NombreArchivo = DdlPlantilla2.SelectedItem.Text.ToString() workbook.Save(Response, $"{NombreArchivo}.xlsx", SaveOptions.XlsxDefault) @@ -1894,26 +2183,26 @@ Partial Class ContabilidadC_RegPrePoliza Dim TotalAbonos As Integer = 0 - CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/RegPrePolizaExcel", DdlPlantilla2.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, DdlPlantilla2.SelectedItem.Text.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) + CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/RegPrePolizaExcel", DdlPlantilla2.SelectedValue.ToEntero(), TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate(), DdlPlantilla2.SelectedItem.Text.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero()) For Each Row As DataRow In dt.Rows - NombreCuenta = Row("NombreCuenta").ToString - Cuenta = Row("Cuenta").ToString + NombreCuenta = Row("NombreCuenta").ToString() + Cuenta = Row("Cuenta").ToString() - Dim Importe As Decimal = If(Row("Cargo").ToString.ToDecimal <> 0, Row("Cargo").ToString.ToDecimal, Row("Abono").ToString.ToDecimal) - Dim Concepto As String = Row("Concepto").ToString - Dim Referencia As String = Row("Referencia").ToString + Dim Importe As Decimal = If(Row("Cargo").ToString().ToDecimal() <> 0, Row("Cargo").ToString().ToDecimal(), Row("Abono").ToString().ToDecimal()) + Dim Concepto As String = Row("Concepto").ToString() + Dim Referencia As String = Row("Referencia").ToString() Dim IdCuenta As Integer = -1 - Dim CveSubProyecto As Integer = Row("CveSubProyecto").ToString.ToEntero - Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) + Dim CveSubProyecto As Integer = Row("CveSubProyecto").ToString().ToEntero() + Dim TipoMovto As Boolean = If(Row("Cargo").ToString().ToDecimal() <> 0, False, True) Dim YaExiste As Boolean = False - Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString.ToEntero - Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero + Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString().ToEntero() + Dim IdCtaContable As Integer = Row("IdCtaContable").ToString().ToEntero() If ObjConta.GetCuentas(-1, Cuenta.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then - IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero + IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero() 'TipoCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Tipo") Else Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe}
    ") @@ -1932,7 +2221,7 @@ Partial Class ContabilidadC_RegPrePoliza If YaExiste = False Then If IdCuenta > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate, IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate(), IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then TieneError = True Exit For End If @@ -1945,12 +2234,12 @@ Partial Class ContabilidadC_RegPrePoliza Next If Not TieneError Then ObjConta.Commit() - Alert(String.Format("

    Prepóliza: {1}", CvePrePoliza, ObjConta.ContaFolio)) + Alert(String.Format("

    Prepóliza: {1}", CvePrePoliza, ObjConta.ContaFolio)) Alert($"Se agregó la póliza {ObjConta.ContaFolio}") Else - Alert($"No encontraron las siguientes cuentas: {Reporte.ToString} ", TipoMensaje.MsgError) + Alert($"No encontraron las siguientes cuentas: {Reporte.ToString()} ", TipoMensaje.MsgError) ObjConta.RollBack() End If @@ -2014,5 +2303,72 @@ Partial Class ContabilidadC_RegPrePoliza Return dataTable End Function + + Protected Sub BtnGuardarArchivo_Click(sender As Object, e As EventArgs) Handles BtnGuardarArchivo.Click + Dim ObjIE As New ClsBancos + Dim Comprobante As String = "" + + Dim Filesgral As List(Of Archivo) = TxtCargarArchivo.getfiles().Archivos + If Filesgral.Count > 0 Then + Dim fileItem As Archivo = Filesgral(0) + Dim Path As String = HttpContext.Current.Request.ApplicationPath + Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + + Path = Extensiones.DirectorioBaseEmpresas + Path += String.Format("Empresas/{0}/IE", UsuarioActual.CveEmpresa) + + + + If Not Directory.Exists(Path) Then + Directory.CreateDirectory(Path) + End If + Path += $"/{CveIE}.{Comprobante}" + If File.Exists(Path) Then + File.Delete(Path) + End If + My.Computer.FileSystem.MoveFile(fileItem.FileUrl, Path) + End If + TxtCargarArchivo.Text = "" + RegistraScript("$('#ModalUpload').modal('hide')", "hidemodal1") + + If ObjIE.UpdateComprobanteIE(Comprobante.Replace("."c, ""), CveIE) Then + Alert("El Comprobante se guardo exitosamente.", TipoMensaje.MsgInformacion) + End If + + ObjIE.Dispose() + + End Sub + + Private Function VerificarComprobante() As Boolean + Dim filtro() As String = {"CveCompra", "CveIE", "CveConceptoContable"} + Dim Path As String + Dim dt As DataTable = DtMovimientos.FiltraParametros("", "", filtro) + Dim ObjIE As New ClsBancos() + Dim TieneComprobante As Boolean = False + + For Each Row As DataRow In dt.FiltraParametros("CveConceptoContable = 30").Rows + + If ObjIE.GetBancosIE(Row("CveIE").ToString().ToEntero(), UsuarioActual.CveEmpresa) Then + If ObjIE.DtResultados.Rows.Count > 0 Then + Path = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ObjIE.Comprobante.ToString()) + If File.Exists(Path) Then + TieneComprobante = True + Exit For + Else + TieneComprobante = False + Exit For + End If + Else + TieneComprobante = False + Exit For + End If + End If + + Next + ObjIE.Dispose() + Return TieneComprobante + + End Function + End Class diff --git a/Empresas/119/Formatos/Nomina.rdlc b/Empresas/119/Formatos/Nomina.rdlc index 84d07c8ba..e631698bf 100644 --- a/Empresas/119/Formatos/Nomina.rdlc +++ b/Empresas/119/Formatos/Nomina.rdlc @@ -656,7 +656,7 @@ DsOC - 7.70215cm + 7.96673cm 0.15979cm 2.05138cm 10.0953cm @@ -1234,7 +1234,7 @@ DataSet1 - 7.70435cm + 7.96893cm 10.2551cm 2.05606cm 9.79494cm @@ -1333,7 +1333,7 @@ Lugar de expedición: 83220 Hermosillo Textbox2 0.12976cm 4.80311cm - 2.24428cm + 2.1513cm 8.10317cm 2 + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!SubProyecto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + 0.49417cm @@ -5279,13 +5509,14 @@ Lugar de expedición: 83220 Hermosillo + DsOC - 2.51578cm + 2.33057cm 0.15979cm - 5.0304cm - 19.84967cm + 5.44519cm + 19.84968cm 9 - 18.41425cm + 18.46717cm - 10 + 12 @@ -167,6 +173,8 @@ + + @@ -182,7 +190,9 @@ RECIBO DE NOMINA - - 2 + 3 + @@ -213,7 +224,9 @@ - - 4 + 5 + @@ -276,11 +292,16 @@ - - - Textbox209 @@ -294,40 +315,10 @@ 2pt + 3 - - - - true - true - - - - - - - - - Textbox210 - - - 2pt - 2pt - 2pt - 2pt - - - 2 - - + @@ -344,7 +335,9 @@ - + 4 - - - - true - true - - - - - - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - + + + @@ -446,7 +375,9 @@ - - 4 + 5 + @@ -486,7 +418,9 @@ - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - 2 - - - - - - + true true @@ -629,208 +531,21 @@ =Parameters!Codigo.Value - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Días Trabajados - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Parameters!DiasLaborados.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - Sueldo Correspondiente - - Black - 1pt 2pt 2pt @@ -838,13 +553,42 @@ 2pt - 2 - - + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + true true @@ -852,7 +596,9 @@ =Parameters!NombreCompleto.Value - - 3 + 2 + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + R.F.C + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + - + true true - - @@ -905,108 +778,25 @@ - + true true - Faltas - - - Textbox46 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Parameters!DiasFaltados.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - @@ -1022,8 +812,10 @@ 2pt + 2 + @@ -1031,21 +823,29 @@ - + true true - R.F.C. - + + + =Parameters!SubProyecto.Value + @@ -1061,37 +861,6 @@ 2pt - 2 - - - - - - - true - true - - - - - =Parameters!RFC.Value - - - 2pt - 2pt - 2pt - 2pt - - 3 @@ -1099,50 +868,31 @@ - + true true - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - Retardos - - - Textbox170 + Textbox29 @@ -1153,176 +903,13 @@ 2pt - - - - - - true - true - - - - - =Parameters!DiasRetardos.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - CURP - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - 2 - - true - true - - - - - =Parameters!CURP.Value - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - + true true @@ -1330,13 +917,15 @@ - @@ -1351,21 +940,25 @@ - + true true - Días Vacaciones - - - Textbox161 + Textbox177 @@ -1380,36 +973,7 @@ - - true - true - - - - - =Parameters!DiasVacaciones.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - + true true @@ -1417,13 +981,15 @@ - @@ -1436,81 +1002,6 @@ - - - - true - true - - - - - - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - Tipo de Pago - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - 2 - - - @@ -1521,7 +1012,9 @@ =Parameters!TipoPeriodo.Value - - 3 - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Días Incapacidad - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Parameters!DiasIncapacidad.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - Afi I.M.S.S. - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - 2 - - - - - - - true - true - - - - - =Parameters!NSS.Value - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Periodo de - - - 2pt - 2pt - 2pt - 2pt - - - - - - - + true true @@ -1834,29 +1043,35 @@ =Parameters!FechaInicio.Value - al - =Parameters!FechaFin.Value - - - Textbox187 + Textbox39 - Black - 1pt 2pt 2pt @@ -1871,534 +1086,6 @@ - - 0.6cm - - - - - true - true - - - - - - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - 2 - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha de Pago - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Parameters!FechaPago.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - 0.6cm @@ -2451,13 +1138,15 @@ 2pt - 5 + 7 + + @@ -2524,7 +1213,9 @@ Concepto - - 2 + 3 + @@ -2567,7 +1259,9 @@ - + 2 + @@ -2678,7 +1378,9 @@ Concepto - 1pt - 2pt - 2pt - 2pt - 2pt + 1pt + 1pt + 1pt + 1pt - + true true @@ -2866,27 +1576,30 @@ =Fields!ConceptoP.Value - - 2pt - 2pt - 2pt - 2pt + 1pt + 1pt + 1pt + 1pt - 2 + 3 + @@ -2897,7 +1610,9 @@ =IIf(not IsNothing(Fields!ConceptoP.Value) ORELSE Fields!ImporteP.Value >0,"$",Nothing) - @@ -2949,8 +1665,10 @@ 2pt + 2 + @@ -2961,7 +1679,9 @@ =Fields!NoConceptoD.Value - @@ -3088,7 +1813,7 @@ - 1.39375cm + 0.30896cm @@ -3100,7 +1825,9 @@ - + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -3134,7 +1892,9 @@ - + + + + + + Textbox229 + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -3254,7 +2053,9 @@ - + + + + + + Textbox102 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + @@ -3462,7 +2316,9 @@ Total Percepciones - @@ -3577,8 +2436,10 @@ 2pt + 2 + @@ -3589,7 +2450,9 @@ - @@ -3758,7 +2626,7 @@ - 0.6cm + 0.36187cm @@ -3770,7 +2638,9 @@ - + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -3799,7 +2700,9 @@ - + + + + + + Textbox241 + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -3919,7 +2861,9 @@ - @@ -4095,7 +3046,7 @@ - 0.6cm + 0.52062cm @@ -4106,8 +3057,10 @@ - - - 10 + 12 @@ -4136,10 +3089,12 @@ + + - 0.6cm + 0.54708cm @@ -4150,8 +3105,10 @@ - Recibí de la empresa arriba mencionada, la cantidad neta a que este documento se refiere, estando conforme con las - - 10 + 12 @@ -4180,10 +3137,60 @@ + + - 0.6cm + 0.46771cm + + + + + true + true + + + + + se refiere, estando conforme con las + + + + + + 2pt + 2pt + 2pt + 2pt + + + 12 + + + + + + + + + + + + + + + + + 0.46771cm @@ -4194,8 +3201,10 @@ - Percepciones y deducciones que en el aparecen a la fecha [@Empresa] no me adeuda - - 10 + 12 @@ -4224,10 +3233,12 @@ + + - 0.6cm + 0.52062cm @@ -4238,8 +3249,10 @@ - cantidad alguna por concepto de sueldos, ni ningun otro concepto analogo. - - 10 + 12 @@ -4268,10 +3281,12 @@ + + - 1.2cm + 0.98834cm @@ -4302,6 +3317,35 @@ + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -4424,7 +3468,7 @@ - + true true @@ -4435,6 +3479,39 @@ + + + Textbox243 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -4739,7 +3853,7 @@ - + true true @@ -4750,6 +3864,39 @@ + + + Textbox244 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + - Textbox298 @@ -4807,7 +3958,9 @@ - @@ -4974,13 +4116,13 @@ - 5.98179in + 3.76337in - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Parameters!SubProyecto.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - 2 - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - 0.49417cm @@ -5509,14 +5279,13 @@ Lugar de expedición: 83220 Hermosillo - DsOC - 2.33057cm + 2.51578cm 0.15979cm - 5.44519cm - 19.84968cm + 5.0304cm + 19.84967cm 9 - 18.46717cm + 18.41425cm - 12 + 10 @@ -173,8 +167,6 @@ - - @@ -190,9 +182,7 @@ RECIBO DE NOMINA - + - 3 + 2 - @@ -224,9 +213,7 @@ - + + + - 5 + 4 - @@ -292,16 +276,11 @@ - - + + + - 3 - + + + + true + true + + + + + + + + + Textbox210 + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + @@ -335,9 +344,7 @@ - + - 4 - - - + + + + true + true + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + @@ -375,9 +446,7 @@ - + - 5 + 4 - @@ -418,9 +486,7 @@ - + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + true true @@ -531,9 +629,7 @@ =Parameters!Codigo.Value - + - - - 2pt 2pt 2pt 2pt + 3 + + - + true true @@ -565,15 +661,13 @@ - + @@ -588,7 +682,169 @@ - + + true + true + + + + + Días Trabajados + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!DiasLaborados.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Sueldo Correspondiente + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + true true @@ -596,9 +852,7 @@ =Parameters!NombreCompleto.Value - + - 2 + 3 - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - R.F.C - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - 2 - - - + true true - Afi I.M.S.S. - + + @@ -778,25 +905,108 @@ - + true true - =Parameters!NSS.Value - + Faltas + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!DiasFaltados.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + @@ -812,10 +1022,8 @@ 2pt - 2 - @@ -823,29 +1031,21 @@ - + true true - Departamento - - - - =Parameters!SubProyecto.Value - + R.F.C. + @@ -861,6 +1061,37 @@ 2pt + 2 + + + + + + + true + true + + + + + =Parameters!RFC.Value + + + 2pt + 2pt + 2pt + 2pt + + 3 @@ -868,31 +1099,21 @@ - + true true - Dias Trab. - - - - =Parameters!DiasLaborados.Value - + + + @@ -903,13 +1124,205 @@ 2pt + + + + + + true + true + + + + + Retardos + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!DiasRetardos.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + CURP + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + 2 - + + true + true + + + + + =Parameters!CURP.Value + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + true true @@ -917,15 +1330,13 @@ - + @@ -940,25 +1351,21 @@ - + true true - Periodo - + Días Vacaciones + + @@ -973,23 +1380,21 @@ - + true true - - + =Parameters!DiasVacaciones.Value + @@ -1002,6 +1407,110 @@ + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Tipo de Pago + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + @@ -1012,9 +1521,7 @@ =Parameters!TipoPeriodo.Value - + + 3 + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + - + + true + true + + + + + Días Incapacidad + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!DiasIncapacidad.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Afi I.M.S.S. + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Parameters!NSS.Value + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Periodo de + + + 2pt + 2pt + 2pt + 2pt + + + + + + + true true @@ -1043,35 +1834,29 @@ =Parameters!FechaInicio.Value - + + + + + Black + 1pt 2pt 2pt @@ -1086,6 +1871,534 @@ + + 0.6cm + + + + + true + true + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha de Pago + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!FechaPago.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + 0.6cm @@ -1138,15 +2451,13 @@ 2pt - 7 + 5 - - @@ -1213,9 +2524,7 @@ Concepto - + - 3 + 2 - @@ -1259,9 +2567,7 @@ - + + + - 2 - @@ -1378,9 +2678,7 @@ Concepto - + + + + + 1pt - 1pt - 1pt - 1pt - 1pt + 2pt + 2pt + 2pt + 2pt - + true true @@ -1576,30 +2866,27 @@ =Fields!ConceptoP.Value - + - 1pt - 1pt - 1pt - 1pt + 2pt + 2pt + 2pt + 2pt - 3 + 2 - @@ -1610,9 +2897,7 @@ =IIf(not IsNothing(Fields!ConceptoP.Value) ORELSE Fields!ImporteP.Value >0,"$",Nothing) - + @@ -1665,10 +2949,8 @@ 2pt - 2 - @@ -1679,9 +2961,7 @@ =Fields!NoConceptoD.Value - + + + @@ -1813,7 +3088,7 @@ - 0.30896cm + 1.39375cm @@ -1825,9 +3100,7 @@ - + - - - - - 2pt - 2pt - 2pt - 2pt - - - - @@ -1892,9 +3134,7 @@ - + + + + - - - - - - Textbox229 - - - 2pt - 2pt - 2pt - 2pt - - - - @@ -2053,9 +3254,7 @@ - + + + + + + - - - - - - Textbox102 - - - - Black - - 1pt - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - @@ -2316,9 +3462,7 @@ Total Percepciones - + + @@ -2436,10 +3577,8 @@ 2pt - 2 - @@ -2450,9 +3589,7 @@ - + + + @@ -2626,7 +3758,7 @@ - 0.36187cm + 0.6cm @@ -2638,9 +3770,7 @@ - + - - - - - 2pt - 2pt - 2pt - 2pt - - - - @@ -2700,9 +3799,7 @@ - + + + + - - - - - - Textbox241 - - - 2pt - 2pt - 2pt - 2pt - - - - @@ -2861,9 +3919,7 @@ - + + + + @@ -3046,7 +4095,7 @@ - 0.52062cm + 0.6cm @@ -3057,10 +4106,8 @@ - Recibí de la empresa arriba mencionada, - + + - 12 + 10 @@ -3089,12 +4136,10 @@ - - - 0.54708cm + 0.6cm @@ -3105,10 +4150,8 @@ - la cantidad neta a que este documento - + Recibí de la empresa arriba mencionada, la cantidad neta a que este documento se refiere, estando conforme con las + - 12 + 10 @@ -3137,60 +4180,10 @@ - - - 0.46771cm - - - - - true - true - - - - - se refiere, estando conforme con las - - - - - - 2pt - 2pt - 2pt - 2pt - - - 12 - - - - - - - - - - - - - - - - - 0.46771cm + 0.6cm @@ -3201,10 +4194,8 @@ - Percepciones y deducciones que en el - + Percepciones y deducciones que en el aparecen a la fecha [@Empresa] no me adeuda + - 12 + 10 @@ -3233,12 +4224,10 @@ - - - 0.52062cm + 0.6cm @@ -3249,10 +4238,8 @@ - aparecen especificados. - + cantidad alguna por concepto de sueldos, ni ningun otro concepto analogo. + - 12 + 10 @@ -3281,12 +4268,10 @@ - - - 0.98834cm + 1.2cm @@ -3317,35 +4302,6 @@ - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - @@ -3466,37 +4422,6 @@ - - - - true - true - - - - - - - - - Textbox243 - - - 2pt - 2pt - 2pt - 2pt - - - - @@ -3507,9 +4432,7 @@ - + + + + + - - 2pt - 2pt - 2pt - 2pt - - - - @@ -3851,37 +4737,6 @@ - - - - true - true - - - - - - - - - Textbox244 - - - 2pt - 2pt - 2pt - 2pt - - - - @@ -3892,9 +4747,7 @@ - + + + + + @@ -4116,13 +4974,13 @@ - 3.76337in + 5.98179in @@ -88,7 +88,7 @@ - + @@ -117,24 +117,9 @@ - + - - - - - - - - - - - - - - - - + diff --git a/RH/CalculoSBC.aspx.cs b/RH/CalculoSBC.aspx.cs index c715eed04..cddcad81f 100644 --- a/RH/CalculoSBC.aspx.cs +++ b/RH/CalculoSBC.aspx.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Web; using System.Web.UI; @@ -27,12 +28,12 @@ public partial class RH_CalculoSBC : ClsPaginas { 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)) { GVCalculosSBC.DataSource = objnom.DTSetResultados.Tables[0]; GVCFija.DataSource = objnom.DTSetResultados.Tables[0]; GVPV.DataSource = objnom.DTSetResultados.Tables[0]; - if(objnom.DTSetResultados.Tables.Count > 0) + if (objnom.DTSetResultados.Tables.Count >1) { GVDetalleParteVariable.DataSource = objnom.DTSetResultados.Tables[1]; GVDetalleParteVariable.DataBind(); @@ -75,8 +76,8 @@ public partial class RH_CalculoSBC : ClsPaginas //} foreach (GridViewRow item in GVCalculosSBC.Rows) { - double SalarioDiarioSSNuevo =Math.Round( item.DataKey("SalarioDiarioSSNuevo").ToDouble(),2); - double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(),2); + double SalarioDiarioSSNuevo = Math.Round(item.DataKey("SalarioDiarioSSNuevo").ToDouble(), 2); + double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2); if (SalarioDiarioSSNuevo != SalarioDiarioSS) { MovtosmodSalario = string.Format("{0}{1}{2}", MovtosmodSalario, concater, item.DataKey("Movtotxt")); @@ -113,9 +114,9 @@ public partial class RH_CalculoSBC : ClsPaginas int CvePersonal = item.DataKey("CvePersonal").ToEntero();//,,, double SalarioDiario = item.DataKey("SalarioDiario").ToDouble(); double SDINuevo = item.DataKey("SDINuevo").ToDouble(); - double SalarioDiarioSSNuevo = Math.Round(item.DataKey("SalarioDiarioSSNuevo").ToDouble(),2); + double SalarioDiarioSSNuevo = Math.Round(item.DataKey("SalarioDiarioSSNuevo").ToDouble(), 2); double SalarioVariableNuevo = item.DataKey("SalarioVariableNuevo").ToDouble(); - double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(),2); + double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2); if (continuar && SalarioDiarioSSNuevo != SalarioDiarioSS && (continuar = objrh.UpdateSalarios(CvePersonal, fecha, UsuarioActual.CveEmpresa, SalarioDiario, SDINuevo, SalarioDiarioSSNuevo, SalarioDiario))) { @@ -141,22 +142,118 @@ public partial class RH_CalculoSBC : ClsPaginas protected void LnkDescargar_Click(object sender, EventArgs e) { - if (Tab.ActiveTab == TabSBC) + DataTable dt = GVToDT(GVCalculosSBC,"Salario"); + DataTable dtPF = GVToDT(GVCFija, "Parte fija"); + DataTable dtPV = GVToDT(GVPV, "Parte variable"); + DataTable dtPVD = GVToDT(GVDetalleParteVariable, "Detalle parte variable"); + + ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook(); + var libro = wb.AddWorksheet(dt); + var libroPF = wb.AddWorksheet(dtPF); + var libroPV = wb.AddWorksheet(dtPV); + var libroPVD = wb.AddWorksheet(dtPVD); + libro.ColumnsUsed().AdjustToContents(); + libroPF.ColumnsUsed().AdjustToContents(); + libroPV.ColumnsUsed().AdjustToContents(); + libroPVD.ColumnsUsed().AdjustToContents(); + + + libro.ColumnsUsed().AdjustToContents(); + libro.Row(1).InsertRowsAbove(5); + libro.Range(1, 2, 1, 6).Merge().Value = UsuarioActual.Empresa.Empresa; + libro.Range(2, 2, 2, 6).Merge().Value = $"Reporte de calculo de sbc {TxtFechaPago.Text}."; + libro.Range(1, 2, 2, 6).Style.Font.SetBold(true); + libro.Range(1, 2, 2, 6).Style.Font.SetFontSize(16); + libro.Range(2, 2, 2, 6).Style.Font.SetFontSize(14); + libro.Range(1, 2, 2, 6).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center; + //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, 6, 5, 9).Merge().Value = "Actual"; + libro.Range(5, 10, 5, 12).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, 6, 6, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(128, 100, 162)); + libro.Range(5, 6, 6, 9).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; + libro.Range(5, 10, 6, 12).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(136, 214, 205)); + libro.Range(5, 10, 6, 12).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; + + + libro.Range(7, 6, 7 + dt.Rows.Count, 12).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right; + libro.Range(7, 6, 7+ dt.Rows.Count, 12).Style.NumberFormat.Format = "$##,###,###,0.00"; + + + + System.IO.Stream fs = new System.IO.MemoryStream(); + wb.SaveAs(fs); + fs.Position = 0; + System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(); + using (System.IO.Stream input = fs) + { - GVCalculosSBC.ExportToExcel("Salario"); - } - if (Tab.ActiveTab == TabParteFija) - { - GVCFija.ExportToExcel("Salario"); - } - if (Tab.ActiveTab == TabParteVariable) - { - GVPV.ExportToExcel("Salario"); - } - if (Tab.ActiveTab == TabDetalleParteVariable) - { - GVDetalleParteVariable.ExportToExcel("Salario"); + input.CopyTo(memoryStream); } + memoryStream.Position = 0; + + Response.Clear(); + Response.Buffer = true; + + Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; + Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.xlsx", "Salario")); + Response.BinaryWrite(memoryStream.ToArray()); + Response.End(); + } + public string limpiarcelda( string celdatext) + { + celdatext = celdatext.Replace("
    ", "\r\n").Replace(" ", " "); + while (celdatext.Contains(" ")){ + celdatext = celdatext.Replace(" ", " "); + } + celdatext = celdatext.Replace("\n ", " "); + celdatext = celdatext.Replace("\r ", " "); + + return celdatext; + } + public DataTable GVToDT(GridView GridView, string NombreArchivoXLSX) + { + DataTable dt = new DataTable(NombreArchivoXLSX); + if (GridView != null && GridView.Rows.Count > 0) + { + int i = 0; + List ArrColumnasVisibles = new List(); // solo recorro las columnas visibles + + foreach (TableCell cell in GridView.HeaderRow.Cells) + { + string titulo = HttpUtility.HtmlDecode(Extensiones.ModExtensiones.TextoCelda(cell)).Trim(); + titulo = limpiarcelda( titulo); + if (GridView.Columns[i].Visible && titulo.Length > 0) + { + if (dt.Columns.Contains(titulo)) + titulo = titulo + i; + dt.Columns.Add(titulo); + ArrColumnasVisibles.Add(i); + } + i += 1; + } + i = 0; + + foreach (GridViewRow row in GridView.Rows) + { + dt.Rows.Add(); + i = 0; + foreach (int j in ArrColumnasVisibles) + { + dt.Rows[dt.Rows.Count - 1][i] = limpiarcelda(Extensiones.ModExtensiones.TextoCelda(row.Cells[j]).Replace("
    ", "\r\n")); + i = i + 1; + } + } + } + return dt; + } } \ No newline at end of file diff --git a/RH/CatPersonal.aspx b/RH/CatPersonal.aspx index 7fd4e727e..f6ba72b60 100644 --- a/RH/CatPersonal.aspx +++ b/RH/CatPersonal.aspx @@ -62,6 +62,9 @@
  • Descargar Excel
  • +
  • + Formato saldos iniciales +
  • Personalizar
  • @@ -77,6 +80,7 @@ +
  • diff --git a/RH/CatPersonal.aspx.vb b/RH/CatPersonal.aspx.vb index c915c826e..655ca2973 100644 --- a/RH/CatPersonal.aspx.vb +++ b/RH/CatPersonal.aspx.vb @@ -680,4 +680,366 @@ Partial Class RH_CatPersonal End If End Sub + Protected Sub LnkCargaMasiva_Click(sender As Object, e As EventArgs) + Dim wb As ClosedXML.Excel.XLWorkbook = New ClosedXML.Excel.XLWorkbook() + Dim libro = wb.AddWorksheet("Personal") + Dim crow As Integer = 1 + Dim ccol As Integer = 1 + + Dim colLugarNacimiento As Integer = 1 + Dim rowLugarNacimiento As Integer = 1 + +#Region "Regimen de contratación" + Dim Catalogos = wb.AddWorksheet("Catalogos") + crow = 1 + ccol = 1 + Dim colRegimenContratacion As Integer = 1 + Dim rowRegimenContratacion As Integer = 1 + Catalogos.Cell(crow, ccol).Value = "Regimen de contratación" + For Each row As DataRow In GlobalDTNomSatRegimenContratacion.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveSATRegimenContratacion"), row("RegimenContratacion")) + Next + colRegimenContratacion = ccol + rowRegimenContratacion = crow +#End Region +#Region "Estado civil" + Dim colEstadoCivil As Integer = 1 + Dim rowEstadoCivil As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Estado civil" + For Each row As DataRow In GlobalDTEstadoCivil.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstadoCivil"), row("EstadoCivil")) + Next + colEstadoCivil = ccol + rowEstadoCivil = crow +#End Region +#Region "Escolaridad" + Dim colEscolaridad As Integer = 1 + Dim rowEscolaridad As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Escolaridad" + For Each row As DataRow In GlobalDTEscolaridad.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEscolaridad"), row("Escolaridad")) + Next + colEscolaridad = ccol + rowEscolaridad = crow + +#End Region +#Region "Tipo Periodo" + Dim colTipoPeriodo As Integer = 1 + Dim rowTipoPeriodo As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Tipo Periodo" + For Each row As DataRow In GlobalDTTipoPeriodo.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveTipoPeriodo"), row("TipoPeriodo")) + Next + colTipoPeriodo = ccol + rowTipoPeriodo = crow + +#End Region +#Region "Estatus" + Dim colEstatusPersonal As Integer = 1 + Dim rowEstatusPersonal As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Estatus" + For Each row As DataRow In GlobalDTEstatusPersonal.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstatusPersonal"), row("EstatusPersonal")) + Next + colEstatusPersonal = ccol + rowEstatusPersonal = crow + +#End Region +#Region "Tipo Contratro" + Dim colTipoContrato As Integer = 1 + Dim rowTipoContrato As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Tipo Contratro" + For Each row As DataRow In GlobalDTTiposContrato.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}", row("TipoContrato")) + Next + colTipoContrato = ccol + rowTipoContrato = crow + +#End Region +#Region "Departamento" + Dim colDepartamento As Integer = 1 + Dim rowDepartamento As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Departamento" + For Each row As DataRow In GlobalDTDepartamentos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa).Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveDepartamento"), row("Departamento")) + Next + colDepartamento = ccol + rowDepartamento = crow + +#End Region +#Region "Turno" + Dim colTurno As Integer = 1 + Dim rowTurno As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Turno" + For Each row As DataRow In GlobalDTTurno.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa).Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveTurno"), row("Turno")) + Next + colTurno = ccol + rowTurno = crow + +#End Region +#Region "Puesto" + Dim colPuesto As Integer = 1 + Dim rowPuesto As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Puesto" + For Each row As DataRow In GlobalDTRHPuestos(UsuarioActual.CveEmpresa).Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CvePuesto"), row("Puesto")) + Next + colPuesto = ccol + rowPuesto = crow + +#End Region +#Region "Estado" + Dim colEstado As Integer = 1 + Dim rowEstado As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Estado" + For Each row As DataRow In GlobalDTGralEstados(1).Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstado"), row("Estado")) + Next + colEstado = ccol + rowEstado = crow + +#End Region +#Region "Tipo salario" + + Dim colTipoSalario As Integer = 1 + Dim rowTipoSalario As Integer = 1 + + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Tipo salario" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "1: Salario fijo" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "2: Salario variable" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "3: Salario mixto" + colTipoSalario = ccol + rowTipoSalario = crow + +#End Region +#Region "Genero" + Dim colSexo As Integer = 1 + Dim rowSexo As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Genero" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "1: Masculino" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "2: Femenino" + colSexo = ccol + rowSexo = crow + +#End Region +#Region "Sindicalizado" + Dim colsindicalizado As Integer = 1 + Dim rowsindicalizado As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Sindicalizado" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "1: Sí" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "0: No" + colsindicalizado = ccol + rowsindicalizado = crow + +#End Region +#Region "Area geografica" + Dim colAreaGeografica As Integer = 1 + Dim rowAreaGeografica As Integer = 1 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Area geografica" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "A" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "B" + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = "C" + colAreaGeografica = ccol + rowAreaGeografica = crow + +#End Region +#Region "Metodo pago" + Dim colmetodopago = 0 + Dim rowmetodopago = 0 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "Metodo pago" + For Each row As DataRow In GlobalDTMetodosPago.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveMetodoPago"), row("MetodoPago")) + Next + colmetodopago = ccol + rowmetodopago = crow + +#End Region + +#Region "subproyecto" + Dim colsubproyecto = 0 + Dim rowsubproyecto = 0 + crow = 1 + ccol = ccol + 1 + Catalogos.Cell(crow, ccol).Value = "subproyecto" + Dim dtsubproyecto = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)) + For Each row As DataRow In dtsubproyecto.Rows + crow = crow + 1 + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveSubProyecto"), row("SubProyecto")) + Next + colsubproyecto = ccol + rowsubproyecto = crow + +#End Region + Catalogos.Range(1, 1, 1, ccol).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)) + Catalogos.Range(1, 1, 1, ccol).Style.Font.FontColor = ClosedXML.Excel.XLColor.White + + crow = 1 + ccol = 1 + + libro.Cell(crow, ccol).Value = "Código" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Apellido Paterno" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Apellido Materno" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Nombre" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Correo Electronico" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Fecha Nacimiento" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Sexo" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colSexo, rowSexo, colSexo), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Lugar Nacimiento" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Dirección" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Ciudad" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Estado Civil" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colEstadoCivil, rowEstadoCivil, colEstadoCivil), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Teléfono" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Celular" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "RFC" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "CURP" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Numero SS" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "CLABE" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Fecha Ingreso" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Fecha Baja" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Alta IMSS" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Código Postal" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Estatus Personal" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colEstatusPersonal, rowEstatusPersonal, colEstatusPersonal), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Estado" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colEstado, rowEstado, colEstado), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Nombre Padre" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Nombre Madre" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Puesto" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colPuesto, rowPuesto, colPuesto), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Turno" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colTurno, rowTurno, colTurno), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Tipo Contrato" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colTipoContrato, rowTipoContrato, colTipoContrato), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Departamento" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colDepartamento, rowDepartamento, colDepartamento), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Tipo Periodo" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colTipoPeriodo, rowTipoPeriodo, colTipoPeriodo), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Escolaridad" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colEscolaridad, rowEscolaridad, colEscolaridad), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Salario Diario" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Tipo Salario" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colTipoSalario, rowTipoSalario, colTipoSalario), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Salario variable" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Sindicalizado" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colsindicalizado, rowsindicalizado, colsindicalizado), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "SubProyecto " : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colsubproyecto, rowsubproyecto, colsubproyecto), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "RegimenContratacion" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colRegimenContratacion, rowRegimenContratacion, colRegimenContratacion), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Area Geografica" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colAreaGeografica, rowAreaGeografica, colAreaGeografica), True) : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Prima vacacional" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Dias aguinaldo" : ccol = ccol + 1 + libro.Cell(crow, ccol).Value = "Metodo Pago" : libro.Range(crow + 1, ccol, 50000, ccol).SetDataValidation().List(Catalogos.Range(2, colmetodopago, rowmetodopago, colmetodopago), True) : ccol = ccol + 1 + + + + + libro.Range(crow, 1, crow, ccol - 1).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)) + libro.Range(crow, 1, crow, ccol - 1).Style.Font.FontColor = ClosedXML.Excel.XLColor.White + + Catalogos.ColumnsUsed().AdjustToContents() + libro.ColumnsUsed().AdjustToContents() + 'AreaGeografica ABC + 'GlobalDTMetodosPago MetodoPago" DataValueField="CveMetodoPago + + + Dim fs As System.IO.Stream = New System.IO.MemoryStream() + wb.SaveAs(fs) + fs.Position = 0 + Dim memoryStream As System.IO.MemoryStream = New System.IO.MemoryStream() + + Using input As System.IO.Stream = fs + input.CopyTo(memoryStream) + End Using + + memoryStream.Position = 0 + Response.Clear() + Response.Buffer = True + Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + Response.AddHeader("content-disposition", String.Format("attachment;filename=SaldosInicialesRH.xlsx", "")) + Response.BinaryWrite(memoryStream.ToArray()) + Response.[End]() + 'Using nom As ClsNominas = New ClsNominas() + + ' If nom.ReportedePercepcionesDeduccionesGet(UsuarioActual.CveEmpresa, fechai, fechaf, 4) Then + ' Dim dt As DataTable = nom.DTSetResultados.Tables(0) + ' Dim libro = wb.AddWorksheet(nom.DTSetResultados.Tables(0), "Percepciones y deducciones") + ' libro.Tables.FirstOrDefault().Theme = ClosedXML.Excel.XLTableTheme.None + ' Dim crow As Integer = 1 + + ' For Each item As DataRow In dt.Rows + ' crow += 1 + + ' Select Case item("Grupoid").ToString() + ' Case "10" + ' libro.Range(crow, 1, crow, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(184, 204, 228)) + ' Case "8", "11" + ' libro.Range(crow, 1, crow, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)) + ' libro.Range(crow, 1, crow, 11).Style.Font.FontColor = ClosedXML.Excel.XLColor.White + ' Case "6" + ' libro.Range(crow, 1, crow, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(216, 228, 188)) + ' Case "5", "7" + ' libro.Range(crow, 1, crow, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(155, 187, 89)) + ' libro.Range(crow, 1, crow, 9).Style.Font.FontColor = ClosedXML.Excel.XLColor.White + ' Case "2" + ' Case "1", "3" + ' libro.Range(crow, 1, crow, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(75, 172, 198)) + ' libro.Range(crow, 1, crow, 9).Style.Font.FontColor = ClosedXML.Excel.XLColor.White + ' End Select + ' Next + + ' libro.Range(2, 4, crow, 9).Style.NumberFormat.Format = "$##,###,###,0.00" + ' libro.Range(2, 4, crow, 9).DataType = ClosedXML.Excel.XLDataType.Number + ' libro.Column(1).Delete() + ' libro.ColumnsUsed().AdjustToContents() + ' libro.Row(1).InsertRowsAbove(4) + ' libro.Range(1, 2, 1, 6).Merge().Value = UsuarioActual.Empresa.Empresa + ' libro.Range(2, 2, 2, 6).Merge().Value = $"Reporte de percepciones y deducciones del {fechai} al {fechaf}" + ' libro.Range(1, 2, 2, 6).Style.Font.SetBold(True) + ' libro.Range(1, 2, 2, 6).Style.Font.SetFontSize(16) + ' libro.Range(2, 2, 2, 6).Style.Font.SetFontSize(14) + ' libro.Range(1, 2, 2, 6).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center + ' libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now}" + ' libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now}" + ' End If + 'End Using + End Sub End Class +S \ No newline at end of file diff --git a/RH/DiasFestivos.aspx b/RH/DiasFestivos.aspx new file mode 100644 index 000000000..1be34aea1 --- /dev/null +++ b/RH/DiasFestivos.aspx @@ -0,0 +1,79 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="DiasFestivos.aspx.cs" Inherits="RH_DiasFestivos" %> + + + + + + +Catalogo de días festivos + + + + +
  • días festivos
  • + + + + + + + + + + + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + diff --git a/RH/DiasFestivos.aspx.cs b/RH/DiasFestivos.aspx.cs new file mode 100644 index 000000000..4304fdcd7 --- /dev/null +++ b/RH/DiasFestivos.aspx.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class RH_DiasFestivos : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDiasFestivos(); + } + + } + + + protected void CargaDiasFestivos() + { + ClsRH ObjDias = new ClsRH(); + ObjDias.DiasFestivosGet(UsuarioActual.CveEmpresa ); + GVDiasFestivos.DataSource = ObjDias.DtResultados; + ObjDias.Dispose(); + GVDiasFestivos.DataBind(); + upDatosDias.Update(); + } + protected void LimpiaDiasFestivos() + { + TxtDiasfecha.Text = ""; + UPModalDias.Update(); + } + protected void LnkAgregarDias_Click(object sender, EventArgs e) + { + this.RegistraScript("$('#DModalDiasFestivos').modal();"); + LimpiaDiasFestivos(); + BtnDiasADD.Visible = true; + UPModalDias.Update(); + } + protected void BtnDiasADD_Click(object sender, EventArgs e) + { + + DateTime fecha = TxtDiasfecha.Text.ToDate(); + ClsRH ObjDias = new ClsRH(); + bool Continuar = ObjDias.DiasFestivosAdd(fecha, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario); + ObjDias.Dispose(); + if (Continuar) + { + this.RegistraScript("$('#DModalDiasFestivos').modal('hide');"); + LimpiaDiasFestivos(); + CargaDiasFestivos(); + UPModalDias.Update(); + this.Alert("El dìa festivos se ha agregado"); + } + } + protected void LnkEliminarDias_Click(object sender, EventArgs e) + { + GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + DateTime fecha = gvRow.DataKey("CveDiainabil").ToDateTime(); + ClsRH ObjDias = new ClsRH(); + bool Continuar = ObjDias.DiasFestivosRemove(fecha, UsuarioActual.CveEmpresa); + ObjDias.Dispose(); + if (Continuar) + { + CargaDiasFestivos(); + this.Alert("El dìa festivos se ha Eliminado"); + } + } + + + +} \ No newline at end of file From 900aa1ae2c4e9d096fcbdfdc8d9c671f057b0fbe Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 20 May 2021 19:27:33 -0700 Subject: [PATCH 4/4] Tareas119 Cambio servidor FTP, Proveedores abonar filtros SubProyectos y tipo de contrato --- Bancos/ProveedoresAbonar.aspx | 2 +- Bancos/ProveedoresAbonar.aspx.vb | 7 +++++-- TareasProgramadas/Tareas119.ashx | 9 ++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx index f67afd6b0..32b656103 100644 --- a/Bancos/ProveedoresAbonar.aspx +++ b/Bancos/ProveedoresAbonar.aspx @@ -176,7 +176,7 @@
    - +
    diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index fdf1a13af..9aebbf918 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1938,6 +1938,7 @@ Partial Class Bancos_ProveedoresAbonar End If Case 42 'Acreedores + If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then Dim ObjCreditos As New ClsBancos ObjCreditos.GetTarjetasCreditos(DdlCuenta.SelectedValue.ToEntero, DdlTarjeta.SelectedValue.ToEntero) @@ -1947,10 +1948,12 @@ Partial Class Bancos_ProveedoresAbonar IdCtaContable = IdCuenta End If - ImporteMovimiento = TxtImporte.Text.ToDecimal - importeMX = If(CveMoneda = 2, If(DivTC.Visible, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal * TipoCambioPago, TxtImporte.Text.ToDecimal * TipoCambioPago), TxtImporte.Text.ToDecimal) + Dim Importe42 As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal + ImporteMovimiento = Importe42 + importeMX = If(CveMoneda = 2, If(DivTC.Visible, Importe42 / TxtTC.Text.ToDecimal * TipoCambioPago, Importe42 * TipoCambioPago), Importe42) TipoCambioGeneral = TipoCambioPago End If + Case 30 'Conta ContPAQ If IdCuenta < 1 Then diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index c573d0a37..573054243 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -26,7 +26,7 @@ public class TareasJam : IHttpHandler switch (Metodo) { case "TestConexion": - retorno = PruebaConexionFTP("ftp://us2.hostedftp.com/", "agrojam", "A12345678"); + retorno = PruebaConexionFTP("ftp://thalamus.exavault.com", "agrojam", "A12345678"); break; case "EjecutaThalamus": @@ -112,7 +112,7 @@ public class TareasJam : IHttpHandler //string FTPPass = "agj-3500"; - string FTPServer = "ftp://us2.hostedftp.com"; + string FTPServer = "ftp://thalamus.exavault.com"; string TFPUsr = "agrojam"; string FTPPass = "A12345678"; @@ -375,7 +375,10 @@ public class TareasJam : IHttpHandler ErrorProceso = true; Respuesta = false; } - + + + // ErrorProceso = true; + if (!ErrorProceso) {