Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -171,6 +171,32 @@ Public Class ClsNominas
|
||||
#End Region
|
||||
|
||||
#Region "ClsNominas_Nominas"
|
||||
Public Function AddComprobantesEmitidos(ByVal cveEmpresa As Integer, ByVal folioFiscal As String, ByVal tipoDocto As String, ByVal importeTotal As Decimal, ByVal estatus As Integer, ByVal fecha As String, ByVal moneda As String, ByVal rFCReceptor As String, ByVal rutaXml As String, ByVal rFCEmisor As String, ByVal serie As String, ByVal folio As String) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_Sat_ComprobantesAdd", CommandType.StoredProcedure)
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@cveEmpresa", SqlDbType.Int).Value = cveEmpresa
|
||||
.Add("@folioFiscal", SqlDbType.VarChar).Value = folioFiscal
|
||||
.Add("@tipoDocto", SqlDbType.VarChar).Value = tipoDocto
|
||||
.Add("@importeTotal", SqlDbType.Decimal).Value = importeTotal
|
||||
.Add("@estatus", SqlDbType.Int).Value = estatus
|
||||
.Add("@fecha", SqlDbType.VarChar).Value = fecha
|
||||
.Add("@moneda", SqlDbType.VarChar).Value = moneda
|
||||
.Add("@rFCReceptor", SqlDbType.VarChar).Value = rFCReceptor
|
||||
.Add("@rFCEmisor", SqlDbType.VarChar).Value = rFCEmisor
|
||||
.Add("@rutaXml", SqlDbType.VarChar).Value = rutaXml
|
||||
.Add("@serie", SqlDbType.VarChar).Value = serie
|
||||
.Add("@folio", SqlDbType.VarChar).Value = folio
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al Realizar el calculo del Aguinaldo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetCalculoAguinaldo(ejercicio As Int32, cveEmpresa As Int32, importe As Double, CveTipoPeriodo As Integer, CvePeriodo As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
@@ -1835,7 +1861,32 @@ Public Class ClsNominas
|
||||
#End Region
|
||||
|
||||
|
||||
Public Function AddUPNom_NominasDetalles(CveNomina As Integer, CvePeriodo As Integer, CvePersonal As Integer, CveConcepto As Integer, Importe As Decimal, ImporteGravado As Decimal, ImporteExento As Decimal, CveUsuario As Integer) As Boolean
|
||||
Public Function GetInversionNomina(CveEmpresa As Integer, Optional FechaInicio As String = "", Optional FechaFin As String = "",
|
||||
Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1,
|
||||
Optional Cve1 As Integer = -1, Optional Cve2 As Integer = -1,
|
||||
Optional CveStr1 As String = "-1", Optional CveStr2 As String = "-1") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Nom_InversionNominaGET")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("FechaInicio", SqlDbType.Int).Value = FechaInicio
|
||||
.Add("FechaFin", SqlDbType.Int).Value = FechaFin
|
||||
.Add("CveProyecto", SqlDbType.Int).Value = CveProyecto
|
||||
.Add("CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("Cve1", SqlDbType.Int).Value = Cve1
|
||||
.Add("Cve2", SqlDbType.Int).Value = Cve2
|
||||
.Add("CveStr1", SqlDbType.Int).Value = CveStr1
|
||||
.Add("CveStr2", SqlDbType.Int).Value = CveStr2
|
||||
.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 el reporte de inversión de nomina.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function AddUPNom_NominasDetalles(CveNomina As Integer, CvePeriodo As Integer, CvePersonal As Integer, CveConcepto As Integer, Importe As Decimal, ImporteGravado As Decimal, ImporteExento As Decimal, CveUsuario As Integer, Optional IsEdited As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Nom_NominasDetallesAddUP")
|
||||
@@ -1849,6 +1900,7 @@ Public Class ClsNominas
|
||||
.Add("ImporteGravado", SqlDbType.Float).Value = ImporteGravado
|
||||
.Add("ImporteExento", SqlDbType.Float).Value = ImporteExento
|
||||
.Add("CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("IsEdited", SqlDbType.Bit).Value = IsEdited
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -1902,10 +1954,10 @@ Public Class ClsNominas
|
||||
retorno = True
|
||||
Catch sqEx As SqlException
|
||||
retorno = False
|
||||
OnError("Ocurrió un error al obtener las tablas.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Catch ex As Exception
|
||||
retorno = False
|
||||
OnError("Ocurrió un error al obtener las tablas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
@@ -5933,7 +5933,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al Consultar el catalogo de Uniformes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
OnError("Ocurrió un error al agregar permiso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
@@ -17,26 +17,38 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||
context.Response.ContentType = "text/plain"
|
||||
currentcontext = context
|
||||
'timbrarNominab()
|
||||
Dim retorno As String = "no se encontro la variable"
|
||||
Try
|
||||
Dim metodo As String = ""
|
||||
If context.Request("var") IsNot Nothing Then
|
||||
URLParametros = Parametros(context.Request("var"))
|
||||
End If
|
||||
|
||||
Dim metodo As String = URLParametros("metodo")
|
||||
metodo = URLParametros("metodo")
|
||||
ElseIf context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing Then
|
||||
context.Response.ContentType = "application/json"
|
||||
Using reader As New StreamReader(context.Request.InputStream)
|
||||
Dim json = reader.ReadToEnd()
|
||||
Dim JsonRequest As JObject = JObject.Parse(json)
|
||||
If JsonRequest IsNot Nothing Then
|
||||
metodo = JsonRequest("Metodo").ToString
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
Select Case metodo
|
||||
Case "TimbrarNomina"
|
||||
retorno = "Error Timbrado Nomina"
|
||||
retorno = timbrarNomina()
|
||||
retorno = ""
|
||||
context.Response.Write(retorno)
|
||||
Case "EstadosCuenta"
|
||||
IniciaEnvioEstadoDeCuenta(context, 1, "-1", "-1")
|
||||
'CargaEstadosCuenta(context, 119, 227736)
|
||||
CargaEstadosCuenta(context, -1, -1)
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
ex.GuardaLog(ex.ToString())
|
||||
ex.GuardaLog(ex.ToString())
|
||||
context.Response.Write(retorno)
|
||||
End Try
|
||||
context.Response.Write(retorno)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -254,47 +266,27 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
|
||||
|
||||
#Region "E S T A D O S D E C U E N T A"
|
||||
Private Sub CargaEstadosCuenta(ByVal context As HttpContext)
|
||||
Private Sub CargaEstadosCuenta(ByVal context As HttpContext, pCveEmpresa As Integer, pCveCliente As Integer)
|
||||
Dim Retorno As New JArray()
|
||||
Dim DtEmpresas As DataTable = Nothing
|
||||
|
||||
Dim ObjEmpresas As New ClsSisEmpresas()
|
||||
If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
|
||||
DtEmpresas = ObjEmpresas.DtResultados.FiltraParametros("", "", {"CveEmpresa"})
|
||||
End If
|
||||
ObjEmpresas.Dispose()
|
||||
Using ObjEmpresas As New ClsSisEmpresas()
|
||||
If ObjEmpresas.GetEmpresas(pCveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
DtEmpresas = ObjEmpresas.DtResultados.FiltraParametros("", "", {"CveEmpresa"})
|
||||
End If
|
||||
End Using
|
||||
|
||||
If DtEmpresas IsNot Nothing Then
|
||||
For Each Row As DataRow In DtEmpresas.Rows
|
||||
IniciaEnvioEstadoDeCuenta(context, Row("CveEmpresa").ToString().ToEntero(), "-1", "-1")
|
||||
Dim Usuario = ValidaUsuarioSistema(Row("CveEmpresa").ToString().ToEntero())
|
||||
Dim obj = EjecutarEnvioEstadoCuenta(Usuario, pCveCliente:=pCveCliente)
|
||||
|
||||
Retorno.Add(obj)
|
||||
Next
|
||||
End If
|
||||
|
||||
context.Response.Write(Retorno.ToString())
|
||||
End Sub
|
||||
|
||||
Private Sub IniciaEnvioEstadoDeCuenta(ByVal context As HttpContext, CveEmpresa As Integer, pFechaI As String, pFechaF As String)
|
||||
Dim JsonRetorno As New JObject()
|
||||
If CveEmpresa > 0 Then
|
||||
Dim Usuario = ValidaUsuarioSistema(CveEmpresa)
|
||||
Dim FechaI, FechaF As DateTime
|
||||
|
||||
If pFechaI <> "-1" AndAlso pFechaF <> "-1" Then
|
||||
Dim FechaReferencia = DateTime.Now
|
||||
|
||||
Dim DiaAnterior = FechaReferencia.AddDays(-1)
|
||||
Dim DiaAnteriorSemanaPasada = DiaAnterior.AddDays(-7)
|
||||
|
||||
FechaI = New DateTime(DiaAnteriorSemanaPasada.Year, DiaAnteriorSemanaPasada.Month, DiaAnteriorSemanaPasada.Day, 0, 0, 0)
|
||||
FechaF = New DateTime(DiaAnterior.Year, DiaAnterior.Month, DiaAnterior.Day, 23, 59, 59)
|
||||
|
||||
JsonRetorno = EjecutarEnvioEstadoCuenta(Usuario, FechaI, FechaF)
|
||||
Else
|
||||
FechaI = pFechaI.ToDateTime()
|
||||
FechaF = pFechaF.ToDateTime()
|
||||
|
||||
JsonRetorno = EjecutarEnvioEstadoCuenta(Usuario, FechaI, FechaF)
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
||||
Dim UsuarioActual As Usuario = Nothing
|
||||
@@ -310,8 +302,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
End If
|
||||
ObjUsuarios.Dispose()
|
||||
Return UsuarioActual
|
||||
End Function
|
||||
|
||||
End Function
|
||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||
|
||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
@@ -332,43 +323,54 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function EjecutarEnvioEstadoCuenta(UsuarioActual As Usuario, FechaI As DateTime, FechaF As DateTime) As JObject
|
||||
Dim Facturas As New JArray()
|
||||
Dim DebeTimbrar As Boolean = True
|
||||
Private Function EjecutarEnvioEstadoCuenta(UsuarioActual As Usuario, Optional pCveCliente As Integer = -1) As JObject
|
||||
Dim ClientesSinEnviar As New JArray()
|
||||
|
||||
Dim Json As New JObject(
|
||||
New JProperty("Empresa", UsuarioActual.Empresa.Empresa),
|
||||
New JProperty("Usuario", UsuarioActual.Usuario),
|
||||
New JProperty("FechaI", FechaI.ToString("dd/MM/yyy HH:mm:ss")),
|
||||
New JProperty("FechaF", FechaF.ToString("dd/MM/yyy HH:mm:ss"))
|
||||
New JProperty("Fecha", DateTime.Now.ToString("dd/MM/yyy HH:mm:ss"))
|
||||
)
|
||||
Dim DTClientes As DataTable = Nothing
|
||||
|
||||
Dim ObjCliente As New ClsClientes
|
||||
If ObjCliente.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
DTClientes = ObjCliente.DtResultados.Copy()
|
||||
End If
|
||||
End If
|
||||
ObjCliente.Dispose()
|
||||
Dim DTClientes As DataTable = Nothing
|
||||
|
||||
Using ObjCliente As New ClsClientes
|
||||
If ObjCliente.GetClientes(pCveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1, Estatus:=1) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
DTClientes = ObjCliente.DtResultados.Copy()
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
If DTClientes IsNot Nothing Then
|
||||
For Each RowCliente As DataRow In DTClientes.Rows
|
||||
Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero()
|
||||
Dim Correo As String = "jonathan.perez@adssistemas.mx" 'RowCliente("Correo").ToString()
|
||||
Dim Correo As String = RowCliente("CobranzaCorreo").ToString()
|
||||
|
||||
Dim Cliente As New Modelos.ClienteModel(CveCliente, UsuarioActual.CveEmpresa)
|
||||
|
||||
GenerarPDFCrystal(UsuarioActual, Correo, "-1", "-1", Cliente)
|
||||
Dim Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente)
|
||||
|
||||
If Envio Then
|
||||
Using ObjBitacora As New ClsOIEventos
|
||||
ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=Cliente.CveCliente)
|
||||
End Using
|
||||
Else
|
||||
ClientesSinEnviar.Add(New JObject(
|
||||
New JProperty("CveCliente", Cliente.CveCliente),
|
||||
New JProperty("Cliente", Cliente.Nombre)
|
||||
))
|
||||
End If
|
||||
Next
|
||||
DTClientes.Dispose()
|
||||
End If
|
||||
Json.Add(New JProperty("Facturas", Facturas))
|
||||
Json.Add(New JProperty("ClientesSinEnviar", ClientesSinEnviar))
|
||||
|
||||
Return Json
|
||||
End Function
|
||||
|
||||
Private Sub GenerarPDFCrystal(UsuarioActual As Usuario, Correo As String, FI As String, FF As String, Cliente As Modelos.ClienteModel)
|
||||
Private Function EnviarEstadoCuenta(UsuarioActual As Usuario, Correo As String, Cliente As Modelos.ClienteModel) As Boolean
|
||||
Dim Retorno As Boolean = True
|
||||
|
||||
Dim ArchivoPDF As Byte() = Nothing
|
||||
|
||||
Dim Formato As String = "PDF"
|
||||
@@ -389,22 +391,34 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
Dim ContaIng As Integer = 0
|
||||
Dim ContaAnt As Integer = 0
|
||||
Dim FechaCorte As Date = ("9999/01/01").ToDate
|
||||
Dim TipoDocto As String = "-1"
|
||||
Dim TipoDocto2 As String = "-1"
|
||||
|
||||
Dim TipoDocto2 As String = "'Ing','NC','Dev'"
|
||||
Dim FechaVencimientoI As String = "-1"
|
||||
Dim FechaVencimientoF As String = "-1"
|
||||
Dim dtt As DataTable = Nothing
|
||||
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
If ObjMovtos.GetCxCClienteDetalle(Cliente.CveCliente, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, CveClienteSucursal:=-1) Then
|
||||
DtCxCFact = ObjMovtos.DtResultados.FiltraParametros("", "TipoDocto").Copy
|
||||
'cargo los anticipos NC
|
||||
DtCxCFact.Columns.Add("SaldoAnticipo", GetType(Decimal))
|
||||
If ObjMovtos.GetAnticiposNCIxCCliente(Cliente.CveCliente, -1, -1) Then
|
||||
dtt = ObjMovtos.DtResultados.FiltraParametros("SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) )")
|
||||
End If
|
||||
End If
|
||||
ObjMovtos.Dispose()
|
||||
Dim FI As String = "-1"
|
||||
Dim FF As String = "-1"
|
||||
Dim dtt As DataTable = Nothing
|
||||
|
||||
Try
|
||||
Using ObjMovtos As New ClsMovimientos()
|
||||
If ObjMovtos.GetCxCClienteDetalle(Cliente.CveCliente, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, CveClienteSucursal:=-1) Then
|
||||
DtCxCFact = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "TipoDocto")
|
||||
'cargo los anticipos NC
|
||||
DtCxCFact.Columns.Add("SaldoAnticipo", GetType(Decimal))
|
||||
If ObjMovtos.GetAnticiposNCIxCCliente(Cliente.CveCliente, -1, -1) Then
|
||||
dtt = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 AND SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) )")
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
Retorno = False
|
||||
dtt = Nothing
|
||||
OnError("Ocurrió un erro al obtener el CxC", ex)
|
||||
End Try
|
||||
|
||||
If Not Retorno Then
|
||||
Return Retorno
|
||||
End If
|
||||
|
||||
Try
|
||||
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
@@ -421,6 +435,9 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
drr("CveMoneda") = drt("CveMoneda")
|
||||
DtCxCFact.Rows.Add(drr)
|
||||
Next
|
||||
Else
|
||||
Retorno = False
|
||||
Return Retorno
|
||||
End If
|
||||
|
||||
If DtCxCFact IsNot Nothing Then
|
||||
@@ -495,7 +512,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
Dim dr As DataRow = DtCxCFact2.Rows(0)
|
||||
Dim lista = New List(Of CrystalParametro)
|
||||
lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
lista.Add(New CrystalParametro("TipoCuentas", ""))
|
||||
lista.Add(New CrystalParametro("TipoCuentas", "Con Saldo"))
|
||||
lista.Add(New CrystalParametro("NombreCliente", Cliente.Nombre))
|
||||
lista.Add(New CrystalParametro("FechaInicio", If(FI = "-1", "-", FI)))
|
||||
lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", DateTime.Now.ToShortDateString, FF)))
|
||||
@@ -524,11 +541,10 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim File As Byte()
|
||||
If Archivo.Exists Then
|
||||
File = ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato)
|
||||
ArchivoPDF = ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato)
|
||||
Else
|
||||
File = ImprimirPDFCrystal(HttpContext.Current.Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato)
|
||||
ArchivoPDF = ImprimirPDFCrystal(HttpContext.Current.Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -537,7 +553,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
Else
|
||||
Dim lista = New List(Of CrystalParametro)
|
||||
lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
lista.Add(New CrystalParametro("TipoCuentas", "Todas"))
|
||||
lista.Add(New CrystalParametro("TipoCuentas", "Con Saldo"))
|
||||
lista.Add(New CrystalParametro("NombreCliente", Cliente.Nombre))
|
||||
lista.Add(New CrystalParametro("FechaInicio", If(FI = "-1", "-", FI)))
|
||||
lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", DateTime.Now.ToShortDateString, FF)))
|
||||
@@ -580,14 +596,16 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
Else
|
||||
ArchivoPDF = ImprimirPDFCrystal(HttpContext.Current.Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el pdf", ex)
|
||||
ArchivoPDF = Nothing
|
||||
End Try
|
||||
|
||||
Try
|
||||
Dim Cuerpo As String = String.Format("Estimado cliente {0}, al presente se correo se anexa su estado actual de cartera en {1}.<br />
|
||||
If ArchivoPDF IsNot Nothing Then
|
||||
Try
|
||||
Dim Cuerpo As String = String.Format("Estimado cliente {0}, al presente del correo se anexa su estado actual de cartera en {1}.<br />
|
||||
<br />
|
||||
Quedamos a sus ordenes para cualquier duda o aclaración con su agente de Ventas.<br />
|
||||
<br />
|
||||
@@ -596,12 +614,17 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
<br />
|
||||
<b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA.</b>", Cliente.NombreComercial, UsuarioActual.Empresa.Empresa)
|
||||
|
||||
MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo)
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al enviar el correo", TipoMensaje.MsgAdvertencia)
|
||||
End Try
|
||||
Retorno = MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo)
|
||||
Catch ex As Exception
|
||||
Retorno = False
|
||||
OnError("Ocurrió un error al enviar el correo", ex)
|
||||
End Try
|
||||
Else
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
@@ -658,7 +681,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
Return Bytes
|
||||
End Function
|
||||
|
||||
Private Sub MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String)
|
||||
Private Function MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String) As Boolean
|
||||
|
||||
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
|
||||
'a.GuardaLog()
|
||||
@@ -667,9 +690,8 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"})
|
||||
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
|
||||
|
||||
End Sub
|
||||
Return Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
Binary file not shown.
BIN
Empresas/80/Formatos/RH_FormatoVacaciones.docx
Normal file
BIN
Empresas/80/Formatos/RH_FormatoVacaciones.docx
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,7 @@ Partial Class Inventarios_RepAlmacen
|
||||
DdlTipoAlmacen.DataBind()
|
||||
DdlTipoAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1)
|
||||
DdlAlmacen.DataBind()
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="row">
|
||||
<label class="col-md-1" style="width: 60px !important;">Ejercicio: </label>
|
||||
<div class="col-md-2" style="width: 140px !important;">
|
||||
<asp:DropDownList ID="DdlEjercicios" DataTextField="Ejercicio" DataValueField="Ejercicio" runat="server" width="100%" CssClass="select2me"></asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlEjercicios" DataTextField="Ejercicio" DataValueField="Ejercicio" runat="server" Width="100%" CssClass="select2me"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1" style="width: 120px !important;">Tipo Período: </label>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</asp:DropDownList>
|
||||
|
||||
</div>
|
||||
<label class="col-md-1" style="width: 60px !important;"> </label>
|
||||
<label class="col-md-1" style="width: 60px !important;"></label>
|
||||
<div class="col-md-2">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@@ -55,18 +55,33 @@
|
||||
<div class="dashboard-stat blue">
|
||||
<div class="visual"><i class="fa fa-sort-numeric-desc"></i></div>
|
||||
<div class="details">
|
||||
<div class="number"> <asp:Literal ID="LtlTotal" runat="server"></asp:Literal> </div>
|
||||
<div class="number">
|
||||
<asp:Literal ID="LtlTotal" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="desc">
|
||||
Total Aguinaldo
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-md-offset-2">
|
||||
<div class="col-md-3 col-md-offset-1">
|
||||
<div class="dashboard-stat green">
|
||||
<div class="visual"><i class="fa fa-line-chart"></i></div>
|
||||
<div class="details">
|
||||
<div class="number"> <asp:Literal ID="LtldiasEjercicio" runat="server"></asp:Literal></div>
|
||||
<div class="number">
|
||||
<asp:Literal ID="LtlAutorizado" runat="server"></asp:Literal></div>
|
||||
<div class="desc">
|
||||
Autorizado
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-md-offset-1">
|
||||
<div class="dashboard-stat green">
|
||||
<div class="visual"><i class="fa fa-line-chart"></i></div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<asp:Literal ID="LtldiasEjercicio" runat="server"></asp:Literal></div>
|
||||
<div class="desc">
|
||||
Días ejercicio
|
||||
</div>
|
||||
@@ -75,7 +90,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GVCalcularAguinaldo" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVCalcularUtilidades" AutoGenerateColumns="False"
|
||||
DataKeyNames="Nombre,CvePersonal">
|
||||
DataKeyNames="Nombre,CvePersonal" OnRowDataBound="GVCalcularAguinaldo_RowDataBound">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Nombre ">
|
||||
<ItemTemplate>
|
||||
@@ -86,43 +101,43 @@
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldiasLaborados" runat="server" Text='<%# Eval("DiasLaborados")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Días Aguinaldo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldiasAguinaldo" runat="server" Text='<%# Eval("NumDiasAguinaldo")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Salario Diario">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblsueldoDiario" runat="server" Text='<%# Eval("SalarioDiario", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aguinaldo Completo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblsueldoAguinaldoCompleto" runat="server" Text='<%# Eval("AguinaldoCompleto", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aguinaldo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAguinaldo" runat="server" Text='<%# Eval("Aguinaldo", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aguinaldo Gravado">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAguinaldoGravado" runat="server" Text='<%# Eval("AguinaldoGravado", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Impuesto">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAguinaldo" runat="server" Text='<%# Eval("ISR", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
@@ -148,6 +163,47 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<div id="ModalAutorizar" class="modal ADS fade" role="dialog">
|
||||
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAutorizar" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Autorizar</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<label class="col-md-4 ">Tipo Período:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlTipoPeriodoB" runat="server" CssClass="select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoPeriodoB_SelectedIndexChanged"
|
||||
DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Style="width: 100% !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-4 ">Período:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Style="width: 100% !important;" >
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LnkAutorizar" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpUpDatosFiel" OnClick="LnkAutorizar_Click"> <i class='material-icons'>done_all</i> Actualizar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -34,7 +34,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
|
||||
}
|
||||
DdlEjercicios.DataBind();
|
||||
|
||||
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'");
|
||||
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo' AND CveTipoPeriodo <>-1");
|
||||
DdlTipoPeriodo.DataBind();
|
||||
DdlTipoPeriodo.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
if (DdlTipoPeriodo.Items.Count > 0)
|
||||
@@ -58,16 +58,204 @@ public partial class Nomina_Aguinaldo : ClsPaginas
|
||||
DTAguinaldos = objnom.DtResultados;
|
||||
GVCalcularAguinaldo.DataSource = DTAguinaldos;
|
||||
LtlTotal.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo"));
|
||||
LtlAutorizado.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo","CveNomina>0"));
|
||||
|
||||
LtldiasEjercicio.Text = string.Format("{0}/12/31", ejercicio).ToDate().DayOfYear.ToString();
|
||||
}
|
||||
|
||||
GVCalcularAguinaldo.DataBind();
|
||||
GVCalcularAguinaldo.DataBind();
|
||||
LnkAutorizarModal.Visible = true;
|
||||
upDatosPA_N.Update();
|
||||
}
|
||||
private void CargaPeriodos()
|
||||
{
|
||||
DataTable dtPeriodos = null;
|
||||
using (ClsNominas ObjPeriodos = new ClsNominas())
|
||||
{
|
||||
if (ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, DdlEjercicios.SelectedValue.ToEntero(), -1, -1))
|
||||
{
|
||||
dtPeriodos = ObjPeriodos.DtResultados.FiltraParametros("Estatus IN (0,1)");
|
||||
}
|
||||
ObjPeriodos.Dispose();
|
||||
}
|
||||
|
||||
if (dtPeriodos != null && dtPeriodos.Rows.Count > 0)
|
||||
{
|
||||
DdlPeriodo.DataSource = dtPeriodos.FiltraParametros(string.Format(" CveTipoPeriodo={0}", DdlTipoPeriodoB.SelectedValue));
|
||||
}
|
||||
DdlPeriodo.DataBind();
|
||||
DdlPeriodo.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
UpModalAutorizar.Update();
|
||||
}
|
||||
protected void LnkAutorizarModal_Click(object sender, EventArgs e)
|
||||
{
|
||||
DdlTipoPeriodoB.ClearSelection();
|
||||
DdlTipoPeriodoB.Items.Clear();
|
||||
DdlTipoPeriodoB.DataSource = GlobalDTTipoPeriodo.FiltraParametros(string.Format("CveTipoPeriodo=6 OR CveTipoPeriodo={0}", DdlTipoPeriodo.SelectedValue));
|
||||
DdlTipoPeriodoB.DataBind();
|
||||
|
||||
CargaPeriodos();
|
||||
RegistraScript("$('#ModalAutorizar').modal();");
|
||||
}
|
||||
|
||||
protected void LnkAutorizar_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool continuar = true;
|
||||
string mensaje = "";
|
||||
//int DiasLaborados;
|
||||
decimal Importe;
|
||||
int CveMoneda = 1;
|
||||
var CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();
|
||||
int ejercicio = DdlEjercicios.SelectedValue.ToEntero();
|
||||
int CvePersonal;
|
||||
int CvePeriodo;
|
||||
decimal ImporteGravado = 0;
|
||||
decimal ImporteExento = 0;
|
||||
//string NombrePersonal = "";
|
||||
int CveMetodoPago = 0;
|
||||
int CveNomina = 0;
|
||||
int CveConcepto = 0;
|
||||
if (continuar)
|
||||
{
|
||||
using (ClsNominas objNomina = new ClsNominas())
|
||||
{
|
||||
objNomina.IniciaTransacSQL();
|
||||
if (continuar)
|
||||
{
|
||||
//continuar = objNomina.UpADDdUtilidadesEjercicio(UsuarioActual.CveEmpresa, ejercicio, utilimporte, utilimporteAnt, false);
|
||||
//if (continuar)
|
||||
//{
|
||||
// if (objNomina.DtResultados.Rows.Count < 0 || objNomina.DtResultados.Rows[0]["CONTimbrado"].ToString() == "1")
|
||||
// continuar = false;
|
||||
//}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
continuar = objNomina.GetConceptos(UsuarioActual.CveEmpresa);
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
DataRow rowc = objNomina.DtResultados.FiltroPrimero("CveSistema=5");
|
||||
if ((rowc != null))
|
||||
{
|
||||
CveConcepto = rowc["CveConcepto"].ToString().ToEntero();
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// CveConcepto = objNomina.AddConcepto("PTU", "Utilidades", "P", "", true, true, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, false, -1, -1, -1, 0, -1, 0, 0, 0, 0, 0);
|
||||
//}
|
||||
if (CveConcepto < 1)
|
||||
{
|
||||
continuar = false;
|
||||
Alert("debe agregar un concepto para el calculo del aguinaldo", ModExtensiones.TipoMensaje.ToastAdventencia);
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
foreach (DataRow row in DTAguinaldos.Rows)
|
||||
{
|
||||
//DiasLaborados = row["DiasLaborados"].ToString().ToEntero();
|
||||
CvePeriodo = CvePeriodoSeleccionado;
|
||||
/*
|
||||
if (continuar)
|
||||
{CveNomina
|
||||
continuar = objNomina.AddUtilidad(CvePersonal, Importe, CvePeriodo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ejercicio, DiasLaborados, SueldoTotal);
|
||||
}*/
|
||||
CveNomina = 0;
|
||||
CvePersonal = row["CvePersonal"].ToString().ToEntero();
|
||||
CveMetodoPago = row["CveMetodoPago"].ToString().ToEntero();
|
||||
Importe = row["Aguinaldo"].ToString().ToDecimal();
|
||||
ImporteGravado = row["AguinaldoGravado"].ToString().ToDecimal();
|
||||
ImporteExento = Importe - ImporteGravado;
|
||||
|
||||
if (CvePersonal > 0 && Importe>0 && row["CveNomina"].ToString().ToEntero()==0)
|
||||
{
|
||||
if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
if (objNomina.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
CveNomina = objNomina.CveNomina;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (objNomina.AddNom_Nominas(-1, 1, CvePersonal, CvePeriodoSeleccionado, Importe.ToString().ToDouble(), 0, 0, Importe.ToString().ToDouble(), CveMoneda, 1, CveMetodoPago, DateTime.Now, "Deducciones nómina",
|
||||
"", "", "", "", 0, 0, 0, new DateTime(), new DateTime(), new DateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
CveNomina = objNomina.CveNomina;
|
||||
}
|
||||
else
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
if (CveNomina > 0)
|
||||
{
|
||||
|
||||
if (!objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, UsuarioActual.CveUsuario))
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!continuar)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (continuar & CvePeriodoSeleccionado > 0)
|
||||
//{
|
||||
// continuar = objNomina.CambiaEstatusPeriodo(CvePeriodoSeleccionado, (int)enumNominasEstatus.Activa, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
|
||||
//}
|
||||
if (continuar)
|
||||
{
|
||||
objNomina.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
objNomina.RollBack();
|
||||
}
|
||||
objNomina.Dispose();
|
||||
}
|
||||
}
|
||||
if (mensaje.Length > 0)
|
||||
{
|
||||
Alert(mensaje, ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
continuar = false;
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
RegistraScript("$('#ModalAutorizar').modal('hide');");
|
||||
Alert("Se ha generado el aguinaldo");
|
||||
BtnCalcular_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
protected void DdlTipoPeriodoB_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
CargaPeriodos();
|
||||
}
|
||||
|
||||
protected void GVCalcularAguinaldo_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
int CveNomina = e.Row.DBCampo("CveNomina").ToString().ToEntero();
|
||||
if (CveNomina > 0)
|
||||
{
|
||||
e.Row.CssClass = "success";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,9 +283,15 @@ Partial Class Nomina_Finiquito
|
||||
pnlupValoresFiniquito.Visible = True
|
||||
End If
|
||||
Using ObjNom As New ClsNominas()
|
||||
If ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
DTConceptosPersonal = ObjNom.DtResultados
|
||||
End If
|
||||
'If ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
' DTConceptosPersonal = ObjNom.DtResultados
|
||||
'Autoriza nomina
|
||||
'Finiquita Liquidación
|
||||
'Rep Nomina
|
||||
'RepInversion de nomina
|
||||
'Alertas Altas /Bajas
|
||||
'
|
||||
'End If
|
||||
End Using
|
||||
GvConceptos.DataSource = ConceptsPersonas
|
||||
GvConceptos.DataBind()
|
||||
|
||||
@@ -71,6 +71,9 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkVerTablas" OnClick="LnkVerTablas_Click" runat="server">Tablas</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAutorizar" OnClick="LnkAutorizar_Click" runat="server"><i class="fa fa-thumbs-up" aria-hidden="true"></i>Autorizar</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
@@ -551,7 +551,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
GvNominas.DataBind();
|
||||
}
|
||||
|
||||
try
|
||||
if (dtPeriodo != null && dtPeriodo.Rows.Count > 0)
|
||||
{
|
||||
|
||||
DateTime FechaInicio = (DateTime)dtPeriodo.Rows[0]["FechaInicio"];
|
||||
@@ -596,11 +596,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
gvasistencia.Append("</table>");
|
||||
ltlGvAsistencia.Text = gvasistencia.ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
#endregion
|
||||
UpDatos.Update();
|
||||
@@ -845,7 +840,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
{
|
||||
if (!dontsaveconcepto)//el usuario definira si desea actualizar o no el concepto en el periodo
|
||||
{
|
||||
if (!objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, UsuarioActual.CveUsuario))
|
||||
if (!objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, UsuarioActual.CveUsuario,true))
|
||||
{
|
||||
rollback = true;
|
||||
}
|
||||
@@ -1052,7 +1047,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
|
||||
|
||||
|
||||
frow = objper.DtResultados.FiltroPrimero("CveSistema =4");
|
||||
frow = objper.DtResultados.FiltroPrimero("CveSistema =4");
|
||||
TxtFonValor.Text = "";
|
||||
DdlFonTipoAplicacion.SelectedValueExist("-1");
|
||||
TxtFonDescripcion.Text = "";
|
||||
@@ -2957,7 +2952,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
double valor = TxtValor.Text.ToDouble();
|
||||
int vecesAplicar = TxtVecesAplicar.Text.ToEntero();
|
||||
decimal montoLimite = TxtMontoLimite.Text.ToDecimal();
|
||||
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
|
||||
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
|
||||
bool estatus = ChkEstatus.Checked;
|
||||
bool Continuar;
|
||||
using (ClsNominas ObjMovt = new ClsNominas())
|
||||
@@ -2983,7 +2978,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
double valor = TxtValor.Text.ToDouble();
|
||||
int vecesAplicar = TxtVecesAplicar.Text.ToEntero();
|
||||
decimal montoLimite = TxtMontoLimite.Text.ToDecimal();
|
||||
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
|
||||
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
|
||||
bool estatus = ChkEstatus.Checked;
|
||||
bool Continuar;
|
||||
using (ClsNominas ObjMovt = new ClsNominas())
|
||||
@@ -3078,4 +3073,111 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void LnkAutorizar_Click(object sender, EventArgs e)
|
||||
{
|
||||
autorizarNomina(-1);
|
||||
}
|
||||
|
||||
private void autorizarNomina(int FiltroCvePersonal)
|
||||
{
|
||||
|
||||
bool continuar = true;
|
||||
DataTable dtr = dtempleados.FiltraParametros(string.Format("CvePersonal={0} OR {0}=-1", FiltroCvePersonal));
|
||||
DataTable dtconp = null;
|
||||
int CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();//cambiar reparar
|
||||
#region PropNomina
|
||||
int CvePersonal = 0;
|
||||
int CveNomina = 0;
|
||||
int CveMetodoPago = 0;
|
||||
double Total = 0;
|
||||
int CveMoneda = 1;
|
||||
#endregion
|
||||
#region PropNominaDetalle
|
||||
int CveConcepto=0;
|
||||
decimal ImporteConcepto=0, ImporteGravadoConcepto=0, ImporteExentoConcepto = 0;
|
||||
#endregion
|
||||
|
||||
|
||||
using (ClsNominas objNomina = new ClsNominas())
|
||||
{
|
||||
objNomina.IniciaTransacSQL();
|
||||
foreach (DataRow rtemp in dtr.Rows)
|
||||
{
|
||||
CveNomina = 0;
|
||||
CvePersonal = rtemp["CvePersonal"].ToString().ToEntero();
|
||||
CveMetodoPago = rtemp["CveMetodoPago"].ToString().ToEntero();
|
||||
Total = 0;//cambiar reparar
|
||||
|
||||
if (continuar)
|
||||
{
|
||||
if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
if (objNomina.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
CveNomina = objNomina.CveNomina;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (objNomina.AddNom_Nominas(-1, 1, CvePersonal, CvePeriodoSeleccionado, Total, 0, 0, Total, CveMoneda, 1, CveMetodoPago, DateTime.Now, "Deducciones nómina",
|
||||
"", "", "", "", 0, 0, 0, new DateTime(), new DateTime(), new DateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
CveNomina = objNomina.CveNomina;
|
||||
}
|
||||
else
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CveNomina == 0)
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (continuar)
|
||||
{
|
||||
dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0}", CvePersonal));
|
||||
foreach (DataRow rcon in dtconp.Rows)
|
||||
{
|
||||
|
||||
CveConcepto =rcon["CveConcepto"].ToString().ToEntero();
|
||||
ImporteConcepto =rcon["ImporteConcepto"].ToString().ToDecimal();
|
||||
ImporteGravadoConcepto =rcon["ImporteGravadoConcepto"].ToString().ToDecimal();
|
||||
ImporteExentoConcepto = ImporteConcepto -ImporteGravadoConcepto ;
|
||||
if (continuar)
|
||||
{
|
||||
|
||||
if (!objNomina.AddUPNom_NominasDetalles(CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, ImporteConcepto, ImporteGravadoConcepto, ImporteExentoConcepto, UsuarioActual.CveUsuario))
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
objNomina.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
objNomina.RollBack();
|
||||
|
||||
}
|
||||
}
|
||||
dtr.Dispose();
|
||||
dtconp.Dispose();
|
||||
Alert("Termine");
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ Partial Class Nomina_ReportePTU
|
||||
|
||||
Private Sub CargaPeriodos()
|
||||
Dim ObjPeriodos As New ClsNominas()
|
||||
If ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, DdlEjercicios.SelectedValue.ToEntero, -1, -1) Then
|
||||
If ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, DdlEjercicios.SelectedValue.ToEntero(), -1, -1) Then
|
||||
dtPeriodos = ObjPeriodos.DtResultados.FiltraParametros("Estatus IN (0,1)")
|
||||
End If
|
||||
ObjPeriodos.Dispose()
|
||||
@@ -86,7 +86,7 @@ Partial Class Nomina_ReportePTU
|
||||
GVTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros($"Estatus = 'Activo' AND CveTipoPeriodo IN({listaCveTipoPeriodo.ToString()})")
|
||||
GVTipoPeriodo.DataBind()
|
||||
|
||||
If (Not IsNothing(dtPeriodos) AndAlso dtPeriodos.Rows.Count()) Then
|
||||
If (Not IsNothing(dtPeriodos) AndAlso dtPeriodos.Rows.Count() > 0) Then
|
||||
DdlPeriodo.DataSource = dtPeriodos.FiltraParametros("CveTipoPeriodo=6")
|
||||
|
||||
End If
|
||||
@@ -97,6 +97,7 @@ Partial Class Nomina_ReportePTU
|
||||
|
||||
Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
PnlTipoPeriodos.Visible = (DdlPeriodo.SelectedValue.ToEntero() <= 0)
|
||||
UpModalAutorizar.Update()
|
||||
End Sub
|
||||
'Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
' CargaPeriodos()
|
||||
|
||||
@@ -531,7 +531,7 @@
|
||||
<asp:UpdatePanel ID="UpGvVacaciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvVacaciones" Width="100%" runat="server" GridLines="None" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
DataKeyNames="CvePersonalVacaciones,Periodo,FechaIng,Estatus,CveAutoriza,Autoriza,Dias,Usuario,SEstatus,Folio,FechaInicio,FechaFin,Documento"
|
||||
DataKeyNames="CvePersonalVacaciones,Periodo,FechaIng,Estatus,CveAutoriza,Autoriza,Dias,Usuario,SEstatus,Folio,FechaInicio,FechaFin,Documento,Motivo"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD GvVacaciones" data-sort="true" data-height="300" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
@@ -590,7 +590,7 @@
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpGvPermisos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvPermisos" Width="100%" runat="server" GridLines="None" DataKeyNames="CvePermiso,CvePersonal,Descripcion,FechaInicio,FechaFin,HoraEntrada,HoraSalida, GoceSueldo, Estatus" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
<asp:GridView ID="GvPermisos" Width="100%" runat="server" GridLines="None" DataKeyNames="CvePermiso,CvePersonal,Descripcion,Motivo,FechaInicio,FechaFin,HoraEntrada,HoraSalida,GoceSueldo,Estatus" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
CssClass=" table table-striped table-advance table-hover Widthall" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
|
||||
@@ -450,13 +450,22 @@ Partial Class RH_MiPerfil
|
||||
|
||||
Dim jefeCve As Integer = If(ObjPersonal.CvePersonalPadre = ObjPersonal.CvePersonal, "0", If(ObjPersonal.CvePersonalPadre.ToString = "0", "-1", ObjPersonal.CvePersonalPadre.ToString))
|
||||
Dim expressionJefe As String = String.Format("CvePersonal = {0}", jefeCve)
|
||||
Dim resultad As DataRow() = DTOrganigrama.Select(expressionJefe)
|
||||
JefeInmediato = resultad(0).Item("NombreCompleto")
|
||||
Dim resultad As DataRow = DTOrganigrama.FiltroPrimero(expressionJefe)
|
||||
If (Not IsNothing(resultad)) Then
|
||||
JefeInmediato = resultad.Item("NombreCompleto").ToString()
|
||||
Else
|
||||
JefeInmediato = ""
|
||||
End If
|
||||
|
||||
Dim puestosAux As DataTable = GlobalDTRHPuestos(UsuarioActual.CveEmpresa)
|
||||
Dim expressionPuesto As String = String.Format("CvePuesto = {0}", ObjPersonal.CvePuesto.ToString)
|
||||
Dim resultadoPuesto As DataRow() = puestosAux.Select(expressionPuesto)
|
||||
puestoProp = resultad(0).Item("Puesto")
|
||||
Dim resultadoPuesto As DataRow = puestosAux.FiltroPrimero(expressionPuesto)
|
||||
|
||||
If (Not IsNothing(resultad)) Then
|
||||
puestoProp = resultadoPuesto.Item("Puesto")
|
||||
Else
|
||||
puestoProp = ""
|
||||
End If
|
||||
|
||||
If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
|
||||
ImgPersonal.ImageUrl = $"/Empresas/{UsuarioActual.CveEmpresa}/RH/Personal/{ObjPersonal.URL}"
|
||||
@@ -975,7 +984,7 @@ Partial Class RH_MiPerfil
|
||||
'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
|
||||
|
||||
'DescarSolicitudVacaciones(Folio)
|
||||
Dim RutaFormato As String = String.Format("{0}Formatos\RH_FormatoVacaciones.docx", UsuarioActual.Empresa.Ruta)
|
||||
Dim RutaFormato As String = String.Format("{0}Formatos\PermisoSolicitud.docx", UsuarioActual.Empresa.Ruta)
|
||||
|
||||
Dim NombreEmpleado As String = String.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text)
|
||||
Dim Codigo As String = TxtCodigo.Text
|
||||
@@ -983,8 +992,9 @@ Partial Class RH_MiPerfil
|
||||
Dim JefeInmediatoAux As String = JefeInmediato
|
||||
Dim FechaInicio As String = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim FechaFin As String = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim diasPermiso As String = $"{(GvRow.DataKey("FechaInicio").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}"
|
||||
Dim MotivoPermiso As String = GvRow.DataKey("Descripcion")
|
||||
Dim diasPermiso As String = $"{(GvRow.DataKey("FechaFin").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}"
|
||||
Dim HorasPermiso As String = "" 'String.Format("{0}", ((GvRow.DataKey("FechaInicio").ToDateTime() - GvRow.DataKey("FechaFin").ToDateTime()).Hours))
|
||||
Dim MotivoPermiso As String = String.Format("{0},{1}", GvRow.DataKey("Descripcion"), GvRow.DataKey("Motivo"))
|
||||
If File.Exists(RutaFormato) Then
|
||||
|
||||
Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
|
||||
@@ -999,6 +1009,7 @@ Partial Class RH_MiPerfil
|
||||
ListaTags.Add(New TagsDocumentos("{FechaInicio}", FechaInicio))
|
||||
ListaTags.Add(New TagsDocumentos("{FechaFin}", FechaFin))
|
||||
ListaTags.Add(New TagsDocumentos("{diasPermiso}", diasPermiso))
|
||||
ListaTags.Add(New TagsDocumentos("{HorasPermiso}", HorasPermiso))
|
||||
ListaTags.Add(New TagsDocumentos("{MotivoPermiso}", MotivoPermiso))
|
||||
|
||||
objGemDocument.SustituirTags(ListaTags)
|
||||
@@ -1014,7 +1025,8 @@ Partial Class RH_MiPerfil
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicituddepermiso_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
|
||||
Response.BinaryWrite(bytesInStream)
|
||||
Response.End()
|
||||
|
||||
Else
|
||||
Alert("No se encontro el formato de Permisos", TipoMensaje.ToastAdventencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -2330,7 +2330,7 @@
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpGvPermisos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvPermisos" Width="100%" runat="server" GridLines="None" DataKeyNames="CvePermiso,CvePersonal,Descripcion,FechaInicio,FechaFin,HoraEntrada,HoraSalida, GoceSueldo, Estatus" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
<asp:GridView ID="GvPermisos" Width="100%" runat="server" GridLines="None" DataKeyNames="CvePermiso,CvePersonal,Descripcion,Motivo,FechaInicio,FechaFin,HoraEntrada,HoraSalida,GoceSueldo,Estatus" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
CssClass=" table table-striped table-advance table-hover Widthall" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
|
||||
@@ -4542,53 +4542,52 @@ Partial Class RH_Personal
|
||||
End Sub
|
||||
|
||||
Public Sub DownLoad_ClickSolicitudPermiso(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
|
||||
|
||||
'DescarSolicitudVacaciones(Folio)
|
||||
Dim RutaFormato As String = String.Format("{0}Formatos\RH_FormatoVacaciones.docx", UsuarioActual.Empresa.Ruta)
|
||||
|
||||
Dim NombreEmpleado As String = String.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text)
|
||||
Dim Codigo As String = TxtCodigo.Text
|
||||
Dim Departamento As String = DdlDepartamento.SelectedItem.Text
|
||||
Dim JefeInmediato As String = DdlSupervisorOrganigrama.SelectedItem.Text
|
||||
Dim FechaInicio As String = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim FechaFin As String = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim diasPermiso As String = $"{(GvRow.DataKey("FechaInicio").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}"
|
||||
Dim MotivoPermiso As String = GvRow.DataKey("Descripcion")
|
||||
If File.Exists(RutaFormato) Then
|
||||
|
||||
Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
|
||||
Dim ListaTags As New List(Of TagsDocumentos)
|
||||
|
||||
ListaTags = GetDatosTagsDocumentos()
|
||||
|
||||
ListaTags.Add(New TagsDocumentos("{NombreEmpleado}", NombreEmpleado))
|
||||
ListaTags.Add(New TagsDocumentos("{Codigo}", Codigo))
|
||||
ListaTags.Add(New TagsDocumentos("{Departamento}", Departamento))
|
||||
ListaTags.Add(New TagsDocumentos("{JefeInmediato}", JefeInmediato))
|
||||
ListaTags.Add(New TagsDocumentos("{FechaInicio}", FechaInicio))
|
||||
ListaTags.Add(New TagsDocumentos("{FechaFin}", FechaFin))
|
||||
ListaTags.Add(New TagsDocumentos("{diasPermiso}", diasPermiso))
|
||||
ListaTags.Add(New TagsDocumentos("{MotivoPermiso}", MotivoPermiso))
|
||||
|
||||
objGemDocument.SustituirTags(ListaTags)
|
||||
|
||||
'objGemDocument.GuardarStream()
|
||||
objGemDocument.GuardarStreamPDF()
|
||||
Dim bytesInStream As Byte() = objGemDocument.GetBytesDocumento()
|
||||
'Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
|
||||
objGemDocument.Dispose()
|
||||
|
||||
Response.Clear()
|
||||
Response.ContentType = "application/force-download"
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicituddepermiso_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
|
||||
Response.BinaryWrite(bytesInStream)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
|
||||
'DescarSolicitudVacaciones(Folio)
|
||||
Dim RutaFormato As String = String.Format("{0}Formatos\PermisoSolicitud.docx", UsuarioActual.Empresa.Ruta)
|
||||
|
||||
Dim NombreEmpleado As String = String.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text)
|
||||
Dim Codigo As String = TxtCodigo.Text
|
||||
Dim Departamento As String = DdlDepartamento.SelectedItem.Text
|
||||
Dim JefeInmediato As String = DdlSupervisorOrganigrama.SelectedItem.Text
|
||||
Dim FechaInicio As String = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim FechaFin As String = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim diasPermiso As String = $"{(GvRow.DataKey("FechaFin").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}"
|
||||
Dim HorasPermiso As String = "" 'String.Format("{0}", ((GvRow.DataKey("FechaInicio").ToDateTime() - GvRow.DataKey("FechaFin").ToDateTime()).Hours))
|
||||
Dim MotivoPermiso As String = String.Format("{0},{1}", GvRow.DataKey("Descripcion"), GvRow.DataKey("Motivo"))
|
||||
If File.Exists(RutaFormato) Then
|
||||
|
||||
Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
|
||||
Dim ListaTags As New List(Of TagsDocumentos)
|
||||
|
||||
ListaTags = GetDatosTagsDocumentos()
|
||||
|
||||
ListaTags.Add(New TagsDocumentos("{NombreEmpleado}", NombreEmpleado))
|
||||
ListaTags.Add(New TagsDocumentos("{Codigo}", Codigo))
|
||||
ListaTags.Add(New TagsDocumentos("{Departamento}", Departamento))
|
||||
ListaTags.Add(New TagsDocumentos("{JefeInmediato}", JefeInmediato))
|
||||
ListaTags.Add(New TagsDocumentos("{FechaInicio}", FechaInicio))
|
||||
ListaTags.Add(New TagsDocumentos("{FechaFin}", FechaFin))
|
||||
ListaTags.Add(New TagsDocumentos("{diasPermiso}", diasPermiso))
|
||||
ListaTags.Add(New TagsDocumentos("{HorasPermiso}", HorasPermiso))
|
||||
ListaTags.Add(New TagsDocumentos("{MotivoPermiso}", MotivoPermiso))
|
||||
|
||||
objGemDocument.SustituirTags(ListaTags)
|
||||
|
||||
'objGemDocument.GuardarStream()
|
||||
objGemDocument.GuardarStreamPDF()
|
||||
Dim bytesInStream As Byte() = objGemDocument.GetBytesDocumento()
|
||||
'Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
|
||||
objGemDocument.Dispose()
|
||||
|
||||
Response.Clear()
|
||||
Response.ContentType = "application/force-download"
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicituddepermiso_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
|
||||
Response.BinaryWrite(bytesInStream)
|
||||
Response.End()
|
||||
Else
|
||||
Alert("No se encontro el Formato, favor de revisarlo con soporte tecnico.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("No se encontro el formato de Permisos", TipoMensaje.ToastAdventencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -124,7 +124,8 @@
|
||||
<asp:BoundField runat="server" DataField="Cantidad" HeaderText="Cantidad" DataFormatString="{0:###,###}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField runat="server" DataField="Departamento" HeaderText="Departamento" />
|
||||
<asp:BoundField runat="server" DataField="SubProyecto" HeaderText="Sucursal" />
|
||||
|
||||
<asp:BoundField runat="server" DataField="Precio" DataFormatString="${0:N2}" HeaderText="Total" />
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
@@ -3902,7 +3902,7 @@ Partial Class Clientes
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim Cuerpo As String = String.Format("Estimado cliente {0}, al presente se correo se anexa su estado actual de cartera en {1}.<br />
|
||||
Dim Cuerpo As String = String.Format("Estimado cliente {0}, al presente del correo se anexa su estado actual de cartera en {1}.<br />
|
||||
<br />
|
||||
Quedamos a sus ordenes para cualquier duda o aclaración con su agente de Ventas.<br />
|
||||
<br />
|
||||
|
||||
@@ -5331,6 +5331,11 @@ Partial Class Ventas
|
||||
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString)
|
||||
End If
|
||||
|
||||
'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES
|
||||
If CveVenta <= 0 Then
|
||||
LnkRemisiones.Visible = If(UsuarioActual.TienePermisoProceso(199), True, False) : LnkOCs.Visible = True : LnkCotizaciones.Visible = True : LnkPedido2SinFacturar.Visible = True : InicializaAplicarNCMasiva()
|
||||
End If
|
||||
|
||||
UPPVentas.Update()
|
||||
UpEstatus.Update()
|
||||
UPCondicionesPago.Update()
|
||||
|
||||
Reference in New Issue
Block a user