CarataPorte
This commit is contained in:
@@ -673,6 +673,15 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim CveClasificacion As Integer
|
||||
|
||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||
|
||||
|
||||
If ChkEmitirTimbrado.Checked Then
|
||||
If Not ValidaPSSAT(DrPS) Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If DrPS IsNot Nothing Then
|
||||
CveClasificacion = DrPS("CveClasificacion").ToString.ToEntero
|
||||
Dim DrUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimero($"CveUnidadMedida = {CveUnidadMedida}")
|
||||
@@ -1190,7 +1199,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
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 CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimientoSalida, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, Fechallegada, "T", "", "", MinFecha, 1, 1, 1)
|
||||
Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimientoSalida, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, TxtFechaLlegada.Text.ToDate, "T", "", "", MinFecha, 1, 1, TxtDistancia.Text.ToEntero,
|
||||
ConfigCartaPorte:=DdlConfigAuto.SelectedValue, CveCamionRemolque1:=DdlRemolque1.SelectedValue.ToEntero, CveCamionRemolque2:=DdlRemolque2.SelectedValue.ToEntero)
|
||||
|
||||
If CveEntregaAlmacen > 0 Then
|
||||
CveTimbre = ObjGral.AddGralTimbre("Tra", CveSubProyectoTimbre, TxtFechaEntrega.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=ChkEmitirCartaPorte.Checked)
|
||||
@@ -2962,10 +2972,47 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End Sub
|
||||
|
||||
Public Sub CargarCamiones()
|
||||
|
||||
DdlConfigAuto.Items.Clear()
|
||||
DdlUnidadCamion.Items.Clear()
|
||||
|
||||
DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa)
|
||||
'DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa)
|
||||
'DdlUnidadCamion.DataBind()
|
||||
|
||||
|
||||
|
||||
Using ObjInv As New ClsInventarios
|
||||
|
||||
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1) Then
|
||||
DdlUnidadCamion.DataSource = ObjInv.DtResultados
|
||||
End If
|
||||
|
||||
|
||||
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
|
||||
DdlRemolque1.DataSource = ObjInv.DtResultados
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
DdlUnidadCamion.DataBind()
|
||||
DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
|
||||
|
||||
DdlRemolque1.DataBind()
|
||||
DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
|
||||
|
||||
|
||||
Using ObjGrales As New ClsGenerales
|
||||
|
||||
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
|
||||
DdlConfigAuto.DataSource = ObjGrales.DtResultados
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
DdlConfigAuto.DataBind()
|
||||
DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1"))
|
||||
|
||||
'Using ObjGral As New ClsGenerales
|
||||
' If ObjGral.GetCartaPorteConfigAutoTransportes() Then
|
||||
@@ -3092,6 +3139,220 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "remolques"
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub DdlUnidadCamionActivoFijo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
DvRemolque1.Visible = False
|
||||
DvRemolque2.Visible = False
|
||||
|
||||
DdlRemolque1.SelectedValueExist(-1)
|
||||
DdlRemolque2.SelectedValueExist(-1)
|
||||
|
||||
If DdlUnidadCamion.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
|
||||
Using ObjInv As New ClsInventarios
|
||||
|
||||
If ObjInv.GetCamiones(DdlUnidadCamion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1) Then
|
||||
DdlConfigAuto.SelectedValueExist(ObjInv.DtResultados.FiltroPrimeroValor("ConfigCartaPorte"))
|
||||
DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing)
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
|
||||
End If
|
||||
|
||||
UpEmitirTransitorio.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Property RequiereRemolque As Boolean
|
||||
Get
|
||||
If ViewState("RequiereRemolque") Is Nothing Then
|
||||
ViewState("RequiereRemolque") = False
|
||||
End If
|
||||
|
||||
Return Boolean.Parse(ViewState("RequiereRemolque").ToString)
|
||||
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("RequiereRemolque") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property MostrarRemolques As Boolean
|
||||
Get
|
||||
If ViewState("MostrarRemolques") Is Nothing Then
|
||||
ViewState("MostrarRemolques") = False
|
||||
End If
|
||||
|
||||
Return Boolean.Parse(ViewState("MostrarRemolques").ToString)
|
||||
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("MostrarRemolques") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Protected Sub DdlConfigAuto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ValidaConfiguracionVeiculo()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ValidaConfiguracionVeiculo()
|
||||
DvRemolque1.Visible = False
|
||||
DvRemolque2.Visible = False
|
||||
|
||||
DdlRemolque1.SelectedValueExist(-1)
|
||||
DdlRemolque2.SelectedValueExist(-1)
|
||||
|
||||
If DdlConfigAuto.SelectedIndex > 0 Then
|
||||
|
||||
Using ObjGrales As New ClsGenerales
|
||||
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
|
||||
Dim Remolque As String = ObjGrales.DtResultados.FiltroPrimeroValor("Remolque", $" ClaveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'")
|
||||
|
||||
|
||||
If Remolque = "1" Then
|
||||
RequiereRemolque = True
|
||||
MostrarRemolques = True
|
||||
End If
|
||||
|
||||
If Remolque = "0, 1" Then
|
||||
RequiereRemolque = False
|
||||
MostrarRemolques = True
|
||||
End If
|
||||
|
||||
If Remolque = "0" Then
|
||||
RequiereRemolque = False
|
||||
MostrarRemolques = False
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
Else
|
||||
RequiereRemolque = False
|
||||
MostrarRemolques = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
If RequiereRemolque Or MostrarRemolques Then
|
||||
DvRemolque1.Visible = True
|
||||
End If
|
||||
|
||||
If Not RequiereRemolque Then
|
||||
DvConfiguracionVeiculo.Visible = False
|
||||
Else
|
||||
DvConfiguracionVeiculo.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
UpEmitirTransitorio.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlRemolque1_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
DdlRemolque2.Items.Clear()
|
||||
|
||||
If DdlRemolque1.SelectedValue.ToEntero > 0 Then
|
||||
DvRemolque2.Visible = True
|
||||
|
||||
Using ObjInv As New ClsInventarios
|
||||
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
|
||||
DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}")
|
||||
End If
|
||||
End Using
|
||||
|
||||
DdlRemolque2.DataBind()
|
||||
|
||||
|
||||
Else
|
||||
DvRemolque2.Visible = False
|
||||
End If
|
||||
|
||||
DdlRemolque2.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
UpEmitirTransitorio.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function validarRemolques() As Boolean
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
|
||||
If RequiereRemolque And DdlRemolque1.SelectedValue.ToEntero <= 0 Then
|
||||
Alert("La configuración de la carta porte requiere que seleccione un remolque", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
If RequiereRemolque And DdlRemolque1.SelectedValue.ToEntero > 0 Then
|
||||
Respuesta = True
|
||||
End If
|
||||
|
||||
If Not RequiereRemolque Then
|
||||
Respuesta = True
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Function ValidaPSSAT(DrPS As DataRow) As Boolean
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
Dim CveSATPS As Integer = DrPS("CveSATPS").ToString.ToEntero
|
||||
Dim PesoKg As Decimal = DrPS("PesoKg").ToString.ToDecimal
|
||||
Dim SATClaveUnidadMedida As String = DrPS("SATClaveUnidadMedida").ToString.Trim
|
||||
|
||||
If CveSATPS > 0 And PesoKg > 0 And SATClaveUnidadMedida.Length > 0 Then
|
||||
Respuesta = True
|
||||
Else
|
||||
Respuesta = False
|
||||
Dim SBMensaje As New StringBuilder
|
||||
|
||||
SBMensaje.AppendLine("El producto seleccionado presenta la siguiente situación: <br>")
|
||||
|
||||
If CveSATPS <= 0 Then
|
||||
SBMensaje.AppendLine("-Producto SAT no asignado. <br>")
|
||||
End If
|
||||
|
||||
|
||||
If PesoKg = 0 Then
|
||||
SBMensaje.AppendLine("-Producto sin peso definido. <br>")
|
||||
End If
|
||||
|
||||
|
||||
If SATClaveUnidadMedida.Length = 0 Then
|
||||
SBMensaje.AppendLine("-Producto sin unidad de medida SAT asignada. ")
|
||||
End If
|
||||
|
||||
|
||||
SBMensaje.AppendLine($"<br><br> <strong><a class='texto' target='_blank' href='../Ventas/ProductosServicios.aspx?CvePS={DrPS("CvePS").ToString}' > Corregir Producto </a></strong>")
|
||||
|
||||
|
||||
Alert(SBMensaje.ToString, TipoMensaje.MsgAdvertencia)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Return Respuesta
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user