From cdee77379d96894d67a856fe65caf6a70204dfb2 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 22 Apr 2024 22:54:55 -0700 Subject: [PATCH 1/5] --metodos para update de clasificaciones en franquicias --- App_Code/ClsClasificaciones.vb | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index fb2c585bf..7ce2da27d 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -421,6 +421,58 @@ Public Class ClsClasificaciones Return Retorno End Function + Public Function UpdateClasificacionFranquicia(CveClasificacion As Integer, CveEmpresaActual As Integer, CveEmpresaFranquicia As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_ClasificacionFranquiciaUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveEmpresaActual", SqlDbType.Int).Value = CveEmpresaActual + .Add("@CveEmpresaFranquicia", SqlDbType.Int).Value = CveEmpresaFranquicia + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("La clasificación no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al intentar actualizar los datos de la clasificación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al intentar Actualizar los datos de la clasificación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + Public Function RemoveClasificacionFranquicia(CveClasificacion As Integer, CveEmpresaActual As Integer, CveEmpresaFranquicia As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_ClasificacionFranquiciaRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveEmpresaActual", SqlDbType.Int).Value = CveEmpresaActual + .Add("@CveEmpresaFranquicia", SqlDbType.Int).Value = CveEmpresaFranquicia + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("La clasificación no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al intentar actualizar los datos de la clasificación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al intentar Actualizar los datos de la clasificación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + 'Public Function UpdateClasificacionCunetas(CveClasificacion As Integer, CveCuentaContableIngreso As Integer, CveCuentaContableGasto As Integer, CveEmpresa As Object) As Boolean 'End Function From 47b3bf82893ff0f746ccf1b0c55f6c0be8f81bef Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 22 Apr 2024 23:46:29 -0700 Subject: [PATCH 2/5] Akustes Karedex, Reporte Asistencias Checador 2024.04.17 --- App_Code/ClsGenerales.vb | 2 +- App_Code/ClsInventarios.vb | 2 +- App_Code/ClsRH.vb | 15 +- Inventarios/Kardex.aspx.vb | 2 +- OS/OrdenesServicios.aspx | 22 +-- RH/RepChecadorPreAsistencia.aspx | 142 +++++++++++++++- RH/RepChecadorPreAsistencia.aspx.vb | 245 ++++++++++++++++++++++------ 7 files changed, 359 insertions(+), 71 deletions(-) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index ef9e785c4..c4b2b01bc 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -76,7 +76,7 @@ Public Class ClsGenerales If TransaccionCompartida Is Nothing Then SqlConexion = New SqlConnection - SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB + SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB Try SqlConexion.Open() Catch ex As Exception diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 387fe8e56..32239a15e 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1588,7 +1588,7 @@ Public Class ClsInventarios End Function Public Function GetKardex(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer, - Optional AgruparAlmacen As Boolean = False, Optional Serie As String = "-1", Optional CveAlmacenes As String = "-1", Optional CveMarca As Integer = -1, Optional CveProveedor As Integer = -1) As Boolean + Optional AgruparAlmacen As Boolean = False, Optional Serie As String = "-1", Optional CveAlmacenes As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_KardexGet") diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 5c4a50311..ed19dedff 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -2787,12 +2787,12 @@ Public Class ClsRH End Function - Public Function AddPreAsistencia(CvePersonal As Integer, Fecha As Date, CveAsistenciasInasistencias As Integer, PorcentajePago As Double, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddPreAsistencia(CvePersonal As Integer, Fecha As Date, CveAsistenciasInasistencias As Integer, PorcentajePago As Double, CveUsuario As Integer, CveEmpresa As Integer, Optional HorasDobles As Decimal = 0, + Optional HorasTriples As Decimal = 0, Optional CveMotivoHoraExtra As Integer = -1, Optional Observacion As String = "") As Boolean Dim Retorno As Boolean = False - Data = New DataTable - 'SqlAdapter = New SqlDataAdapter("PA_RH_PersonalAsistenciasAddUpd", SqlConexion) - 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure + Data = New DataTable + SqlDataAdapter("PA_RH_PersonalPreAsistenciasAddUpd") With SqlAdapter.SelectCommand.Parameters .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal @@ -2801,6 +2801,10 @@ Public Class ClsRH .Add("@PorcentajePago", SqlDbType.Float).Value = PorcentajePago .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@HorasDobles", SqlDbType.Money).Value = HorasDobles + .Add("@HorasTriples", SqlDbType.Money).Value = HorasTriples + .Add("@CveMotivoHoraExtra", SqlDbType.Int).Value = CveMotivoHoraExtra + .Add("@Observacion", SqlDbType.VarChar).Value = Observacion .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -6702,7 +6706,7 @@ Public Class ClsRH End Function - Public Function PreAsistenciaRegistrosGet(InicioPeriodo As Date, FinPeriodo As Date, CveTurno As Integer, CveEmpresa As Integer) As Boolean + Public Function PreAsistenciaRegistrosGet(InicioPeriodo As Date, FinPeriodo As Date, CveTurno As Integer, CveEmpresa As Integer, IncluyePreAsistencia As Boolean) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_ChecadorPreasistenciaRegistrosGet") @@ -6712,6 +6716,7 @@ Public Class ClsRH .Add("@FinPeriodo", SqlDbType.Date).Value = FinPeriodo .Add("@CveTurno", SqlDbType.Int).Value = CveTurno .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@IncluyePreAsistencia", SqlDbType.Bit).Value = IncluyePreAsistencia End With Try diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb index 6c9e0670e..b1d45e4ba 100644 --- a/Inventarios/Kardex.aspx.vb +++ b/Inventarios/Kardex.aspx.vb @@ -353,7 +353,7 @@ Partial Class Inventarios_Kardex Dim ObjInventarios As New ClsInventarios If ObjInventarios.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, - ChkAgruparAlmacen.Checked, Serie, CveAlmacenes, CveMarca:=DdlMarca.SelectedValue.ToEntero, CveProveedor:=DdlProveedores.SelectedValue.ToEntero) Then + ChkAgruparAlmacen.Checked, Serie, CveAlmacenes) Then dt = ObjInventarios.DtResultados.Copy End If ObjInventarios.Dispose() diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx index 807df5df5..b10c8df6b 100644 --- a/OS/OrdenesServicios.aspx +++ b/OS/OrdenesServicios.aspx @@ -1095,8 +1095,10 @@ Bitacora
-
-
+
+ +
@@ -1131,14 +1133,14 @@ - - Archivo - - - - - - + + Archivo + + + + + + diff --git a/RH/RepChecadorPreAsistencia.aspx b/RH/RepChecadorPreAsistencia.aspx index b475984ea..f4e645bab 100644 --- a/RH/RepChecadorPreAsistencia.aspx +++ b/RH/RepChecadorPreAsistencia.aspx @@ -25,6 +25,10 @@ +
  • + +
  • @@ -34,13 +38,14 @@ -
    +
      -
    • Ejercicio: +
    • Ejercicio: + @@ -52,7 +57,7 @@
    • Período: - @@ -77,10 +82,23 @@
    +
    @@ -88,19 +106,129 @@ + +
    +
    +
    +
    +
    + + +
    + +

    + Carga Masiva

    +
    +
    +
    + +
    +
    + +
    + + + + +
    + + + + + + +
    +
    + + +
    +
    + + + + +
    +
    + +
    +
    + + + + +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +
    +
    + + + +
    +
    + +
    +
    + + +
    +
    + + +
    + + +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    - + <%-- - - + --%> + <%-- - + --%> + + + diff --git a/RH/RepChecadorPreAsistencia.aspx.vb b/RH/RepChecadorPreAsistencia.aspx.vb index 321280968..1b8f3221e 100644 --- a/RH/RepChecadorPreAsistencia.aspx.vb +++ b/RH/RepChecadorPreAsistencia.aspx.vb @@ -265,7 +265,16 @@ Partial Class RH_RepChecadorPreAsistencia DdlAsistenciaInacistencia.DataSource = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(" CveAsistenciasInasistencias <> 6") DdlAsistenciaInacistencia.DataBind() - DdlAsistenciaInacistencia.Items.Insert(0, New ListItem("Seleccionar una opción", "-1")) + DdlAsistenciaInacistencia.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + + DdlAsistenciaInacistenciaCarga.DataSource = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa) + DdlAsistenciaInacistenciaCarga.DataBind() + DdlAsistenciaInacistenciaCarga.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + + DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras(UsuarioActual.CveEmpresa) + DdlMotivoHoraExtra.DataBind() + DdlMotivoHoraExtra.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + Dim objNom As New ClsNominas If objNom.GetTiposPeriodos() Then @@ -286,8 +295,20 @@ Partial Class RH_RepChecadorPreAsistencia DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) DdlTurno.Items.Insert(0, New ListItem("Todos", "-1")) DdlTurno.SelectedValue = "-1" + + CargaDepartamento() + End Sub + Private Sub CargaDepartamento() + DdlDepartamento.DataSource = GlobalDTDepartamentos(UsuarioActual.CveEmpresa) + DdlDepartamento.DataBind() End Sub + Private Sub CargaDdlAsistencia() + + + + + End Sub Private Sub GeneraFechasInicioFinPerdiodo() @@ -320,53 +341,54 @@ Partial Class RH_RepChecadorPreAsistencia cargaPeriodos() - 'Dim objNomina As New ClsNominas + Dim objNomina As New ClsNominas - 'If objNomina.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, -1, -1, -1) Then + If objNomina.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, -1, -1, -1) Then - ' TxtFechaModal.Text = "" - ' lblTituloPagina.Text = "" - ' UpTituloPagina.Update() - ' UpModalFechaBody.Update() + ' TxtFechaModal.Text = "" + ' lblTituloPagina.Text = "" + ' UpTituloPagina.Update() + ' UpModalFechaBody.Update() - ' If objNomina.DtResultados.Rows.Count > 0 Then - ' BtnConsultar.Enabled = True - ' DTPeriodos = objNomina.DtResultados - ' Dim DTPeridosView As DataView = DTPeriodos.DefaultView - ' DTPeridosView.Sort = " FechaInicio desc " - ' DTPeriodos = DTPeridosView.ToTable - ' DdlPeriodo.DataSource = objNomina.DtResultados + If objNomina.DtResultados.Rows.Count > 0 Then + ' BtnConsultar.Enabled = True + DTPeriodos = objNomina.DtResultados + ' Dim DTPeridosView As DataView = DTPeriodos.DefaultView + ' DTPeridosView.Sort = " FechaInicio desc " + ' DTPeriodos = DTPeridosView.ToTable + ' DdlPeriodo.DataSource = objNomina.DtResultados - ' ' LblPeriodo.Visible = True - ' 'DdlRango.Visible = True - ' Else - ' ' RegistraScript("$('#ModalModalFecha').modal({ backdrop: 'static', keyboard: false});") - ' Alert("No se encontraron periodos disponibles.", TipoMensaje.MsgAdvertencia) - ' DTPeriodos = Nothing - ' DdlPeriodo.DataSource = Nothing - ' End If - 'Else - ' DTPeriodos = Nothing - ' DdlPeriodo.DataSource = Nothing - 'End If - 'objNomina.Dispose() + ' ' LblPeriodo.Visible = True + ' 'DdlRango.Visible = True + Else + ' ' RegistraScript("$('#ModalModalFecha').modal({ backdrop: 'static', keyboard: false});") + ' Alert("No se encontraron periodos disponibles.", TipoMensaje.MsgAdvertencia) + DTPeriodos = Nothing + ' DdlPeriodo.DataSource = Nothing + End If + 'Else + ' DTPeriodos = Nothing + ' DdlPeriodo.DataSource = Nothing + End If + + objNomina.Dispose() Dim DtTempFechaInicial As DataTable = DTPeriodos.FiltraParametros("Estatus = 1") - DdlPeriodo.DataBind() + DdlPeriodo.DataBind() - If DtTempFechaInicial.Rows.Count > 0 Then - Dim temCvePeriodoNomi As Integer = DtTempFechaInicial(0)("CvePeriodo").ToString().ToEntero - DdlPeriodo.SelectedValueExist(temCvePeriodoNomi) - End If + If DtTempFechaInicial.Rows.Count > 0 Then + Dim temCvePeriodoNomi As Integer = DtTempFechaInicial(0)("CvePeriodo").ToString().ToEntero + DdlPeriodo.SelectedValueExist(temCvePeriodoNomi) + End If - DdlPeriodo.Items.Insert(0, New ListItem("Seleccione uno", "-1")) - UPFiltros.Update() - ' BtnConsultar.Enabled = True - Else + DdlPeriodo.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + UPFiltros.Update() + ' BtnConsultar.Enabled = True + Else - DTPeriodos = Nothing + DTPeriodos = Nothing DdlPeriodo.DataSource = Nothing 'DdlRango.Visible = False @@ -378,6 +400,8 @@ Partial Class RH_RepChecadorPreAsistencia End If GeneraFechasInicioFinPerdiodo() + + DdlPeriodo_SelectedIndexChanged(Nothing, Nothing) End Sub Private Sub DdlRango_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPeriodo.SelectedIndexChanged @@ -491,15 +515,27 @@ Partial Class RH_RepChecadorPreAsistencia Dim DtTempPeriodo As DataTable = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue.ToEntero) Dim FechaInicioPeriodoFiltro = DtTempPeriodo(0)("FechaInicio").ToString().ToDate + 'Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto).AsEnumerable() + ' Let Inicio = fila.Field(Of Date)("FechaInicio") + ' Let FechaFinOriginal = fila.Field(Of Date?)("FechaFin") + ' Let FechaFin = If(FechaFinOriginal.HasValue, FechaFinOriginal.Value, Now) + ' Where Inicio <= FechaInicioPeriodoFiltro AndAlso FechaInicioPeriodoFiltro <= FechaFin + ' Select fila + + Dim FilCveDepartamento As Integer = DdlDepartamento.SelectedValue.ToEntero + Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto).AsEnumerable() - Let Inicio = fila.Field(Of Date)("FechaInicio") - Let FechaFinOriginal = fila.Field(Of Date?)("FechaFin") - Let FechaFin = If(FechaFinOriginal.HasValue, FechaFinOriginal.Value, Now) - Where Inicio <= FechaInicioPeriodoFiltro AndAlso FechaInicioPeriodoFiltro <= FechaFin - Select fila + Let Inicio = fila.Field(Of Date)("FechaInicio") + Let FechaFinOriginal = fila.Field(Of Date?)("FechaFin") + Let FechaFin = If(FechaFinOriginal.HasValue, FechaFinOriginal.Value, Now) + Where Inicio <= FechaInicioPeriodoFiltro AndAlso FechaInicioPeriodoFiltro <= FechaFin _ + AndAlso (FilCveDepartamento = -1 OrElse fila.Field(Of Integer)("CveDepartamento") = FilCveDepartamento) + Select fila DtPersonal = FilasFiltradas.CopyToDataTable() + + If objRH.ChecadorHorariosGet(-1, 1, UsuarioActual.Empresa.CveEmpresa) Then DTHorarios = objRH.DtResultados @@ -531,7 +567,7 @@ Partial Class RH_RepChecadorPreAsistencia End If - If objRH.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then + If objRH.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, False) Then DTChecadorRegistros = objRH.DtResultados End If @@ -571,6 +607,13 @@ Partial Class RH_RepChecadorPreAsistencia Dim Fecha As Date = FechaInicioPeriodo Dim ContadorFaltas As Integer = 0 + + objRH = New ClsRH + If objRH.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, True) Then + DTChecadorRegistros = objRH.DtResultados + End If + objRH.Dispose() + Dim registrosPersonal As DataTable = DTChecadorRegistros.FiltraParametros(" CvePersonal = " & dRow(0).ToString()) Dim CveTurno As Integer = dRow("CveTurno").ToString.ToEntero @@ -1169,14 +1212,21 @@ Partial Class RH_RepChecadorPreAsistencia End Sub Private Sub GvBind() + + Dim Enviado As Boolean = PeriodoBloqueado(DdlPeriodo.SelectedValue.ToEntero) + LnkEnviarAsistencia.Visible = False + LnkCargaMasiva.Visible = False + If DtDatosTabla.Rows.Count > 0 Then - 'BtnAgregar.Visible = True GVRegDatos.DataSource = DtDatosTabla LnkEnviarAsistencia.Visible = True + If Not Enviado Then + LnkCargaMasiva.Visible = True + End If + Else - 'BtnAgregar.Visible = False GVRegDatos.DataSource = Nothing End If @@ -1861,7 +1911,7 @@ Partial Class RH_RepChecadorPreAsistencia Dim objRH As New ClsRH - If objRH.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + If objRH.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, False) Then DTChecadorRegistros = objRH.DtResultados End If @@ -2366,4 +2416,107 @@ Partial Class RH_RepChecadorPreAsistencia ObjPersonal.Dispose() End Sub + Protected Sub LnkCargaMasiva_Click(sender As Object, e As EventArgs) + + DVEnvioMasivo.Visible = False + Dim Enviado As Boolean = PeriodoBloqueado(DdlPeriodo.SelectedValue.ToEntero) + + If Enviado Then + Alert("El periodo ya ha sido enviado.", TipoMensaje.MsgAdvertencia) + Else + DVEnvioMasivo.Visible = True + End If + + UpDatos.Update() + + End Sub + + Private Function PeriodoBloqueado(CvePeriodo As Integer) As Boolean + Dim respuesta As Boolean = True + If CvePeriodo > 0 Then + Using objPeriodos As New ClsNominas() + If objPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, CvePeriodo) Then + + If objPeriodos.DtResultados.Rows.Count > 0 Then + respuesta = Boolean.Parse(objPeriodos.DtResultados.Rows(0)("PreAsistenciaEnviada").ToString) + Else + respuesta = False + End If + + End If + End Using + End If + + Return respuesta + + End Function + + + Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs) + + Dim Enviado As Boolean = PeriodoBloqueado(DdlPeriodo.SelectedValue.ToEntero) + + If Enviado Then + LnkEnviarAsistencia.Visible = False + 'LnkCargaMasiva.Visible = False + Else + LnkEnviarAsistencia.Visible = True + 'LnkCargaMasiva.Visible = True + End If + + UPFiltros.Update() + + End Sub + + Protected Sub LnklEnviarCargaMasiva_Click(sender As Object, e As EventArgs) + + + Dim Enviado As Boolean = PeriodoBloqueado(DdlPeriodo.SelectedValue.ToEntero) + + If Enviado Then + Alert($"El periodo {DdlPeriodo.SelectedItem.Text} ya fue enviado.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim FechaCarga As Date = TxtFechaCargaMasiva.Text.ToDate + Dim ProcesoOK As Boolean = True + + If Not (FechaCarga >= FechaInicioPeriodo AndAlso FechaCarga <= FechaFinPeriodo) Then + Alert("La fecha de carga masiva debe de estar en el rango de fechas del período seleccionado.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If DdlMotivoHoraExtra.SelectedValue.ToEntero > 0 And (TxtHorasDobles.Text.ToDecimal > 0 And TxtHorasTriples.Text.ToDecimal > 0) Then + Alert("Debe seleccionar un motivo de horas extra.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim ObjRH As New ClsRH + ObjRH.IniciaTransacSQL() + + + For Each GvRow As GridViewRow In GVRegDatos.Rows + + Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero + + If Not ObjRH.AddPreAsistencia(CvePersonal, FechaCarga, DdlAsistenciaInacistenciaCarga.SelectedValue.ToEntero, TxtPorcentajePago.Text.ToDecimal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, + TxtHorasDobles.Text.ToDecimal, TxtHorasTriples.Text.ToDecimal, DdlMotivoHoraExtra.SelectedValue.ToEntero, TxtObs.Text) Then + ProcesoOK = False + Exit For + End If + + Next + + If ProcesoOK Then + ObjRH.Commit() + Alert("Carga realizada correctamente.") + CargaDatos() + Else + ObjRH.RollBack() + End If + + + End Sub + + End Class \ No newline at end of file From c03c08a976543d2a7c6dadd4e83bf9eb2f705c82 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 23 Apr 2024 08:30:32 -0700 Subject: [PATCH 3/5] Correcion ClsInventarios, Kardex se eliminan parametros , CveMarca CveProveedor --- App_Code/ClsInventarios.vb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 32239a15e..d45f8afca 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1607,8 +1607,7 @@ Public Class ClsInventarios .Add("@AgruparAlmacen", SqlDbType.Bit).Value = AgruparAlmacen .Add("@Serie", SqlDbType.VarChar).Value = Serie .Add("@CveAlmacenes", SqlDbType.VarChar).Value = CveAlmacenes - .Add("@CveMarca", SqlDbType.Int).Value = CveMarca - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + End With From a743f03e2decc28931f87871e441fbdba3b076fc Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 23 Apr 2024 19:44:12 -0700 Subject: [PATCH 4/5] --Clonar Clasificaciones cuando exista la funcionalidad 563 --- App_Code/ClsClasificaciones.vb | 3 +- General/SaldosIniciales.aspx.vb | 2 +- Ventas/CatClasificaciones.aspx.vb | 220 +++++++++++++++++++++--------- 3 files changed, 160 insertions(+), 65 deletions(-) diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 7ce2da27d..5c81d9f0c 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -421,13 +421,14 @@ Public Class ClsClasificaciones Return Retorno End Function - Public Function UpdateClasificacionFranquicia(CveClasificacion As Integer, CveEmpresaActual As Integer, CveEmpresaFranquicia As Integer) As Boolean + Public Function UpdateClasificacionFranquicia(CveClasificacion As Integer, Clasificacion As String, CveEmpresaActual As Integer, CveEmpresaFranquicia As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_ClasificacionFranquiciaUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@Clasificacion", SqlDbType.VarChar).Value = Clasificacion .Add("@CveEmpresaActual", SqlDbType.Int).Value = CveEmpresaActual .Add("@CveEmpresaFranquicia", SqlDbType.Int).Value = CveEmpresaFranquicia End With diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 76b6e6e28..72563b724 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -2581,7 +2581,7 @@ Partial Class General_SaldosIniciales Dim ObjMovimientos As New ClsInventarios ObjMovimientos.IniciaTransacSQL() - Dim ProductosServiciosRef As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) + Dim ProductosServiciosRef As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, Estatus:=-1) Dim AlmacenRef As DataTable = GlobalDTAlmacen(UsuarioActual.CveEmpresa) Dim contadorMovimientos As Integer = 0 Dim listadoMovimientos As String = "" diff --git a/Ventas/CatClasificaciones.aspx.vb b/Ventas/CatClasificaciones.aspx.vb index 250fe13ba..23e1657fa 100644 --- a/Ventas/CatClasificaciones.aspx.vb +++ b/Ventas/CatClasificaciones.aspx.vb @@ -75,10 +75,19 @@ Partial Class CatClasificaciones Set(value As Boolean) ViewState("CargaCostos") = value End Set - End Property - + End Property + Private Property ClasificacionOriginal As String + Get + Return IfNull(ViewState("ClasificacionOriginal"), "", ViewState("ClasificacionOriginal").ToString()).ToString() + End Get + Set(value As String) + ViewState("ClasificacionOriginal") = value + End Set + End Property + + #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then @@ -86,6 +95,7 @@ Partial Class CatClasificaciones CargaCostos = True CargaIngresos = True DtCuentasContables = Nothing + ClasificacionOriginal = "" CargaDdlSATPS() CargaDDLs() @@ -149,56 +159,85 @@ Partial Class CatClasificaciones Dim ObjClasificaciones As New ClsClasificaciones Dim objConta As New ClsContabilidad(ObjClasificaciones.IniciaTransacSQL) Dim RequireSerieLote As Integer = If(ChkRequiereSerieLote.Checked, 1, 0) + Dim TieneError As Boolean = False - If HdnModalidadClasificacion.Value = "A" Then - If ObjClasificaciones.AddClasificaciones(TxtClasificacion.Text.Trim, "", - DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, - RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then + Try + If HdnModalidadClasificacion.Value = "A" Then + If ObjClasificaciones.AddClasificaciones(TxtClasificacion.Text.Trim, "", + DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, + RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then + + ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") + + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + If DdlCuentaGasto.SelectedValue.ToEntero > 0 Then + If Not objConta.AddCuentasAsignaciones(6, UsuarioActual.CveEmpresa, DdlCuentaGasto.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion) Then + TieneError = True + End If + End If + If DdlCuentaCostos.SelectedValue.ToEntero > 0 Then + If Not objConta.AddCuentasAsignaciones(69, UsuarioActual.CveEmpresa, DdlCuentaCostos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion) Then + TieneError = True + End If + End If + If DdlCuentaIngresos.SelectedValue.ToEntero > 0 Then + If Not objConta.AddCuentasAsignaciones(4, UsuarioActual.CveEmpresa, DdlCuentaIngresos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion) Then + TieneError = True + End If + End If + End If + + If Not TieneError AndAlso UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + TieneError = Not ActualizarClasificacionFranquicia(ObjClasificaciones, ObjClasificaciones.CveClasificacion, TxtClasificacion.Text.Trim) + End If + Else + TieneError = True + End If + + ElseIf HdnModalidadClasificacion.Value = "U" Then + Dim Clasificacion As String = TxtClasificacion.Text + Dim Estatus As Boolean = ChkEstatus.Checked + Dim CveClasificacion As Integer = HdnIDClasificacion.Value.ToEntero + Dim DdlGasto As DropDownList = DdlCuentaGasto + Dim DdlCosto As DropDownList = DdlCuentaCostos + Dim DdlIngresos As DropDownList = DdlCuentaIngresos + + If ObjClasificaciones.UpdateClasificacion(Clasificacion, "", + Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, + RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + If DdlCuentaGasto.SelectedValue.ToEntero > 0 Then + If Not objConta.UpdateCuentasAsignaciones(HdnCveCuentaAsignacion.Value.ToEntero, 6, DdlCuentaGasto.SelectedValue.ToEntero, CveClasificacion:=CveClasificacion) Then + TieneError = True + End If + End If + End If + + If Not TieneError AndAlso UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + TieneError = Not ActualizarClasificacionFranquicia(ObjClasificaciones, CveClasificacion, Me.ClasificacionOriginal) + End If + Else + TieneError = True + End If + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar la clasificación", ex) + TieneError = True + End Try - ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") - If UsuarioActual.Empresa.TipoContabilidad = 1 Then - If DdlCuentaGasto.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(6, UsuarioActual.CveEmpresa, DdlCuentaGasto.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion) - If DdlCuentaCostos.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(69, UsuarioActual.CveEmpresa, DdlCuentaCostos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion) - If DdlCuentaIngresos.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(4, UsuarioActual.CveEmpresa, DdlCuentaIngresos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion) - End If - ObjClasificaciones.Commit() - TxtClasificacion.Text = "" - TxtPrecioBaseCosto.Text = "" - DdlCuentaGasto.SelectedValueExist("0") - DdlCuentaCostos.SelectedValueExist("0") - DdlCuentaIngresos.SelectedValueExist("0") - RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones")) - Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion) - Else - Alert("Ocurrió un error al agregar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError) - ObjClasificaciones.RollBack() - End If - - ElseIf HdnModalidadClasificacion.Value = "U" Then - Dim Clasificacion As String = TxtClasificacion.Text - Dim Estatus As Boolean = ChkEstatus.Checked - Dim CveClasificacion As Integer = HdnIDClasificacion.Value.ToEntero - Dim DdlGasto As DropDownList = DdlCuentaGasto - Dim DdlCosto As DropDownList = DdlCuentaCostos - Dim DdlIngresos As DropDownList = DdlCuentaIngresos - - If ObjClasificaciones.UpdateClasificacion(Clasificacion, "", - Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, - RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then - - If UsuarioActual.Empresa.TipoContabilidad = 1 Then - If DdlCuentaGasto.SelectedValue.ToEntero > 0 Then objConta.UpdateCuentasAsignaciones(HdnCveCuentaAsignacion.Value.ToEntero, 6, DdlCuentaGasto.SelectedValue.ToEntero, CveClasificacion:=CveClasificacion) - - End If - - ObjClasificaciones.Commit() - RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones")) - Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) - - Else - Alert("Ocurrió un error al actualizar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError) - ObjClasificaciones.RollBack() - End If + If TieneError Then + Alert("Ocurrió un error al guardar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError) + ObjClasificaciones.RollBack() + Else + ObjClasificaciones.Commit() + Me.ClasificacionOriginal = "" + TxtClasificacion.Text = "" + TxtPrecioBaseCosto.Text = "" + DdlCuentaGasto.SelectedValueExist("0") + DdlCuentaCostos.SelectedValueExist("0") + DdlCuentaIngresos.SelectedValueExist("0") + RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones")) + Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If ObjClasificaciones.Dispose() @@ -316,16 +355,37 @@ Partial Class CatClasificaciones Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then - GvDatos.EditIndex = -1 - GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing - CargaDatos() - Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion) - Else - Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError) - End If - ObjClasificaciones.Dispose() - + ObjClasificaciones.IniciaTransacSQL() + Dim TieneError As Boolean = False + Try + Dim CveClasificacion As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero + If Not TieneError AndAlso UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + TieneError = Not RemoveClasificacionFranquicia(ObjClasificaciones, CveClasificacion) + End If + + If Not TieneError AndAlso Not ObjClasificaciones.RemoveClasificacion(CveClasificacion) Then + TieneError = True + End If + Catch ex As Exception + OnError("Ocurrió un error al eliminar la clasificación", ex) + TieneError = True + End Try + + If TieneError Then + ObjClasificaciones.RollBack() + ObjClasificaciones.Dispose() + Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError) + Else + ObjClasificaciones.Commit() + ObjClasificaciones.Dispose() + + Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion) + GvDatos.EditIndex = -1 + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing + CargaDatos() + End If + + End Sub #End Region @@ -433,7 +493,7 @@ Partial Class CatClasificaciones DdlCuentaIngresos.SelectedValueExist(CveCuentaIngresoActual) End If - + Me.ClasificacionOriginal = Clasificacion TxtClasificacion.Text = Clasificacion TxtPrecioBaseCosto.Text = PrecioBaseCosto.FormatoNumero(2) DdlCategoria.SelectedValueExist(CveCategoria) @@ -473,5 +533,39 @@ Partial Class CatClasificaciones End Sub Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) CargaDatos() - End Sub + End Sub + + Private Function ActualizarClasificacionFranquicia(ByRef ObjClas As ClsClasificaciones, CveClasificacion As Integer, NombreOriginal As String) As Boolean + Dim TieneError As Boolean = False + Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563) + + Dim Franquicias As String() = FranquiciasStr.Split(","c) + + For Each Franquicia As String In Franquicias + Dim CveEmpresaFranquicia As Integer = Franquicia.ToEntero + If Not ObjClas.UpdateClasificacionFranquicia(CveClasificacion, NombreOriginal, UsuarioActual.CveEmpresa, CveEmpresaFranquicia) Then + TieneError = True + Exit For + End If + Next + + Return Not TieneError + End Function + + Private Function RemoveClasificacionFranquicia(ByRef ObjClas As ClsClasificaciones, CveClasificacion As Integer) As Boolean + Dim TieneError As Boolean = False + Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563) + + Dim Franquicias As String() = FranquiciasStr.Split(","c) + + For Each Franquicia As String In Franquicias + Dim CveEmpresaFranquicia As Integer = Franquicia.ToEntero + If Not ObjClas.RemoveClasificacionFranquicia(CveClasificacion, UsuarioActual.CveEmpresa, CveEmpresaFranquicia) Then + TieneError = True + Exit For + End If + Next + + Return Not TieneError + End Function End Class From f51b8c9e55bded5cc2711a8c6b87d158f83c8ec4 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 24 Apr 2024 08:35:59 -0700 Subject: [PATCH 5/5] Reporte Asistencias Checador 2024.04.17 --- Compras/PopUpVerFactura.aspx.vb | 24 +- RH/RepChecadorPreAsistencia.aspx | 116 ++++--- RH/RepChecadorPreAsistencia.aspx.vb | 469 ++++++++++++++++------------ 3 files changed, 351 insertions(+), 258 deletions(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 427b1e733..85bc94eeb 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -5751,18 +5751,22 @@ Partial Class PopUpVerFactura If ObjIE.GetBancosIEFacturasPagadas(CveIE, UsuarioActual.CveEmpresa) Then dtMovs = ObjIE.DtResultados.FiltraParametros("CveConceptoContable IN (17,2,308,309,312,292 )") - CvePrePoliza = dtMovs.Rows(0)("CVePrePoliza").ToString.ToEntero - If Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then - 'CONVIERTO A PESOS CUANDO SE PAGA CON PESOS FACTURAS DE DOLARES - For Each Dr As DataRow In dtMovs.Rows - Dr("Importe") = Dr("ImporteMN").ToString.ToDecimal - Dr("ImporteNC") = Dr("ImporteNC").ToString.ToDecimal * Dr("TC").ToString.ToDecimal - Dr("Total") = Dr("Total").ToString.ToDecimal * Dr("TC").ToString.ToDecimal - Dr("Saldo") = Dr("Saldo").ToString.ToDecimal * Dr("TC").ToString.ToDecimal - Next + If dtMovs IsNot Nothing AndAlso dtMovs.Rows.Count > 0 Then + CvePrePoliza = dtMovs.Rows(0)("CVePrePoliza").ToString.ToEntero + + If Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then + 'CONVIERTO A PESOS CUANDO SE PAGA CON PESOS FACTURAS DE DOLARES + For Each Dr As DataRow In dtMovs.Rows + Dr("Importe") = Dr("ImporteMN").ToString.ToDecimal + Dr("ImporteNC") = Dr("ImporteNC").ToString.ToDecimal * Dr("TC").ToString.ToDecimal + Dr("Total") = Dr("Total").ToString.ToDecimal * Dr("TC").ToString.ToDecimal + Dr("Saldo") = Dr("Saldo").ToString.ToDecimal * Dr("TC").ToString.ToDecimal + Next + End If End If + End If Dim rds As New ReportDataSource("DataSet1", dtMovs) @@ -5794,7 +5798,7 @@ Partial Class PopUpVerFactura End With dtMovs.Dispose() - If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then + If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 And CvePrePoliza > 0 Then Dim ObjContabilidad As New ClsContabilidad diff --git a/RH/RepChecadorPreAsistencia.aspx b/RH/RepChecadorPreAsistencia.aspx index f4e645bab..ae68c12ee 100644 --- a/RH/RepChecadorPreAsistencia.aspx +++ b/RH/RepChecadorPreAsistencia.aspx @@ -227,7 +227,7 @@ --%> - + @@ -399,62 +399,96 @@ + +