Cancelacion IE

This commit is contained in:
rakcsle
2022-01-14 08:51:19 -07:00
parent 57f98890c8
commit 3569eba70d
8 changed files with 477 additions and 281 deletions

View File

@@ -148,6 +148,29 @@ Partial Class ProductosyServicios
End Property
#End Region
#Region "Material peligroso"
Property ValidaMaterialPeligrosoMensaje As Boolean
Get
If ViewState("ValidaMaterialPeligroso") Is Nothing Then
ViewState("ValidaMaterialPeligroso") = False
End If
Return Boolean.Parse(ViewState("ValidaMaterialPeligroso").ToString)
End Get
Set(value As Boolean)
ViewState("ValidaMaterialPeligroso") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -1213,6 +1236,15 @@ Partial Class ProductosyServicios
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
If DdlSATPS.txtValue.Value.ToEntero > 0 Then
If Not ValidaMaterialPeligrosoMensaje Then
ValidaMaterialPeligroso(DdlSATPS.txtValue.Value.ToEntero)
Exit Sub
End If
End If
If DdlSATPS.SelectedValue.Contiene("46920", "0", "-1") AndAlso UsuarioActual.CveEmpresa.Contiene(119, 158, 72, 80, 145) Then
Alert("El Producto Servicio SAT con clave '01010101' no es valido, por favor seleccione otro", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -3045,4 +3077,76 @@ Partial Class ProductosyServicios
End If
Return False
End Function
Sub ValidaMaterialPeligroso(CveSATPS As Integer)
Dim EsPeligroso As Boolean = False
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATProductosServicios(CveSATPS:=CveSATPS) Then
Dim DTDatos As New DataTable
DTDatos = ObjGrales.DtResultados.FiltraParametros($" CveSATPS= {CveSATPS}")
'Es material Peligros
If DTDatos.Rows(0)("EsPeligroso").ToString.ToEntero = 1 Then
If DdlMaterialPeligroso.txtValue.Value.ToEntero > 0 And DdlEmbalaje.txtValue.Value.ToEntero > 0 And TxtPesoKg.Text.Trim.Length > 0 Then
ValidaMaterialPeligrosoMensaje = True
Else
RegistraScript("$('#DivModalMensaje').modal('show');")
ValidaMaterialPeligrosoMensaje = False
LblModalMensajeCuerpo.Text = "El producto servicio del SAT seleccionado esta clasificado como material peligroso, favor de llenar los datos de la sección carta porte en la pestaña Contabilidad - Inventarios."
UPModalMensaje.Update()
End If
Else
'No es matgerial peligroso
If DdlMaterialPeligroso.txtValue.Value.ToEntero > 0 Or DdlEmbalaje.txtValue.Value.ToEntero > 0 Or TxtPesoKg.Text.Trim.Length > 0 Then
RegistraScript("$('#DivModalMensaje').modal('show');")
ValidaMaterialPeligrosoMensaje = False
LblModalMensajeCuerpo.Text = "El producto servicio del SAT seleccionado no esta clasificado como material peligroso, favor de limpiar los datos de la sección carta porte en la pestaña Contabilidad - Inventarios, el incluir estos datos en un material no peligroso generara errores al timbrar traslados."
UPModalMensaje.Update()
Else
ValidaMaterialPeligrosoMensaje = True
End If
End If
End If
ObjGrales.Dispose()
'Return Respuesta
End Sub
Protected Sub BtnmodalMensajeOK_Click(sender As Object, e As EventArgs)
ValidaMaterialPeligrosoMensaje = True
RegistraScript("$('#DivPersonalizar').modal('hide');")
BtnGuardar_Click(Nothing, Nothing)
End Sub
End Class