mejora en validación de datos de traslados

This commit is contained in:
2021-12-20 11:39:55 -07:00
parent da86bac203
commit 4f9eca412c

View File

@@ -204,29 +204,25 @@ Partial Class Inventarios_TraspasoAlmacen
divEmitir.Visible = False divEmitir.Visible = False
End If End If
If UsuarioActual.CveEmpresa.Contiene(1, 119, 140, 2) Then If UsuarioActual.CveEmpresa.Contiene(1, 2, 119, 140) Then
If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then
ChkEmitirTimbrado.Checked = True
End If
ChkEmitirCartaPorte.Visible = True ChkEmitirCartaPorte.Visible = True
End If End If
CantidadTotal = 0 CantidadTotal = 0
CvePS = 0 CvePS = 0
TipoSeccionAlmacen = 0 TipoSeccionAlmacen = 0
If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
TxtFecha.Enabled = False TxtFecha.Enabled = False
ImgFecha.Visible = False ImgFecha.Visible = False
TxtFechaRecepcion.Enabled = False TxtFechaRecepcion.Enabled = False
ImgFechaRecepcion.Visible = False ImgFechaRecepcion.Visible = False
End If End If
Else Else
If ChkTransitorio.Checked Then If ChkTransitorio.Checked Then
@@ -731,19 +727,19 @@ Partial Class Inventarios_TraspasoAlmacen
#Region " GUARDAR " #Region " GUARDAR "
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
If ChkEmitirTimbrado.Checked Then 'If ChkEmitirTimbrado.Checked Then
If DdlChofer.SelectedValue.ToEntero <= 0 Then ' If DdlChofer.SelectedValue.ToEntero <= 0 Then
Alert("Debe de seleccionar un chofer") ' Alert("Debe de seleccionar un chofer")
Exit Sub ' Exit Sub
End If ' End If
If DdlUnidadCamion.SelectedValue.ToEntero <= 0 Then ' If DdlUnidadCamion.SelectedValue.ToEntero <= 0 Then
Alert("Debe de seleccionar una unidad") ' Alert("Debe de seleccionar una unidad")
Exit Sub ' Exit Sub
End If ' End If
End If 'End If
'VALIDA ALMACEN ORIGEN Y DESTINO 'VALIDA ALMACEN ORIGEN Y DESTINO
If DdlAlmacenOrigen.SelectedValue = DdlAlmacenDestino.SelectedValue Then If DdlAlmacenOrigen.SelectedValue = DdlAlmacenDestino.SelectedValue Then
@@ -1156,7 +1152,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim CveSubProyectoTimbre As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero Dim CveSubProyectoTimbre As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero
Dim Fechallegada As DateTime = (TxtFechaLlegada.Text & " 23:59:59").ToDateTime Dim Fechallegada As DateTime = (TxtFechaLlegada.Text & " 23:59:59").ToDateTime
Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimientoSalida, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, Fechallegada, "T", 1, 1, 1) Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimientoSalida, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, Fechallegada, "T", "", "", MinFecha, 1, 1, 1)
If CveEntregaAlmacen > 0 Then If CveEntregaAlmacen > 0 Then
CveTimbre = ObjGral.AddGralTimbre("Tra", CveSubProyectoTimbre, TxtFechaEntrega.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=ChkEmitirCartaPorte.Checked) CveTimbre = ObjGral.AddGralTimbre("Tra", CveSubProyectoTimbre, TxtFechaEntrega.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=ChkEmitirCartaPorte.Checked)