-- cambio en globaldtmesestiouso

This commit is contained in:
2023-07-03 12:49:50 -07:00
parent a0b41cc0d8
commit 42e0fdf79e
3 changed files with 45 additions and 22 deletions

View File

@@ -4101,29 +4101,51 @@ Public Class ClsPaginas
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTAcumGarantiasMesesTipoUso(CveEmpresa As Integer, CveMarca As Integer, CveTipoUso As Integer, Mes As Integer) As DataTable
Property GlobalDTAcumGarantiasTipoUso(CveEmpresa As Integer, CveMarca As Integer, CveTipoUso As Integer) As DataTable
Get
Dim AppNombre As String = $"GlobalDTAcumGarantiasMesesTipoUso-{CveEmpresa}"
Dim AppNombre As String = $"GlobalDTAcumGarantiasTipoUso-{CveEmpresa}"
If Application(AppNombre) Is Nothing Then
Dim ObjAcumuladores As New ClsAcumuladores()
If ObjAcumuladores.GarantiasMesesGet(-1, CveEmpresa) Then Application(AppNombre) = ObjAcumuladores.DtResultados.FiltraParametros("", DistinctColumns:={"CveMarca", "CveTipoUso", "TipoUso"})
ObjAcumuladores.Dispose()
End If
If CveMarca <> -1 Then
Dim Str As StringBuilder = New StringBuilder()
If CveMarca <> -1 Then Str.AppendFormat("CveMarca = {0}", CveMarca)
If CveTipoUso <> -1 Then Str.AppendFormat("CveTipoUso = {0}", CveTipoUso)
If Mes <> -1 Then Str.AppendFormat("Mes = {0}", CveTipoUso)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAcumGarantiasMesesTipoUso = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAcumGarantiasMesesTipoUso = DirectCast(Application(AppNombre), DataTable)
End If
Dim filtros As New List(Of String)
If CveMarca <> -1 Then filtros.Add($"CveMarca = {CveMarca}")
If CveTipoUso <> -1 Then filtros.Add($"CveTipoUso = {CveTipoUso}")
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
GlobalDTAcumGarantiasTipoUso = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTAcumGarantiasMesesTipoUso-{CveEmpresa}"
Dim AppNombre As String = $"GlobalDTAcumGarantiasTipoUso-{CveEmpresa}"
Application(AppNombre) = value
End Set
End Property
Property GlobalDTAcumGarantiasTipoUsoMeses(CveEmpresa As Integer, CveMarca As Integer, CveTipoUso As Integer, Mes As Integer) As DataTable
Get
Dim AppNombre As String = $"GlobalDTAcumGarantiasTipoUsoMeses-{CveEmpresa}"
If Application(AppNombre) Is Nothing Then
Dim ObjAcumuladores As New ClsAcumuladores()
If ObjAcumuladores.GarantiasMesesGet(-1, CveEmpresa) Then Application(AppNombre) = ObjAcumuladores.DtResultados
ObjAcumuladores.Dispose()
End If
Dim filtros As New List(Of String)
If CveMarca <> -1 Then filtros.Add($"CveMarca = {CveMarca}")
If CveTipoUso <> -1 Then filtros.Add($"CveTipoUso = {CveTipoUso}")
If Mes <> -1 Then filtros.Add($"Mes = {Mes}")
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
GlobalDTAcumGarantiasTipoUsoMeses = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTAcumGarantiasTipoUsoMeses-{CveEmpresa}"
Application(AppNombre) = value
End Set
End Property

View File

@@ -3089,7 +3089,7 @@ Partial Class Inventarios_RecepcionUsados
End If
DdlTipoUso.Items.Clear()
DdlTipoUso.DataSource = GlobalDTAcumGarantiasMesesTipoUso(UsuarioActual.CveEmpresa, CveMarca, -1, -1)
DdlTipoUso.DataSource = GlobalDTAcumGarantiasTipoUso(UsuarioActual.CveEmpresa, CveMarca, -1)
DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlTipoUso.DataBind()
@@ -3246,7 +3246,7 @@ Partial Class Inventarios_RecepcionUsados
CveMarca = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimeroValor("CveMarca", "").ToEntero
Dim dtt As DataTable = GlobalDTAcumGarantiasMesesTipoUso(UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero)
Dim dtt As DataTable = GlobalDTAcumGarantiasTipoUsoMeses(UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero)
If dtt IsNot Nothing Then
If dtt.Rows.Count > 0 Then

View File

@@ -7378,7 +7378,7 @@ Partial Class PV
End If
DdlTipoUso.Items.Clear()
DdlTipoUso.DataSource = GlobalDTAcumGarantiasMesesTipoUso(UsuarioActual.CveEmpresa, CveMarca)
DdlTipoUso.DataSource = GlobalDTAcumGarantiasTipoUso(UsuarioActual.CveEmpresa, CveMarca, -1)
DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlTipoUso.DataBind()
@@ -7434,12 +7434,13 @@ Partial Class PV
CveMarca = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimeroValor("CveMarca", "").ToEntero
Dim ImportePagarCliente As Decimal = 0
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then
If ObjAcum.DtResultados.Rows.Count > 0 Then
Dim dtt As DataTable = GlobalDTAcumGarantiasTipoUsoMeses(UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero)
If dtt IsNot Nothing Then
If dtt.Rows.Count > 0 Then
''obtener siempre y cuando la fecha de inicio sea mayor
Dim strDate As Date = ($"20{TxtEtiqueta.Text.Substring(2, 2)}/{TxtEtiqueta.Text.Substring(0, 2)}/01").ToDate
Dim drg As DataRow = ObjAcum.DtResultados.FiltroPrimero($" #{strDate.ToString("yyyy/MM/dd")}# >= FechaInicioVigencia ", "FechaInicioVigencia DESC")
Dim drg As DataRow = dtt.FiltroPrimero($" #{strDate.ToString("yyyy/MM/dd")}# >= FechaInicioVigencia ", "FechaInicioVigencia DESC")
If drg IsNot Nothing Then
TxtPorcentajeAjuste.Text = (drg("Valor").ToString.ToDouble / 100).ToString
@@ -7498,7 +7499,7 @@ Partial Class PV
Else
Alert("No se tiene especificado tabla de garantía")
End If
ObjAcum.Dispose()
Else
If DdlPSAjuste.SelectedValue.ToEntero <= 0 Then
Alert("Especificar el producto a recibir")