diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index fa676a5bd..9acc9375e 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -2525,7 +2525,7 @@ Public Class ClsGenerales Public Function GetHistorialBitacora(CveAcarreo As Integer, CveOrdenCompra As Integer, CveActivoFijo As Integer, CveOS As Integer, CvePS As Integer, CveCompra As Integer, CveIE As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional CvePersonal As Integer = -1, - Optional IdPoliza As Integer = -1, Optional CvePrePoliza As Integer = -1, Optional CvePromocion As Integer = -1) As Boolean + Optional IdPoliza As Integer = -1, Optional CvePrePoliza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveConceptoNomina As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_HistorialBitacoraGet") @@ -2542,8 +2542,11 @@ Public Class ClsGenerales .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza - .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion - + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@CveConceptoNomina", SqlDbType.Int).Value = CveConceptoNomina + + + End With 'SqlTypes.SqlDateTime.Null Try @@ -2583,7 +2586,7 @@ Public Class ClsGenerales CveActivoFijo As Integer, CveOS As Integer, CvePS As Integer, CveCompra As Integer, CveIE As Integer, Actual As String, Anterior As String, CveUsuario As Integer, CveEmpresa As Integer, SeElimino As Integer, Descripcion As String, Tipo As String, - Id_Clave As String, Optional IdPoliza As Integer = -1, Optional CvePromocion As Integer = -1) As Boolean + Id_Clave As String, Optional IdPoliza As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_HistorialBitacoraAdd") @@ -2605,10 +2608,7 @@ Public Class ClsGenerales .Add("@Tipo", SqlDbType.VarChar).Value = Tipo .Add("@Id_Clave", SqlDbType.VarChar, 100).Value = Id_Clave .Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza - .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion - - - + End With 'SqlTypes.SqlDateTime.Null Try diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 3fe0eeeb6..5ac824654 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -2251,6 +2251,29 @@ Public Class ClsNominas End Try Return retorno End Function + Public Function GetchecadorAdistencia(FechaInicio As DateTime, FechaFin As DateTime, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + + Try + DTSet = New DataSet() + DataAdapter("PA_RH_PersonalChecadorASistencia", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + SqlAdapter.Fill(DTSet) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al Realizar el calculo de asistencia.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al Realizar el calculo de asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GetNominaAcumulado(Ejercicio As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodoI As Integer, CvePeriodoF As Integer, CveEmpresa As Integer, Optional RegimenContratacion As Integer = 1, Optional CvePersonal As Integer = -1) As Boolean Dim retorno As Boolean = False @@ -2280,6 +2303,48 @@ Public Class ClsNominas Return retorno End Function +#Region "Vacaciones" + Public Function GETPersonalVacResumen(CveEmpresa As Integer, CvePersonal As Integer) As Boolean + Dim retorno As Boolean = False + + Try + DataAdapter("PA_RH_PersonalVacResumenGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Decimal).Value = CvePersonal + End With + SqlAdapter.Fill(Data) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las vacaciones.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las vacaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GETPersonalVacaciones(CveEmpresa As Integer, CvePersonal As Integer) As Boolean + Dim retorno As Boolean = False + + Try + DataAdapter("PA_RH_PersonalVacacionesGET", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Decimal).Value = CvePersonal + End With + SqlAdapter.Fill(Data) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las vacaciones.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las vacaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function +#End Region Public Function GetCalculoSBC(CveEmpresa As Integer, Tipo As Integer, FechaCalculo As String) As Boolean Dim retorno As Boolean = False Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 6f614ab00..ca3dfd4b8 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3896,6 +3896,7 @@ Public Class ClsPaginas If Application("GlobalSIGAppPaginas") Is Nothing Then PaginaDict = New System.Collections.Hashtable + PaginaDict.Add("/Nomina/ChecadorAsistencia.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918) PaginaDict.Add("/Nomina/MovimientosSUA.aspx".ToUpper(), 919) 'PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916) diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index 35304a37d..12a49ab51 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -327,7 +327,7 @@ Public Class LogicNominas Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos) If DtPercepciones IsNot Nothing AndAlso DtPercepciones.Rows.Count > 0 Then For Each Row As DataRow In DtPercepciones.Rows - If Row("Importe").ToString().ToDecimal > 0 AndAlso Row("SATCveConcepto").ToString().ToEntero() <> 17 Then + If Row("Importe").ToString().ToDecimal > 0 OrElse (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("ImporteValor").ToString().ToDecimal().Abs() > 0) Then If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For ObjPercepciones.Add(New CFDINominaPercepciones With {.TipoPercepcion = If(Row("SATCveConcepto").ToString() = "999", "038", Row("SATCveConcepto").ToString()), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .ImporteGravado = Row("ImporteGravado").ToString().ToDecimal(), .ImporteExento = Row("ImporteExento").ToString().ToDecimal()}) @@ -352,7 +352,7 @@ Public Class LogicNominas If DtDeducciones IsNot Nothing AndAlso DtDeducciones.Rows.Count > 0 Then For Each Row As DataRow In DtDeducciones.Rows - If Row("Importe").ToString().ToDecimal <> 0 Then + If Row("Importe").ToString().ToDecimal <> 0 OrElse (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("ImporteValor").ToString().ToDecimal().Abs() > 0) Then If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 Then @@ -383,7 +383,7 @@ Public Class LogicNominas If DtOtrosPagos IsNot Nothing AndAlso DtOtrosPagos.Rows.Count > 0 Then For Each Row As DataRow In DtOtrosPagos.Rows - If (Row("Importe").ToString().ToDecimal() <> 0) OrElse + If (Row("Importe").ToString().ToDecimal() <> 0) OrElse (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("ImporteValor").ToString().ToDecimal().Abs() > 0) OrElse (Row("SATCveConcepto").ToString().ToEntero() = 2 AndAlso (CveRegimenContratacion.ToEntero() = 2 OrElse Row("Importe").ToString().ToDecimal() <> 0)) OrElse (Row("SATCveConcepto").ToString().ToEntero().Contiene(2, 4) AndAlso Row("Importe").ToString().ToDecimal() < 0) Then diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index b36f28a44..093752da9 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -9902,6 +9902,7 @@ Namespace Modelos Public Property EsDistribuidor As Boolean Public Property CorreoCotizacion As String Public Property ImprimeNombreSucursal As Integer + Public Property CobranzaCorreo As String End Class diff --git a/Ashx/TareasProgramadas.ashx b/Ashx/TareasProgramadas.ashx index e7168ab56..8171b5431 100644 --- a/Ashx/TareasProgramadas.ashx +++ b/Ashx/TareasProgramadas.ashx @@ -20,10 +20,12 @@ Public Class TareasProgramadas : Implements IHttpHandler 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")) 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 + 'SI TRAE UN JSON COMO PARAMETRO + ElseIf context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing AndAlso (context.Request("var") Is Nothing AndAlso context.Request("metodo") IsNot Nothing) Then context.Response.ContentType = "application/json" Using reader As New StreamReader(context.Request.InputStream) Dim json = reader.ReadToEnd() @@ -32,6 +34,8 @@ Public Class TareasProgramadas : Implements IHttpHandler metodo = JsonRequest("Metodo").ToString End If End Using + ElseIf context.Request("metodo") IsNot Nothing Then + metodo = context.Request("metodo").ToString() End If Select Case metodo @@ -282,9 +286,13 @@ Public Class TareasProgramadas : Implements IHttpHandler Retorno.Add(obj) Next + + DtEmpresas.Dispose() End If - context.Response.Write(Retorno.ToString()) + GuardaLogEdoCuenta(Retorno.ToString()) + + context.Response.Write("True") End Sub @@ -324,7 +332,8 @@ Public Class TareasProgramadas : Implements IHttpHandler Private Function EjecutarEnvioEstadoCuenta(UsuarioActual As Usuario, Optional pCveCliente As Integer = -1) As JObject - Dim ClientesSinEnviar As New JArray() + Dim ClientesSinEnviar As New JArray() + Dim ClientesEdoEnviado As New JArray() Dim Json As New JObject( New JProperty("Empresa", UsuarioActual.Empresa.Empresa), @@ -333,37 +342,80 @@ Public Class TareasProgramadas : Implements IHttpHandler ) 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 + '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 + + Using ObjMov As New ClsMovimientos + Dim FechaI As String = "-1" + Dim FechaF As String = "-1" + Dim FechaVI As String = "-1" + Dim FechaVF As String = "-1" + Dim TCEspecifico = -1 + + Dim CveCobranzaEstatus As Integer = -1 + Dim CveClienteClasificacion As Integer = -1 + Dim CveCliente As Integer = -1 + Dim AplicaAnticipos As Integer = 0 + + Dim CveSubProyecto As Integer = -1 + Dim CveVendedor As Integer = -1 + Dim Grupo As Integer = 5 + Dim TipoCambio As Integer = 1 + Dim TipoDocto As String = "-1" + Dim FechaCorte As DateTime = New DateTime(Now.Year, 12, 31) + + If ObjMov.GetCxC(FechaI, FechaF, CveCliente, CveSubProyecto, CveVendedor, -1, -1, "-1", UsuarioActual.CveEmpresa, Grupo, -1, TipoCambio, TCEspecifico, TipoDocto, FechaVI, FechaVF, FechaCorte:=FechaCorte, + EstatusCliente:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=-1, TipoCliente:=-1, AplicaAnticiposPagados:=AplicaAnticipos) Then + DTClientes = ObjMov.DtResultados.FiltraParametros("CveCliente > 0", DistinctColumns:={"CveCliente"}) 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 = RowCliente("CobranzaCorreo").ToString() + 'DTClientes = DTClientes.FiltraParametros("CveCliente IN (227289,227429,227733,227838,228181,228544,229176,229481,230029,230432,230860,230911,230918,231197,231576,232173,232185,233055,233295,233357,233588,236379,236460,237161,237635,238285,238530,238622,238724,239033,239099,239865,239895,239903,240202,240235,240236,240238,240303,240340,262404,262517,264765,264806,264825,264848,264930,265063,265180,265213,265214,265236,265344,265492,265555,265669,265797,265952,265963,266156,266182,268346,268396,268488,268535,268539,268558,268562,268706,268726,268787,268868,268889,268910,268925,269023,269081,269089,272066,272070,272657,273080,273084,275627,276259,276587,281115,283110,284664,285392,287653,288711,291374,292444,295578,296375,296598,302728,303936,306897,307183,311007,320060,320685,320800,323520,323772,325237,326996,327801,330630,331741,332118,337105,340502,341796,342807,343858,355862,358123,365794,371524,375391,377122,377948,378267,380167,381210,381878,383098,383250,383339,383650,384472,385321,385585,386630,387114,388987,396341,396405,396541,401995,404175,408306,416386,416819,420275,438732,447566,447636,450284,464150,464376,468051,475172,475932,476984,477997,478426)") + + For Each RowCliente As DataRow In DTClientes.Rows + + Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero() Dim Cliente As New Modelos.ClienteModel(CveCliente, UsuarioActual.CveEmpresa) - Dim Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente) + If Cliente IsNot Nothing Then + Dim Correo As String = Cliente.CobranzaCorreo '"japmx95@gmail.com" 'RowCliente("CobranzaCorreo").ToString() - 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 + Dim Envio As Boolean = False + If Not String.IsNullOrEmpty(Correo) Then + Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente) + End If + + If Envio Then + + ClientesEdoEnviado.Add(New JObject( + New JProperty("CveCliente", Cliente.CveCliente), + New JProperty("Cliente", Cliente.Nombre) + )) + + 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 + End If + Next DTClientes.Dispose() End If - Json.Add(New JProperty("ClientesSinEnviar", ClientesSinEnviar)) + Json.Add(New JProperty("ClientesSinEnviar", ClientesSinEnviar)) + Json.Add(New JProperty("ClientesEdoEnviado", ClientesEdoEnviado)) Return Json End Function @@ -616,10 +668,12 @@ Public Class TareasProgramadas : Implements IHttpHandler
ESTE CORREO SE GENERO EN FORMA AUTOMATICA.", Cliente.NombreComercial, UsuarioActual.Empresa.Empresa) - Retorno = MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo) + Dim Hilo As New System.Threading.Thread(Sub() MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo)) + Hilo.Start() + Retorno = True Catch ex As Exception Retorno = False - OnError("Ocurrió un error al enviar el correo", ex) + OnError("Ocurrió error al mandar el correo de estado de cuenta", ex) End Try Else Retorno = False @@ -683,17 +737,47 @@ Public Class TareasProgramadas : Implements IHttpHandler Return Bytes End Function - Private Function MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String) As Boolean + Private Function MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String) As Boolean + 'Para = "japmx95@gmail.com" + Try + Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para) + 'a.GuardaLog() + Dim Mail As New ClsSisMail() + + Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"}) + + Return Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail) + Catch ex As Exception + OnError("Ocurrió un error al enviar el correo de edo cuenta", ex) + Return False + End Try - Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para) - 'a.GuardaLog() - Dim Mail As New ClsSisMail() - - Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) - LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"}) - - Return Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail) End Function + + Public Sub GuardaLogEdoCuenta(Str As String) + Dim ArchivoW As StreamWriter + Dim strLineaTMP As String + + ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10) + strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString) + Try + ArchivoW = New StreamWriter(String.Format("{0}\Log\LogEdoCuenta.txt", ModExtensiones.DirectorioBaseEmpresas), True, System.Text.Encoding.UTF8) + Catch ex As UnauthorizedAccessException + 'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError) + Exit Sub + Catch ex As Exception + Exit Sub + End Try + + Try + ArchivoW.WriteLine(strLineaTMP) + Catch + End Try + + ArchivoW.Close() + ArchivoW.Dispose() + End Sub #End Region End Class \ No newline at end of file diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 8ad8491f4..a5a1fb0a0 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -304,17 +304,20 @@ Partial Class Bancos_DepositosCaja End If 'Asignamos la cuenta Deposito - If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEDestino, CveIE) Then + If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEOrigen, CveIE) Then OcurrioError = True Exit For - End If - Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}") - - 'documentos += String.Format("Imprimir {1}

