This commit is contained in:
2025-01-16 09:14:12 -07:00
12 changed files with 419 additions and 403 deletions

View File

@@ -26,6 +26,18 @@ Partial Class Ventas_PVCobranza
End Set
End Property
Private Property CveVendedor As Integer
Get
If ViewState("CveVendedor") Is Nothing Then
ViewState("CveVendedor") = -1
End If
Return ViewState("CveVendedor").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveVendedor") = value
End Set
End Property
Private Property CveVentaCancelacion As Integer
Get
If ViewState("CveVentaCancelacion") Is Nothing Then
@@ -999,6 +1011,8 @@ Partial Class Ventas_PVCobranza
LtlTipoAnticipo.Text = ""
HdnTipoAmortizacion.Value = ""
CveCliente = -1
CveVendedor = -1
If TmpDTAnticiposNCIxCCliente IsNot Nothing Then
TmpDTAnticiposNCIxCCliente.Clear()
@@ -1988,17 +2002,16 @@ Partial Class Ventas_PVCobranza
DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty)
End If
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()
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()
If DbRowVenta IsNot Nothing Then
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
End If
If DbRowVenta IsNot Nothing Then
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
CveVendedor = DbRowVenta("CveVendedor").ToString().ToEntero()
End If
If CveCliente > 0 Then
@@ -2154,6 +2167,19 @@ Partial Class Ventas_PVCobranza
End If
End If
Dim CveVenta As Integer = gvr.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = gvr.DataKey("CveIE").ToEntero()
Dim ObjVta As New ClsVentas
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, gvr.DataKey("CveCliente").ToEntero(), CveVendedor, Importe, 0, UsuarioActual.CveUsuario, 1, TipoDocumento:="Ant", DiasVencidos:=1, CveVenta:=CveVenta, CveIE:=CveIE) Then
Dim msgAlert = "La autorización se agregó correctamente."
If EnvioMsg Then
msgAlert = $"{msgAlert} Se envió una notificación de autorización a los usuarios"
End If
Alert(msgAlert, TipoMensaje.MsgInformacion)
End If
ObjVta.Dispose()
UpAnticipos.Update()
End Sub
@@ -2320,20 +2346,19 @@ Partial Class Ventas_PVCobranza
DivConceptoNC.Visible = False
End If
If CveCliente <= 0 Then
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero
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
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero
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()
CveVendedor = DbRowVenta("CveVendedor").ToString().ToEntero()
End If
If CveCliente > 0 Then
CargaAnticipos(CveCliente)