From e8a993f3facf2816489af7b44d663fbb1b8585b7 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 19 Apr 2024 18:01:29 -0700 Subject: [PATCH] --FIX, cerrar corte de caja al dia siguiente --Anticipos de publico general en otros clientes --- Ventas/Ventas.aspx.vb | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 0706e5dba..87fd3ae4a 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3746,7 +3746,7 @@ Partial Class Ventas If ObjPVenta.DtResultados.Rows.Count > 0 Then CveCorte = ObjPVenta.CveCorte Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-5) - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < NowADS().Date Then + If (UsuarioActual.Empresa.Funcionalidad(531) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1") AndAlso FechaICorte < NowADS().Date Then DebeCerrarCorte = True LblMotivoBloqueo.Text = $"Existe un corte del día {FechaICorte.ToString("dd/MM/yyyy")}. Favor de cerrarlo para iniciar un nuevo corte." Else @@ -16501,8 +16501,25 @@ Partial Class Ventas Dim ObjMovtos As New ClsMovimientos() If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then - Me.TmpDTAnticiposNCIxCCliente = ObjMovtos.DtResultados.Copy() + End If + + 'AGREGAR LOS ANTICIPOS, DEV, IxC QUE ESTEN EN PUBLICO GENERAL + If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso UsuarioActual.CveEmpresa = 190 Then + Dim CveClientePublicoGeneral = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() + If CveClientePublicoGeneral > 0 Then + If CveCliente <> CveClientePublicoGeneral Then + If ObjMovtos.GetAnticiposNCIxCCliente(CveClientePublicoGeneral) Then + For Each DrGeneral As DataRow In ObjMovtos.DtResultados.Rows + Me.TmpDTAnticiposNCIxCCliente.Rows.Add(DrGeneral.ItemArray) + Next + End If + End If + End If + End If + ObjMovtos.Dispose() + + If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing Then Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}") If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then @@ -16516,7 +16533,6 @@ Partial Class Ventas Else GVAnticipos.DataSource = Nothing End If - ObjMovtos.Dispose() If CveVenta <= 0 OrElse (EsCreaApartirDe Or CveDevolucion > 0) Then divAmortizacionTipo.Visible = True