Total:
diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb
index d1958d9ca..734b66b09 100644
--- a/Ventas/PVCobranza.aspx.vb
+++ b/Ventas/PVCobranza.aspx.vb
@@ -520,7 +520,7 @@ Partial Class Ventas_PVCobranza
HdnVentaCondicionesPago.Value = GvRow.DataKey("CondicionesPago")
HdnPlazoCobranza.Value = GvRow.DataKey("PlazoCobranza")
- If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) AndAlso GvRow.DataKey("TipoDocto") = "Rem" Then
+ If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) AndAlso GvRow.DataKey("TipoDocto").Contiene("Rem", "Ant") Then
DivAnticipo.Visible = True
ImgAntiPend.Visible = True
End If
@@ -2247,43 +2247,32 @@ Partial Class Ventas_PVCobranza
Protected Sub ImgAntiPend_Click(sender As Object, e As EventArgs)
- Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
-
- 'If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
- ' If DdlTipoAmortizacionAnticipo.Items.FindByValue("4") Is Nothing Then
- ' DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4"))
- ' End If
- ' DdlTipoAmortizacionAnticipo.SelectedValueExist("4")
-
- ' DdlTipoRelacionAnticipo.SelectedValueExist("-1")
-
- ' divAmortizacionTipoRelacion.Visible = False
-
- ' DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty)
- 'End If
+ VerificaCargaAnticipo()
+ UpAnticipos.Update()
+ RegistraScript("$('#DivAnticipos').modal();", "AE")
+ End Sub
+ Private Sub VerificaCargaAnticipo()
+ Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
Dim DbRowVenta As DataRow = Nothing
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
End If
ObjVentas.Dispose()
-
+ Dim tTipoDocto As String
If DbRowVenta IsNot Nothing Then
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
CveVendedor = DbRowVenta("CveVendedor").ToString().ToEntero()
+ tTipoDocto = DbRowVenta("TipoDocto").ToString()
End If
If CveCliente > 0 Then
- CargaAnticipos(CveCliente)
+ CargaAnticipos(CveCliente, tTipoDocto)
End If
-
- UpAnticipos.Update()
-
- RegistraScript("$('#DivAnticipos').modal();", "AE")
End Sub
- Private Sub CargaAnticipos(CveCliente As Integer)
+ Private Sub CargaAnticipos(CveCliente As Integer, TipoDocto As String)
If CveCliente > 0 Then
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then
@@ -2291,48 +2280,34 @@ Partial Class Ventas_PVCobranza
End If
ObjMovtos.Dispose()
+ Dim TipoAnticipo As String = "'NC','IxC','Ant'"
+ If TipoDocto = "Ant" Then TipoAnticipo = " 'IxC' "
+
If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing Then
- GVAnticipos.DataSource = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"ISTotal = 0 AND Saldo > 0 AND Tipo IN('NC','IxC','Ant') ")
- Else
- GVAnticipos.DataSource = Nothing
+ GVAnticipos.DataSource = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"ISTotal = 0 AND Saldo > 0 AND Tipo IN ({TipoAnticipo}) ")
+ Else
+ GVAnticipos.DataSource = Nothing
+ End If
+
+ GVAnticipos.Columns(5).Visible = False
+ GVAnticipos.Columns(9).Visible = False
+
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ GVAnticipos.Columns(7).Visible = True
+ End If
+
+ GVAnticipos.DataBind()
+
+ If ListaAnticiposAplicados IsNot Nothing Then
+ ListaAnticiposAplicados.Clear()
+ End If
+ TxtNCDev.Text = "0.00"
End If
-
- GVAnticipos.Columns(5).Visible = False
- GVAnticipos.Columns(9).Visible = False
-
- If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
- GVAnticipos.Columns(7).Visible = True
- End If
-
- GVAnticipos.DataBind()
-
- If ListaAnticiposAplicados IsNot Nothing Then
- ListaAnticiposAplicados.Clear()
- End If
- TxtNCDev.Text = "0.00"
- End If
- UpAnticipos.Update()
+ UpAnticipos.Update()
End Sub
Protected Sub LnkRecargaAnticipos_Click(sender As Object, e As EventArgs)
- Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
-
- If CveCliente <= 0 Then
- Dim DbRowVenta As DataRow = Nothing
- Dim ObjVentas As New ClsVentas
- If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
- DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
- End If
- ObjVentas.Dispose()
-
- If DbRowVenta IsNot Nothing Then
- CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
- End If
- End If
-
- If CveCliente > 0 Then
- CargaAnticipos(CveCliente)
- End If
+ VerificaCargaAnticipo()
End Sub
Protected Sub LnkSolicitarActivarAnticipo_Click(sender As Object, e As EventArgs)