diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ff30d80b6..5b1a8e42a 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -26820,16 +26820,21 @@ Partial Class Ventas Dim GenerarDevolucionAnticipada As Boolean = False If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Rem") AndAlso Not EsRefacturacion AndAlso ObjFacturaCancelacion.Pagado > 0 Then + CancelacionPagos = OpcionesCancelacionPagos.ConPagos_GenerarIxC + End If + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Rem") AndAlso Not EsRefacturacion Then If ChkDevAlm.Checked Then GenerarDevolucionAnticipada = True End If - For Each Gvr As GridViewRow In GvCancelarRemisiones.Rows - ListaRemisionesCancelar.Add(Gvr.DataKey("CveVenta").ToEntero()) - Next + If ObjFacturaCancelacion.TipoDocto.Contiene("Ing") Then + For Each Gvr As GridViewRow In GvCancelarRemisiones.Rows + ListaRemisionesCancelar.Add(Gvr.DataKey("CveVenta").ToEntero()) + Next + End If - CancelacionPagos = OpcionesCancelacionPagos.ConPagos_GenerarIxC End If resp = ObjFacturaCancelacion.CancelarFactura(If(ChkDevAlm.Checked, 1, 0), ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion, ForzarDevolucion:=GenerarDevolucionAnticipada, CancelacionPagos:=CancelacionPagos)