Transportes Mejoras
This commit is contained in:
@@ -4481,6 +4481,10 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ValidaFechaDeAlamacen() Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then
|
||||
@@ -7803,6 +7807,54 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ValidaFechaDeAlamacen() As Boolean
|
||||
Dim respuesta As Boolean = False
|
||||
|
||||
|
||||
|
||||
Dim objInventario As New ClsInventarios
|
||||
Dim MovimientosError As Boolean = False
|
||||
|
||||
'Dim SB As New StringBuilder
|
||||
'Dim FechaCompra As DateTime = TxtFecha.Text.ToDate
|
||||
'FechaCompra
|
||||
Dim FechaMinima As DateTime = TxtFecha.Text.ToDate
|
||||
|
||||
If DtInv IsNot Nothing Then
|
||||
For Each Dr As DataRow In TmpDT.Rows
|
||||
|
||||
Dim CveTipoPS As Integer = Dr("CveTipoPS").ToString.ToEntero
|
||||
|
||||
If CveTipoPS = 2 Then
|
||||
If objInventario.GetValidaFechaAlmacen(CveEmpresa:=UsuarioActual.CveEmpresa, CveAlmacen:=ddlAlmacenAdd.SelectedValue.ToEntero, CvePS:=Dr("CvePS").ToString.ToEntero) Then
|
||||
|
||||
If objInventario.DtResultados IsNot Nothing AndAlso objInventario.DtResultados.Rows.Count > 0 Then
|
||||
Dim FechamoMovimiento As DateTime = objInventario.DtResultados(0)("FechaMovto").ToString.ToDate
|
||||
If FechamoMovimiento > FechaMinima Then
|
||||
FechaMinima = FechamoMovimiento
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
objInventario.Dispose()
|
||||
|
||||
If FechaMinima > TxtFecha.Text.ToDate Then
|
||||
Alert($"Los productos tienen movientos, la fecha minima que se puede aplicar es {FechaMinima.ToString("dd/MM/yyyy HH:mm")}", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Return respuesta
|
||||
|
||||
End Function
|
||||
|
||||
Private Function GeneraStrinDoctosRelacionados() As String
|
||||
|
||||
Dim DoctosRelacionados As String = "-1"
|
||||
|
||||
Reference in New Issue
Block a user