--Validaciones Garantias
This commit is contained in:
@@ -3195,16 +3195,47 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Try
|
||||
|
||||
If DdlAlmacen.SelectedValue.ToEntero() <= 0 Then
|
||||
TxtPorcentajeAjuste.Text = ""
|
||||
TxtImporteAjuste.Text = "0.00"
|
||||
|
||||
Alert("Debe seleccionar un almacen de tipo garantía", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" Then
|
||||
Dim CveMarca As Integer = -1
|
||||
If String.IsNullOrEmpty(TxtEtiqueta.Text.Trim) Then
|
||||
TxtPorcentajeAjuste.Text = ""
|
||||
TxtImporteAjuste.Text = "0.00"
|
||||
|
||||
CveMarca = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimeroValor("CveMarca", "").ToEntero
|
||||
Alert("Es necesario llenar el campo 'Etiqueta'", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If TxtEtiqueta.Text.Trim.Length <> 4 Then
|
||||
TxtPorcentajeAjuste.Text = ""
|
||||
TxtImporteAjuste.Text = "0.00"
|
||||
|
||||
Alert("La etiqueta no es valida", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" Then
|
||||
Dim CveMarca As Integer = -1, Marca As String = ""
|
||||
|
||||
Dim rowPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
|
||||
CveMarca = rowPS("CveMarca").ToString().ToEntero
|
||||
Marca = rowPS("Marca").ToString()
|
||||
|
||||
Dim DtAcumMeses As DataTable = GlobalDTAcumGarantiasTipoUsoMeses(UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero)
|
||||
|
||||
If DtAcumMeses IsNot Nothing AndAlso DtAcumMeses.Rows.Count = 0 Then
|
||||
TxtPorcentajeAjuste.Text = ""
|
||||
TxtImporteAjuste.Text = "0.00"
|
||||
|
||||
Alert($"No se encontraron datos de garantias con los siguientes datos: <br/> Tipo de Uso :{DdlTipoUso.SelectedItem.Text}<br/> Meses :{TxtMesesUso.Text} <br/> Marca :{Marca}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Dtt As DataTable = Nothing
|
||||
If DtAcumMeses IsNot Nothing Then
|
||||
''obtener siempre y cuando la fecha de inicio sea mayor
|
||||
@@ -3256,6 +3287,8 @@ Partial Class Inventarios_RecepcionUsados
|
||||
'cuando no está registrada, no da ajuste
|
||||
TxtImporteAjuste.ToolTip = "El producto no tiene ajuste en ese periodo"
|
||||
TxtImporteAjuste.Text = "0.00"
|
||||
|
||||
Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -3330,7 +3363,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
CalculaMesesUso()
|
||||
End Sub
|
||||
Protected Sub BtnCalcularImporteAjuste_Click(sender As Object, e As EventArgs)
|
||||
CalculaPorcentajeAjuste()
|
||||
CalculaMesesUso()
|
||||
End Sub
|
||||
|
||||
Private Sub CalculaMesesUso()
|
||||
|
||||
Reference in New Issue
Block a user