Motivo para autorizaciones
This commit is contained in:
@@ -5315,7 +5315,7 @@ Public Class ClsVentas
|
||||
#End Region
|
||||
|
||||
|
||||
Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0) As Boolean
|
||||
Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0, Optional Motivo As String = "") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -5328,6 +5328,7 @@ Public Class ClsVentas
|
||||
.Add("@TipoAutorizacion", SqlDbType.Int).Value = TipoAutorizacion
|
||||
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
|
||||
.Add("@DiasVencidos", SqlDbType.Int).Value = DiasVencidos
|
||||
.Add("@Motivo", SqlDbType.VarChar).Value = Motivo
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="5%" HeaderText="D.Venc" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
|
||||
<asp:HyperLinkField DataTextField="FacturaAplicada" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label>
|
||||
@@ -203,6 +204,14 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDiasVencidos2" runat="server" HighlightCssClass="vco" TargetControlID="RFVDiasVencidos2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivMotivo" runat="server" visible="false" class="row">
|
||||
<label class="col-md-2 truncate">Motivo:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtMotivo" CssClass="form-control input-sm" runat="server" Rows="2" TextMode="MultiLine" Width="100%" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMotivo" runat="server" ControlToValidate="TxtMotivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEMotivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVMotivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardar" />
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -7845,6 +7845,14 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCEImporteSolicitud" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteSolcitud" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= TxtImporteSolicitud.ClientID.ToString()%>">Importe:</label>
|
||||
</div>
|
||||
<div id="DivMotivoAutorizacion" runat="server" visible="false" class="row">
|
||||
<label class="col-md-2 truncate">Motivo:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtMotivoAutorizacion" CssClass="form-control input-sm" runat="server" Rows="2" TextMode="MultiLine" Width="100%" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMotivo" runat="server" ControlToValidate="TxtMotivoAutorizacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="VgmGuardarAut"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEMotivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVMotivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnSolicitarCredito" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardarAut" />
|
||||
|
||||
@@ -7594,7 +7594,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'VERIFICA SI EL DESCUENTO SUPERA EL SUBTOTAL
|
||||
If ObjDescuento.ImporteDescuento > (Cantidad * PU) Then
|
||||
If ObjDescuento.ImporteDescuento.RoundSQL(2) > (Cantidad * PU).RoundSQL(2) Then
|
||||
Alert("El descuento no puede ser mayor al subtotal", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -21616,7 +21616,7 @@ Partial Class Ventas
|
||||
LimpiaProntoPago()
|
||||
|
||||
'NO PERMITE EDITAR FECHA DEL PAGO
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(260) Then
|
||||
TxtFechaPago.Enabled = False
|
||||
imgCalendario.Visible = False
|
||||
End If
|
||||
@@ -33740,8 +33740,10 @@ Partial Class Ventas
|
||||
DiasVencidos = TxtDiasVencidos.Text.ToEntero()
|
||||
End If
|
||||
|
||||
Dim Motivo As String = TxtMotivoAutorizacion.Text
|
||||
|
||||
Dim ObjPS As New ClsVentas
|
||||
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos) Then
|
||||
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo) Then
|
||||
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
|
||||
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
@@ -33772,10 +33774,12 @@ Partial Class Ventas
|
||||
Case "Ing"
|
||||
If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then
|
||||
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
|
||||
DivMotivoAutorizacion.Visible = True
|
||||
End If
|
||||
Case "Egs"
|
||||
'QUITAR LA DE VENCIMIENTO
|
||||
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
|
||||
DivMotivoAutorizacion.Visible = True
|
||||
End Select
|
||||
UpModalSolicitud.Update()
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user