From 135a75291ea42b72073cf9c3073762186ca3914d Mon Sep 17 00:00:00 2001 From: MLopez Date: Wed, 11 Jan 2023 18:05:51 -0700 Subject: [PATCH 01/24] =?UTF-8?q?Refactorizaci=C3=B3n=20de=20c=C3=B3digo:?= =?UTF-8?q?=20Mover=20m=C3=A1s=20GlobalDTs=20a=20ClsPaginas.vb=20y=20que?= =?UTF-8?q?=20se=20carguen=20solo=20cuando=20se=20ocupen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsGenerales.vb | 2 +- App_Code/ClsPaginas.vb | 458 ++++++++++++++++++++++++++++----------- Global.asax | 65 +++--- 3 files changed, 361 insertions(+), 164 deletions(-) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 92975bdfe..6af4ed287 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -1248,7 +1248,7 @@ Public Class ClsGenerales #End Region #Region "C O L E C T I V A S" - Public Function GetColectivas(CveColectiva As Integer, Colectiva As String, Codigo As String, Tipo As String, CveEmpresa As Integer) As Boolean + Public Function GetColectivas(Optional CveColectiva As Integer = -1, Optional Colectiva As String = "-1", Optional Codigo As String = "-1", Optional Tipo As String = "-1", Optional CveEmpresa As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_ColectivasGet") diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index efe2c4f5d..f9c98df2d 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -375,61 +375,96 @@ Public Class ClsPaginas Property GlobalDTFraccionArancelaria() As DataTable Get - GlobalDTFraccionArancelaria = DirectCast(Application("GlobalDTFraccionArancelaria"), EnumerableRowCollection(Of DataRow)).CopyToDataTable + Dim AppNombre As String = "GlobalDTFraccionArancelaria" + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATFraccionArancelaria() Then Application(AppNombre) = ObjGrales.DtResultados.AsEnumerable() + ObjGrales.Dispose() + End If + GlobalDTFraccionArancelaria = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable End Get Set(value As DataTable) - Application("GlobalDTFraccionArancelaria") = value + Dim AppNombre As String = "GlobalDTFraccionArancelaria" + Application(AppNombre) = value End Set End Property Property GlobalDTIncoterm() As DataTable Get - GlobalDTIncoterm = DirectCast(Application("GlobalDTIncoterm"), DataTable) + Dim AppNombre As String = "GlobalDTIncoterm" + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATIncoterm() Then Application(AppNombre) = ObjGrales.DtResultados + ObjGrales.Dispose() + End If + GlobalDTIncoterm = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTIncoterm") = value + Dim AppNombre As String = "GlobalDTIncoterm" + Application(AppNombre) = value End Set End Property Property GlobalDTTipoOperacion() As DataTable Get - GlobalDTTipoOperacion = DirectCast(Application("GlobalDTTipoOperacion"), DataTable) + Dim AppNombre As String = "GlobalDTTipoOperacion" + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATTipoOperacion() Then Application(AppNombre) = ObjGrales.DtResultados + ObjGrales.Dispose() + End If + GlobalDTTipoOperacion = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTTipoOperacion") = value + Dim AppNombre As String = "GlobalDTTipoOperacion" + Application(AppNombre) = value End Set End Property Property GlobalDTSATMotivoTraslado() As DataTable Get - GlobalDTSATMotivoTraslado = DirectCast(Application("GlobalDTSATMotivoTraslado"), DataTable) + Dim AppNombre As String = "GlobalDTSATMotivoTraslado" + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATMotivoTraslado() Then Application(AppNombre) = ObjGrales.DtResultados + ObjGrales.Dispose() + End If + GlobalDTSATMotivoTraslado = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTSATMotivoTraslado") = value + Dim AppNombre As String = "GlobalDTSATMotivoTraslado" + Application(AppNombre) = value End Set End Property Property GlobalDTUnidadAduana() As DataTable Get - GlobalDTUnidadAduana = DirectCast(Application("GlobalDTUnidadAduana"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTUnidadAduana") = value - End Set - End Property - - - Property GlobalDTGralPaises() As DataTable - Get - If Application("GlobalDTGralPaises") Is Nothing Then + Dim AppNombre As String = "GlobalDTUnidadAduana" + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATPais() Then Application("GlobalDTGralPaises") = ObjGrales.DtResultados Else Application("GlobalDTGralPaises") = Nothing + If ObjGrales.GetSATUnidadesAduana() Then Application(AppNombre) = ObjGrales.DtResultados ObjGrales.Dispose() End If - GlobalDTGralPaises = DirectCast(Application("GlobalDTGralPaises"), DataTable) + GlobalDTUnidadAduana = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTGralPaises") = value + Dim AppNombre As String = "GlobalDTUnidadAduana" + Application(AppNombre) = value + End Set + End Property + Property GlobalDTGralPaises() As DataTable + Get + Dim AppNombre As String = "GlobalDTGralPaises" + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATPais() Then Application(AppNombre) = ObjGrales.DtResultados + ObjGrales.Dispose() + End If + GlobalDTGralPaises = DirectCast(Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = "GlobalDTGralPaises" + Application(AppNombre) = value End Set End Property Property GlobalDTGralEstados(ClaveSATPais As String, Optional CvePais As Integer = -1) As DataTable @@ -437,7 +472,7 @@ Public Class ClsPaginas Dim AppNombre As String = "GlobalDTGralEstados" If Application(AppNombre) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATEstado("-1") Then Application(AppNombre) = ObjGrales.DtResultados Else Application(AppNombre) = Nothing + If ObjGrales.GetSATEstado("-1") Then Application(AppNombre) = ObjGrales.DtResultados ObjGrales.Dispose() End If @@ -463,7 +498,7 @@ Public Class ClsPaginas Dim AppNombre As String = "GlobalDTGralMunicipios" If Application(AppNombre) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATMunicipio("-1") Then Application(AppNombre) = ObjGrales.DtResultados Else Application(AppNombre) = Nothing + If ObjGrales.GetSATMunicipio("-1") Then Application(AppNombre) = ObjGrales.DtResultados ObjGrales.Dispose() End If @@ -490,7 +525,7 @@ Public Class ClsPaginas If Application("GlobalDTLocalidad") Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATLocalidad(-1, -1) Then Application("GlobalDTLocalidad") = ObjGrales.DtResultados Else Application("GlobalDTLocalidad") = Nothing + If ObjGrales.GetSATLocalidad(-1, -1) Then Application("GlobalDTLocalidad") = ObjGrales.DtResultados ObjGrales.Dispose() End If @@ -523,14 +558,13 @@ Public Class ClsPaginas End Property - Property GlobalDTGralColonias(ClaveSATEstado As String, ClaveSATMunicipio As String, ClaveSATColonia As String, Optional CveMunicipio As Integer = -1, Optional CodigoPostal As Integer = -1, Optional CveColonia As Integer = -1) As DataTable Get Dim AppNombre As String = "GlobalDTGralColonias" If Application(AppNombre) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATColonia("-1", "-1", "-1") Then Application(AppNombre) = ObjGrales.DtResultados Else Application(AppNombre) = Nothing + If ObjGrales.GetSATColonia("-1", "-1", "-1") Then Application(AppNombre) = ObjGrales.DtResultados ObjGrales.Dispose() End If @@ -561,7 +595,7 @@ Public Class ClsPaginas Get If Application("GlobalDTPSATUM") Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATUnidadMedida Then Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATUM") = Nothing + If ObjGrales.GetSATUnidadMedida Then Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() ObjGrales.Dispose() End If @@ -1007,18 +1041,36 @@ Public Class ClsPaginas End Property Property GlobalDTFamilias(Optional CveEmpresa As Integer = -1) As DataTable Get - If CveEmpresa <> -1 Then - - Dim Dv As New DataView(DirectCast(Application("GlobalDTFamilias"), DataTable), String.Format("CveEmpresa = {0} ", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTFamilias = Dv.ToTable - Dv.Dispose() - Else - GlobalDTFamilias = DirectCast(Application("GlobalDTFamilias"), DataTable) + Dim AppNombre As String = $"GlobalDTFamilias-{CveEmpresa}" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGenerales As New ClsGenerales + If ObjGenerales.GetCategorias(CveEmpresa, 2) Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() End If + GlobalDTFamilias = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTFamilias") = value + Dim AppNombre As String = $"GlobalDTFamilias-{CveEmpresa}" + Application(AppNombre) = value + End Set + End Property + Property GlobalDTCategoriasPresupuestos(Optional CveEmpresa As Integer = -1) As DataTable + Get + Dim AppNombre As String = $"GlobalDTCategoriasPresupuestos-{CveEmpresa}" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGenerales As New ClsGenerales + If ObjGenerales.GetCategorias(CveEmpresa, 3) Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() + End If + + GlobalDTCategoriasPresupuestos = DirectCast(Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTCategoriasPresupuestos-{CveEmpresa}" + Application(AppNombre) = value End Set End Property @@ -1109,6 +1161,14 @@ Public Class ClsPaginas 'End Property Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1, Optional RegimenFiscalReceptor As String = "-1") As DataTable Get + Dim AppNombre As String = "GlobalDTSATUsosCFDI" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATUsosCFDI() Then Application(AppNombre) = ObjGrales.DtResultados + ObjGrales.Dispose() + End If + If EsPersonaFisica <> -1 Then Dim Tipo As New StringBuilder If EsPersonaFisica = 1 Then Tipo.Append("AplicaPersonaFisica = 1") Else Tipo.Append("AplicaPersonaMoral = 1") @@ -1117,16 +1177,17 @@ Public Class ClsPaginas Tipo.AppendFormat("AND RegimenFiscalReceptor LIKE '%{0}%'", RegimenFiscalReceptor) End If - Dim Dv As New DataView(DirectCast(Application("GlobalDTSATUsosCFDI"), DataTable), Tipo.ToString(), " UsoCFDIDescripcion", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Tipo.ToString(), " UsoCFDIDescripcion", DataViewRowState.CurrentRows) GlobalDTSATUsosCFDI = Dv.ToTable Dv.Dispose() Else - GlobalDTSATUsosCFDI = DirectCast(Application("GlobalDTSATUsosCFDI"), DataTable) + GlobalDTSATUsosCFDI = DirectCast(Application(AppNombre), DataTable) End If End Get - Set(ByVal value As DataTable) - Application("GlobalDTSATUsosCFDI") = value + Set(value As DataTable) + Dim AppNombre As String = "GlobalDTSATUsosCFDI" + Application(AppNombre) = value End Set End Property Public Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable @@ -2616,11 +2677,11 @@ Public Class ClsPaginas #Region "***********************************************************************DT GENERALES**************************************************************************************" Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable Get - Dim AppNombre As String = String.Format("GlobalDTGralCategorias-{0}", CveEmpresa) + Dim AppNombre As String = $"GlobalDTGralCategorias-{CveEmpresa}" 'sino existe, recarga los datos If DirectCast(Application(AppNombre), DataTable) Is Nothing Then Dim ObjGenerales As New ClsGenerales - If ObjGenerales.GetCategorias(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados Else Application(AppNombre) = Nothing + If ObjGenerales.GetCategorias(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados ObjGenerales.Dispose() End If @@ -2634,54 +2695,69 @@ Public Class ClsPaginas Dv.Dispose() End Get Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTGralCategorias-{0}", CveEmpresa) + Dim AppNombre As String = $"GlobalDTGralCategorias-{CveEmpresa}" Application(AppNombre) = value End Set - End Property Property GlobalDTGralCategorias2(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTCategorias2"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTGralCategorias2 = Dv.ToTable - Dv.Dispose() - Else - GlobalDTGralCategorias2 = DirectCast(Application("GlobalDTCategorias2"), DataTable) + Dim AppNombre As String = $"GlobalDTGralCategorias2-{CveEmpresa}" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGenerales As New ClsGenerales + If ObjGenerales.GetCategorias(CveEmpresa, 4) Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() End If + + Dim filtro As New StringBuilder + 'If CveMarca > 0 Then + ' filtro.AppendFormat(" CveMarca={0} ", CveMarca) + 'End If + + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTGralCategorias2 = Dv.ToTable + Dv.Dispose() End Get Set(value As DataTable) - Application("GlobalDTCategorias2") = value + Dim AppNombre As String = $"GlobalDTGralCategorias2-{CveEmpresa}" + Application(AppNombre) = value End Set End Property - Property GlobalDTGralEscolaridades() As DataTable Get - GlobalDTGralEscolaridades = DirectCast(Application("GlobalDTGralEscolaridades"), DataTable) + Dim AppNombre As String = "GlobalDTGralEscolaridades" + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGenerales As New ClsGenerales + If ObjGenerales.GetEscolaridades() Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() + End If + GlobalDTGralEscolaridades = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTGralEscolaridades") = value + Dim AppNombre As String = "GlobalDTGralEscolaridades" + Application(AppNombre) = value End Set End Property Property GlobalDTGralColectivas(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTGralColectivas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTGralColectivas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTGralColectivas = DirectCast(Application("GlobalDTGralColectivas"), DataTable) + Dim AppNombre As String = $"GlobalDTGralColectivas-{CveEmpresa}" + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGenerales As New ClsGenerales + If ObjGenerales.GetColectivas(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() End If + GlobalDTGralColectivas = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTGralColectivas") = value + Dim AppNombre As String = $"GlobalDTGralColectivas-{CveEmpresa}" + Application(AppNombre) = value End Set End Property Property GlobalDTGralMarcas(CveEmpresa As Integer, Optional CveMarca As Integer = -1) As DataTable Get - Dim AppNombre As String = String.Format("GlobalDTGralMarcas-{0}", CveEmpresa) + Dim AppNombre As String = $"GlobalDTGralMarcas-{CveEmpresa}" 'sino existe, recarga los datos If DirectCast(Application(AppNombre), DataTable) Is Nothing Then Dim ObjMarcas As New ClsProductosServicios @@ -2701,7 +2777,7 @@ Public Class ClsPaginas End Get Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTGralMarcas-{0}", CveEmpresa) + Dim AppNombre As String = $"GlobalDTGralMarcas-{CveEmpresa}" Application(AppNombre) = value End Set End Property @@ -3496,33 +3572,58 @@ Public Class ClsPaginas #Region "**********************************************************************GLOBAL DT RH (RECURSOS HUMANOS)********************************************************************" Property GlobalDTAsistenciaDetalle() As DataTable Get - GlobalDTAsistenciaDetalle = DirectCast(Application("GlobalDTAsistenciaDetalle"), DataTable) + Dim AppNombre As String = "GlobalDTAsistenciaDetalle" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetAsistenciasDetalle() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTAsistenciaDetalle = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAsistenciaDetalle") = value + Dim AppNombre As String = "GlobalDTAsistenciaDetalle" + Application(AppNombre) = value End Set End Property Property GlobalDTAsistenciasInasistencias() As DataTable Get - GlobalDTAsistenciasInasistencias = DirectCast(Application("GlobalDTAsistenciasInasistencias"), DataTable) + Dim AppNombre As String = "GlobalDTAsistenciasInasistencias" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetAsistenciasInasistencias() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTAsistenciasInasistencias = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAsistenciasInasistencias") = value + Dim AppNombre As String = "GlobalDTAsistenciasInasistencias" + Application(AppNombre) = value End Set End Property Property GlobalDTEstatusPersonal() As DataTable Get - GlobalDTEstatusPersonal = DirectCast(Application("GlobalDTEstatusPersonal"), DataTable) + Dim AppNombre As String = "GlobalDTEstatusPersonal" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetEstatusPersonal() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTEstatusPersonal = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTEstatusPersonal") = value + Dim AppNombre As String = "GlobalDTEstatusPersonal" + Application(AppNombre) = value End Set End Property - Property GlobalDTRHPersonal(CveEmpresa As Integer, Optional CvePersonal As Integer = -1) As DataTable - Get - Dim AppNombre As String = String.Format("GlobalDTRHPersonal-{0}", CveEmpresa) + Dim AppNombre As String = $"GlobalDTRHPersonal-{CveEmpresa}" 'sino existe, recarga los datos If DirectCast(Application(AppNombre), DataTable) Is Nothing Then Dim ObjPersonal As New ClsRH @@ -3530,145 +3631,239 @@ Public Class ClsPaginas ObjPersonal.Dispose() End If - If CveEmpresa <> -1 Or CvePersonal <> -1 Then - Dim Str As StringBuilder = New StringBuilder() - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CvePersonal <> -1 Then Str.AppendFormat(" {0} CvePersonal = {1}", If(Str.Length > 0, "AND", ""), CvePersonal) - - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTRHPersonal = Dv.ToTable - Dv.Dispose() - Else - GlobalDTRHPersonal = DirectCast(Application(AppNombre), DataTable) - End If - + GlobalDTRHPersonal = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTRHPersonal-{0}", CveEmpresa) + Dim AppNombre As String = $"GlobalDTRHPersonal-{CveEmpresa}" Application(AppNombre) = value End Set End Property - - Property GlobalDTDepartamentos() As DataTable Get - GlobalDTDepartamentos = DirectCast(Application("GlobalDTDepartamentos"), DataTable) + Dim AppNombre As String = "GlobalDTDepartamentos" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetDepartamentos() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTDepartamentos = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTDepartamentos") = value + Dim AppNombre As String = "GlobalDTDepartamentos" + Application(AppNombre) = value End Set End Property Property GlobalDTRHPuestos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTRHPuestos"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTRHPuestos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTRHPuestos = DirectCast(Application("GlobalDTRHPuestos"), DataTable) + Dim AppNombre As String = $"GlobalDTRHPuestos-{CveEmpresa}" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetPuestos(CveEmpresa) Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() End If + GlobalDTRHPuestos = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTRHPuestos") = value + Dim AppNombre As String = $"GlobalDTRHPuestos-{CveEmpresa}" + Application(AppNombre) = value End Set End Property Property GlobalDTEscolaridad() As DataTable Get - GlobalDTEscolaridad = DirectCast(Application("GlobalDTEscolaridad"), DataTable) + Dim AppNombre As String = "GlobalDTEscolaridad" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetEscolaridades() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTEscolaridad = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTEscolaridad") = value + Dim AppNombre As String = "GlobalDTEscolaridad" + Application(AppNombre) = value End Set End Property Property GlobalDTEstadoCivil() As DataTable Get - GlobalDTEstadoCivil = DirectCast(Application("GlobalDTEstadoCivil"), DataTable) + Dim AppNombre As String = "GlobalDTEstadoCivil" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetEstadoCivil() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTEstadoCivil = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTEstadoCivil") = value + Dim AppNombre As String = "GlobalDTEstadoCivil" + Application(AppNombre) = value End Set End Property Property GlobalDTDocumentos() As DataTable Get - GlobalDTDocumentos = DirectCast(Application("GlobalDTDocumentos"), DataTable) + Dim AppNombre As String = "GlobalDTDocumentos" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetDocumentos() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTDocumentos = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTDocumentos") = value + Dim AppNombre As String = "GlobalDTDocumentos" + Application(AppNombre) = value End Set End Property Property GlobalDTGenero() As DataTable Get - GlobalDTGenero = DirectCast(Application("GlobalDTGenero"), DataTable) + Dim AppNombre As String = "GlobalDTGenero" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetGeneros() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTGenero = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTGenero") = value + Dim AppNombre As String = "GlobalDTGenero" + Application(AppNombre) = value End Set End Property Property GlobalDTMotivoBaja() As DataTable Get - GlobalDTMotivoBaja = DirectCast(Application("GlobalDTMotivoBaja"), DataTable) + Dim AppNombre As String = "GlobalDTMotivoBaja" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetMotivoBaja() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTMotivoBaja = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTMotivoBaja") = value + Dim AppNombre As String = "GlobalDTMotivoBaja" + Application(AppNombre) = value End Set End Property Property GlobalDTTiposContrato() As DataTable Get - GlobalDTTiposContrato = DirectCast(Application("GlobalDTTiposContrato"), DataTable) + Dim AppNombre As String = "GlobalDTTiposContrato" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetTiposContrato() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTTiposContrato = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTTiposContrato") = value + Dim AppNombre As String = "GlobalDTTiposContrato" + Application(AppNombre) = value End Set End Property Property GlobalDTRutas() As DataTable Get - GlobalDTRutas = DirectCast(Application("GlobalDTRutas"), DataTable) + Dim AppNombre As String = "GlobalDTRutas" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetRutas() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTRutas = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTRutas") = value + Dim AppNombre As String = "GlobalDTRutas" + Application(AppNombre) = value End Set End Property Property GlobalDTTurno() As DataTable Get - GlobalDTTurno = DirectCast(Application("GlobalDTTurno"), DataTable) + Dim AppNombre As String = "GlobalDTTurno" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetTurnos() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTTurno = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTTurno") = value + Dim AppNombre As String = "GlobalDTTurno" + Application(AppNombre) = value End Set End Property Property GlobalDTJornadas() As DataTable Get - GlobalDTJornadas = DirectCast(Application("GlobalDTJornadas"), DataTable) + Dim AppNombre As String = "GlobalDTJornadas" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetJornadas() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTJornadas = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTJornadas") = value + Dim AppNombre As String = "GlobalDTJornadas" + Application(AppNombre) = value End Set End Property Property GlobalDTMotivosHorasExtras() As DataTable Get - GlobalDTMotivosHorasExtras = DirectCast(Application("GlobalDTMotivosHorasExtras"), DataTable) + Dim AppNombre As String = "GlobalDTMotivosHorasExtras" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetMotivoHorasExtras() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTMotivosHorasExtras = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTMotivosHorasExtras") = value + Dim AppNombre As String = "GlobalDTMotivosHorasExtras" + Application(AppNombre) = value End Set End Property Property GlobalDTTipoBuzon() As DataTable Get - GlobalDTTipoBuzon = DirectCast(Application("GlobalDTTipoBuzon"), DataTable) + Dim AppNombre As String = "GlobalDTTipoBuzon" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetTipoBuzon() Then Application(AppNombre) = ObjPersonal.DtResultados + ObjPersonal.Dispose() + End If + + GlobalDTTipoBuzon = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTTipoBuzon") = value + Dim AppNombre As String = "GlobalDTTipoBuzon" + Application(AppNombre) = value End Set End Property #End Region #Region "*********** D T - C O M B U S T I B L E S ***********" - - Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -3884,19 +4079,20 @@ Public Class ClsPaginas End Set End Property Property GlobalDTPaqueteriaGuiaTipos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTPaqueteriaGuiaTipos"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTPaqueteriaGuiaTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTPaqueteriaGuiaTipos = DirectCast(Application("GlobalDTPaqueteriaGuiaTipos"), DataTable) + Dim AppNombre As String = $"GlobalDTPaqueteriaGuiaTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGenerales As New ClsGenerales + If ObjGenerales.GetGralPaqueteriasGuiasTipo(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() End If + + GlobalDTPaqueteriaGuiaTipos = DirectCast(Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTPaqueteriaGuiaTipos") = value + Dim AppNombre As String = $"GlobalDTPaqueteriaGuiaTipos-{CveEmpresa}" + Application(AppNombre) = value End Set End Property Public Shared Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1, diff --git a/Global.asax b/Global.asax index 10ae25b9a..e8091ab91 100644 --- a/Global.asax +++ b/Global.asax @@ -9,36 +9,37 @@ diff --git a/OS/RepServicioDomicilio.aspx.vb b/OS/RepServicioDomicilio.aspx.vb index 825438e5c..2b5459bb0 100644 --- a/OS/RepServicioDomicilio.aspx.vb +++ b/OS/RepServicioDomicilio.aspx.vb @@ -9,6 +9,7 @@ Imports Telerik.Web.UI Imports APP_Code_CSharp Imports AjaxControlToolkit.AsyncFileUpload.Constants Imports System +Imports System.Globalization Partial Class OS_RepServicioDomicilio Inherits ClsPaginas @@ -740,7 +741,7 @@ Partial Class OS_RepServicioDomicilio DdlTecnicoAsignar.SelectedValueExist(ObjOS.CveUsuarioAtendio) CveTecnicoAsignarOrioginal = ObjOS.CveUsuarioAtendio FechaInicioOriginal = ObjOS.FechaInicio - TxtModalFechaOS.Text = ObjOS.FechaInicio.ToString.ToDate.ToString("dd/MM/yyyy hh:mm") + TxtModalFechaOS.Text = ObjOS.FechaInicio.ToString.ToDate.ToString("dd/MM/yyyy HH:mm") DvModalSubProyecto.Visible = True 'TSTimeSelector.Hour = If(ObjOS.FechaInicio.Hour > 12, ObjOS.FechaInicio.Hour - 12, ObjOS.FechaInicio.Hour) 'TSTimeSelector.Minute = ObjOS.FechaInicio.Minute @@ -971,11 +972,11 @@ Partial Class OS_RepServicioDomicilio Dim CorreoAsignado As String = GlobalDTUsuarios(DdlTecnicoAsignar.SelectedValue.ToEntero).Rows(0)("Correo").ToString If Not TieneError And CorreoAsignado.Trim.Length > 0 AndAlso DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then CorreoAsignado = GlobalDTUsuarios(DdlTecnicoAsignar.SelectedValue.ToEntero).Rows(0)("Correo").ToString - MandaCorreOS(CveOSAsignar, CorreoAsignado) + MandaCorreOS(CveOS, CorreoAsignado) End If If Not TieneError And TxtEmail.Text.Trim.Length > 0 AndAlso DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then - MandaCorreOS(CveOSAsignar, TxtEmail.Text, True) + MandaCorreOS(CveOS, TxtEmail.Text, True) End If If Not TieneError Then @@ -1092,7 +1093,7 @@ Partial Class OS_RepServicioDomicilio params.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)) params.Add(New ReportParameter("Condiciones", dr("Condiciones").ToString)) - params.Add(New ReportParameter("FechaAtencion", If(dr("FechaInicio").ToString.Length > 0, dr("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy"), ""))) + params.Add(New ReportParameter("FechaAtencion", If(dr("FechaInicio").ToString.Length > 0, dr("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy hh:mm tt"), ""))) params.Add(New ReportParameter("TecnicoAsignado", dr("UsuarioAtendio").ToString)) @@ -1126,7 +1127,7 @@ Partial Class OS_RepServicioDomicilio Dim lrds As New List(Of ReportDataSource) Dim rds As New ReportDataSource With {.Name = "DataSet2", .Value = TmpDTMaterialesOS} - Dim rds2 As New ReportDataSource With {.Name = "DataSet1", .Value = TmpDTOS} + Dim rds2 As New ReportDataSource With {.Name = "DataSet1", .Value = TmpDTMaterialesOS} lrds.Add(rds) lrds.Add(rds2) @@ -1247,4 +1248,154 @@ Partial Class OS_RepServicioDomicilio End Sub + + + Protected Sub LnkHorariosNoOperativos_Click(sender As Object, e As EventArgs) + RegistraScript("$('#DVModalOSHorarioNoOperativo').modal('show');") + + DdlTecnicoAsignarHorario.Items.Clear() + + DdlTecnicoAsignarHorario.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True'") + DdlTecnicoAsignarHorario.DataBind() + DdlTecnicoAsignarHorario.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + DdlTecnicoAsignarHorario.SelectedValueExist("-1") + + TxtHorarioInicio.SetTime(0, 0, 0, MKB.TimePicker.TimeSelector.AmPmSpec.AM) + TxtHorarioFin.SetTime(0, 0, 1, MKB.TimePicker.TimeSelector.AmPmSpec.AM) + + UpModalHorariosNoOperativos.Update() + + End Sub + + + Protected Sub DdlTecnicoAsignarHorario_SelectedIndexChanged(sender As Object, e As EventArgs) + + + TxtHorarioInicio.SetTime(0, 0, 0, MKB.TimePicker.TimeSelector.AmPmSpec.AM) + TxtHorarioFin.SetTime(0, 0, 1, MKB.TimePicker.TimeSelector.AmPmSpec.AM) + + + If DdlTecnicoAsignarHorario.SelectedValue.ToEntero > 0 Then + Dim objOS As New ClsOS + Dim DTHorarios As New DataTable + + If objOS.GetOrdenesServiciosTecnicoHorarioNoOperativo(DdlTecnicoAsignarHorario.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + DTHorarios = objOS.DtResultados + End If + + objOS.Dispose() + + + + + If DTHorarios IsNot Nothing AndAlso DTHorarios.Rows.Count > 0 Then + + Dim HoraInicio As String = DTHorarios.Rows(0)("HoraInicio").ToString + Dim HoraFin As String = DTHorarios.Rows(0)("HoraFin").ToString + + TxtHorarioInicio.SetTime(HoraInicio.ToDateTime.Hour, HoraInicio.ToDateTime.Minute, HoraInicio.ToDateTime.Second, If(HoraInicio.ToDateTime.ToString("tt", CultureInfo.InvariantCulture) = "PM", MKB.TimePicker.TimeSelector.AmPmSpec.PM, MKB.TimePicker.TimeSelector.AmPmSpec.AM)) + TxtHorarioFin.SetTime(HoraFin.ToDateTime.Hour, HoraFin.ToDateTime.Minute, HoraFin.ToDateTime.Second, If(HoraFin.ToDateTime.ToString("tt", CultureInfo.InvariantCulture) = "PM", MKB.TimePicker.TimeSelector.AmPmSpec.PM, MKB.TimePicker.TimeSelector.AmPmSpec.AM)) + + + End If + + + End If + + UpModalHorariosNoOperativos.Update() + + End Sub + + + Protected Sub LnkGuardarHorarioNoOpeartivo_Click(sender As Object, e As EventArgs) + + If DdlTecnicoAsignarHorario.SelectedValue.ToEntero > 0 Then + Dim HoraInicio = $"{TxtHorarioInicio.Hour}:{TxtHorarioInicio.Minute}:{TxtHorarioInicio.Second} {TxtHorarioInicio.AmPm}".ToDateTime + Dim HoraFin = $"{TxtHorarioFin.Hour}:{TxtHorarioFin.Minute}:{TxtHorarioFin.Second} {TxtHorarioFin.AmPm}".ToDateTime + + + If HoraInicio > HoraFin Then + Alert("La hora final no debe ser mayor a la hora inicial", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If HoraFin = HoraInicio Then + Alert("la hora de inicio y la hora fin no pueden ser iguales", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim objOS As New ClsOS + + If objOS.AddOrdenesServiciosTecnicoHorarioNoOperativo(DdlTecnicoAsignarHorario.SelectedValue.ToEntero, HoraInicio, HoraFin, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + Alert("Horario no operativo guardado correntamente.") + RegistraScript("$('#DVModalOSHorarioNoOperativo').modal('hide');") + End If + + objOS.Dispose() + + + + + End If + + + + End Sub + + + + + Protected Sub DdlTecnicoAsignar_SelectedIndexChanged1(sender As Object, e As EventArgs) + ValidaHorarioNoOperativo() + End Sub + + + Protected Sub LnkValidaHorarioNoOperativo_Click(sender As Object, e As EventArgs) + ValidaHorarioNoOperativo() + End Sub + + Private Sub ValidaHorarioNoOperativo() + If DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then + + + 'If ViewState("Validando") Is Nothing Then + ' ViewState("Validando") = True + 'Else + ' Exit Sub + 'End If + + + Dim objOS As New ClsOS + Dim DTHorarios As New DataTable + + + + + If objOS.GetOrdenesServiciosTecnicoHorarioNoOperativo(DdlTecnicoAsignar.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + DTHorarios = objOS.DtResultados + End If + + objOS.Dispose() + + If DTHorarios IsNot Nothing AndAlso DTHorarios.Rows.Count > 0 Then + + Dim HoraInicio As TimeSpan = DTHorarios.Rows(0)("HoraInicio").ToString.ToDate.TimeOfDay + Dim HoraFin As TimeSpan = DTHorarios.Rows(0)("HoraFin").ToString.ToDate.TimeOfDay + Dim HoraAsignacion As TimeSpan = TxtModalFechaOS.Text.ToDate.TimeOfDay + + If HoraAsignacion >= HoraInicio And HoraAsignacion <= HoraFin Then + Alert($"La hora especificada esta dentro del horario no operativo del Técnico {HoraInicio.ToString()} a {HoraFin.ToString()} .", TipoMensaje.MsgAdvertencia) + End If + + + + End If + + + 'ViewState("Validando") = Nothing + + End If + End Sub + + End Class From 949fda338c701ca318da63cef600c674d66975e5 Mon Sep 17 00:00:00 2001 From: MLopez Date: Fri, 13 Jan 2023 09:24:30 -0700 Subject: [PATCH 19/24] =?UTF-8?q?E141=20Kardex=20Almacen=20Proceso=20349?= =?UTF-8?q?=20Bloqueo=20opci=C3=B3n=20"No"=20en=20tr=C3=A1nsito?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/KardexAlmacenHorizontal.aspx.vb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb index dc2f229a8..b01a8ac17 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx.vb +++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb @@ -30,6 +30,10 @@ Partial Class Inventarios_KardexAlmacen txtFechaI.Text = Now.ToShortDateString End If + If UsuarioActual.TienePermisoProceso(349) Then + DdlIncluyeTransitorios.Items.RemoveAt(0) 'oculta opción "No" en tránsito + End If + If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero) ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1") End If @@ -147,8 +151,9 @@ Partial Class Inventarios_KardexAlmacen Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1) Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM) Dim GPO As Integer = Ddlgrupo.SelectedValue.ToEntero + Dim IncluyeTransitorios As Integer = DdlIncluyeTransitorios.SelectedValue.ToEntero - If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), + If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), IncluyeTransitorios, DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes, GPO:=GPO) Then If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then From 0c1f0f56fbb26cee44a9e012a47771d85187a393 Mon Sep 17 00:00:00 2001 From: MLopez Date: Fri, 13 Jan 2023 14:31:24 -0700 Subject: [PATCH 20/24] E172 Cargar PS Empacados/TipoOrganicos desde GlobalDT --- App_Code/ClsPaginas.vb | 36 +++++++++++++++++++++++++++++-- Ventas/ProductosServicios.aspx.vb | 13 ++--------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 887b33ddb..7c3dfc1d2 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4313,6 +4313,40 @@ Public Class ClsPaginas End Set End Property +#Region "CITRUS GAME" + Property GlobalDTGralEmpacados(CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = $"GlobalDTGralEmpacados-{CveEmpresa}" + If Application(AppNombre) Is Nothing Then + Dim ObjGenerales As New ClsGenerales() + If ObjGenerales.GetEmpacados(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() + End If + + GlobalDTGralEmpacados = DirectCast(Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTGralEmpacados-{CveEmpresa}" + Application(AppNombre) = value + End Set + End Property + Property GlobalDTGralTipoOrganicos(CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = $"GlobalDTGralTipoOrganicos-{CveEmpresa}" + If Application(AppNombre) Is Nothing Then + Dim ObjGenerales As New ClsGenerales() + If ObjGenerales.GetTipoOrganicos(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() + End If + + GlobalDTGralTipoOrganicos = DirectCast(Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTGralTipoOrganicos-{CveEmpresa}" + Application(AppNombre) = value + End Set + End Property +#End Region #End Region @@ -4321,8 +4355,6 @@ Public Class ClsPaginas DirectorioSitio = 2 eFacturasCaptcha = 3 - - RutaEmpresasJM = 500 RutaEmpresasRM = 501 RutaEmpresasPC = 502 diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 3d24b25b9..dd685d23e 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -438,21 +438,12 @@ Partial Class ProductosyServicios End Sub Private Sub CargaPanelCitricos() - Dim ObjGral As New ClsGenerales() - If ObjGral.GetEmpacados(UsuarioActual.CveEmpresa) Then - DdlEmpacado.DataSource = ObjGral.DtResultados - End If - If ObjGral.GetTipoOrganicos(UsuarioActual.CveEmpresa) Then - DdlTipoOrganico.DataSource = ObjGral.DtResultados - End If - ObjGral.Dispose() - + DdlEmpacado.DataSource = GlobalDTGralEmpacados(UsuarioActual.CveEmpresa) + DdlTipoOrganico.DataSource = GlobalDTGralTipoOrganicos(UsuarioActual.CveEmpresa) DdlEmpacado.DataBind() DdlTipoOrganico.DataBind() - End Sub - Private Sub MuestraPanel(Optional AfterPageLoad As Boolean = False) If AfterPageLoad Then RegistraScript("window.onload = function MuestraPanel() { document.getElementById(""C_BtnMostrarPanel"").click(); }") From 19cdedbfd4b814319c5d8b48ff3516de3d570eb2 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Sat, 14 Jan 2023 09:17:38 -0700 Subject: [PATCH 21/24] Clientes busqueda cuenta, correcion descarga documentos cat documentos, ajustes servicio domicilio --- App_Code/ClsClientes.vb | 5 ++- Bancos/RepCxCCliente.aspx | 6 +-- Bancos/RepCxCCliente.aspx.vb | 12 +++--- Compras/Compras.aspx.vb | 60 ++++++++++++++++++++++----- Inventarios/EntradasSalidas.aspx.vb | 2 +- OS/RepServicioDomicilio.aspx | 18 +------- OS/RepServicioDomicilio.aspx.vb | 5 --- RH/CatDocumentos.aspx | 6 ++- RH/CatDocumentos.aspx.vb | 64 +++++++++++++++++++++-------- Ventas/PopUpBuscarClientes.aspx | 13 ++++++ Ventas/PopUpBuscarClientes.aspx.vb | 9 +++- 11 files changed, 137 insertions(+), 63 deletions(-) diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index f71c30878..e7a7280d6 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -264,7 +264,8 @@ 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, Optional CveUsuarioConsulta As Integer = -1) 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, + Optional Cuenta As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClientesGet") @@ -287,6 +288,8 @@ Public Class ClsClientes .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta .Add("@PermiteCredito", SqlDbType.Int).Value = PermiteCreditoFiltro .Add("@TopSelect", SqlDbType.Int).Value = TopSelect + .Add("@Cuenta", SqlDbType.VarChar).Value = Cuenta + End With Try SqlAdapter.Fill(Data) diff --git a/Bancos/RepCxCCliente.aspx b/Bancos/RepCxCCliente.aspx index 283a6e5ba..4c4067ef2 100644 --- a/Bancos/RepCxCCliente.aspx +++ b/Bancos/RepCxCCliente.aspx @@ -59,7 +59,7 @@ -
+
@@ -124,10 +124,10 @@
  • Cuenta:     - +
  • Moneda: - +
  • diff --git a/Bancos/RepCxCCliente.aspx.vb b/Bancos/RepCxCCliente.aspx.vb index ffa1a3378..960811766 100644 --- a/Bancos/RepCxCCliente.aspx.vb +++ b/Bancos/RepCxCCliente.aspx.vb @@ -69,13 +69,13 @@ Partial Class Bancos_RepCxCCliente Mov.Dispose() GvCxC.DataBind() - If (GvCxC.Rows.Count > 0) Then - GvCxC.UseAccessibleHeader = True - GvCxC.HeaderRow.TableSection = TableRowSection.TableHeader - RegistraScript("OrdenarGV();") + 'If (GvCxC.Rows.Count > 0) Then + GvCxC.UseAccessibleHeader = True + GvCxC.HeaderRow.TableSection = TableRowSection.TableHeader + RegistraScript("OrdenarGV();") + UPDatos.Update() - UPDatos.Update() - End If + 'End If End Sub Protected Sub GvCxC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCxC.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 405c5dcb1..479eefe24 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1084,6 +1084,7 @@ Partial Class Compras_Compras #End Region + Dim DTConceptos As DataTable Private Property EmpresasOC As List(Of Integer) Get @@ -1185,6 +1186,18 @@ Partial Class Compras_Compras End Property + Private Property EsDevolucionApoyoLogistico As Boolean + Get + + If ViewState("EsDevolucionApoyoLogistico") Is Nothing Then + ViewState("EsDevolucionApoyoLogistico") = False + End If + Return CType(ViewState("EsDevolucionApoyoLogistico"), Boolean) + End Get + Set(value As Boolean) + ViewState("EsDevolucionApoyoLogistico") = value + End Set + End Property Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load @@ -1610,7 +1623,13 @@ Partial Class Compras_Compras NCSeleccionFacturasRelacionadas(UUIDSList) End If + If CveFactura > 0 AndAlso Serie Isnot nothing AndAlso Serie.ToUpper = "NL" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + EsDevolucionApoyoLogistico = True + DdlTipoComprobante.Items.Clear() + DdlTipoComprobante.Items.Add(New ListItem("Devolución", "DEV")) + DdlTipoComprobante.SelectedValueExist("DEV") + End If End If @@ -5527,6 +5546,8 @@ Partial Class Compras_Compras If DdlTipoComprobante.SelectedValue = "Fac" Then + + For Each tCveAlmacen As Integer In ListAlmacenes If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then Continue For @@ -5553,7 +5574,7 @@ Partial Class Compras_Compras ListaMovimientosAlmacen.Add(CveMovimientoInventario) - + Dim contadorAlamcen As Integer = 0 For Each Dr As DataRow In DtInv.Rows CveProducto = Dr("CvePS").ToString.ToEntero @@ -5594,22 +5615,26 @@ Partial Class Compras_Compras End If End If - 'si no es por serie lote + ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) - If(DdlMoneda.SelectedValue.ToEntero = 1, tDescuento, tDescuento * TipoCambioGuardar) + 'si no es por serie lote ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto) - If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDecimal), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then - ErrorMovInv = True - Exit For + If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDecimal), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then + ErrorMovInv = True + Exit For + End If End If + End If - End If - - i = i + 1 + i = i + 1 + contadorAlamcen = contadorAlamcen + 1 Next End If + + Next End If @@ -10988,7 +11013,16 @@ Partial Class Compras_Compras e.Row.FCCheckBox("cbInv").Enabled = False End If - e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(If(DdlTipoCompra.SelectedValue.ToEntero = 9, "CveTipoAlmacen IN (21)", "CveTipoAlmacen IN (1,2,7,14,19)")) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) + + If EsDevolucionApoyoLogistico Then + e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen = 27") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) + + Else + e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(If(DdlTipoCompra.SelectedValue.ToEntero = 9, "CveTipoAlmacen IN (21)", "CveTipoAlmacen IN (1,2,7,14,19)")) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) + End If + + + e.Row.FCDropDownList("ddlEAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) e.Row.FCDropDownList("ddlEAlmacen").DataBind() 'e.Row.FCDropDownList("ddlEAlmacen").SelectedValue = If(e.Row.DBCampo("CveAlmacen").ToEntero <= 0, "-1", e.Row.DBCampo("CveAlmacen")) @@ -11100,6 +11134,10 @@ Partial Class Compras_Compras StrAlmacenes = $"Modalidad = 0" End If + If EsDevolucionApoyoLogistico Then + StrAlmacenes = " CveTipoAlmacen = 27" + End If + e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) e.Row.FCDropDownList("ddlAlmacen").DataBind() @@ -17625,6 +17663,8 @@ Partial Class Compras_Compras 'If GlobalDTProductosServiciosEquivalencias(CvePS, CveUM).Rows.Count = 0 Then Row("CveEq") = 1 Else Row("CveEq") = 0 Row("NoDeducible") = NoDeducible + + Total = Math.Round(PU, DecimalesPermitidos) * Cantidad - Descuento Row("PU") = Math.Round(PU, DecimalesPermitidos) If CargaXml And (Version = "3.3" Or Version = "4.0") Then diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 32792b00f..8db28f336 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -2042,7 +2042,7 @@ Partial Class Inventarios_EntradasSalidas If Not ErrorAC And Not ErrorMovInv Then - If Not DdlDireccionEnvio.SelectedValue.ToEntero > 0 Then + If ChkEmitirTimbrado.Checked AndAlso Not DdlDireccionEnvio.SelectedValue.ToEntero > 0 Then ErrorMovInv = True Alert("La direccion destino es requerida.", TipoMensaje.MsgAdvertencia) End If diff --git a/OS/RepServicioDomicilio.aspx b/OS/RepServicioDomicilio.aspx index 8b9b087d3..cca9c7ac9 100644 --- a/OS/RepServicioDomicilio.aspx +++ b/OS/RepServicioDomicilio.aspx @@ -1180,24 +1180,10 @@ function InitCalendar() { $(document).ready(function () { - //$("#TxtModalFechaOS").on("change paste keyup", function () { - // console.log('TxtModalFechaOS Modificado'); - //}); - - //jQuery('#TxtModalFechaOS').on('input', function () { - // console.log('TxtModalFechaOS Modificado'); - //}); - - //$("#TxtModalFechaOS").change(function () { - // console.log('TxtModalFechaOS Modificado'); - //}); + Calendario(); - - // CargaPickers(); - - - // $("#TxtModalFechaOS").val("" + start.format("DD/MM/YYYY 08:00 tt")); + }); diff --git a/OS/RepServicioDomicilio.aspx.vb b/OS/RepServicioDomicilio.aspx.vb index 2b5459bb0..33a77efd2 100644 --- a/OS/RepServicioDomicilio.aspx.vb +++ b/OS/RepServicioDomicilio.aspx.vb @@ -1358,11 +1358,6 @@ Partial Class OS_RepServicioDomicilio If DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then - 'If ViewState("Validando") Is Nothing Then - ' ViewState("Validando") = True - 'Else - ' Exit Sub - 'End If Dim objOS As New ClsOS diff --git a/RH/CatDocumentos.aspx b/RH/CatDocumentos.aspx index 39c160e78..8b286199b 100644 --- a/RH/CatDocumentos.aspx +++ b/RH/CatDocumentos.aspx @@ -50,7 +50,8 @@ + DataKeyNames="CveDocumentacion,Documentacion,DocumentacionFormato,Orden,Estatus,CveDocumentacionTipo,DocumentacionTipo,Requerido,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento" + EmptyDataText="No se encontraron registros de documentos" CssClass="table table-hover table-advance Widthall" GridLines="None" > @@ -111,7 +112,8 @@ - + diff --git a/RH/CatDocumentos.aspx.vb b/RH/CatDocumentos.aspx.vb index 61d32c97d..530066dbc 100644 --- a/RH/CatDocumentos.aspx.vb +++ b/RH/CatDocumentos.aspx.vb @@ -418,8 +418,11 @@ Partial Class RH_CatDocumentos If e.Row.RowType = DataControlRowType.DataRow Then Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString.ToEntero - Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString - Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString + + 'Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim ImgDownLoadFormato As LinkButton = e.Row.FCLinkButton("ImgDownLoadFormato") + Dim separado As Char() = {"."} Dim array() As String = DocumetacionFormato.Split(separado) Dim extencion As String = "" @@ -430,27 +433,50 @@ Partial Class RH_CatDocumentos If DocumetacionFormato.Trim.Length > 0 Then - Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & _CveDocumentacion & "_" & DocumetacionFormato - Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato - If File.Exists(linkDescargaArchivo) Then - ImgDownLoad.Visible = True - If extencion.Length > 0 Then - ImgDownLoad.Text = String.Format(" ", linkDescarga, DocumetacionFormato) - Else - ImgDownLoad.Text = String.Format(" ", linkDescarga, DocumetacionFormato) - End If - Else - ImgDownLoad.Visible = False - End If - - Else - ImgDownLoad.Visible = False - End If + Dim PathDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato + Dim FileD = New FileInfo(PathDescargaArchivo) + If FileD.Exists Then + ImgDownLoadFormato.Visible = True + ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoadFormato) + End If + + + End If + + + End If End Sub + Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs) + + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + 'Dim Adjunto As String = GvRow.DataKey("Adjunto") + + Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString.ToEntero + Dim DocumetacionFormato As String = GvRow.DataKey("DocumentacionFormato").ToString + + Dim PathDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato + + Dim FileD = New FileInfo(PathDescargaArchivo) + + If FileD.Exists Then + + Response.Clear() + Response.AddHeader("Content-Disposition", "attachment; filename=" + FileD.Name) + Response.AddHeader("Content-Length", FileD.Length.ToString()) + Response.ContentType = "text/octet-stream" + Response.Flush() + Response.TransmitFile(FileD.FullName) + Response.End() + + End If + + End Sub + #End Region @@ -670,5 +696,7 @@ Partial Class RH_CatDocumentos RegistraScript(String.Format("$('#{0}').modal('show');", "DVParametros")) End Sub + + End Class diff --git a/Ventas/PopUpBuscarClientes.aspx b/Ventas/PopUpBuscarClientes.aspx index 11b583660..727fb9ca2 100644 --- a/Ventas/PopUpBuscarClientes.aspx +++ b/Ventas/PopUpBuscarClientes.aspx @@ -73,6 +73,19 @@ + + + + Cuenta: + + + + + + + + + diff --git a/Ventas/PopUpBuscarClientes.aspx.vb b/Ventas/PopUpBuscarClientes.aspx.vb index fa8690108..58141167d 100644 --- a/Ventas/PopUpBuscarClientes.aspx.vb +++ b/Ventas/PopUpBuscarClientes.aspx.vb @@ -2,6 +2,8 @@ Option Strict On Imports Extensiones +Imports Microsoft.Owin.Security.Provider + Partial Class PopUpBuscarClientes Inherits ClsPaginas @@ -74,13 +76,17 @@ Partial Class PopUpBuscarClientes Dim ObjClientes As New ClsClientes() Dim CveUsuarioConsulta As Integer + + Dim Cuenta As String = If(TxtCuenta.Text = "", "-1", TxtCuenta.Text) + 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, CveUsuarioConsulta:=CveUsuarioConsulta) Then + DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente, TopSelect:=100, CveUsuarioConsulta:=CveUsuarioConsulta, Cuenta:=Cuenta) Then + If ObjClientes.DtResultados.Rows.Count > 0 Then LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0) GV.DataSource = ObjClientes.DtResultados @@ -150,6 +156,7 @@ Partial Class PopUpBuscarClientes If TxtMail.Text.Trim <> String.Empty Then Return True If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True + If TxtCuenta.Text.Trim.Length > 0 Then Return True Return False End Function From 793dc80866c69fa1fab347ab2806e3bcc7d64fcd Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Sat, 14 Jan 2023 14:07:54 -0700 Subject: [PATCH 22/24] =?UTF-8?q?Ajsute=20almacen=20prorrateo,=20Clientes?= =?UTF-8?q?=20dise=C3=B1o=20perdido=20parametros=20estados=20de=20cuenta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntradasSalidas.aspx.vb | 43 ++- Ventas/Clientes.aspx | 471 ++++++++++++++++++++++------ Ventas/Clientes.aspx.vb | 13 +- 3 files changed, 420 insertions(+), 107 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 8db28f336..25c18b4f9 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -4404,6 +4404,11 @@ Partial Class Inventarios_EntradasSalidas Exit Sub End If + If Not TxtIFDescripcion.Text.Trim.Length > 0 Then + Alert("La descripción es requerida", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Dim ObjInventario As New ClsInventarios Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) @@ -4426,6 +4431,14 @@ Partial Class Inventarios_EntradasSalidas Dim idCtaContableEntrada As Integer = 0 Dim idCtaContableSalida As Integer = 0 + Dim Prorratear As Boolean = If(UsuarioActual.CveEmpresa = 172 AndAlso DtMovimientosSalidaInvFisico.Rows.Count > 0 AndAlso DtMovimientosEntradaInvFisico.Rows.Count > 0, True, False) + Dim ProPU As Decimal = 0 + 'Dim ImporteSalida As Decimal = + + 'DtMovimientosSalidaInvFisico + 'DtMovimientosEntradaInvFisico + + Dim IdCuentaOtrosIngresos As Integer = UsuarioActual.Empresa.IdCuentaOtrosIngresos Select Case UsuarioActual.CveEmpresa Case 119 @@ -4438,6 +4451,8 @@ Partial Class Inventarios_EntradasSalidas Dim EsContabilizable As Boolean = (CveModalidad = 1) + + 'MOVIMIENTO DE ENTRADA If DtMovimientosEntradaInvFisico.Rows.Count > 0 Then 'FolioEntrada = ObjInventario.GetFolioSiguiente(32, UsuarioActual.CveEmpresa) @@ -4484,9 +4499,35 @@ Partial Class Inventarios_EntradasSalidas End If Next + + + + If Prorratear Then + If Not ErrorMovInv AndAlso CveMovimientoSalida > 0 Then + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then + + Dim ProTotalSalida As Decimal = ObjInventario.DtResultados.SUMD("Total", "") + Dim ProCantidadEntrada As Decimal = DtMovimientosEntradaInvFisico.SUMD("Cantidad", "") + + ProPU = (ProTotalSalida / ProCantidadEntrada).RoundSQL(6) + + If Not ProPU > 0 Then + ErrorMovInv = True + Mensaje = $"Ocurrió un error al obtener el PU proraterado, pu {ProPU}" + End If + + Else + ErrorMovInv = True + Mensaje = "Ocurrió un error al obtener el PU proraterado" + End If + End If + End If + + + If Not ErrorMovInv Then For Each Dr As DataRow In DtMovimientosEntradaInvFisico.Rows - ImporteConcepto = Dr("PU").ToString.ToDecimal + ImporteConcepto = If(Prorratear, ProPU, Dr("PU").ToString.ToDecimal) If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index b638c446e..ba8e4ec33 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -1641,7 +1641,346 @@
    -
    + + +
    + +
    +
    +
    + + Parametros +
    + +
    + + +
    + +
    +
    + + + + + +
    +
    +
    + +
    +
    +
    +
    + + Estado de Cuenta +
    +
    + +
    +
    +
    + + +
    +
    + +
    + + + + + + + +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    +
    +
    + + + + + +
    + +
    + + + + + + + + + + + <%-- + + + + + --%> +
    +
    +
    +
    + +
    +
    +
    +
    + +    +
    +
    + + + + +
    +
    +
    + +
    +
    + + + <%--
    @@ -1668,7 +2007,7 @@ - <%-- --%> +
    @@ -1783,66 +2122,13 @@
    - <%-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --%> +
    - - <%----%> +
    @@ -1851,8 +2137,7 @@
    - - <%----%> +
    @@ -1867,8 +2152,7 @@
    - - <%----%> +
    @@ -1877,45 +2161,21 @@
    - <%--
    - - -
    - -
    - - -
    - -
    - -
    - - -
    - - -
    - -
    -
    --%> +
    - - <%----%> +
    - - <%----%> +
    - - <%----%> +
    @@ -1947,10 +2207,7 @@
    - <%-- - Cuentas por Cobrar - Anticipos / NC - --%> +
    @@ -2021,12 +2278,7 @@ - <%-- - - - - - --%> +
    @@ -2052,11 +2304,13 @@
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    + --%> + + + +
    +
    @@ -2085,6 +2339,15 @@
    + +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + +
    +
    - <%----%> + diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index b40560271..ec502615f 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -764,9 +764,11 @@ Partial Class Clientes If UsuarioActual.TienePermisoProceso(162) Then ChkPermiteCredito.Enabled = True TxtLimiteCreditoSucursal.Enabled = True + TxtFechaLimiteCredito.Enabled = True Else ChkPermiteCredito.Enabled = False TxtLimiteCreditoSucursal.Enabled = False + TxtFechaLimiteCredito.Enabled = False End If ChkEstado.Enabled = False If UsuarioActual.TienePermisoProceso(180) Then @@ -1635,6 +1637,9 @@ Partial Class Clientes ChkRequiereOC.Checked = ObjClientes.RequiereOC ChkEsDistribuidor.Checked = Boolean.Parse(ObjClientes.DtResultados(0)("EsDistribuidor").ToString()) CobranzaTelefono = ObjClientes.CobranzaTelefono + + TxtFechaLimiteCredito.Text = If(ObjClientes.DtResultados.Rows(0)("FechaLimiteCredito").ToString.ToDate = New Date(1900, 1, 1), "", ObjClientes.DtResultados.Rows(0)("FechaLimiteCredito").ToString.ToDate.ToString("dd/MM/yyyy")) + If CobranzaTelefono.Length = 10 Then BtnCobranzaSMS.ToolTip = $"El mensaje SMS será enviado al número celular {CobranzaTelefono}
    con #referencia ""{If(UsuarioActual.CveEmpresa = 4, TxtNombreCorto.Text, CodigoCliente)}""" End If @@ -2684,6 +2689,10 @@ Partial Class Clientes Dim TipoPersona As Boolean = If(RdTipoPersona.SelectedValue.ToEntero = 1, True, False) + + Dim FechaLimiteCredito As Date = If(TxtFechaLimiteCredito.Text.Trim.Length > 0, TxtFechaLimiteCredito.Text.ToDate, New Date(1900, 1, 1)) + + If CveCliente = -1 Then Dim ErrorAC As Boolean = False Dim CtaCliente As Integer = DdlCtaContableClientes.SelectedValue.ToEntero() @@ -2747,7 +2756,7 @@ Partial Class Clientes CvePais:=DdlPais.SelectedValue.ToEntero(), CveEstado:=DdlEstado.SelectedValue.ToEntero(), CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero(), CveColonia:=DdlColonia.SelectedValue.ToEntero(), CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero(), NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(), ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()), - CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim()) Then + CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito) Then ViewState("CveCliente") = ObjClientes.CveCliente @@ -2844,7 +2853,7 @@ Partial Class Clientes ApellidoPaternoPF:=IIf(TxtApellidoPaterno.Text = "", "-1", TxtApellidoPaterno.Text).ToString(), ApellidoMaternoPF:=IIf(TxtApellidoMaterno.Text = "", "-1", TxtApellidoMaterno.Text).ToString(), NombresPF:=IIf(TxtNombres.Text = "", "-1", TxtNombres.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()), - NoDesglosaIVA:=ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim()) Then + NoDesglosaIVA:=ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito) Then ObjClientes.LimpiaImpuestosLocales(CveCliente) From 9f737154d55e92d3919f10359ff67c24ab7c407b Mon Sep 17 00:00:00 2001 From: MLopez Date: Sat, 14 Jan 2023 14:34:13 -0700 Subject: [PATCH 23/24] E172 ClsGenerales agregar "Estatus" a AddEmpacado y AddTipoOrganico --- App_Code/ClsGenerales.vb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 6af4ed287..77f4301c1 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -4223,15 +4223,16 @@ Public Class ClsGenerales Return Retorno End Function - Public Function AddTipoOrganico(TipoOrganico As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddTipoOrganico(TipoOrganico As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_TipoOrganicosAdd") With SqlAdapter.SelectCommand.Parameters .Add("@TipoOrganico", SqlDbType.VarChar).Value = TipoOrganico - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try @@ -4317,15 +4318,16 @@ Public Class ClsGenerales Return Retorno End Function - Public Function AddEmpacado(TipoEmpacado As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddEmpacado(TipoEmpacado As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_EmpacadosAdd") With SqlAdapter.SelectCommand.Parameters .Add("@TipoEmpacado", SqlDbType.VarChar).Value = TipoEmpacado - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try From ec9f4983f30234987f4f7abf10a046ef6c92d136 Mon Sep 17 00:00:00 2001 From: MLopez Date: Sat, 14 Jan 2023 17:14:30 -0700 Subject: [PATCH 24/24] E172 FIX Error ClsProductosServicios UpdatePS() --- App_Code/ClsProductosServicios.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index a6c62f462..f3ae17edc 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -762,8 +762,8 @@ Public Class ClsProductosServicios .Add("@VigenciaIndeterminadaRSCO", SqlDbType.Bit).Value = VigenciaIndeterminadaRSCO 'Nuevo MLopez 18/11/2022 - .Add("@CveTipoEmpacado", SqlDbType.Int).Value = CveTipoOrganico - .Add("@CveTipoOrganico", SqlDbType.Int).Value = CveTipoEmpacado + .Add("@CveTipoEmpacado", SqlDbType.Int).Value = CveTipoEmpacado + .Add("@CveTipoOrganico", SqlDbType.Int).Value = CveTipoOrganico End With