diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 42e66ad44..018752561 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -265,7 +265,7 @@ Public Class ClsClientes End Sub Public Function GetClientes(CveCliente As Integer, Nombre As String, Codigo As String, NombreCorto As String, RFC As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional Notificar As String = "-1", Optional CvePrecioLista As Integer = -1, Optional CveClienteClasificacion As Integer = -1, - Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean + Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveUsuarioConsulta As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClientesGet") @@ -285,6 +285,7 @@ Public Class ClsClientes .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta .Add("@PermiteCredito", SqlDbType.Int).Value = PermiteCreditoFiltro .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 4039d1299..8dc140ab6 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -171,6 +171,47 @@ Public Class ClsNominas #End Region #Region "ClsNominas_Nominas" + + Public Function NominaUpMetododepago(cveEmpresa As Integer, CvePersonal As Integer, CvePeriodo As Integer, MetodoPagoFijo As Boolean, + CveMetodoPago As Integer, CveSATBanco As Integer, BancoNumCuenta As String, CLABE As String) As Boolean + Dim retorno As Boolean = False + DTSet = New DataSet() + DataAdapter("PA_Nom_NominaUpMetododepago", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@MetodoPagoFijo", SqlDbType.Bit).Value = MetodoPagoFijo + .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago + .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco + .Add("@BancoNumCuenta", SqlDbType.VarChar).Value = BancoNumCuenta + .Add("@CLABE", SqlDbType.VarChar).Value = CLABE + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + End With + Try + SqlAdapter.Fill(DTSetResultados) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar forma de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function PersonalISRAnual(CvePersonal As Integer, cveEmpresa As Integer, Ejercicio As Integer) As Boolean + Dim retorno As Boolean = False + DTSet = New DataSet() + DataAdapter("PA_Nom_PersonalISRAnual", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio + End With + Try + SqlAdapter.Fill(DTSet) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el finiquito.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function Public Function RemoveFiniquito(CvePersonal As Integer, cveEmpresa As Integer, CvePersonalAltas As Integer) As Boolean Dim retorno As Boolean = False DTSet = New DataSet() @@ -542,8 +583,13 @@ Public Class ClsNominas Try SqlAdapter.Fill(Data) Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al Guardar el Movimiento de Nomina.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' + Catch sqlex As SqlException + If sqlex.Message.Contains("x5010") Then + Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina(Timbrada).", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Else + Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If End Try Return Retorno @@ -786,6 +832,14 @@ Public Class ClsNominas Try SqlAdapter.Fill(Data) Retorno = True + + Catch sqlex As SqlException + If sqlex.Message.Contains("Número: 50001x") Then + Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina(Timbrada).", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Else + Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + End If Catch ex As Exception Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try @@ -1930,12 +1984,13 @@ Public Class ClsNominas End Function #End Region - Public Function GetFiniquitosPersonal(CvePersonal As Integer, CveEmpresa As Integer, Optional Limpiar As Integer = 0) As Boolean + Public Function GetFiniquitosPersonal(CvePersonal As Integer, CveEmpresa As Integer, Optional Limpiar As Integer = 0, Optional diasindemnizacion As Integer = 90) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_FiniquitosGET") With SqlAdapter.SelectCommand.Parameters .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@diasindemnizacion", SqlDbType.Int).Value = diasindemnizacion '.Add("@Limpiar", SqlDbType.Int).Value = Limpiar End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 2f67b4eff..06ea7a8d6 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -293,28 +293,19 @@ Public Class ClsPaginas Application("Directorio") = value End Set End Property - Public Shared ReadOnly Property GlobalDTPSATPS(SATClaveProductoServicio As String) As DataTable + Property GlobalDTPSATPS() As DataTable Get - 'If Application("GlobalDTPSATPS") Is Nothing Then - ' Dim ObjGrales As New ClsGenerales - ' If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing - ' ObjGrales.Dispose() - 'End If - - 'GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable - - Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATProductosServicios(SATClaveProductoServicio) Then - GlobalDTPSATPS = ObjGrales.DtResultados - Else - GlobalDTPSATPS = Nothing + If Application("GlobalDTPSATPS") Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing + ObjGrales.Dispose() End If - ObjGrales.Dispose() + GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable End Get - 'Set(value As DataTable) - ' Application("GlobalDTPSATPS") = value - 'End Set + Set(value As DataTable) + Application("GlobalDTPSATPS") = value + End Set End Property #Region "GLOBALES DE SAT COMERCIO EXTERIOR" @@ -647,7 +638,7 @@ Public Class ClsPaginas End Property - Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1, Optional Estatus As Integer = 1) As DataTable + Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa) 'sino existe, recarga los datos @@ -662,7 +653,6 @@ Public Class ClsPaginas If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion) If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion) - If Estatus <> -1 Then Str.AppendFormat(" AND Estatus = '{0}'", If(Estatus = 1, "Activo", "Inactivo")) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) GlobalDTClasificaciones = Dv.ToTable Dv.Dispose() @@ -3076,6 +3066,8 @@ Public Class ClsPaginas End Set End Property + + Property GlobalDTContaConceptosContables(CvePlantillaPoliza As Integer) As DataTable Get If CvePlantillaPoliza <> -1 Then @@ -3848,6 +3840,7 @@ Public Class ClsPaginas If Application("GlobalSIGAppPaginas") Is Nothing Then PaginaDict = New System.Collections.Hashtable + PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918) PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916) PaginaDict.Add("/RH/CalculoSBC.aspx".ToUpper(), 915) PaginaDict.Add("/Inicio.aspx".ToUpper(), -1) @@ -4617,7 +4610,6 @@ Public Class ClsPaginas PaginaDict.Add("/GPS/RepGastos.aspx".ToUpper(), 685) PaginaDict.Add("/GPS/RecursoConfiableTracking.aspx".ToUpper(), 692) PaginaDict.Add("/GPS/KimberlyClarkTracking.aspx".ToUpper(), -1) - PaginaDict.Add("/GPS/RepUnidades.aspx".ToUpper(), 780) #End Region 'INVENTARIOS #Region "Inventarios" @@ -5951,19 +5943,6 @@ Public Class ClsPaginas Dim TipoDocumentoRef As String = "" Dim AplicaPagare As String = "1" - Dim RFCReceptor As String = "" - - If String.IsNullOrEmpty(Vta.RFCReceptor) Then - RFCReceptor = Vta.Cliente.RFC - If Vta.FacturarSucursal Then - If Vta.ClienteSucursal IsNot Nothing Then - RFCReceptor = Vta.ClienteSucursal.RFC - End If - End If - Else - RFCReceptor = Vta.RFCReceptor - End If - Dim RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio) Dim ImagenCBB As New System.IO.FileInfo(RutaCBB) Dim ImgCBB As String '= String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio) @@ -6093,7 +6072,7 @@ Public Class ClsPaginas 'Si no tiene CBB, SE GENERA If Not ImagenCBB.Exists Then Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() - CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB) + CBB.GenerarCBB(UsuarioActual.Empresa.RFC, Vta.Cliente.RFC, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB) End If ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio) @@ -6108,7 +6087,7 @@ Public Class ClsPaginas 'CLIENTE params.Add(New CrystalParametro("ClienteCodigo", Vta.Cliente.Codigo)) - params.Add(New CrystalParametro("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso RFCReceptor = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre)))) + params.Add(New CrystalParametro("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre)))) params.Add(New CrystalParametro("ClienteDireccion", ClienteDireccion)) params.Add(New CrystalParametro("ClienteLugar", ClienteLugar)) @@ -6140,7 +6119,7 @@ Public Class ClsPaginas params.Add(New CrystalParametro("SelloSAT", Vta.SelloSAT)) params.Add(New CrystalParametro("QR", ImgCBB)) - params.Add(New CrystalParametro("ClienteRFC", RFCReceptor)) + params.Add(New CrystalParametro("ClienteRFC", Vta.Cliente.RFC)) params.Add(New CrystalParametro("FormaPago", Vta.FormaPagoText)) params.Add(New CrystalParametro("Moneda", Vta.Moneda)) params.Add(New CrystalParametro("TipoCambio", Vta.TipoCambio.ToString)) @@ -6475,18 +6454,7 @@ Public Class ClsPaginas Dim NombreArchivoDescarga As String = "" Dim TipoDocumento As String = "" Dim TipoDocumentoRef As String = "" - Dim RFCReceptor As String = "" - If String.IsNullOrEmpty(Vta.RFCReceptor) Then - RFCReceptor = Vta.Cliente.RFC - If Vta.FacturarSucursal Then - If Vta.ClienteSucursal IsNot Nothing Then - RFCReceptor = Vta.ClienteSucursal.RFC - End If - End If - Else - RFCReceptor = Vta.RFCReceptor - End If Dim RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio) Dim ImagenCBB As New System.IO.FileInfo(RutaCBB) @@ -6641,7 +6609,7 @@ Public Class ClsPaginas 'Si no tiene CBB, SE GENERA If Not ImagenCBB.Exists AndAlso Vta.CveCliente.ToEntero > 0 Then Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() - CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB) + CBB.GenerarCBB(UsuarioActual.Empresa.RFC, Vta.Cliente.RFC, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB) End If ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio) @@ -6662,14 +6630,14 @@ Public Class ClsPaginas params.Add(New ReportParameter("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre)))) params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion)) params.Add(New ReportParameter("ClienteLugar", ClienteLugar)) - params.Add(New ReportParameter("ClienteRFC", RFCReceptor)) + params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC)) End If If Vta.CveEmpresaCRM.ToEntero > 0 Then params.Add(New ReportParameter("ClienteCodigo", Vta.Cliente.Codigo)) params.Add(New ReportParameter("ClienteNombre", Vta.Cliente.Nombre)) params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion)) params.Add(New ReportParameter("ClienteLugar", ClienteLugar)) - params.Add(New ReportParameter("ClienteRFC", RFCReceptor)) + params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC)) End If 'TOTALES diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 196f5f3bf..80494b780 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -5654,7 +5654,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Return Retorno End Function - Public Function SolicitudVacacionesAdd(CvePersonal As Integer, Fecha As Date, FechaFin As Date, Estatus As Integer, CveUsuario As Integer, CveAutoriza As Integer, Folio As Integer, Optional Motivo As String = "", Optional FechaPago As String = "", Optional diasinabiles As Integer = 0, Optional PorcentajePrimaVac As Decimal = -1) As Boolean + Public Function SolicitudVacacionesAdd(CvePersonal As Integer, Fecha As Date, FechaFin As Date, Estatus As Integer, CveUsuario As Integer, CveAutoriza As Integer, Folio As Integer, Optional Motivo As String = "", Optional FechaPago As String = "", Optional diasinabiles As Integer = 0, Optional PorcentajePrimaVac As Decimal = -1, Optional CveTipoPago As Integer = 0, Optional diasExtras As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_SolicitudVacacionesAdd") @@ -5670,6 +5670,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@diasinabiles", SqlDbType.Int).Value = diasinabiles .Add("@PorcentajePrimaVac", SqlDbType.Money).Value = PorcentajePrimaVac .Add("@FechaPago", SqlDbType.VarChar).Value = FechaPago + .Add("@CveTipoPago", SqlDbType.Int).Value = CveTipoPago + .Add("@diasExtras", SqlDbType.Int).Value = diasExtras '.Add("@Motivo", SqlDbType.VarChar).Value = MotivoFechaPago As String = "", Optional diasinabiles End With diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index 6ac889921..7e9d8cc88 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -137,6 +137,7 @@ Public Class LogicNominas Dim SDI As Double = 0 Dim SalarioDiarioSS As Double = 0 Dim ClaveEstado As String = "" + Dim MetodoPagoFijo As Boolean Dim ObjIncapacidades As New List(Of CFDINominaIncapacidades) 'Conexiones a la Base de Datos @@ -152,6 +153,12 @@ Public Class LogicNominas cfdi.Nomina.UltimoSueldoOrdinario = drow("UltimoSueldoOrdinario").ToString().ToDecimal() Serie = objNomina.Serie Folio = objNomina.Folio.ToString() + + MetodoPagoFijo = drow("MetodoPagoFijo").ToString().ToUpper().Contiene("1", "TRUE") + + ClaveBanco = drow("ClaveBanco").ToString() + BancoNumCuenta = drow("BancoNumCuenta").ToString() + If TimbreIndemnizacion Then cfdi.Timbrado = drow("SeTimbroFiniquitoVal").ToString().ToEntero() = 1 cfdi.IStimbreFiniquito = True @@ -180,8 +187,11 @@ Public Class LogicNominas Puesto = objPersonal.Puesto CveSATRiesgoPuesto = objPersonal.CveSATRiesgoPuesto.ToString() TipoPeriodoPago = objPersonal.TipoPeriodoPago - ClaveBanco = objPersonal.ClaveBanco - BancoNumCuenta = objPersonal.BancoNumCuenta + If Not MetodoPagoFijo Then + ClaveBanco = objPersonal.ClaveBanco + BancoNumCuenta = objPersonal.BancoNumCuenta + + End If SDI = objPersonal.SDI SalarioDiarioSS = objPersonal.SalarioDiarioSS ClaveEstado = objPersonal.ClaveEstado @@ -332,7 +342,7 @@ Public Class LogicNominas 'subsidio al empleo If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser referente a subsidio al empleo - .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal, .Subsidiocausado = Row("Importe").ToString().ToDecimal().Abs()}) + .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal, .Subsidiocausado = Row("ImporteValor").ToString().ToDecimal().Abs()}) End If Next End If @@ -362,7 +372,7 @@ Public Class LogicNominas 'subsidio al empleo If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser referente a subsidio al empleo - .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal(), .Subsidiocausado = Row("Importe").ToString().ToDecimal().Abs()}) + .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal(), .Subsidiocausado = Row("ImporteValor").ToString().ToDecimal().Abs()}) End If Next End If @@ -376,7 +386,7 @@ Public Class LogicNominas If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For Dim otrp = New CFDINominaOtrosPagos With {.TipoOtroPago = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), - .Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("Importe").ToString().ToDecimal().Abs()} + .Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("ImporteValor").ToString().ToDecimal().Abs()} If Row("SATCveConcepto").ToString().ToEntero() = 4 Then otrp.ejercicio = DateTime.Now.Year - 1 otrp.SaldoAFavor = Row("ImporteValor").ToString().ToDecimal().Abs() diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index e267668e4..a9bf3cfff 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -5,8 +5,8 @@ Imports System.Data Imports Extensiones Partial Class Bancos_PopIEVentas - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "Propiedades" Private Property DtDeudores As DataTable Get @@ -520,9 +520,9 @@ Partial Class Bancos_PopIEVentas Set(value As Date) ViewState("Fecha") = value End Set - End Property + End Property #End Region - + Private Sub Bancos_PopIEVentas_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then @@ -618,8 +618,8 @@ Partial Class Bancos_PopIEVentas TxtTCDolares.Text = GlobalTipoCambio(Fecha).FormatoNumero(4) End If End If - End Sub - + End Sub + #Region "C A M B I A R P A N E L" Private Sub RBLContado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLContado.SelectedIndexChanged Select Case RBLContado.SelectedValue @@ -670,9 +670,9 @@ Partial Class Bancos_PopIEVentas End Select UpGuardar.Update() - End Sub + End Sub #End Region - + #Region "C A R G A R I N F O R M A C I O N" Private Sub CargaVenta(pCveVenta As Integer) Dim ObjVenta As New ClsVentas() @@ -1005,9 +1005,9 @@ Partial Class Bancos_PopIEVentas End If UpDeudores.Update() - End Sub + End Sub #End Region - + #Region "DDL'S CHANGED" Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged Dim valor As Integer = DirectCast(sender, DropDownList).SelectedValue.ToEntero @@ -1097,8 +1097,8 @@ Partial Class Bancos_PopIEVentas Private Sub DdlDeudor_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDeudor.SelectedIndexChanged CambieDeudor() - End Sub - + End Sub + #Region " CUENTAS DEPOSITOS" Private Sub CargaCuentasDepositos() DdlCuentaDeposito.Items.Clear() @@ -1166,10 +1166,10 @@ Partial Class Bancos_PopIEVentas End If Dep.Dispose() UpCuentaDeposito.Update() - End Sub + End Sub #End Region #End Region - + #Region "GV ROW DATA BOUND" Private Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvIngresos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -1218,12 +1218,12 @@ Partial Class Bancos_PopIEVentas Dim rv As RangeValidator = CType(e.Row.FindControl("RVSaldoDeudor"), RangeValidator) End If - End Sub - + End Sub + #End Region - + #Region "CHK TIPO CAMBIO" - + #Region "PAGAR CON PESOS" Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs) If ChkPagarPesos.Checked Then @@ -1284,9 +1284,9 @@ Partial Class Bancos_PopIEVentas Else args.IsValid = False End If - End Sub + End Sub #End Region - + #Region "PAGAR CON DOLARES" Protected Sub ChkPagarDolares_CheckedChanged(sender As Object, e As EventArgs) If ChkPagarDolares.Checked Then @@ -1345,9 +1345,9 @@ Partial Class Bancos_PopIEVentas Else args.IsValid = False End If - End Sub + End Sub #End Region - + Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs) CambiaTipoMoneda() End Sub @@ -1377,6 +1377,9 @@ Partial Class Bancos_PopIEVentas #Region "G U A R D A R" Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click + + + Dim FechaFactura As Date = FechaVenta Dim FechaDocumentoPago As Date = TxtFechaDocumento.Text.ToDate @@ -3588,9 +3591,9 @@ Partial Class Bancos_PopIEVentas UpDatos.Update() UpGuardar.Update() - End Sub + End Sub #End Region - + #Region " COMPLEMENTOS PAGO " Private Function EmitirComplementoPago(CveIE As Integer, CveVentas As List(Of Integer), Series As List(Of String)) As String If Not ChkComplementoPago.Checked Then @@ -3601,6 +3604,16 @@ Partial Class Bancos_PopIEVentas 'For i = 0 To CveVentas.Count - 1 Dim ObjBancos As New ClsBancos + + If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 2, UsuarioActual.CveEmpresa, -1) Then + If Not ObjBancos.DtResultados.Rows.Count > 0 Then + ObjBancos.Dispose() + Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia) + Return "" + End If + End If + + ObjBancos.IniciaTransacSQL() If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente) Then diff --git a/Bin/ClosedXML.dll b/Bin/ClosedXML.dll index 4065a321f..0bdfccd36 100644 Binary files a/Bin/ClosedXML.dll and b/Bin/ClosedXML.dll differ diff --git a/Bin/DocumentFormat.OpenXml.dll b/Bin/DocumentFormat.OpenXml.dll index 1698758e5..7978b0462 100644 Binary files a/Bin/DocumentFormat.OpenXml.dll and b/Bin/DocumentFormat.OpenXml.dll differ diff --git a/Bin/Microsoft.Owin.Security.OAuth.dll b/Bin/Microsoft.Owin.Security.OAuth.dll index 8f95e3053..650eb379b 100644 Binary files a/Bin/Microsoft.Owin.Security.OAuth.dll and b/Bin/Microsoft.Owin.Security.OAuth.dll differ diff --git a/Bin/Microsoft.Owin.Security.dll b/Bin/Microsoft.Owin.Security.dll index e162f2d25..3bf4f0a88 100644 Binary files a/Bin/Microsoft.Owin.Security.dll and b/Bin/Microsoft.Owin.Security.dll differ diff --git a/Bin/Microsoft.Owin.dll b/Bin/Microsoft.Owin.dll index 3b7a0ffe8..0e19530d5 100644 Binary files a/Bin/Microsoft.Owin.dll and b/Bin/Microsoft.Owin.dll differ diff --git a/Bin/WebGrease.dll b/Bin/WebGrease.dll index 1d308f8ed..a6a80d37f 100644 Binary files a/Bin/WebGrease.dll and b/Bin/WebGrease.dll differ diff --git a/Contabilidad2/CatCuentas.aspx.vb b/Contabilidad2/CatCuentas.aspx.vb index c49923db5..d4a8d1ef1 100644 --- a/Contabilidad2/CatCuentas.aspx.vb +++ b/Contabilidad2/CatCuentas.aspx.vb @@ -512,7 +512,10 @@ Partial Class Contabilidad2_CatCuentas ObjConta2.RollBack() ObjConta.RollBack() Alert("Ocurrio un error al vincultar la cuenta con SIG y Compaq", TipoMensaje.MsgError) + Else + ObjConta2.Commit() End If + Else TieneError = True ObjConta2.RollBack() diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb index 886765323..3202ecc39 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb +++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb @@ -165,13 +165,13 @@ Partial Class Contabilidad2_CatCuentasAsignaciones If LbAgregar.Text = "Agregar" Then If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, - DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero) Then + DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero()) Then ErrorString = "Error al agregar" End If ElseIf LbAgregar.Text = "Actualizar" Then If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, - DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero) Then + DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero()) Then ErrorString = "Error al actualizar" End If End If diff --git a/Nomina/ConceptoNomina.aspx b/Nomina/ConceptoNomina.aspx index f691d8511..5e4827a94 100644 --- a/Nomina/ConceptoNomina.aspx +++ b/Nomina/ConceptoNomina.aspx @@ -203,7 +203,7 @@
- +
diff --git a/Nomina/ConceptoNomina.aspx.cs b/Nomina/ConceptoNomina.aspx.cs index 2c9f70bee..b798fb34e 100644 --- a/Nomina/ConceptoNomina.aspx.cs +++ b/Nomina/ConceptoNomina.aspx.cs @@ -271,6 +271,21 @@ public partial class Nomina_CatConcepto : ClsPaginas DdlCtaContable.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlCtaContable.SelectedValueExist("-1"); } + else + { + + using (ClsContabilidad ObjConta = new ClsContabilidad()) + { + if (ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa)) + { + + DdlCtaContable.DataSource = ObjConta.DtResultados; + DdlCtaContable.DataBind(); + } + } + DdlCtaContable.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlCtaContable.SelectedValueExist("-1"); + } } @@ -453,7 +468,14 @@ public partial class Nomina_CatConcepto : ClsPaginas DdlClasificacion.SelectedValueExist(drow["CveClasificacion"]); DdlTipoGasto.SelectedValueExist(drow["CveTipoGasto"]); - DdlCtaContable.SelectedValueExist(drow["IdCtaContable"]); + DdlCtaContable.SelectedValueExist(drow["CveCuenta"]); + //if (UsuarioActual.Empresa.TipoContabilidad == 1) + //{ + //} + //else + //{ + // DdlCtaContable.SelectedValueExist(drow["IdCtaContable"]); + //} DdlConceptoSAT.SelectedValueExist(drow["CveSATConcepto"]); } ObjNomina.Dispose(); diff --git a/Nomina/Finiquito.aspx b/Nomina/Finiquito.aspx index 8aff005bd..0d915c274 100644 --- a/Nomina/Finiquito.aspx +++ b/Nomina/Finiquito.aspx @@ -242,6 +242,13 @@ Indemnización
+
+
+ + +
+
+
Separación unica diff --git a/Nomina/Finiquito.aspx.cs b/Nomina/Finiquito.aspx.cs index 3596e07ff..5b28459b6 100644 --- a/Nomina/Finiquito.aspx.cs +++ b/Nomina/Finiquito.aspx.cs @@ -1062,16 +1062,15 @@ public partial class Nomina_Finiquito : ClsPaginas using (ClsRH ObjPersonal = new ClsRH()) using (ClsNominas onom = new ClsNominas(ObjPersonal.IniciaTransacSQL())) { - if (ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked,chkIndemnizacion.Checked ,chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0) + if (continuar =ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked,chkIndemnizacion.Checked ,chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0) { DataRow da = ObjPersonal.DtResultados.Rows[0]; CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero(); - CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero(); - continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa); + CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero(); } if (continuar) { - continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa); + continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa,diasindemnizacion:Txtdiasindemnizacion.Text.ToEntero()); } if (continuar) { @@ -1311,16 +1310,15 @@ public partial class Nomina_Finiquito : ClsPaginas using (ClsRH ObjPersonal = new ClsRH()) using (ClsNominas onom = new ClsNominas(ObjPersonal.IniciaTransacSQL())) { - if (ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0) + if (continuar =ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0) { DataRow da = ObjPersonal.DtResultados.Rows[0]; CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero(); CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero(); - continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa); } if (continuar) { - continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa); + continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa, diasindemnizacion: Txtdiasindemnizacion.Text.ToEntero()); } if (continuar) { loadsobrerecibo(onom); } diff --git a/Nomina/ISRCalculoAnual.aspx b/Nomina/ISRCalculoAnual.aspx new file mode 100644 index 000000000..6de631038 --- /dev/null +++ b/Nomina/ISRCalculoAnual.aspx @@ -0,0 +1,128 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ISRCalculoAnual.aspx.cs" Inherits="Nomina_ISCalculoAnual" %> + + + + + + + Calculo anual de ISR + + + + + + + + + + + + +
+
+
+
+ +
+ +
+
+ + +
+ +
+
+
+ <%----%> +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/Nomina/ISRCalculoAnual.aspx.cs b/Nomina/ISRCalculoAnual.aspx.cs new file mode 100644 index 000000000..f6528e3b0 --- /dev/null +++ b/Nomina/ISRCalculoAnual.aspx.cs @@ -0,0 +1,47 @@ +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_ISCalculoAnual : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + + DataTable dtejercicio = new DataTable(); + using (ClsNominas objnom = new ClsNominas()) + { + if (objnom.GetEjercicios(UsuarioActual.CveEmpresa)) + { + dtejercicio = objnom.DtResultados; + } + } + DdlEjercicios.DataSource = dtejercicio; + DdlEjercicios.DataBind(); + } + + protected void LnkConsultar_Click(object sender, EventArgs e) + { + CargaPersonalISRAnual(); + } + + protected void CargaPersonalISRAnual() + { + DataTable dtdatos = new DataTable(); + int ejercicio = DdlEjercicios.SelectedValue.ToEntero(); + using (ClsNominas objnom = new ClsNominas()) + { + if (objnom.PersonalISRAnual(-1, UsuarioActual.CveEmpresa, ejercicio)) + { + dtdatos = objnom.DTSetResultados.Tables[0]; + } + } + GVPersonalISRAnual.DataSource = dtdatos; + GVPersonalISRAnual.DataBind(); + upDatosPers.Update(); + } +} \ No newline at end of file diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index bb73f7840..c04e8e10c 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -1,103 +1,309 @@ -<%@ Page Title="Nómina - Nómina" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Nomina.aspx.vb" Inherits="Nomina_Nomina" %> +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Nomina.aspx.cs" Inherits="Nomina_Nomina2" %> - - + - - <%-- Nómina --%> + + Nominas + + + + + +
  • + Autorizar +
  • +
  • + Registrar provisión +
  • +
  • + Layout banco +
  • +
  • + Ver provisión +
  • +
  • + Ver provisión Asimilados +
  • +
  • + Timbrar todos +
  • +
  • + Incidencias asistencia +
  • +
  • + Reporte percepciones y deducciones +
  • +
  • + Reporte acumulados +
  • +
  • + Empleado concepto +
  • +
  • + Carga masiva de asistencia +
  • +
  • + Lista de raya +
  • +
  • + Cargar masiva de conceptos +
  • +
  • + Tablas de cálculo +
  • +
  • + Cálculo ISR +
  • +
  • + Ir a asistencia +
  • +
  • + Nómina tabular +
  • +
  • + Simulador +
  • +
  • + Procesar archivo SUA +
  • +
  • + Descargar archivos SUA +
  • +
  • + Recibos timbrados +
  • +
    + + + + + + +
    +
    - + + + +
    - -
    - -
    - - -
    - - - -
    - - -
    - - - -
    - +
    - - - + +
    + + +
    + +
    + + +
    + + + +
    +
    + + <%----%> + <%----%> + + + + + Recibos +
    +
    + +
    -
    +
    + +
    +
    +
    + Forma de pago
    + + + + + +
    +
    +
    +
    + + Días extras +
    +
    +
    diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index c5bac7099..c76ba4672 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -4514,7 +4514,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) + 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()) If objRH.DtResultados.Rows.Count > 0 Then Dim ShowError As String = objRH.DtResultados.Rows(0)("ShowError").ToString() If ShowError.Length > 0 Then @@ -4768,11 +4768,6 @@ Partial Class RH_Personal Protected Sub BtnEditarDiaVacacionModal_Click(sender As Object, e As EventArgs) Handles BtnEditarDiaVacacionModal.Click - Dim objRH As New ClsRH() - - - - Dim FileExtension As String = "-1" Dim Filesgral As List(Of Archivo) = TxtFileFormatoVacaciones.getfiles().Archivos Dim Filename As String = "" @@ -4784,36 +4779,27 @@ Partial Class RH_Personal Documento = $"Vacaciones_{CvePersonalVacaciones}.{FileExtension}" Dim tempArray() As String tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) - Dim rutaDestino As String = $"{UsuarioActual.Empresa.Ruta}Personal\{CvePersonal}\Vacaciones\{Documento}" - If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\Vacaciones\") Then System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\Vacaciones\") End If - - If System.IO.File.Exists(rutaDestino) Then System.IO.File.Delete(rutaDestino) End If - System.IO.File.Move(fileItem.FileUrl, rutaDestino) - TxtFileFormatoVacaciones.Text = "" - Catch ex As Exception OnError("Error al cargar Formato vacaciones", ex) End Try Next If Documento.Length > 0 Then - + Dim objRH As New ClsRH() If objRH.SolicitudVacacionesAddUpdate(CvePersonalVacaciones, CvePersonal, UsuarioActual.CveUsuario, Documento) Then Alert("La fecha se actualizo correctamente") End If UpModalEditarDiaVacacion.Update() - objRH.Dispose() - CargaVacaciones() CargaVacacionesResumenPeriodoActual() RegistraScript("$('#divEditarDiaVacacion').modal('hide');") @@ -5304,38 +5290,14 @@ Partial Class RH_Personal Dim Cantidad As Double = TxtCantidadResguardo.Text.ToDouble() Dim Serie As String = TxtLiberarSerie.Text.Trim - Dim MsgError As String = "" Dim CveResultadoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenUniforme, 3, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme) - If CveResultadoSalida > 0 Then - If CveSeccionAlmacenUniforme = 0 Then CveSeccionAlmacenUniforme = -3 'que lo tome por default - Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacenUniforme, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme) - Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero - If ResultadoDetalleSalida Then + Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacenUniforme, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme) + Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero + Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme) + Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie) - Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme) - If CveResultadoEntrada > 0 Then - Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie) - If ResultadoDetalleSalida And ResultadoDetalleEntrada Then - MsgError = "" - Else - Alert("No se pudo registrar la liberación.", TipoMensaje.MsgError) - MsgError = "Error1" - End If - Else - MsgError = "Error1" - End If - - Else - MsgError = "Error1" - End If - Else - MsgError = "Error" - - End If - - - If MsgError = "" Then + If ResultadoDetalleSalida And ResultadoDetalleEntrada Then ObjInventario.Commit() Alert("El resguardo se liberó correctamente") RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalUniforme")) @@ -5344,7 +5306,6 @@ Partial Class RH_Personal Alert("No se pudo registrar la liberación.", TipoMensaje.MsgError) ObjInventario.RollBack() End If - ObjInventario.Dispose() End Sub diff --git a/Sistemas/PopUpCambiaUsuario.aspx.vb b/Sistemas/PopUpCambiaUsuario.aspx.vb index acda2dfa4..2c3b04d80 100644 --- a/Sistemas/PopUpCambiaUsuario.aspx.vb +++ b/Sistemas/PopUpCambiaUsuario.aspx.vb @@ -53,29 +53,30 @@ Partial Class Sistemas_PopUpCambiaUsuario End If If splitedtext.Length > 0 Then - Select Case splitedtext(0).ToUpper() - Case "VSH" : CveEmpresa = "7" - Case "JAM" : CveEmpresa = "119" - Case "COMPUPROVEEDORES" : CveEmpresa = "72" - Case "DNDIFUSA" : CveEmpresa = "80" - Case "SOGO" : CveEmpresa = "8" - Case "BDH" : CveEmpresa = "140" - Case "ECONOLLANTAS" : CveEmpresa = "141" - End Select - End If - DdlEmpresa.DataBind() - DdlEmpresa.SelectedValue = CveEmpresa - - 'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero) - 'DdlRol.DataBind() - 'DdlRol.Items.Insert(0, New ListItem("Todos", "-1")) - - TxtBusqueda.Attributes.Add("data-table", gvUsuarios.ClientID) - - CargaUsuarios() - 'LblUsuario.Text = usuarioactual. - + Select Case splitedtext(0).ToUpper() + Case "VSH" : CveEmpresa = "7" + Case "JAM" : CveEmpresa = "119" + Case "COMPUPROVEEDORES" : CveEmpresa = "72" + Case "DNDIFUSA" : CveEmpresa = "80" + Case "SOGO" : CveEmpresa = "8" + Case "BDH" : CveEmpresa = "140" + Case "ECONOLLANTAS" : CveEmpresa = "141" + Case "SERVEC" : CveEmpresa = "153" + End Select End If + DdlEmpresa.DataBind() + DdlEmpresa.SelectedValue = CveEmpresa + + 'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero) + 'DdlRol.DataBind() + 'DdlRol.Items.Insert(0, New ListItem("Todos", "-1")) + + TxtBusqueda.Attributes.Add("data-table", gvUsuarios.ClientID) + + CargaUsuarios() + 'LblUsuario.Text = usuarioactual. + + End If End Sub diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index ab9cb4640..f911a4b94 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -397,12 +397,12 @@ public class TareasJam : IHttpHandler this.GuardaLog($"EjecutaThalamus: Cargando archivo excel productos a FTP. "); - CargaProductos = CargarArchivos(FInfoProductos, $"{FTPServer}/Productos", TFPUsr, FTPPass); + CargaProductos = CargarArchivos(FInfoProductos, $"{FTPServer}/productos", TFPUsr, FTPPass); if (CargaProductos) { this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. "); - CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, $"{FTPServer}/Productos", TFPUsr, FTPPass); + CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, $"{FTPServer}/productos", TFPUsr, FTPPass); } if (CargaProductos) @@ -417,11 +417,11 @@ public class TareasJam : IHttpHandler if (CargaProductos) { this.GuardaLog($"EjecutaThalamus: Cargando archivo excel ventas a FTP. "); - CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass); + CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/ventas", TFPUsr, FTPPass); if (CargaVentas) { this.GuardaLog($"EjecutaThalamus: Verificando archivo ventas. "); - CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass); + CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/ventas", TFPUsr, FTPPass); } } @@ -437,11 +437,11 @@ public class TareasJam : IHttpHandler if (CargaProductos & CargaVentas) { this.GuardaLog($"EjecutaThalamus: Cargando archivo excel clientes a FTP. "); - CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass); + CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/clientes", TFPUsr, FTPPass); if (CargaClientes) { this.GuardaLog($"EjecutaThalamus: Verificando archivo clientes. "); - CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass); + CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/clientes", TFPUsr, FTPPass); } } @@ -457,11 +457,11 @@ public class TareasJam : IHttpHandler if (CargaProductos & CargaVentas & CargaClientes) { this.GuardaLog($"EjecutaThalamus: Cargando archivo excel almacenes a FTP. "); - CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass); + CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/stock", TFPUsr, FTPPass); if (CargaClientes) { this.GuardaLog($"EjecutaThalamus: Verificando archivo almacenes. "); - CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, $"{FTPServer}/Stock", TFPUsr, FTPPass); + CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, $"{FTPServer}/stock", TFPUsr, FTPPass); } } diff --git a/Ventas/PopUpBuscarClientes.aspx.vb b/Ventas/PopUpBuscarClientes.aspx.vb index 7a988792a..a65d2da95 100644 --- a/Ventas/PopUpBuscarClientes.aspx.vb +++ b/Ventas/PopUpBuscarClientes.aspx.vb @@ -72,8 +72,15 @@ Partial Class PopUpBuscarClientes If ValidarUnFiltroSeleccionado() Then Dim ObjClientes As New ClsClientes() + Dim CveUsuarioConsulta As Integer + + If UsuarioActual.TienePermisoProceso(322) Then + CveUsuarioConsulta = UsuarioActual.CveVendedor + Else + CveUsuarioConsulta = -1 + End If If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, - DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente, TopSelect:=100) Then + DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente, TopSelect:=100, CveUsuarioConsulta:=CveUsuarioConsulta) Then If ObjClientes.DtResultados.Rows.Count > 0 Then LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0) GV.DataSource = ObjClientes.DtResultados diff --git a/Ventas/RepVentas.aspx b/Ventas/RepVentas.aspx index 92a112553..b9214294c 100644 --- a/Ventas/RepVentas.aspx +++ b/Ventas/RepVentas.aspx @@ -332,7 +332,7 @@ - +