--Autorizacion de anticipos
This commit is contained in:
@@ -751,6 +751,22 @@ Public Class ClsVentas
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function UpdateVentaAnticipoAutorizado(CveVenta As Integer, Autorizado As Boolean) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Vta_VentaAnticipoAutorizadoUpdate")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||||
|
.Add("@Autorizado", SqlDbType.Bit).Value = Autorizado
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al actualizar el estatus del anticipo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date) As Boolean
|
Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Vta_VentasFechaVencimientoUpdate")
|
DataAdapter("PA_Vta_VentasFechaVencimientoUpdate")
|
||||||
|
|||||||
@@ -2301,6 +2301,12 @@
|
|||||||
<asp:HyperLink ID="HLDevolverDinero" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-usd'></i>" runat="server" />
|
<asp:HyperLink ID="HLDevolverDinero" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-usd'></i>" runat="server" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Autorización" ItemStyle-HorizontalAlign="Center" Visible="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="LnkAutorizar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" runat="server" OnClick="LnkAutorizarAnticipo_Click" />
|
||||||
|
<asp:LinkButton ID="LnkCancelar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-close'></i>" runat="server" OnClick="LnkCancelarAnticipo_Click" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1874,6 +1874,11 @@ Partial Class Clientes
|
|||||||
DtAnticipoHistorial = Nothing
|
DtAnticipoHistorial = Nothing
|
||||||
End If
|
End If
|
||||||
ObjMovtos.Dispose()
|
ObjMovtos.Dispose()
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) Then
|
||||||
|
GVAnticipos.Columns(7).Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
GVAnticipos.DataBind()
|
GVAnticipos.DataBind()
|
||||||
GVAnticiposHistorial.DataBind()
|
GVAnticiposHistorial.DataBind()
|
||||||
|
|
||||||
@@ -1889,7 +1894,6 @@ Partial Class Clientes
|
|||||||
RegistraScript("OrdenarGVAnticiposHistorial();")
|
RegistraScript("OrdenarGVAnticiposHistorial();")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaOrdenesServiciosCliente()
|
Private Sub CargaOrdenesServiciosCliente()
|
||||||
Dim ObjOS As New ClsOS
|
Dim ObjOS As New ClsOS
|
||||||
@@ -2959,8 +2963,22 @@ Partial Class Clientes
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) AndAlso CType(sender, GridView).ID = "GVAnticipos" Then
|
||||||
|
If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString() = "Ant" Then
|
||||||
|
If e.Row.DBCampo("AnticipoAutorizado").ToString() = "False" Then
|
||||||
|
e.Row.FCLinkButton("LnkAutorizar").Visible = True
|
||||||
|
e.Row.FCLinkButton("LnkCancelar").Visible = False
|
||||||
|
Else
|
||||||
|
e.Row.FCLinkButton("LnkAutorizar").Visible = False
|
||||||
|
e.Row.FCLinkButton("LnkCancelar").Visible = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "R H"
|
#Region "R H"
|
||||||
@@ -10691,6 +10709,31 @@ Partial Class Clientes
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Protected Sub LnkAutorizarAnticipo_Click(sender As Object, e As EventArgs)
|
||||||
|
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||||
|
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
|
||||||
|
If CveVenta > 0 Then
|
||||||
|
Using ObjVentas As New ClsVentas
|
||||||
|
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
|
||||||
|
Alert("El anticipo se autorizó correctamente")
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
CargaAnticipos()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs)
|
||||||
|
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||||
|
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
|
||||||
|
If CveVenta > 0 Then
|
||||||
|
Using ObjVentas As New ClsVentas
|
||||||
|
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
|
||||||
|
Alert("El anticipo se desautorizó correctamente")
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
CargaAnticipos()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4615,6 +4615,9 @@
|
|||||||
|
|
||||||
<div style="max-height: 300px; overflow-y: auto;">
|
<div style="max-height: 300px; overflow-y: auto;">
|
||||||
<div class="row" style="margin-left: 0px; text-align: right" align="left">
|
<div class="row" style="margin-left: 0px; text-align: right" align="left">
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:LinkButton ID="LnkRecargaAnticipos" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-refresh'></i> Actualizar" runat="server" OnClick="LnkRecargaAnticipos_Click" />
|
||||||
|
</div>
|
||||||
<div style="margin-right: 15px">
|
<div style="margin-right: 15px">
|
||||||
<input type="text" id="TxtBusquedaAnticipos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
<input type="text" id="TxtBusquedaAnticipos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
|
|||||||
@@ -7194,7 +7194,13 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
ObjCliente.Dispose()
|
ObjCliente.Dispose()
|
||||||
|
|
||||||
If CveCliente > 0 Then CargaAnticipos(CveCliente) : UpAnticipos.Update()
|
If CveCliente > 0 Then
|
||||||
|
CargaAnticipos(CveCliente)
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then
|
||||||
|
LnkRecargaAnticipos.Visible = True
|
||||||
|
End If
|
||||||
|
UpAnticipos.Update()
|
||||||
|
End If
|
||||||
|
|
||||||
If CveCliente > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveVenta <= 0 Then
|
If CveCliente > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveVenta <= 0 Then
|
||||||
DivVentasUsados.Visible = True
|
DivVentasUsados.Visible = True
|
||||||
@@ -16823,6 +16829,12 @@ Partial Class Ventas
|
|||||||
GVAnticipos.Columns(8).Visible = True
|
GVAnticipos.Columns(8).Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then
|
||||||
|
If e.Row.DBCampo("Tipo").ToString() = "Ant" AndAlso e.Row.DBCampo("AnticipoAutorizado").ToString() = "False" Then
|
||||||
|
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Enabled = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If e.Row.DBCampo("CveMoneda").ToString().ToEntero() = DdlMoneda.SelectedValue.ToEntero() Then
|
If e.Row.DBCampo("CveMoneda").ToString().ToEntero() = DdlMoneda.SelectedValue.ToEntero() Then
|
||||||
e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Visible = False
|
e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Visible = False
|
||||||
@@ -38401,5 +38413,10 @@ Partial Class Ventas
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub LnkRecargaAnticipos_Click(sender As Object, e As EventArgs)
|
||||||
|
If CveCliente > 0 Then
|
||||||
|
CargaAnticipos(CveCliente)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user