From 80019fcb0422fb51fbaae4c272ffed92fd7ca840 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 5 Sep 2024 20:42:10 -0700 Subject: [PATCH] =?UTF-8?q?Puntos=20GDiaz:=20--Pol=C3=ADtica.=20Las=20canc?= =?UTF-8?q?elaciones=20de=20facturas=20en=20el=20mismo=20d=C3=ADa=20de=20f?= =?UTF-8?q?acturaci=C3=B3n=20deber=C3=A1n=20cancelarse=20el=20pago,.=20Las?= =?UTF-8?q?=20devoluciones=20de=20d=C3=ADas=20anteriores,=20de=20las=20fac?= =?UTF-8?q?turas=20pagadas,=20se=20aplican=20ala=20nueva=20factura=20relac?= =?UTF-8?q?ion=C3=A1ndola=20entre=20s=C3=AD=20y=20sin=20emitir=20alg=C3=BA?= =?UTF-8?q?n=20otro=20cfdi,=20que=20no=20sea=20el=20propio=20ingreso.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx.vb | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index fe46d8524..2a0453b04 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1370,6 +1370,15 @@ Partial Class Ventas End Set End Property + Private Property ListaDevolucionesAplicadas As List(Of Modelos.MAnticipoRelacionado) + Get + Return If(IsNothing(ViewState("ListaDevolucionesAplicadas")), Nothing, CType(ViewState("ListaDevolucionesAplicadas"), List(Of Modelos.MAnticipoRelacionado))) + End Get + Set(value As List(Of Modelos.MAnticipoRelacionado)) + ViewState("ListaDevolucionesAplicadas") = value + End Set + End Property + Private Property CveTimbreCartaPorteVenta As Integer Get Return If(IsNothing(ViewState("CveTimbreCartaPorteVenta")), -1, ViewState("CveTimbreCartaPorteVenta").ToString().ToEntero()) @@ -10981,6 +10990,10 @@ Partial Class Ventas ListaAnticiposAplicados.Clear() End If + If ListaDevolucionesAplicadas IsNot Nothing Then + ListaDevolucionesAplicadas.Clear() + End If + 'ENVIAR POLIZA VIRTUAL If ErrorList.Count = 0 Then If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then @@ -13505,6 +13518,26 @@ Partial Class Ventas Next End If + 'DEVOLUCIONES DE OTRA VENTA, APLICADAS EN UNA NUEVA + If UsuarioActual.CveEmpresa.Contiene(1, 189) AndAlso Obj.TipoDocto = "Ing" AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then + If ListaDevolucionesAplicadas IsNot Nothing AndAlso ListaDevolucionesAplicadas.Count > 0 Then + Timbre.CFDIRelacionados.UUID.Clear() + For Each Dev As Modelos.MAnticipoRelacionado In ListaDevolucionesAplicadas + Timbre.CFDIRelacionados.UUID.Add(Dev.FolioFiscal) + Next + + 'TEMPORAL- DEBE SER TIPO RELACION "01 - Nota de crédito de los documentos relacionados" + Dim CveTipoRelacion As Integer = 1 + + Obj.CveTipoRelacion = CveTipoRelacion + + Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {CveTipoRelacion}") + + Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString() + Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString() + End If + End If + Dim totSubTotal As Decimal = Obj.SubTotal Dim totIVA As Decimal = Obj.IVA Dim totRetIVA As Decimal = Obj.RetIVA @@ -17471,6 +17504,12 @@ Partial Class Ventas ListaAnticiposAplicados = New List(Of Modelos.MAnticipoRelacionado) End If + If ListaDevolucionesAplicadas IsNot Nothing Then + ListaDevolucionesAplicadas.Clear() + Else + ListaDevolucionesAplicadas = New List(Of Modelos.MAnticipoRelacionado) + End If + HdnIVACalculado.Value = HdnIVAOriginal.Value For Each gvr As GridViewRow In GVAnticipos.Rows If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3) Then @@ -17481,6 +17520,13 @@ Partial Class Ventas 'CvePSAmortizacion = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", "CveConceptoContable = 11").ToEntero() End If + + 'AGREGAR LAS DEV + If UsuarioActual.CveEmpresa.Contiene(1, 189) AndAlso DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("4") Then + If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(12) Then + ListaDevolucionesAplicadas.Add(New Modelos.MAnticipoRelacionado() With {.CveVenta = gvr.DataKey("CveVenta").ToEntero(), .FolioFiscal = gvr.DataKey("FolioFiscal")}) + End If + End If Next 'Amortizacion += TmpDTImpuestos.SUM("Importe").ToDecimal 'RMF. 2018.12.20- saque de la jugada en la amortización los impuestos locales