", StrEncript, SerieFolio) + End If + + End If - Next - + Next + + Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}") + + + documentos += String.Format("
Imprimir {1}

", StrEncript, "Depósito Bancario") If OcurrioError Then ObjContabilidad.RollBack() diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 53ad84d4f..7bf565dd8 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -2448,7 +2448,11 @@ Partial Class PopUpVerFactura Dim ClienteNombre = "", EnvioContacto = "", EnvioDireccion = "", EnvioColonia = "", EnvioCiudad = "", EnvioEstado = "", ClientePais = "", EnvioCP = "", Contrato = "", Paqueteria = "", NumContrato = "", Guia = "" - Dim CveContrato As Integer = DtMovimientos(0)("CveContrato").ToString.ToEntero + Dim CveContrato As Integer = 0 + If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then + CveContrato = DtMovimientos(0)("CveContrato").ToString.ToEntero + End If + If CveContrato > 0 Then Contrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("DescripcionContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}") NumContrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NumeroContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}") diff --git a/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc b/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc index 5e314ec69..49340acb0 100644 --- a/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc +++ b/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc @@ -1,1638 +1,1589 @@ - - - - - - - - - - - - true - true - - - - - Grupo - - - - - - - Textbox28 - - - - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - 1.78756cm - - - 1.7468cm - - - 1.87995cm - - - 1.75936cm - - - 1.99234cm - - - 0.7279cm - - - 2.03612cm - - - 0.67438cm - - - 1.94909cm - - - 0.5862cm - - - 1.38875cm - - - - - 0.46771cm - - - - - true - true - - - - - =Fields!Ventas.Value - - - - - - - Ventas - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Descuento.Value - - - - - - - Descuento - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Bonificacion.Value - - - - - - - Bonificacion - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Costo.Value - - - - - - - Costo - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Utilidad.Value - - - - - - - Utilidad - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PorUtilidad.Value - - - - - - - PorUtilidad - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Perdida.Value - - - - - - - Perdida - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PorPerdida.Value - - - - - - - PorPerdida - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Neto.Value - - - - - - - Neto - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PorNeto.Value - - - - - - - PorNeto - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Rentabilidad.Value - - - - - - - Rentabilidad - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - 0.46771cm - - - true - true - - - - - Ventas - - - - - - - Textbox18 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Descuento - - - - - - - Textbox25 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Bonificacion - - - - - - - Textbox20 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Costo - - - - - - - Textbox17 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Utilidad - - - - - - - Textbox6 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % - - - - - - - Textbox14 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Perdida - - - - - - - Textbox4 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % - - - - - - - Textbox16 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Neto - - - - - - - Textbox15 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % - - - - - - - Textbox19 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % Rent. - - - - - - - Textbox21 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - 3.0587cm - - - true - true - - - - - =iif(Fields!GPO.Value="","Total",Fields!GPO.Value) - - - - - - - GPO - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - DataSet1 - 3.29875cm - 0.06614cm - 0.93542cm - 19.58715cm - - - - - - true - true - - - - - =Parameters!Filtros.Value - HTML - - - - - - - Textbox1 - 0.07056cm - 0.06614cm - 0.58236cm - 19.58715cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(CDbl(Parameters!Neto.Value) > 0,"UTILIDAD","PERDIDA") - HTML - - - - - - - Textbox1 - 1.01452cm - 5.03122cm - 1.73771cm - 5.11444cm - 2 - - - =iif(CDbl(Parameters!Neto.Value) > 0,"SeaGreen","Maroon") - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Neto.Value - HTML - - - - - - - Textbox1 - 1.85236cm - 5.34872cm - 0.58236cm - 2.59949cm - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!PorNeto.Value - HTML - - - - - - - Textbox1 - 1.85236cm - 8.14257cm - 0.58236cm - 1.68559cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - = "RENTABILIDAD" - HTML - - - - - - - Textbox1 - 1.01452cm - 10.71594cm - 1.73771cm - 5.11444cm - 5 - - - SeaGreen - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Rentabilidad.Value - HTML - - - - - - - Textbox1 - 1.85236cm - 12.93844cm - 0.58236cm - 2.59949cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - 1.667in - - - - - - - Textbox1 - 2.43857cm - 0.6cm - 14.68354cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - REPORTE DE UTILIDAD O PÉRDIDA SOBRE VENTAS - - - - - - - - - - - - - - - - Textbox2 - 0.6cm - 2.40329cm - 0.52945cm - 14.68354cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!LogoPath.Value - FitProportional - 0.06614cm - 2.22362cm - 2.33715cm - 2 - - - - - - - - - - - 1.08126cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.40041cm - 16.97887cm - 0.68085cm - 2.06587cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, "Usuario: ", "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, Parameters!UsuarioImprimio.Value, "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, "Fecha Impresión: ", "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, Parameters!FechaImpresion.Value, "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 29.7cm - 21cm - 0.5cm - 0.5cm - 1cm - 1cm - 0.13cm - + + + + + + + + + HTML + + + + + + + + + =Parameters!Rentabilidad.Value + HTML + + + + + + + Textbox1 + 1.01452cm + 10.29851cm + 1.73771cm + 5.43074cm + + + SeaGreen + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + true + true + + + + + Grupo + + + + + + + Textbox28 + + + + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 1.78756cm + + + 1.7468cm + + + 1.87995cm + + + 1.75936cm + + + 1.99234cm + + + 0.7279cm + + + 2.03612cm + + + 0.67438cm + + + 1.94909cm + + + 0.5862cm + + + 1.38875cm + + + + + 0.46771cm + + + + + true + true + + + + + =Fields!Ventas.Value + + + + + + + Ventas + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descuento.Value + + + + + + + Descuento + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Bonificacion.Value + + + + + + + Bonificacion + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Costo.Value + + + + + + + Costo + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Utilidad.Value + + + + + + + Utilidad + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorUtilidad.Value + + + + + + + PorUtilidad + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Perdida.Value + + + + + + + Perdida + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorPerdida.Value + + + + + + + PorPerdida + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Neto.Value + + + + + + + Neto + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorNeto.Value + + + + + + + PorNeto + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Rentabilidad.Value + + + + + + + Rentabilidad + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.46771cm + + + true + true + + + + + Ventas + + + + + + + Textbox18 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Descuento + + + + + + + Textbox25 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Bonificacion + + + + + + + Textbox20 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Costo + + + + + + + Textbox17 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Utilidad + + + + + + + Textbox6 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % + + + + + + + Textbox14 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Perdida + + + + + + + Textbox4 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % + + + + + + + Textbox16 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Neto + + + + + + + Textbox15 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % + + + + + + + Textbox19 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % Rent. + + + + + + + Textbox21 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 3.0587cm + + + true + true + + + + + =iif(Fields!GPO.Value="","Total",Fields!GPO.Value) + + + + + + + GPO + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet1 + 3.29875cm + 0.06614cm + 0.93542cm + 19.58715cm + 1 + + + + + + true + true + + + + + =Parameters!Filtros.Value + HTML + + + + + + + Textbox1 + 0.07056cm + 0.06614cm + 0.58236cm + 19.58715cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + = "UTILIDAD" + HTML + + + + + + + + + + HTML + + + + + + + + + = ("$" + Parameters!Neto.Value + " &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp " + Parameters!PorNeto.Value) + HTML + + + + + + + Textbox1 + 1.01452cm + 3.09309cm + 1.73771cm + 5.43074cm + 3 + + + SeaGreen + 2pt + 2pt + 2pt + 2pt + + + + 1.667in + + + + + + + Textbox1 + 2.43857cm + 0.6cm + 14.68354cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE UTILIDAD O PÉRDIDA SOBRE VENTAS + + + + + + + + + + + + + + + + Textbox2 + 0.6cm + 2.40329cm + 0.52945cm + 14.68354cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.06614cm + 2.22362cm + 2.33715cm + 2 + + + + + + + + + + + 1.08126cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.40041cm + 16.97887cm + 0.68085cm + 2.06587cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, "Usuario: ", "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, Parameters!UsuarioImprimio.Value, "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, "Fecha Impresión: ", "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, Parameters!FechaImpresion.Value, "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 0.5cm + 0.5cm + 1cm + 1cm + 0.13cm + + + + + + + + + + + + + + +
+
+
+
+ + +
+ + + +
+ + +
+ <%----%> + +
+ + + + + + + + +
+
+ +
+ <%----%> +
+ + + + + + + + +
+
+
+ +
+
+
+
+ +
+
+ +
+ +
+
+ + + + + + + + + + + + + + +
+ + + + diff --git a/Nomina/ChecadorAsistencia.aspx.cs b/Nomina/ChecadorAsistencia.aspx.cs new file mode 100644 index 000000000..09ee10ce6 --- /dev/null +++ b/Nomina/ChecadorAsistencia.aspx.cs @@ -0,0 +1,255 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class Nomina_ChecadorAsistencia : ClsPaginas +{ + private DataTable dtper + { + get + { + if (ViewState["dtper"] == null) { return null; } + else { return (DataTable)ViewState["dtper"]; } + } + set { ViewState["dtper"] = value; } + } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaTiposPeriodo(); + TxtRpdFechaInicio.Text = "01/09/2021"; + TxtRpdFechaFin.Text = "15/09/2021"; + DdlTipoAsistencias.DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros(string.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)); + DdlTipoAsistencias.DataBind(); + + + DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras.FiltraParametros(string.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)); + DdlMotivoHoraExtra.DataBind(); + + CargarCentrosDeCosto(DdlAsisProyecto, DdlAsisSubProyecto, LblAsisProyecto, LblAsisSubProyecto); + PnlProyecto.Visible = DdlAsisProyecto.Visible; + if (PnlProyecto.Visible) + { + PnlSubProyecto.CssClass = "col-md-6"; + } + } + } + private void CargaTiposPeriodo() + { + DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'"); + DdlTipoPeriodo.DataBind(); + DdlTipoPeriodo.Items.Insert(0, new ListItem("Todos", "-1")); + if (DdlTipoPeriodo.Items.Count > 0) + { + DdlTipoPeriodo.SelectedIndex = 0; + } + } + private DataTable generateTable() + { + DateTime FechaI = TxtRpdFechaInicio.Text.ToDateTime(); + DateTime FechaF = TxtRpdFechaFin.Text.ToDateTime(); + DataTable dtCon = new DataTable(); + dtCon.Columns.Add(new DataColumn("Codigo", typeof(string))); + dtCon.Columns.Add(new DataColumn("Empleado", typeof(string))); + DateTime CFecha = FechaI; + while (FechaF > CFecha) + { + string Fecha = string.Format("{0:yyyyMMdd}", CFecha); + string FechaCol = string.Format("{0:dd-MM-yyyy}", CFecha); + dtCon.Columns.Add(new DataColumn(FechaCol, typeof(string)) { }); + CFecha = CFecha.AddDays(1); + } + using (ClsNominas objnom = new ClsNominas()) + { + if (objnom.GetchecadorAdistencia(FechaI, FechaF, UsuarioActual.CveEmpresa)) + { + DataTable dtASis = objnom.DTSetResultados.Tables[0]; + dtper = objnom.DTSetResultados.Tables[1]; + foreach (DataRow item in dtper.Rows) + { + DataRow drow = dtCon.NewRow(); + drow["Codigo"] = item["Codigo"]; + drow["Empleado"] = item["NombreCompleto"]; + CFecha = FechaI; + while (FechaF > CFecha) + { + int Fecha = string.Format("{0:yyyyMMdd}", CFecha).ToEntero(); + string FechaCol = string.Format("{0:dd-MM-yyyy}", CFecha); + string TipoAsis = "(Faltó)"; + DataRow drfec = dtASis.FiltroPrimero(string.Format("CvePersonal={0} AND Agrupador ={1}", item["CvePersonal"], Fecha), "Salida"); + if (drfec != null) + { + DataTable dtx = dtASis.FiltraParametros(string.Format("CvePersonal={0} AND Agrupador ={1}", item["CvePersonal"], Fecha), "Salida"); + + + string asistencia2 = ""; + string Horas2 = ""; + if (dtx.Rows.Count > 1) + { + Horas2 = drfec["Horas"].ToString(); + DataRow drf = dtx.Rows[1]; + asistencia2 = ""; + TipoAsis = drf["TipoAsistencia"].ToString(); + switch (drfec["Tipo"].ToString().ToEntero()) + { + case 1: + asistencia2 = ""; + break; + case 2: + asistencia2 = ""; + break; + case 3: + asistencia2 = ""; + break; + case 4: + asistencia2 = ""; + break; + case 5: + asistencia2 = ""; + break; + + default: + break; + } + } + string asistencia = ""; + TipoAsis = drfec["TipoAsistencia"].ToString(); + switch (drfec["Tipo"].ToString().ToEntero()) + { + case 1: + asistencia = ""; + break; + case 2: + asistencia = ""; + break; + case 3: + asistencia = ""; + break; + case 4: + asistencia = ""; + break; + case 5: + asistencia = ""; + break; + + default: + break; + } + drow[FechaCol] = string.Format("
{0}
{1}
{2}
{3}
", asistencia, drfec["Horas"], asistencia2, Horas2); + //drow[FechaCol] = string.Format("{0}
{1:HH}:{1:mm} - {2:HH}:{2:mm}", asistencia, drfec["Entrada"], drfec["Salida"]); + } + else + { + if (CFecha.DayOfWeek == DayOfWeek.Sunday) + { + drow[FechaCol] = ""; + TipoAsis = "(Descanso)"; + } + else + { + drow[FechaCol] = "
❌
"; + } + } + drow[FechaCol] = string.Format("
{0}
{1}
", drow[FechaCol], TipoAsis, FechaCol, item["CvePersonal"]); + //dtCon.Columns.Add(new DataColumn(FechaCol, typeof(string)));Widthall + CFecha = CFecha.AddDays(1); + } + dtCon.Rows.Add(drow); + } + } + } + //dtCon.Columns.Add(new DataColumn("LabelValorP", typeof(string))); + //dtCon.Columns.Add(new DataColumn("CveConceptoP", typeof(int))); + //dtCon.Columns.Add(new DataColumn("ImporteP", typeof(double))); + return dtCon; + } + protected void LnkConsultar_Click(object sender, EventArgs e) + { + DataTable dtCon = generateTable(); + GvNominas.DataSource = dtCon; + GvNominas.DataBind(); + UpDatos.Update(); + } + + protected void GvNominas_RowDataBound(object sender, GridViewRowEventArgs e) + { + + if (e.Row.RowType == DataControlRowType.DataRow) + { + for (int j = 0; j < e.Row.Cells.Count; j++) + { + string encoded = e.Row.Cells[j].Text; + e.Row.Cells[j].Text = Context.Server.HtmlDecode(encoded); + } + + } + } + + protected void BtnOpenModal_Click(object sender, EventArgs e) + { + DateTime fechai = TxtFecha.Text.ToDateTime(); + DateTime fechaf = fechai.AddDays(1); + int CvePersonal = TxtCvePersonal.Text.ToEntero(); + TxtFechalabel.Text = string.Format("{0:dd/MM/yyyy}", fechai); + using (ClsRH objRH = new ClsRH()) + { + if (objRH.PreAsistenciaRegistrosGet(fechai, fechaf, -1, UsuarioActual.Empresa.CveEmpresa)) + { + GvDetalleDias.DataSource = objRH.DtResultados.FiltraParametros(string.Format("FechaRegistro >='{0:yyyy/MM/dd HH:mm}' AND FechaRegistro <='{1:yyyy/MM/dd HH:mm}' AND CvePersonal = {2}", fechai.AddHours(6), fechaf.AddHours(6), CvePersonal), "FechaRegistro"); + GvDetalleDias.DataBind(); + } + DdlTipoAsistencias.Enabled = GvDetalleDias.Rows.Count > 0; + if (objRH.GetAsistencias(CvePersonal, -1, -1, -1, -1, -1, fechai, fechai, UsuarioActual.CveEmpresa)) + { + if (objRH.DtResultados.Rows.Count > 0) + { + DataRow dr = objRH.DtResultados.Rows[0]; + DdlTipoAsistencias.SelectedValueExist(dr["CveAsistenciasInasistencias"].ToString()); + DdlAsisSubProyecto.SelectedValueExist(dr["CveSubProyecto"].ToString()); + TxtPorPago.Text = dr["PorcentajePago"].ToString(); + TxtHorasDobles.Text = dr["HorasDobles"].ToString(); + TxtHorasTriples.Text = dr["HorasTriples"].ToString(); + DdlMotivoHoraExtra.SelectedValueExist(dr["CveMotivoHoraExtra"].ToString()); + TxtObservaciones.Text = dr["Observacion"].ToString(); + } + } + } + DataRow drow = dtper.FiltroPrimero(string.Format("CvePersonal = {0}", CvePersonal)); + if(drow != null) + { + TxtCodigolabel.Text = drow["Codigo"].ToString(); + TxtEmpleadolabel.Text = drow["NombreCompleto"].ToString(); + } + + UpDetallesDia.Update(); + + RegistraScript("$('#divDetallesDia').modal();"); + } + + protected void BtnEstusAsistenciaModal_Click(object sender, EventArgs e) + { + DateTime fecha = TxtFecha.Text.ToDateTime(); + int CvePersonal = TxtCvePersonal.Text.ToEntero(); + + //int CvePersonal = TxtasiscvePersonal.Text.ToEntero(); + //DateTime fecha = TxtasisFecha.Text.ToDate(); + using (ClsRH objpersonal = new ClsRH()) + { + + if (objpersonal.AddAsistencia(CvePersonal, -1, DdlAsisSubProyecto.SelectedValue.ToEntero(), fecha, DdlTipoAsistencias.SelectedValue.ToEntero(), TxtPorPago.Text.Trim().ToDouble(), TxtHorasDobles.Text.Trim().ToDouble(), + TxtHorasTriples.Text.Trim().ToDouble(), DdlMotivoHoraExtra.SelectedValue.ToEntero(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + //Alert(string.Format("se ha guardado la asistencia satisfactoriamente
{0}
{1:dd/MM/yyyy}", TxtPersonal.Text, TxtasisFecha.Text.ToDate()), TipoMensaje.ToastInformacion); + Alert("Se ha guardado la asistencia satisfactoriamente"); + RegistraScript("$('#DModalModAsistencia').modal('hide');"); + + } + } + } +} \ No newline at end of file diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index edaa3a8d5..97bd06731 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -9,6 +9,11 @@ content: "\f1c1"; } + pre { + font-size: 11px; + padding: 3px; + } + table.gvasistencia tr:hover { background-color: #dddddd; } @@ -354,7 +359,7 @@
- +
@@ -399,7 +404,7 @@ - + @@ -825,6 +830,25 @@ +
@@ -884,6 +908,36 @@
+ + +
+
+
+ + Bitacora +
+
+ + +
+
+
+ + + + + + + + + + + + + + +
+
@@ -1409,16 +1463,13 @@ - -
- +
¿Prima Vacacional?
-
- +
¿Cobrar IMSS?
@@ -1758,6 +1809,371 @@
+ + + + + + + + + + +
@@ -2552,7 +2666,53 @@ - + + + + + + + - + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
+
+
+ diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index e6bb0c374..f845f6931 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -847,6 +847,7 @@ Partial Class RH_Personal If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero() > 0 Then ViewState("CvePersonal") = Request("CvePersonal") + DdlFormapagovacaciones_SelectedIndexChanged(Nothing, Nothing) 'CvePersonal = ViewState("CvePersonal").ToString().ToEntero() CargaDatos() CargaDocumentacionFirmaDecontratos() @@ -4503,43 +4504,70 @@ Partial Class RH_Personal Next End Sub - + Dim dtosvac As DataTable Private Sub CargaVacacionesResumenPeriodoActual() - Dim objRH As New ClsRH - - If objRH.VacacionesResumenGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then - If objRH.DtResultados.Rows.Count > 0 Then - - VacInicioPeriodo = objRH.DtResultados(0)("InicioPeriodo").ToString().ToDate - VacFinPeriodo = objRH.DtResultados(0)("FinPeriodo").ToString().ToDate - VacAnios = objRH.DtResultados(0)("Anios").ToString().ToEntero() - VacDias = objRH.DtResultados(0)("Dias").ToString().ToEntero() - VacDiasUsados = objRH.DtResultados(0)("DiasUsados").ToString().ToEntero() - VacDiasCancelados = objRH.DtResultados(0)("DiasCancelados").ToString().ToEntero() - VacDiasDisponibles = objRH.DtResultados(0)("DiasDisponibles").ToString().ToEntero() - GvVacacionesResumen.DataSource = objRH.DtResultados - VacSupervisorNombre = objRH.DtResultados(0)("SupervisorNombre").ToString() - VacSupervisorCorreo = objRH.DtResultados(0)("SupervisorCorreo").ToString() - VacCveSupervisor = objRH.DtResultados(0)("SupervisorCorreo").ToString().ToEntero() - - Else - VacInicioPeriodo = Now - VacFinPeriodo = Now - VacAnios = 0 - VacDias = 0 - VacDiasUsados = 0 - VacDiasCancelados = 0 - VacDiasDisponibles = 0 + Using objnom As New ClsNominas + If objnom.GETPersonalVacResumen(UsuarioActual.Empresa.CveEmpresa, CvePersonal) Then + RPTVacacionesResumen.DataSource = objnom.DtResultados End If - End If + If objnom.GETPersonalVacaciones(UsuarioActual.Empresa.CveEmpresa, CvePersonal) Then + dtosvac = objnom.DtResultados + GvVaczxy.DataSource = dtosvac + GvVaczxy.DataBind() + End If + End Using - objRH.Dispose() + RPTVacacionesResumen.DataBind() + Using objRH As New ClsRH + If objRH.VacacionesResumenGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then + If objRH.DtResultados.Rows.Count > 0 Then + + VacInicioPeriodo = objRH.DtResultados(0)("InicioPeriodo").ToString().ToDate + VacFinPeriodo = objRH.DtResultados(0)("FinPeriodo").ToString().ToDate + VacAnios = objRH.DtResultados(0)("Anios").ToString().ToEntero() + VacDias = objRH.DtResultados(0)("Dias").ToString().ToEntero() + VacDiasUsados = objRH.DtResultados(0)("DiasUsados").ToString().ToEntero() + VacDiasCancelados = objRH.DtResultados(0)("DiasCancelados").ToString().ToEntero() + VacDiasDisponibles = objRH.DtResultados(0)("DiasDisponibles").ToString().ToEntero() + GvVacacionesResumen.DataSource = objRH.DtResultados + VacSupervisorNombre = objRH.DtResultados(0)("SupervisorNombre").ToString() + VacSupervisorCorreo = objRH.DtResultados(0)("SupervisorCorreo").ToString() + VacCveSupervisor = objRH.DtResultados(0)("SupervisorCorreo").ToString().ToEntero() + + Else + VacInicioPeriodo = Now + VacFinPeriodo = Now + VacAnios = 0 + VacDias = 0 + VacDiasUsados = 0 + VacDiasCancelados = 0 + VacDiasDisponibles = 0 + End If + End If + + End Using GvVacacionesResumen.DataBind() UpGvVacacionesResumen.Update() End Sub + Protected Sub RPTVacacionesResumen_ItemDataBound(sender As Object, e As RepeaterItemEventArgs) + + 'Dim item As DataRowView = DirectCast(e.Item.DataItem, DataRowView) + 'If (item IsNot Nothing AndAlso item("CveEmpresa") IsNot Nothing) Then + + ' Dim CveEmpresa As Integer = item("CveEmpresa").ToString().ToEntero() + ' Dim CvePersonal As Integer = item("CvePersonal").ToString().ToEntero() + ' Dim Ejercicio As Integer = item("Ejercicio").ToString().ToEntero() + ' Dim RptTitulo As GridView = DirectCast(e.Item.FindControl("GvVaczx"), GridView) + ' If dtosvac IsNot Nothing Then + ' RptTitulo.DataSource = dtosvac.FiltraParametros(String.Format("Ejercicio={0}", Ejercicio), "FechaIng") + ' RptTitulo.DataBind() + ' End If + 'End If + End Sub + Protected Sub BtnSolicitarVacaciones_Click(sender As Object, e As EventArgs) Handles BtnSolicitarVacaciones.Click Dim fInicio As Date = TxtFechaInicioVac.Text.ToDate() Dim fFin As Date = TxtFechaFinVac.Text.ToDate() @@ -4551,7 +4579,7 @@ Partial Class RH_Personal VacFolioActual = VacFolioActual + 1 Dim objRH As New ClsRH 'Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, motivoVacaciones) - Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago:=fechapago, diasinabiles:=diasinhabil, CveTipoPago:=DdlFormapagovacaciones.SelectedValue.ToEntero(), diasExtras:=TxtVacDiasExtra.Text.ToEntero()) + Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago:=fechapago, diasinabiles:=diasinhabil, CveTipoPago:=DdlFormapagovacaciones.SelectedValue.ToEntero(), diasExtras:=TxtVacDiasExtra.Text.ToEntero(), Ejercicio:=TxtVacEjercicio.Text.ToEntero(), PrimaVacacional:=If(ChkVacPrimaVacacional.Checked, 1, 0), CobrarImss:=If(ChkVacCobrarIMSS.Checked, 1, 0), diasPago:=TxtVacDiasPago.Text.ToEntero()) If objRH.DtResultados.Rows.Count > 0 Then Dim ShowError As String = objRH.DtResultados.Rows(0)("ShowError").ToString() If ShowError.Length > 0 Then @@ -5088,6 +5116,41 @@ Partial Class RH_Personal Return ListaTags End Function + Protected Sub DdlFormapagovacaciones_SelectedIndexChanged(sender As Object, e As EventArgs) + PnlVacfechas.Visible = False + PnlVacDias.Visible = False + PnlVacFechapago.Visible = False + PnlVacDiasPago.Visible = False + PnlVacChecks.Visible = False + TxtVacDiasPago.Text = "0" + + Select Case DdlFormapagovacaciones.SelectedValue.ToEntero() + Case 1 + PnlVacfechas.Visible = True + PnlVacDias.Visible = True + PnlVacFechapago.Visible = True + PnlVacDiasPago.Visible = True + PnlVacChecks.Visible = True + Case 2 + PnlVacfechas.Visible = True + PnlVacDias.Visible = True + PnlVacChecks.Visible = True + Case 3 + PnlVacfechas.Visible = True + PnlVacDias.Visible = True + PnlVacDiasPago.Visible = False + PnlVacFechapago.Visible = True + Case 4 + PnlVacFechapago.Visible = True + PnlVacDiasPago.Visible = True + PnlVacChecks.Visible = True + Case 5 + PnlVacfechas.Visible = True + Case 6 + PnlVacFechapago.Visible = True + PnlVacDiasPago.Visible = True + End Select + End Sub #End Region #Region "CURSOS" @@ -6601,5 +6664,7 @@ Partial Class RH_Personal End If End Sub + + End Class diff --git a/Ventas/ActualizarPrecios.aspx b/Ventas/ActualizarPrecios.aspx index d24a76714..20f8df15b 100644 --- a/Ventas/ActualizarPrecios.aspx +++ b/Ventas/ActualizarPrecios.aspx @@ -19,6 +19,16 @@
  • Importar Listado
  • +
  • + + + + + + + + +
  • diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index 5f654f4da..4cc1b3df3 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -5,7 +5,8 @@ Option Strict On Imports Extensiones Imports System.Data Imports GemBox.Spreadsheet - +Imports System.IO + Partial Class Ventas_ActualizarPrecios Inherits ClsPaginas @@ -17,6 +18,16 @@ Partial Class Ventas_ActualizarPrecios ViewState("DtSubProyectos") = value End Set End Property + + Private Property DtDatosPrecios As DataTable + Get + Return If(IsNothing(ViewState("DtDatosPrecios")), Nothing, CType(ViewState("DtDatosPrecios"), DataTable)) + End Get + Set(value As DataTable) + ViewState("DtDatosPrecios") = value + End Set + End Property + Private Property CveSucursal As Integer Get If ViewState("CveSucursal") Is Nothing Then @@ -145,7 +156,7 @@ Partial Class Ventas_ActualizarPrecios End Sub Private Sub CargarModelos() If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then - lblModelo.visible = True + lblModelo.Visible = True DdlModelo.Visible = True Dim ObjGeneral As New ClsGenerales If ObjGeneral.GetModelos(UsuarioActual.CveEmpresa) Then @@ -173,7 +184,8 @@ Partial Class Ventas_ActualizarPrecios If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, DdlPrecioLista.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero, CvePS, CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then - GVPrecios.DataSource = objPS.DtResultados + DtDatosPrecios = objPS.DtResultados + GVPrecios.DataSource = DtDatosPrecios End If objPS.Dispose() @@ -246,8 +258,8 @@ Partial Class Ventas_ActualizarPrecios TxtImporte.Text = "" TxtPrecio.Text = "" TxtPorcentaje.Text = "" - End Sub - + End Sub + #Region "MODAL PRECIOS MINIMOS" Public Sub LnkPrecioMinActual_Click(sender As Object, e As EventArgs) @@ -305,10 +317,10 @@ Partial Class Ventas_ActualizarPrecios ObjProductosServicios.Dispose() - End Sub - + End Sub + #End Region - + #Region "C A R G A R E X C E L " Private Sub BtnDescargarFormato_Click(sender As Object, e As EventArgs) Handles BtnDescargarFormato.Click @@ -544,9 +556,9 @@ Partial Class Ventas_ActualizarPrecios End While Return dataTable - End Function + End Function #End Region - + Protected Sub gvSucursal_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then e.Row.FCTextBox("TxtPrecioMinimo").Attributes.Add("onKeyUp", String.Format("FncSeleccionaChk({0});", e.Row.FCCheckBox("chkSucursal").ClientID)) @@ -592,5 +604,200 @@ Partial Class Ventas_ActualizarPrecios Return True End If - End Function + End Function + Protected Sub LnkExportarExcel_Click(sender As Object, e As EventArgs) + Dim DtExcel As New DataTable("Precios") + DtExcel.Columns.Add(New DataColumn("Código", GetType(String))) + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores + DtExcel.Columns.Add(New DataColumn("Código CPK", GetType(String))) + End If + + DtExcel.Columns.Add(New DataColumn("Producto/Servicio", GetType(String))) + DtExcel.Columns.Add(New DataColumn("Clasificación", GetType(String))) + DtExcel.Columns.Add(New DataColumn("Importe", GetType(Decimal))) + DtExcel.Columns.Add(New DataColumn("Precio Mínimo", GetType(Decimal))) + DtExcel.Columns.Add(New DataColumn("U.M.", GetType(String))) + DtExcel.Columns.Add(New DataColumn("Moneda", GetType(String))) + + If UsuarioActual.CveEmpresa = 153 Then 'Empresa servec + DtExcel.Columns.Add(New DataColumn("C. Promedio", GetType(Decimal))) + End If + + DtExcel.Columns.Add(New DataColumn("E. Mínimo", GetType(Decimal))) + DtExcel.Columns.Add(New DataColumn("Importe Anterior", GetType(Decimal))) + DtExcel.Columns.Add(New DataColumn("Precio Mínimo Anterior", GetType(Decimal))) + DtExcel.Columns.Add(New DataColumn("Fecha Modificación", GetType(DateTime))) + DtExcel.Columns.Add(New DataColumn("Usuario Modificó", GetType(String))) + DtExcel.Columns.Add(New DataColumn("Porcentaje", GetType(Decimal))) + DtExcel.Columns.Add(New DataColumn("Fecha Ingreso", GetType(Decimal))) + DtExcel.Columns.Add(New DataColumn("Usuario Ingresó", GetType(String))) + + + If DtDatosPrecios IsNot Nothing Then + For Each Row As DataRow In DtDatosPrecios.Rows + Dim NewRow As DataRow = DtExcel.NewRow() + + NewRow("Código") = Row("Codigo") + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores + NewRow("Código CPK") = Row("Codigo2") + End If + + NewRow("Producto/Servicio") = Row("PS") + NewRow("Clasificación") = Row("Clasificacion") + NewRow("Importe") = Row("PrecioLista") + NewRow("Precio Mínimo") = Row("PrecioMinimo") + NewRow("U.M.") = Row("UnidadMedida") + NewRow("Moneda") = Row("Moneda") + + If UsuarioActual.CveEmpresa = 153 Then 'Empresa servec + NewRow("C. Promedio") = Row("CostoPromedio") + End If + + NewRow("E. Mínimo") = Row("VentaMinima") + NewRow("Importe Anterior") = Row("ImporteAnterior") + NewRow("Precio Mínimo Anterior") = Row("PrecioMinimoAnterior") + NewRow("Fecha Modificación") = Row("FechaModificacion") + NewRow("Usuario Modificó") = Row("UsuarioModifico") + NewRow("Porcentaje") = Row("Porcentaje") + NewRow("Fecha Ingreso") = Row("FechaIng") + NewRow("Usuario Ingresó") = Row("Usuario") + + DtExcel.Rows.Add(NewRow) + Next + End If + + SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) + + Dim FileExcel As New ExcelFile() + + Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName) + worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With + { + .ColumnHeaders = True, + .StartRow = 0, + .StartColumn = 0 + }) + worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255)) + worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255) + + Dim columnCount = worksheet.CalculateMaxUsedColumns() + For i = 0 To columnCount + worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1)) + Next + + Dim FechaIMes As String = "", FechaFMes As String = "", Titulo As String = "LISTADO DE PRECIOS", ListaPrecios As String = DdlPrecioLista.SelectedItem.Text, Divisor As Integer = 1, AlturaImagen As Double = 100, AnchoImagen As Double = 100, DatoTituloExtra As String = "" + + + Dim TotalRowHeader As Integer = 8 + Dim TotalRowFooter As Integer = 2 + + + worksheet.Rows.InsertEmpty(0, TotalRowHeader) + Dim celdasConTexto = worksheet.GetUsedCellRange(True) + celdasConTexto.Style.Font.Name = "Calibri Light" + + Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex) + RangoNombreEmpresa.Merged = True + RangoNombreEmpresa.Value = UsuarioActual.Empresa.Empresa + RangoNombreEmpresa.Style.Font.Size = 20 * 20 + RangoNombreEmpresa.Style.Font.Name = "Calibri Light" + RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + + Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex) + RangoTitulo.Merged = True + RangoTitulo.Value = Titulo + RangoTitulo.Style.Font.Size = 17 * 20 + RangoTitulo.Style.Font.Name = "Calibri Light" + RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + + 'If FechaIMes.Trim.Length > 0 And FechaFMes.Trim.Length > 0 Then + ' Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex) + ' RangoFechas.Merged = True + ' RangoFechas.Value = $"Fechas: {FechaIMes} a {FechaFMes}" + ' RangoFechas.Style.Font.Size = 15 * 20 + ' RangoFechas.Style.Font.Name = "Calibri Light" + ' RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + ' RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + 'End If + + + If ListaPrecios.Length > 0 Then + Dim RangoSubProyecto = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex) + RangoSubProyecto.Merged = True + RangoSubProyecto.Value = $"Lista de precio: {ListaPrecios}" + RangoSubProyecto.Style.Font.Size = 14 * 20 + RangoSubProyecto.Style.Font.Name = "Calibri Light" + RangoSubProyecto.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoSubProyecto.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + End If + + + For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex + + worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20 + worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) + worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) + + + + If i > 0 Then + Try + worksheet.Columns(i).AutoFit(1) + Catch ex As Exception + End Try + End If + + Next + + + Dim IndexEndTable As Integer = DtExcel.Rows.Count + TotalRowHeader + TotalRowFooter + + worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió" + worksheet.Rows(IndexEndTable + 1).Cells(0).Value = UsuarioActual.Nombre + + worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión" + worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy") + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + + If Imagen.Exists Then + Dim Ruta As String = String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta) + Using sr As New StreamReader(Ruta) + Dim ms As New MemoryStream() + sr.BaseStream.CopyTo(ms) + worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel) + End Using + End If + + + For I = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex + + If I > 0 Then + + If Divisor = 1 Then + worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00" + Else + worksheet.Columns(I + 1).Style.NumberFormat = "#,##" + End If + + Try + worksheet.Columns(I).AutoFit(1) + Catch ex As Exception + End Try + + End If + Next + + FileExcel.Save(Response, "Precios.xlsx", SaveOptions.XlsxDefault) + + End Sub End Class \ No newline at end of file diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index a36f25ad3..eae1650c2 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -1584,6 +1584,12 @@ + + Descuento Incluido: + + + + Por Porcentaje @@ -1604,6 +1610,12 @@  ($) + + Descuento Adicional: + + + + @@ -2846,6 +2858,7 @@ +
    @@ -3374,6 +3387,68 @@ } + function CalculaDescuentoAdicional() { + if ($get("TxtPorDescP").value != "0" && $get("TxtPorDescP").value != "") { + var MontoOriginal = ToDouble($get("HdnDescuentoOriginal").value); + + var Monto = 0; + var TipoDescuento = $get("HdnTipoDescuento").value; + + if (TipoDescuento == 0) { + Monto = parseFloat($get("LblPrecio1").innerText.replace(",", "").replace(",", "")); + } + else if (TipoDescuento == 1) { + Monto = parseFloat($get("LblTotalPS1").innerText.replace(",", "").replace(",", "")); + } + else if (TipoDescuento == 2) { + Monto = parseFloat($get("LblSubTotal1").innerText.replace(",", "").replace(",", "")); + } + else if (TipoDescuento == 3) { + Monto = parseFloat($get("LblSubTotal1").innerText.replace(",", "").replace(",", "")); + } + + if (MontoOriginal > 0) { + Monto = Monto - MontoOriginal; + } + + var Descuento = parseFloat($get("TxtPorDescP").value); + var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value); + + if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) { + $get("TxtDescP").value = "0"; + $get("TxtPorDescP").value = "0"; + $get("LblDescuentoAdicional").innerText = "0.00"; + Descuento = 0; + alert("No puede exceder el descuento maximo autorizado."); + } + + $get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ','); + $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); + var Total = (Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""))) ; + + $get("LblDescuentoAdicional").innerText = formato_numero(Total, 2, '.', ','); + + //SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL + Total = Total + MontoOriginal; + + $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); + $get("TxtDescuento").value = formato_numero(Total, 2, '.', ','); + $get("TxtDescP").value = formato_numero(0, 2, '.', ','); + $get("HdnDescuento").value = Total; + if (TipoDescuento == 2) { + $get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ','); + } + + } + else { + $get("LblPrecioFinal").innerText = "0.00"; + $get("LblDescuento").innerText = "0.00"; + $get("HdnDescuento").value = "0.00"; + $get("LblDescuentoAdicional").innerText = "0.00"; + } + + } + function CalculaDescuentoMonto() { if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) { @@ -3423,6 +3498,69 @@ } } + function CalculaDescuentoMontoAdicional() { + + if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) { + var MontoOriginal = ToDouble($get("HdnDescuentoOriginal").value); + + var Monto = 0; + var TipoDescuento = $get("HdnTipoDescuento").value; + + if (TipoDescuento == 0) { + Monto = parseFloat($get("LblPrecio1").innerText.replace(",", "").replace(",", "")); + } + else if (TipoDescuento == 1) { + Monto = parseFloat($get("LblTotalPS1").innerText.replace(",", "").replace(",", "")); + } + else if (TipoDescuento == 2) { + Monto = parseFloat($get("LblSubTotal1").innerText.replace(",", "").replace(",", "")); + } + else if (TipoDescuento == 3) { + Monto = parseFloat($get("LblSubTotal1").innerText.replace(",", "").replace(",", "")); + } + + if (MontoOriginal > 0) { + Monto = Monto - MontoOriginal; + } + + var Descuento = parseFloat($get("TxtDescP").value); + + var PorcentajeDescuento = (Descuento * 100 / Monto) + var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value); + + if (PorcentajeDescuentoMaximo > 0 && PorcentajeDescuento > PorcentajeDescuentoMaximo) { + $get("TxtDescP").value = "0"; + $get("TxtPorDescP").value = "0"; + $get("LblDescuentoAdicional").innerText = "0.00"; + Descuento = 0; + alert("No puede exceder el descuento maximo autorizado."); + } + + $get("TxtPorDescP").value = formato_numero((Descuento * 100 / Monto), 2, '.', ','); + $get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ','); + $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); + var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); + + $get("LblDescuentoAdicional").innerText = formato_numero(Total, 2, '.', ','); + + //SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL + Total = Total + MontoOriginal; + + $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); + $get("TxtDescuento").value = formato_numero(Total, 2, '.', ','); + $get("HdnDescuento").value = Total; + if (TipoDescuento == 2) { + Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); + } + } + else { + $get("LblPrecioFinal").innerText = "0.00"; + $get("LblDescuento").innerText = "0.00"; + $get("HdnDescuento").value = "0.00"; + $get("LblDescuentoAdicional").innerText = "0.00"; + } + } + function BorraDescuentos() { $get("TxtPorDescP").value = "0"; $get("TxtDescP").value = "0"; @@ -3433,6 +3571,23 @@ $("#LblSubTotal1").text($("#TxtSubTotal").val()); } + function AbrirModalDescuentoAdicional() + { + $('#ModalDescuento').modal(); + $get('LblTitulo1').style.display = ''; + $get('LblTitulo2').style.display = 'none'; + $get('LblTituloTipo1').style.display = ''; + $get('LblTituloTipo2').style.display = 'none'; + $get('HdnTipoDescuento').value = '0'; + $get('LblPrecio1').style.display = ''; + $get('LblTotalPS1').style.display = 'none'; + $get('LblSubTotal1').style.display = 'none'; + $get('LblAmort').style.display = 'none'; + $get('BtnAplicarDescP').style.display = ''; + $get('BtnAplicarDescG').style.display = 'none'; + $get('TrMotivoDescuento').style.display = ''; + } + function formato_numero(numero, decimales, separador_decimal, separador_miles) { // v2007-08-06 numero = parseFloat(numero); if (isNaN(numero)) { diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index ac4b17e03..f7e8ca257 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1062,7 +1062,7 @@ Partial Class PV ViewState("ClienteRetIVA") = 0 ViewState("ClienteRetISR") = 0 ViewState("EnviarCorreoCliente") = False - HdnPorcentajeDescuentoMaximo.Value = UsuarioActual.DescuentoAutorizado.ToString() + HdnPorcentajeDescuentoMaximo.Value = If(UsuarioActual.DescuentoAutorizado > 0, UsuarioActual.DescuentoAutorizado, 15).ToString() CveVentaDetalle = -1 EstablecioFolio = False EstatusCliente = False @@ -1113,7 +1113,19 @@ Partial Class PV LblUsuario.Text = UsuarioActual.Usuario TxtCantidad.Attributes.Add("onKeyUp ", "Recalcula();") TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();") - ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';") + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + ImgDescPU.Attributes.Add("onclick", "javascript:AbrirModalDescuentoAdicional();") + TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuentoAdicional();") + TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMontoAdicional();") + TrDescuentoIncluido.Visible = True + TrDescuentoAdicional.Visible = True + Else + ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';") + TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();") + TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();") + End If + 'ImgDescConcepto.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';") 'ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';") ImgOtrosConceptos.Attributes.Add("onclick", "javascript:$('#ModalOtrosConceptos').modal();") @@ -1131,8 +1143,8 @@ Partial Class PV 'ImgCerrarTerminoCorte.Attributes.Add("OnClick", "$('#DivTerminarCorte').hide();") 'ImgCerrarIE.Attributes.Add("OnClick", "$('#DivIngresoEgreso').hide();") 'ImgCerrarEstadoCaja.Attributes.Add("OnClick", "$('#DivEstadoCaja').hide();") - TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();") - TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();") + + 'TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();") CreaDTmpC() @@ -4049,6 +4061,14 @@ Partial Class PV TxtDescuento.Text = (PrecioSugerido * ClasificacionesDescuentos(drPS("CveClasificacion").ToString.ToEntero)).ToString("F2") End If + HdnDescuentoOriginal.Value = TxtDescuento.Text.ToDecimal().ToString() + LblDescuentoIncluido.Text = TxtDescuento.Text.ToDecimal().FormatoNumero(2) + + If PrecioSugerido > 0 AndAlso TxtDescuento.Text.ToDecimal() > 0 Then + TxtPrecio.Text = PrecioSugerido.FormatoNumero() + RegistraScript("$get('LblPrecio1').innerText = formato_numero(" + PrecioSugerido.ToString() + ", 2, '.', ',');", "A1") + End If + If ChkAjuste.Checked Then CalculaMesesUso() UpAjuste.Update() @@ -4072,6 +4092,7 @@ Partial Class PV UpPS.Update() UpUnidadMedida.Update() UpAddVenta.Update() + UPPDescuento.Update() End Sub Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange DdlPSIndexChange(DdlPS.SelectedValue.ToEntero, DdlPS) diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs index b17a3a246..9853c6c1e 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs +++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs @@ -223,24 +223,32 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas //sb.AppendFormat("{0}
    ", respCancelacion.Mensaje); if (!respCancelacion.HuboError) { - retorno.EnviarAcuse = true; - CveEstatus = respCancelacion.CveEstatus; - var ObjVentas = new ClsVentas(); - if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa)) + if (respCancelacion.CveEstatus > 0) { - sb.Append("El estatus de la factura fue cambiado a 'Cancelada'."); + retorno.EnviarAcuse = true; + CveEstatus = respCancelacion.CveEstatus; + var ObjVentas = new ClsVentas(); + if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa)) + { + sb.Append("El estatus de la factura fue cambiado a 'Cancelada'."); + } + else + { + sb.Append("Ocurrió un error al cambiar el estatus de la factura."); + } + ObjVentas.Dispose(); + sb.Append("El documento se canceló correctamente."); + sb.Append($"
    Imprimir Acuse"); + if (!EsRefacturacion) + { + sb.Append("

    ¿Desea enviar el Acuse de Cancelación al Cliente?"); + } } else { - sb.Append("Ocurrió un error al cambiar el estatus de la factura."); - } - ObjVentas.Dispose(); - sb.Append("El documento se canceló correctamente."); - sb.Append($"
    Imprimir Acuse"); - if (!EsRefacturacion) - { - sb.Append("

    ¿Desea enviar el Acuse de Cancelación al Cliente?"); + sb.Append(respCancelacion.Mensaje); } + } if (respCancelacion.CveEstatus.Contiene(4, 5) && EsRefacturacion) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d7df65f78..9c6fbc075 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2628,6 +2628,10 @@ Partial Class Ventas 'DdlEstatus.Enabled = False End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + LnkAgregarCliente.Visible = True + End If + End If CargaEstatusFactura(Opcion) @@ -5632,7 +5636,7 @@ Partial Class Ventas ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100 ViewState("ClienteRetISR") = ObjCliente.RetISR / 100 - If CveVenta <= 0 Then + If CveVenta <= 0 OrElse EsCreaApartirDe Then DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString()) DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty) @@ -7689,13 +7693,7 @@ Partial Class Ventas Dim CveProducto As Integer Dim Existencia As Double Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero() - For Each dr As DataRow In TmpDT.Rows - - 'SI ES SERVICIO NO VALIDA - 'GlobalDTProductosServicios - If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveTipoPS").ToString().ToEntero() = 1 Then - Continue For - End If + For Each dr As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then 'VALIDA EXISTENCIA @@ -18966,6 +18964,12 @@ Partial Class Ventas ' rowSurtidos("Surtido").ToString().ToDouble < rowSurtidos("Cantidad").ToString().ToDouble AndAlso (dr("CantidadDisponible").ToString().ToDouble - rowSurtidos("Surtido").ToString().ToDouble > 0 Or dr("Serie").ToString() <> "") If rowSurtidos("Surtido").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDecimal Then Dim CantidadSurtida As Double = If(dr("CantidadDisponible").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDouble, dr("CantidadDisponible").ToString().ToDecimal, rowSurtidos("Cantidad").ToString().ToDecimal) + + 'SI LA CANTIDAD SURTIDA SUPERA LO REQUERIDO, TOMA SOLO LO NECESARIO PARA COMPLETAR + If (rowSurtidos("Surtido").ToString().ToDecimal + CantidadSurtida) > rowSurtidos("Cantidad").ToString().ToDecimal Then + CantidadSurtida = (rowSurtidos("Cantidad").ToString().ToDecimal - rowSurtidos("Surtido").ToString().ToDecimal) + End If + MovDTCuadrados.ImportRow(dr) MovDTCuadrados(MovDTCuadrados.Rows.Count - 1)("Cantidad") = CantidadSurtida DtRemConceptosSurtidos(Indice)("Surtido") = rowSurtidos("Surtido").ToString().ToDecimal + CantidadSurtida @@ -26913,7 +26917,7 @@ Partial Class Ventas For Each Dr As DataRow In DtImpuestosLocal.Rows FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString().ToDecimal, Dr("PorcentajeRetIVA").ToString().ToDecimal, Dr("PorcentajeRetISR").ToString().ToDecimal, Dr("PorcentajeIEPS").ToString().ToDecimal, Dr("CveSubProyecto")) - Dim importePuTemp As Decimal = (Porcentaje * (TmpDT.SUMD("Total", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr))) + Dim importePuTemp As Decimal = (Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr))) If Not AplicaImpuestosLocales Then importePuTemp = importePuTemp - TotalImpuestosLocalesVentaOriginal @@ -29767,7 +29771,7 @@ Partial Class Ventas End If End If ObjCliente.Dispose() - 'DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty) + DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty) TrVistaPrevia.Visible = True TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString @@ -31158,6 +31162,8 @@ Partial Class Ventas tClienteRetIVA = 0.04D ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then tClienteRetIVA = 0.06D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("0") Then + tClienteRetIVA = 0.00D End If ViewState("ClienteRetIVA") = tClienteRetIVA End If diff --git a/vwd.webinfo b/vwd.webinfo index 805171ec2..cfe841e39 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -312,6 +312,8 @@ + +