diff --git a/Ventas/CatAutorizacionLimites.aspx b/Ventas/CatAutorizacionLimites.aspx
index 43d8496b1..141f85fc6 100644
--- a/Ventas/CatAutorizacionLimites.aspx
+++ b/Ventas/CatAutorizacionLimites.aspx
@@ -123,7 +123,7 @@
diff --git a/Ventas/CatAutorizacionLimites.aspx.vb b/Ventas/CatAutorizacionLimites.aspx.vb
index fa753e9fe..944b72d84 100644
--- a/Ventas/CatAutorizacionLimites.aspx.vb
+++ b/Ventas/CatAutorizacionLimites.aspx.vb
@@ -62,10 +62,6 @@ Partial Class Ventas_CatAutorizacionLimites
DdlEstatus.SelectedValue = "0"
- If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
- DivAntNCIxC.Visible = True
- End If
-
UpModal.Update()
End Sub
Private Sub CargaDatos()
@@ -87,10 +83,6 @@ Partial Class Ventas_CatAutorizacionLimites
ObjGral.Dispose()
GvDatos.DataBind()
- If DivAntNCIxC.Visible Then
- CargaAnticipos(CveCliente, FechaI, FechaF)
- End If
-
UpDatos.Update()
End Sub
@@ -225,6 +217,10 @@ Partial Class Ventas_CatAutorizacionLimites
'cuando es la modalidad 3, es autorización directa sobre la venta ya asociada a la solicitud.
If UsuarioActual.Empresa.Funcionalidad(595) = "3" Then CveEstatusAutorizacion = 2
+ If gvRow.DataKey("TipoDocumento") = "Anticipo" Then
+ CveEstatusAutorizacion = 1
+ End If
+
Dim Importe As Decimal = gvRow.DataKey("Importe").ToDecimal().RoundSQL(2)
'AUTORIZACION DE IMPORTE,
'el cliente limite de 500, y saldo de 501. autorización que puede autorizar no puede ser mayor a 49 ( limite * 1.% - Saldo)
@@ -376,130 +372,4 @@ Partial Class Ventas_CatAutorizacionLimites
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
End Sub
#End Region
-
- Private Sub CargaAnticipos(CveCliente As Integer, FechaI As DateTime, FechaF As DateTime)
-
- Dim ObjMovtos As New ClsMovimientos()
- If ObjMovtos.GetAnticiposNCIxCAutorizaciones(CveCliente, UsuarioActual.CveEmpresa, FechaI, FechaF) Then
- GVAnticipos.DataSource = ObjMovtos.DtResultados
- End If
- ObjMovtos.Dispose()
-
- GVAnticipos.DataBind()
-
- End Sub
-
- 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()
- Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
- Dim CveCliente = GvRow.DataKey("CveCliente").ToEntero()
-
- If CveVenta > 0 OrElse CveIE > 0 Then
- Dim Actualizo As Boolean = False
-
- Using ObjVentas As New ClsVentas
- If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
- If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
- Alert("El anticipo se autorizó correctamente")
- Actualizo = True
- End If
- ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
- If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
- Alert("El anticipo se autorizó correctamente")
- Actualizo = True
- End If
- End If
- End Using
-
- If Actualizo Then
- Dim ObjEventoBitacora As New ClsOIEventos
- ObjEventoBitacora.AddEventoBitacora($"El anticipo se autorizó correctamente. Folio:
{GvRow.DataKey("Folio")}", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1)
- ObjEventoBitacora.Dispose()
- End If
-
- CargaDatos()
-
- End If
-
- UpDatos.Update()
- 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()
- Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
- Dim CveCliente = GvRow.DataKey("CveCliente").ToEntero()
-
- If CveVenta > 0 OrElse CveIE > 0 Then
- Dim Actualizo As Boolean = False
- Using ObjVentas As New ClsVentas
- If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
- If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
- Alert("El anticipo se desautorizó correctamente")
- Actualizo = True
- End If
- ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
- If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
- Alert("El anticipo se desautorizó correctamente")
- Actualizo = True
- End If
- End If
- End Using
-
- If Actualizo Then
- Dim ObjEventoBitacora As New ClsOIEventos
- ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio:
{GvRow.DataKey("Folio")}", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1)
- ObjEventoBitacora.Dispose()
- End If
-
- CargaDatos()
-
- End If
-
- UpDatos.Update()
- End Sub
-
- Protected Sub GVAnticipos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAnticipos.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- Dim AnticipoAutorizado = CBool(e.Row.DBCampo("AnticipoAutorizado"))
-
- If AnticipoAutorizado Then
- e.Row.FCLabel("LblEstatus").CssClass = "badge badge-success"
- Else
- e.Row.FCLabel("LblEstatus").CssClass = "badge badge-danger"
- End If
-
- If e.Row.DataKey("CveIE").ToString().ToEntero() > 0 Then
- e.Row.FCLiteral("LtlFactura").Text = String.Format("
{1}", e.Row.DataKey("CveIE"), e.Row.DataKey("Folio"))
- Else
- e.Row.FCLiteral("LtlFactura").Text = String.Format("
{1}", e.Row.DataKey("CveVenta"), e.Row.DataKey("Folio"))
- End If
-
- If UsuarioActual.TienePermisoProceso(379) Then
- If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant") Then
- If Not AnticipoAutorizado 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
-
- If e.Row.DBCampo("CveIE").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("IxC") Then
- If Not AnticipoAutorizado 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 Sub
End Class
diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx
index f18c8db96..be1803d7e 100644
--- a/Ventas/Clientes.aspx
+++ b/Ventas/Clientes.aspx
@@ -2342,12 +2342,12 @@
-
+ <%--
-
+ --%>
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index 3341f52e7..a216b96a8 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -1946,9 +1946,9 @@ Partial Class Clientes
End If
ObjMovtos.Dispose()
- If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) Then
- GVAnticipos.Columns(7).Visible = True
- End If
+ 'If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) Then
+ ' GVAnticipos.Columns(7).Visible = True
+ 'End If
GVAnticipos.DataBind()
GVAnticiposHistorial.DataBind()
@@ -10753,82 +10753,82 @@ Partial Class Clientes
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()
- Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
+ '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()
+ ' Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
- If CveVenta > 0 OrElse CveIE > 0 Then
- Dim Actualizo As Boolean = False
+ ' If CveVenta > 0 OrElse CveIE > 0 Then
+ ' Dim Actualizo As Boolean = False
- Using ObjVentas As New ClsVentas
- If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
- If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
- Alert("El anticipo se autorizó correctamente")
- Actualizo = True
- End If
- ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
- If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
- Alert("El anticipo se autorizó correctamente")
- Actualizo = True
- End If
- End If
- End Using
+ ' Using ObjVentas As New ClsVentas
+ ' If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
+ ' If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
+ ' Alert("El anticipo se autorizó correctamente")
+ ' Actualizo = True
+ ' End If
+ ' ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
+ ' If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
+ ' Alert("El anticipo se autorizó correctamente")
+ ' Actualizo = True
+ ' End If
+ ' End If
+ ' End Using
- If Actualizo Then
- Dim ObjEventoBitacora As New ClsOIEventos
- If ObjEventoBitacora.AddEventoBitacora($"El anticipo se autorizó correctamente. Folio: