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 3b02033ed..ab6ef9aba 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -309,12 +309,12 @@ Public Class ClsPaginas Else GlobalDTPSATPS = Nothing 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 +647,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 +662,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 +3075,8 @@ Public Class ClsPaginas End Set End Property + + Property GlobalDTContaConceptosContables(CvePlantillaPoliza As Integer) As DataTable Get If CvePlantillaPoliza <> -1 Then @@ -3848,6 +3849,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 +4619,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 +5952,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 +6081,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 +6096,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 +6128,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 +6463,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 +6618,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 +6639,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/IE.aspx.vb b/Bancos/IE.aspx.vb index 26461a676..444749611 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -6011,6 +6011,16 @@ Partial Class Bancos_IE Dim Str As New StringBuilder Dim Banco As New ClsBancos + + If Banco.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 2, UsuarioActual.CveEmpresa, -1) Then + If Not Banco.DtResultados.Rows.Count > 0 Then + Banco.Dispose() + Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + + Banco.IniciaTransacSQL() 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/Compras/Compras.aspx b/Compras/Compras.aspx index 6530840d4..6015bbbd6 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -1139,17 +1139,12 @@ -
+ + @@ -2417,12 +2401,17 @@ - + + + + + +
@@ -6660,6 +6649,28 @@ } + + function ValidaRangoDeFechas(sender, args) { + + if ($("#TxtFecha").val().length == 10 && $("#TxtFechaPago").val().length == 10) { + + let Finicio = parseInt($("#TxtFecha").val().substring(6,10)); + let FFin = parseInt($("#TxtFechaPago").val().substring(6, 10)); + + + if ((FFin - Finicio) > 5) { + args.IsValid = false; + } else { + args.IsValid = true; + } + + + } else { + args.IsValid = true; + } + + } + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 1563e7169..ce5eb995c 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -3955,6 +3955,10 @@ Partial Class Compras_Compras 'End If '------------------ INICIA VALIDACIONES ------------------ + + + + Dim EstatusCredito As Integer = 0 Dim CveSubProyecto As Integer = 0 'Credito Multiple @@ -18684,17 +18688,15 @@ Partial Class Compras_Compras TmpDT.Rows(HdnAliasInd.Value.ToEntero)("Obs") = TxtPSAlias.Text.Trim 'busco si el producto está en otros renglones QUE NO LO TENGAN ASIGNADO, LO VINCULE - If UsuarioActual.CveEmpresa <> 141 Then - For Each drt As DataRow In TmpDT.Select($"PS ='{TxtPSAlias.Text.Trim}' and ISNULL(CvePS,0) = 0") - drt("CvePS") = CvePS - drt("PS") = tPS - drt("CveUM") = DdlUnidadAlias.SelectedValue.ToEntero - drt("UM") = DdlUnidadAlias.SelectedItem.Text - drt("CveClasificacion") = HdnPSAliasCveClasificacion.Value.ToEntero - drt("Clasificacion") = HdnPSAliasClasificacion.Value - drt("Obs") = TxtPSAlias.Text.Trim - Next - End If + For Each drt As DataRow In TmpDT.Select($"PS ='{TxtPSAlias.Text.Trim}' and ISNULL(CvePS,0) = 0") + drt("CvePS") = CvePS + drt("PS") = tPS + drt("CveUM") = DdlUnidadAlias.SelectedValue.ToEntero + drt("UM") = DdlUnidadAlias.SelectedItem.Text + drt("CveClasificacion") = HdnPSAliasCveClasificacion.Value.ToEntero + drt("Clasificacion") = HdnPSAliasClasificacion.Value + drt("Obs") = TxtPSAlias.Text.Trim + Next TmpDT.AcceptChanges() 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/Empresas/154/Formatos/Factura.rdlc b/Empresas/154/Formatos/Factura.rdlc index 78020a870..a5c1e2f0c 100644 --- a/Empresas/154/Formatos/Factura.rdlc +++ b/Empresas/154/Formatos/Factura.rdlc @@ -1,5413 +1,5413 @@ - - - 0 - - - - System.Data.DataSet - /* Local Connection */ - - 06ae5329-8ff5-42b5-b7f4-6d68e5186420 - - - - System.Data.DataSet - /* Local Connection */ - - 3fde81d4-b9ca-4175-9160-5293ca8b9aa9 - - - - System.Data.DataSet - /* Local Connection */ - - c220a38d-e45b-4e04-917e-7dfd9cc3345f - - - - System.Data.DataSet - /* Local Connection */ - - c220a38d-e45b-4e04-917e-7dfd9cc3345f - - - - System.Data.DataSet - /* Local Connection */ - - c220a38d-e45b-4e04-917e-7dfd9cc3345f - - - - System.Data.DataSet - /* Local Connection */ - - c220a38d-e45b-4e04-917e-7dfd9cc3345f - - - - - - DsOC - /* Local Query */ - - - - CveOrdenCompraDetalle - System.Int64 - - - CveOrdenCompra - System.Int64 - - - Cantidad - System.Double - - - CveUnidadMedida - System.Int64 - - - Abreviatura - System.String - - - PS - System.String - - - CveClasificacion - System.Int64 - - - Clasificacion - System.String - - - CveActivoFijo - System.Int64 - - - Codigo - System.String - - - TipoDato - System.Int64 - - - CodigoAF - System.String - - - CodigoPS - System.String - - - UnidadMedida - System.String - - - Importe - System.Decimal - - - Total - System.Decimal - - - UM - System.String - - - Obs - System.String - - - SubProyecto - System.String - - - PU - System.String - - - Descuento - System.String - - - Marca - System.String - - - SATClaveProdServ - System.String - - - SATClaveUM - System.String - - - PorcentajeIVA - System.String - - - - DsOC - C:\Users\Orlando Bojorquez\Documents\Visual Studio 2013\WebSites\WebSite1\App_Code\DsOC.xsd - DtOCDetalle - - - - - - - - DataSet2 - /* Local Query */ - - - - ImpuestoLocal - System.String - - - Importe - System.Double - - - Nombre - System.String - - - ImporteT - System.String - - - Orden - System.String - - - - DataSet2 - C:\Users\jesus\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DataSet2.xsd - DataTable1 - - - - - - - - DsFirmas - /* Local Query */ - - - - Titulo - System.String - - - Nombre - System.String - - - Puesto - System.String - - - Lado - System.String - - - - DsFirmas - C:\Users\Jesus Murua\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DsFirmas.xsd - DataTable1 - - - - - - - - DsDesgloseImpuestos - /* Local Query */ - - - - Impuesto - System.String - - - tasa - System.String - - - Importe - System.String - - - Orden - System.String - - - - DsDesgloseImpuestos - C:\Users\Jesus Murua\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DsFirmas.xsd - DataTable1 - - - - - - - - DsDesgloseImpuestos - /* Local Query */ - - - - SerieFolio - System.String - - - Fecha - System.String - - - Importe - System.String - - - FolioFiscal - System.String - - - - DsDocumentosRelacionados - C:\Users\Jesus Murua\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DsFirmas.xsd - DataTable1 - - - - - - - - DsDesgloseImpuestos - /* Local Query */ - - - - SerieFolio - System.String - - - Fecha - System.String - - - SubTotal - System.String - - - Importe - System.String - - - Moneda - System.String - - - - DsNCVinculadas - C:\Users\Jesus Murua\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DsFirmas.xsd - DataTable1 - - - - - - - - - - - - - - External - =Parameters!QR.Value - FitProportional - 0.04167in - 1.37377in - 1.7524in - - - - - - true - true - true - - - - - Sello Digital del CFDI: - - - - - - - - - - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - 4.17868in - 0.06752in - 1.60919in - 8.23953in - - - - - - - - - 0.54014in - - - 0.59111in - - - 0.80359in - - - 0.66404in - - - 2.60074in - - - 0.83102in - - - 0.6403in - - - 0.69088in - - - 0.80447in - - - - - 0.19645in - - - - - true - true - - - - - # Cant. - - - - - - - - 2pt - - - - 2pt - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Unidad - - - - - - - Black - - 2pt - - - Black - - 2pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Clave Pr./Se - - - - - - - Textbox29 - - - - Black - - 2pt - - - Black - - 2pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Clave U. - - - - - - - Textbox2 - - - - - 2pt - - - - 2pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Nombre - - - - - - - Textbox17 - - - - Black - - 2pt - - - Black - - 2pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Precio - - - - - - - Textbox53 - - - - Black - - 2pt - - - Black - - 2pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Tasa IVA - - - - - - - Textbox21 - - - - Black - - 2pt - - - Black - - 2pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Descto. - - - - - - - Textbox23 - - - - Black - - 2pt - - - Black - - 2pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - SubTotal - - - - - - - Textbox1 - - - - Black - - 2pt - - - Black - - 2pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.16561in - - - - - true - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - true - - - - - =Fields!UM.Value - - - - - - - UM - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - true - - - - - =Fields!SATClaveProdServ.Value - - - - - - - SATClaveProdServ - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - true - - - - - =Fields!SATClaveUM.Value - - - - - - - SATClaveUM - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - true - - - - - =Fields!PS.Value & IIF(Fields!Obs.Value <> "",System.Environment.NewLine &"Observaciones: ","") & Fields!Obs.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - true - - - - - =Fields!PU.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - true - - - - - =Fields!PorcentajeIVA.Value - - - - - - - PorcentajeIVA - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - true - - - - - =Fields!Descuento.Value - - - - - - - Descuento1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - true - - - - - =Fields!Cantidad.Value * Fields!PU.Value - - - - - - - TiempoEntrega - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsOC - 1.92778in - 0.09836in - 0.36206in - 8.16629in - 1 - - - - - - true - true - - - - - - - - Black - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ELECTRICA SERVEC S DE RL DE CV - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Expedido en Sucursal: - - - - =Parameters!Sucursal.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =UCase(Parameters!TipoDocumento.Value) - - - - - - - Textbox8 - 18.23008cm - 0.96018cm - 2.79101cm - 6 - - - Black - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) - - - - - - - Textbox8 - 0.97782cm - 18.23008cm - 0.6cm - 2.79101cm - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha y Hora: - - - - - - - - - =Parameters!Fecha.Value - - - - - - - Textbox8 - 1.57782cm - 18.23008cm - 0.86903cm - 2.79101cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - true - - - - - Folio Fiscal: - - - - =Parameters!FolioFiscal.Value - - - - - - - - - Fecha y hora de certificacion: - - - - =Parameters!FechaCertificacion.Value - - - - - - - - - No. de Serie del Certificado del SAT: - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - - Textbox4 - 2.88607cm - 0.28014cm - 1.09007cm - 9.71199cm - 9 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - true - - - - - No. de Serie del Certificado del CSD: - - - - =Parameters!CertificadoContribuyente.Value - - - - - - - =Parameters!CiudadSucursal.Value - - - - - - - - =Parameters!Fecha.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ClienteNombre.Value - - - - - - - - - - - =Parameters!ClienteColonia.Value - - - - - - - - =Parameters!ClienteCiudad.Value - - - - - - - - =Parameters!ClienteEstado.Value - - - - CP - - - - =Parameters!ClienteCP.Value - - - - - - - - =Parameters!ClientePais.Value - - - - - - - - - - - =Parameters!ClienteTelefono.Value - - - - - - - - =iif(Parameters!ClienteContactoMail.Value = "","","Correo: ") - - - - =Parameters!ClienteContactoMail.Value - - - - - - - =Parameters!ClienteRFC.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!CondicionPago.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - Black - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Ord. Compra: - - - - =Parameters!OrdenCompra.Value - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Tipo de Comprobante:I - - - - =UCase(Parameters!TipoDocumento.Value) - - - - ,Moneda: - - - - =Parameters!MonedaAbreviatura.Value - - - - , Uso de CFDI: - - - - =Parameters!UsoCFDI.Value - - - - , Forma de Pago: - - - - =Parameters!FormaPago.Value - - - - , Método de Pago: - - - - =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - Black - 2pt - 2pt - 2pt - 2pt - - - - Embedded - LOGOSERVECENJPG - FitProportional - 0.71282cm - 0.28014cm - 1.23542cm - 3.86912cm - 17 - - - - - - - - - 2.88535cm - - - - - 0.48004cm - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - =Fields!ImpuestoLocal.Value - - - - 2.82569cm - - - true - true - - - - - =IIF(Fields!ImpuestoLocal.Value = "Total",UCase(Fields!ImpuestoLocal.Value),Fields!ImpuestoLocal.Value) - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - DataSet1 - 7.9071cm - 15.31342cm - 0.48004cm - 5.71104cm - 18 - - - - - - 14.91814cm - - - - - - - Textbox35 - 0.01763cm - 18.52109cm - 0.50624cm - 2.5cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - - - =Now() - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Usuario Imprimió: - - - - - - - - =Parameters!UsuarioImprimio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0cm - 0cm - 0.5cm - 0.5cm - 1.27cm - + + + + + true + true + true + + + + + Sello Digital del CFDI: + + + + + + + + + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + 4.17868in + 0.06752in + 1.60919in + 8.23953in + + + + + + + + + 0.54014in + + + 0.59111in + + + 0.80359in + + + 0.66404in + + + 2.60074in + + + 0.83102in + + + 0.6403in + + + 0.69088in + + + 0.80447in + + + + + 0.19645in + + + + + true + true + + + + + # Cant. + + + + + + + + 2pt + + + + 2pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Unidad + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Clave Pr./Se + + + + + + + Textbox29 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Clave U. + + + + + + + Textbox2 + + + + + 2pt + + + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Nombre + + + + + + + Textbox17 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Precio + + + + + + + Textbox53 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tasa IVA + + + + + + + Textbox21 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Descto. + + + + + + + Textbox23 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + SubTotal + + + + + + + Textbox1 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.16561in + + + + + true + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + true + + + + + =Fields!UM.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + true + + + + + =Fields!SATClaveProdServ.Value + + + + + + + SATClaveProdServ + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + true + + + + + =Fields!SATClaveUM.Value + + + + + + + SATClaveUM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + true + + + + + =Fields!PS.Value & IIF(Fields!Obs.Value <> "",System.Environment.NewLine &"Observaciones: ","") & Fields!Obs.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + true + + + + + =Fields!PU.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + true + + + + + =Fields!PorcentajeIVA.Value + + + + + + + PorcentajeIVA + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + true + + + + + =Fields!Descuento.Value + + + + + + + Descuento1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + true + + + + + =Fields!Cantidad.Value * Fields!PU.Value + + + + + + + TiempoEntrega + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 1.92778in + 0.09836in + 0.36206in + 8.16629in + 1 + + + + + + true + true + + + + + + + + Black + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SERVICIOS ELECTRICOS Y CONTROL DE HERMOSILLO S.A. DE C.V. + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Expedido en Sucursal: + + + + =Parameters!Sucursal.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =UCase(Parameters!TipoDocumento.Value) + + + + + + + Textbox8 + 18.23008cm + 0.96018cm + 2.79101cm + 6 + + + Black + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) + + + + + + + Textbox8 + 0.97782cm + 18.23008cm + 0.6cm + 2.79101cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha y Hora: + + + + + + + + + =Parameters!Fecha.Value + + + + + + + Textbox8 + 1.57782cm + 18.23008cm + 0.86903cm + 2.79101cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + true + + + + + Folio Fiscal: + + + + =Parameters!FolioFiscal.Value + + + + + + + + + Fecha y hora de certificacion: + + + + =Parameters!FechaCertificacion.Value + + + + + + + + + No. de Serie del Certificado del SAT: + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + + Textbox4 + 2.88607cm + 0.28014cm + 1.09007cm + 9.71199cm + 9 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + true + + + + + No. de Serie del Certificado del CSD: + + + + =Parameters!CertificadoContribuyente.Value + + + + + + + =Parameters!CiudadSucursal.Value + + + + + + + + =Parameters!Fecha.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteNombre.Value + + + + + + + + + + + =Parameters!ClienteColonia.Value + + + + + + + + =Parameters!ClienteCiudad.Value + + + + + + + + =Parameters!ClienteEstado.Value + + + + CP + + + + =Parameters!ClienteCP.Value + + + + + + + + =Parameters!ClientePais.Value + + + + + + + + + + + =Parameters!ClienteTelefono.Value + + + + + + + + =iif(Parameters!ClienteContactoMail.Value = "","","Correo: ") + + + + =Parameters!ClienteContactoMail.Value + + + + + + + =Parameters!ClienteRFC.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CondicionPago.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + Black + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Ord. Compra: + + + + =Parameters!OrdenCompra.Value + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo de Comprobante:I + + + + =UCase(Parameters!TipoDocumento.Value) + + + + ,Moneda: + + + + =Parameters!MonedaAbreviatura.Value + + + + , Uso de CFDI: + + + + =Parameters!UsoCFDI.Value + + + + , Forma de Pago: + + + + =Parameters!FormaPago.Value + + + + , Método de Pago: + + + + =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + Black + 2pt + 2pt + 2pt + 2pt + + + + Embedded + LOGOSERVECENJPG + FitProportional + 0.71282cm + 0.28014cm + 1.23542cm + 3.86912cm + 17 + + + + + + + + + 2.88535cm + + + + + 0.48004cm + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + =Fields!ImpuestoLocal.Value + + + + 2.82569cm + + + true + true + + + + + =IIF(Fields!ImpuestoLocal.Value = "Total",UCase(Fields!ImpuestoLocal.Value),Fields!ImpuestoLocal.Value) + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + DataSet1 + 7.9071cm + 15.31342cm + 0.48004cm + 5.71104cm + 18 + + + + + + 14.91814cm + + + + + + + Textbox35 + 0.01763cm + 18.52109cm + 0.50624cm + 2.5cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + + + =Now() + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario Imprimió: + + + + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0cm + 0cm + 0.5cm + 0.5cm + 1.27cm + - - <%-- 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 573054243..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, TFPUsr, FTPPass); + CargaProductos = CargarArchivos(FInfoProductos, $"{FTPServer}/productos", TFPUsr, FTPPass); if (CargaProductos) { this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. "); - CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, 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/RepPS.aspx.vb b/Ventas/RepPS.aspx.vb index 5ae077225..55f38afb9 100644 --- a/Ventas/RepPS.aspx.vb +++ b/Ventas/RepPS.aspx.vb @@ -36,7 +36,7 @@ Partial Class Ventas_RepPS 'DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) End If - If UsuarioActual.TienePermisoProceso(320) Then + If UsuarioActual.TienePermisoProceso(320) OrElse UsuarioActual.CveRol = 1 Then LnkRepDiario.Visible = True End If @@ -242,9 +242,11 @@ Partial Class Ventas_RepPS Dim TC As Integer = 1 Dim TCEspecifico As Decimal = -1 + Dim FechaConsulta As DateTime = Now + Dim DataSet As DataSet = New DataSet Dim ObjVentas As New ClsVentas() - If ObjVentas.GetRepPSDiario(-1, -1, Now, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=-1, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico) Then + If ObjVentas.GetRepPSDiario(-1, -1, FechaConsulta, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=-1, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico) Then DataSet = ObjVentas.DataSetResultados.Copy() End If ObjVentas.Dispose() @@ -254,7 +256,7 @@ Partial Class Ventas_RepPS Dim FileExcel As New ExcelFile() - Dim worksheetName As String = $"{ToShortMonthName(Now).ToUpper()}{Now.Day}" + Dim worksheetName As String = $"{ToShortMonthName(FechaConsulta).ToUpper()}{FechaConsulta.Day}" Const invalidCharsRegex As String = "[/\\*'?[\]:]+" Const maxLength As Integer = 31 Dim safeName As String = Regex.Replace(worksheetName, invalidCharsRegex, " ").Replace(" ", " ").Trim() @@ -269,7 +271,7 @@ Partial Class Ventas_RepPS Dim CellRangeTitulo = worksheet.Cells.GetSubrangeAbsolute(0, 0, 0, 12) CellRangeTitulo.Merged = True - CellRangeTitulo.Value = $"{UsuarioActual.Empresa.Empresa}. VENTA DEL DIA {Now.Day} DE {ToMonthName(Now).ToUpper()} DEL {Now.Year}." + CellRangeTitulo.Value = $"{UsuarioActual.Empresa.Empresa}. VENTA DEL DIA {FechaConsulta.Day} DE {ToMonthName(FechaConsulta).ToUpper()} DEL {FechaConsulta.Year}." CellRangeTitulo.Style.VerticalAlignment = VerticalAlignmentStyle.Center CellRangeTitulo.Style.HorizontalAlignment = HorizontalAlignmentStyle.Center @@ -552,8 +554,8 @@ Partial Class Ventas_RepPS Dim IdxRefAnioAnteriorLlantas As Integer = IdxPorcentajes + 3 worksheet.Cells(IdxRefAnioAnteriorLlantas, 0).Value = "Sucursal" - worksheet.Cells(IdxRefAnioAnteriorLlantas, 1).Value = (Now.Year - 1).ToString() - worksheet.Cells(IdxRefAnioAnteriorLlantas, 2).Value = Now.Year.ToString() + worksheet.Cells(IdxRefAnioAnteriorLlantas, 1).Value = (FechaConsulta.Year - 1).ToString() + worksheet.Cells(IdxRefAnioAnteriorLlantas, 2).Value = FechaConsulta.Year.ToString() worksheet.Cells(IdxRefAnioAnteriorLlantas, 3).Value = "Dif" Dim StyleTitleTable4 = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioAnteriorLlantas, 0, IdxRefAnioAnteriorLlantas, 3).Style @@ -614,13 +616,117 @@ Partial Class Ventas_RepPS DtAnioAnteriorLLantas.Dispose() #End Region +#Region "L L A N T A S M E S A Ñ O A N T E R I O R" + Dim IdxRefMesAnioAnteriorLlantas As Integer = IdxAnioAnteriorLlantas + 3 + + worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 1, IdxRefMesAnioAnteriorLlantas - 1, 3).Merged = True + worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 4, IdxRefMesAnioAnteriorLlantas - 1, 6).Merged = True + worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 1).Value = "LLANTAS" + worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 4).Value = "%" + + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 0).Value = "Sucursal" + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 1).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year - 1)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 2).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 3).Value = "DIF %" + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 4).Value = String.Format("{0} - %", (FechaConsulta.Year - 1)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 5).Value = String.Format("{0} - %", (FechaConsulta.Year)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 6).Value = "DIF %" + + Dim StyleTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 0, IdxRefMesAnioAnteriorLlantas - 1, 6).Style + StyleTitleTable5.Font.Weight = ExcelFont.BoldWeight + StyleTitleTable5.Font.Name = "Calibri" + StyleTitleTable5.Font.Size = 8 * 20 + StyleTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center + StyleTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center + + Dim StyleSubTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas, 0, IdxRefMesAnioAnteriorLlantas, 6).Style + StyleSubTitleTable5.Font.Weight = ExcelFont.BoldWeight + StyleSubTitleTable5.Font.Name = "Calibri" + StyleSubTitleTable5.Font.Size = 8 * 20 + StyleSubTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleSubTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center + StyleSubTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center + + Dim DtMesAnioAnteriorLLantas As DataTable = DataSet.Tables(4) + 'INICIA DESDE LA CUARTA FILA + Dim IdxMesAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas + 1 + + For Each Row As DataRow In DtMesAnioAnteriorLLantas.Rows + worksheet.Cells(IdxMesAnioAnteriorLlantas, 0).Value = Row("Sucursal") + worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior") + worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Value = Row("LLantas") + worksheet.Cells(IdxMesAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name})" + worksheet.Cells(IdxMesAnioAnteriorLlantas, 4).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1.07) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12" + worksheet.Cells(IdxMesAnioAnteriorLlantas, 5).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12" + worksheet.Cells(IdxMesAnioAnteriorLlantas, 6).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name}) - 1" + + Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantas, 0, IdxMesAnioAnteriorLlantas, 6).Style + StyleData.Font.Weight = ExcelFont.NormalWeight + StyleData.Font.Name = "Calibri" + StyleData.Font.Size = 8 * 20 + StyleData.VerticalAlignment = VerticalAlignmentStyle.Center + StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center + StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" + + IdxMesAnioAnteriorLlantas += 1 + Next + + DtMesAnioAnteriorLLantas.Dispose() +#End Region + +#Region "L L A N T A S M E S A Ñ O A N T E R I O R" + Dim IdxRefMesAnioAnteriorLlantasResumen As Integer = IdxMesAnioAnteriorLlantas + 2 + + worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 0).Value = "Mes" + worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 1).Value = String.Format("{0}", (FechaConsulta.Year - 1)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS" + worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 4).Value = "DIF %" + + Dim StyleTitleTable6 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantasResumen, 0, IdxRefMesAnioAnteriorLlantasResumen, 4).Style + StyleTitleTable6.Font.Weight = ExcelFont.BoldWeight + StyleTitleTable6.Font.Name = "Calibri" + StyleTitleTable6.Font.Size = 8 * 20 + StyleTitleTable6.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleTitleTable6.VerticalAlignment = VerticalAlignmentStyle.Center + StyleTitleTable6.HorizontalAlignment = HorizontalAlignmentStyle.Center + + + Dim DtMesAnioAnteriorLLantasResumen As DataTable = DataSet.Tables(5) + 'INICIA DESDE LA CUARTA FILA + Dim IdxMesAnioAnteriorLlantasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen + 1 + + For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper() + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = Row("LLantasAnioAnterior") + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantas") + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})" + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})" + + Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style + StyleData.Font.Weight = ExcelFont.NormalWeight + StyleData.Font.Name = "Calibri" + StyleData.Font.Size = 8 * 20 + StyleData.VerticalAlignment = VerticalAlignmentStyle.Center + StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center + StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" + + IdxMesAnioAnteriorLlantasResumen += 1 + Next + + DtMesAnioAnteriorLLantasResumen.Dispose() +#End Region + Dim columnCount = worksheet.CalculateMaxUsedColumns() For i = 0 To columnCount worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1)) Next - FileExcel.Save(Response, $"DIARIO_{Now.ToString("dd_MM_yyyy")}.xlsx", SaveOptions.XlsxDefault) + FileExcel.Save(Response, $"DIARIO_{FechaConsulta.ToString("dd_MM_yyyy")}.xlsx", SaveOptions.XlsxDefault) End If 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 @@ - +