From ee57d2e4a1ed57097f4ecbb66acf60df648ef44e Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 8 Apr 2024 19:21:48 -0700 Subject: [PATCH] --Cancelacion de solo CFDI. unicamente para usuario 'Sistema' --- Ventas/Ventas.aspx | 4 ++-- Ventas/Ventas.aspx.vb | 50 +++++++++++++++++++++---------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 7369990c9..c41799abf 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -391,9 +391,9 @@
  • Solicitar autorización de crédito
  • - <%--
  • +
  • Cancelar solo CFDI -
  • --%> +
  • Agregar Orden de Servicio diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 5c1359c8a..983eff420 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2386,11 +2386,6 @@ Partial Class Ventas If Not IsPostBack Then - ''SOLO SISTEMA DEBE VER ESTA OPCION - 'If UsuarioActual.CveUsuario = 100 Then - ' LnkCancelarSoloCFDI.Visible = True - 'End If - If IfNull(Request("Opcionx"), "").ToString = "Saldar" And UsuarioActual.CveUsuario = 100 Then TxtFechaSaldarVenta.Text = "2021/12/31" SaldarVenta() @@ -2897,6 +2892,11 @@ Partial Class Ventas HlEvento.Visible = True HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveVenta=" & CveVenta & "&TB_iframe=true&height=370&width=600;" + ''SOLO SISTEMA DEBE VER ESTA OPCION + If UsuarioActual.CveUsuario = 100 Then + LnkCancelarSoloCFDI.Visible = True + End If + End If Else TxtFechaOS.Text = NowADS().ToDateTime.ToString("yyyy-MM-dd HH:mm").Replace(" ", "T") @@ -37750,29 +37750,29 @@ Partial Class Ventas #End Region - 'Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs) - ' If CveVenta > 0 Then - ' Dim RowVenta As DataRow = Nothing + Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs) + If CveVenta > 0 Then + Dim RowVenta As DataRow = Nothing - ' Using ObjVentas As New ClsVentas - ' If (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa)) Then - ' RowVenta = ObjVentas.DtResultados.Copy().Rows(0) - ' End If - ' End Using + Using ObjVentas As New ClsVentas + If (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa)) Then + RowVenta = ObjVentas.DtResultados.Copy().Rows(0) + End If + End Using - ' If RowVenta IsNot Nothing Then - ' Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim() - ' Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal() - ' Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString() - ' Dim ObjTimbrado As New Timbrado - ' Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=4, ValidaFactura:=False, CveSATMotivoCancelacion:=2) - ' If resp IsNot Nothing Then - ' Alert(resp.Estado) - ' End If + If RowVenta IsNot Nothing Then + Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim() + Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal() + Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString() + Dim ObjTimbrado As New Timbrado + Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=4, ValidaFactura:=False, CveSATMotivoCancelacion:=2) + If resp IsNot Nothing Then + Alert(resp.Estado) + End If - ' End If - ' End If - 'End Sub + End If + End If + End Sub Protected Sub LBNotaCredito_Click(sender As Object, e As EventArgs) CargaDdlNCPS()