From 5cdae6421c6fa4cbde38d61691d58ba274f4ded6 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 4 Jan 2025 12:27:20 -0700 Subject: [PATCH] =?UTF-8?q?--=20activaci=C3=B3n=20para=20devoluci=C3=B3nes?= =?UTF-8?q?=20de=20facturas=20del=202024=20E189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx.vb | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ce4681dde..1fbacf4dc 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -10,6 +10,7 @@ Imports System.Security.Cryptography.X509Certificates Imports ADSNetLibrary.SIGAPI.Models.CRM.Request Imports ADSNetLibrary.SIGAPI.Services.CRM Imports ADSTimbrado +Imports com.itextpdf.text.pdf.languages Imports Extensiones Imports Microsoft.Reporting.WebForms Imports Modelos @@ -7777,8 +7778,9 @@ Partial Class Ventas End If End If - - If Not EsFilial AndAlso (((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta <= 0) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot", "Rem") AndAlso CveVenta > 0)) AndAlso RBLPago.SelectedValue = "1" AndAlso PermiteCredito) Then + Dim tTipoDocto As String = "" + If ValorAutorizacion = "3" Then tTipoDocto = "Rem" + If Not EsFilial AndAlso (((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta <= 0) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot", tTipoDocto) AndAlso CveVenta > 0)) AndAlso RBLPago.SelectedValue = "1" AndAlso PermiteCredito) Then 'FUNCIONALIDAD 702 - NO VERIFICAR LIMITE DE CRÉDITO Y CANDADOS DE VENTA If Not UsuarioActual.Empresa.Funcionalidad(702) = "1" Then @@ -9437,7 +9439,7 @@ Partial Class Ventas Private Sub GvInv_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(567) = "1" OrElse (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Dev") Then e.Row.FCCheckBox("cbInv").Checked = True End If @@ -16513,7 +16515,7 @@ Partial Class Ventas Next End If - If UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Dev") AndAlso DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then + If factura.TipoDocto.Contiene("Ing", "Dev") AndAlso DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then Dim Filtro As String = "" Select Case factura.TipoDocto @@ -16601,12 +16603,22 @@ Partial Class Ventas If drPU IsNot Nothing Then PU = drPU("PU").ToString.ToDecimal Else - 'sino se encontró valor, manda mensaje - ErrorList.Add("Ocurrió un error al obtener el costo.
") - OcurrioError = True - Exit For + 'OBTENGO EL ÚLTIMO COSTO + Dim ObjInventarios As New ClsInventarios + If ObjInventarios.GetUltimoCosto(UsuarioActual.CveEmpresa, Dr("CvePS").ToString.ToEntero) Then + Dim drcosto As DataRow = ObjInventarios.DtResultados.FiltroPrimero("") + If drcosto IsNot Nothing Then + PU = drcosto("UltimoCosto").ToString.ToDecimal + End If + End If + ObjInventarios.Dispose() + If PU <= 0 Then + 'sino se encontró valor, manda mensaje + ErrorList.Add("Ocurrió un error al obtener el costo.
") + OcurrioError = True + Exit For + End If End If - End If Dim CveSeccionAlmacen As Integer = -3 'If AplicaSeccion Then CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacen, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen", "").ToEntero @@ -32163,7 +32175,7 @@ Partial Class Ventas LimpiaDocumentoDEV() - If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(567) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1" Then DivAlmacen.Visible = True LltSalidaAlmacen.Text = "Devolución Almacen" @@ -38775,7 +38787,8 @@ Partial Class Ventas End Using Dim PuedeAplicarDevolucion As Boolean = False - + 'código temporal RMF. para devoluciones de facturas cargadas de saldos iniciales. + If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso TxtFecha.Text.ToDate.Year < 2025 Then SaldoAlmacen = -1 If SaldoAlmacen < 0 Then If DevolucionAlmacen = 0 Then PuedeAplicarDevolucion = True