Skip to content

feat: Generate credit note validate License #3848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 19, 2025

Conversation

brunomiguelpinto
Copy link
Contributor

@brunomiguelpinto brunomiguelpinto commented Jun 18, 2025

Context

Voiding an invoice with the [generate_credit_note]

flag should be exclusive to organizations on a Premium license.
Prior to this change, non-premium tenants could still try to generate credit notes through the void-invoice path, bypassing licensing rules this would lead to a 500 error on the server

Description

Added a guard clause in Invoices::VoidService#call:

    def generate_credit_note_allowed?
      return true unless generate_credit_note   # nothing requested
      License.premium?                          # licence check
    end

@brunomiguelpinto brunomiguelpinto changed the title feat: WIP regenerate feat: Generate credit note validate License Jun 19, 2025
@brunomiguelpinto brunomiguelpinto self-assigned this Jun 19, 2025
@brunomiguelpinto brunomiguelpinto merged commit b162bef into main Jun 19, 2025
14 checks passed
@brunomiguelpinto brunomiguelpinto deleted the feat-check-license-when-voiding branch June 19, 2025 17:23
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context
Voiding an invoice with the [generate_credit_note]

flag should be exclusive to organizations on a Premium license.  
Prior to this change, non-premium tenants could still try to generate
credit notes through the void-invoice path, bypassing licensing rules
this would lead to a 500 error on the server

## Description
Added a guard clause in `Invoices::VoidService#call`:

```ruby
    def generate_credit_note_allowed?
      return true unless generate_credit_note   # nothing requested
      License.premium?                          # licence check
    end
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants