Motivo para autorizaciones
This commit is contained in:
@@ -4,14 +4,22 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
Private Property CveAutorizacion() As Integer
|
||||
Private Property CveAutorizacion() As Integer
|
||||
Get
|
||||
Return If(IsNothing(ViewState("CveAutorizacion")), -1, CInt(ViewState("CveAutorizacion")))
|
||||
Return If(IsNothing(ViewState("CveAutorizacion")), -1, CInt(ViewState("CveAutorizacion")))
|
||||
End Get
|
||||
Set
|
||||
End Get
|
||||
Set
|
||||
ViewState("CveAutorizacion") = Value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Modalidad() As String
|
||||
Get
|
||||
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
|
||||
End Set
|
||||
End Property
|
||||
End Get
|
||||
Set
|
||||
ViewState("Modalidad") = Value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
@@ -29,20 +37,20 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
DdlCliente.setEsWebService(True)
|
||||
DdlClienteFiltro.setEsWebService(True)
|
||||
|
||||
#Region "CARGAS"
|
||||
Private Sub CargaCombos()
|
||||
txtFechaI.Text = Now.AddDays(-1).ToString("dd/MM/yyyy")
|
||||
txtFechaI.Text = Now.ToString("dd/MM/yyyy")
|
||||
|
||||
DdlCliente.setEsWebService(True)
|
||||
DdlClienteFiltro.setEsWebService(True)
|
||||
|
||||
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
'If EsWS Then
|
||||
' DdlCliente.setEsWebService(True)
|
||||
' DdlClienteFiltro.setEsWebService(True)
|
||||
'Else
|
||||
' DdlCliente.setEsWebService(False)
|
||||
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
'If EsWS Then
|
||||
' DdlCliente.setEsWebService(True)
|
||||
' DdlClienteFiltro.setEsWebService(True)
|
||||
'Else
|
||||
' DdlCliente.setEsWebService(False)
|
||||
' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
' DdlCliente.DataBind()
|
||||
' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
' DdlClienteFiltro.setEsWebService(False)
|
||||
' DdlClienteFiltro.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
' DdlClienteFiltro.DataBind()
|
||||
' DdlClienteFiltro.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
'End If
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
@@ -64,8 +72,8 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
CveCliente = DdlClienteFiltro.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim CveCliente As Integer = -1
|
||||
Dim FechaI, FechaF As Date
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim.ToDate, MinFecha)
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim.ToDate, MaxFecha)
|
||||
|
||||
Dim ObjGral As New ClsVentas
|
||||
@@ -103,8 +111,10 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
LimpiaModal()
|
||||
Modalidad = "A"
|
||||
BtnGuardar.Text = "Agregar"
|
||||
|
||||
CargaDatos()
|
||||
ltlMotititulo.Text = "Agregar autorización"
|
||||
UpModal.Update()
|
||||
RegistraScript("$('#DModal').modal()")
|
||||
End Sub
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
If DdlTipoAutorizacion.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
|
||||
@@ -119,8 +129,10 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
DiasVencidos = TxtDiasVencidos.Text.ToEntero()
|
||||
End If
|
||||
|
||||
Dim Motivo As String = TxtMotivo.Text.Trim
|
||||
|
||||
Dim ObjPS As New ClsVentas
|
||||
Dim DiasVencidos As Integer = 0
|
||||
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, DdlCliente.SelectedValue.ToEntero(), DdlVendedor.SelectedValue.ToEntero(), TxtPrecio.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocto, DiasVencidos, Motivo:=Motivo) Then
|
||||
RegistraScript("$('#DModal').modal('hide')")
|
||||
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
@@ -132,9 +144,13 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
#End Region
|
||||
|
||||
#Region "LIMPIAR"
|
||||
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
|
||||
Protected Sub LimpiaModal()
|
||||
Me.CveAutorizacion = -1
|
||||
TxtPrecio.Text = ""
|
||||
|
||||
ObjPS.Dispose()
|
||||
DdlCliente.SelectedValue = "-1"
|
||||
DdlVendedor.SelectedValueExist("-1")
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -286,9 +302,11 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then
|
||||
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
|
||||
End If
|
||||
DivMotivo.Visible = False
|
||||
Case "Egs"
|
||||
'QUITAR LA DE VENCIMIENTO
|
||||
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
|
||||
DivMotivo.Visible = True
|
||||
End Select
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user