Skip to content

feat: add BT-120 VAT exemption reason (backport #247)#254

Merged
barredterra merged 5 commits into
version-16-hotfixfrom
mergify/bp/version-16-hotfix/pr-247
Jun 8, 2026
Merged

feat: add BT-120 VAT exemption reason (backport #247)#254
barredterra merged 5 commits into
version-16-hotfixfrom
mergify/bp/version-16-hotfix/pr-247

Conversation

@mergify

@mergify mergify Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Adds a BT-120 textfield for the VAT exemption reason to the E-Invoice Settings: #183


This is an automatic backport of pull request #247 done by Mergify.

(cherry picked from commit cec83b5)

# Conflicts:
#	eu_einvoice/locale/de.po
#	eu_einvoice/locale/main.pot
@mergify mergify Bot added the conflicts label Apr 27, 2026
@mergify

This comment was marked as outdated.

@greptile-apps

greptile-apps Bot commented Apr 27, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

This PR is safe to merge; it adds a new optional field with purely additive changes and no breaking modifications to existing logic.

The change is strictly additive: a new nullable text field in settings and two child-doctype columns. BT-120 is only written when the field is non-empty and only alongside an already-emitted BT-121, which matches the EN16931 constraint. The import path correctly guards the None case. The defensive getattr fix for supplier_numbers is a safe improvement. No migration or schema-breaking change is required for existing installs because all new fields are optional/nullable.

No files require special attention.

Sequence Diagram

sequenceDiagram
    participant EIG as EInvoiceGenerator
    participant DB as frappe.db
    participant TT as ApplicableTradeTax

    EIG->>DB: get_single_value("E Invoice Settings", "vat_exemption_reason_text")
    DB-->>EIG: "vat_exemption_reason_text (str | None)"

    alt "Item-level tax, rate == 0"
        EIG->>TT: set exemption_reason_code (BT-121)
        EIG->>TT: _set_optional_vat_exemption_reason_text → exemption_reason (BT-120)
    end

    alt No taxes on document (_add_empty_tax)
        EIG->>TT: set exemption_reason_code (BT-121)
        EIG->>TT: _set_optional_vat_exemption_reason_text → exemption_reason (BT-120)
    end

    note over EIG,TT: BT-120 only written when vat_exemption_reason_text is non-empty

    participant EII as EInvoiceImport
    participant XML as Parsed CII XML

    XML-->>EII: tax.exemption_reason._text
    EII->>EII: store as vat_exemption_reason_text on E Invoice Trade Tax row
Loading

Reviews (2): Last reviewed commit: "Merge remote-tracking branch 'origin/ver..." | Re-trigger Greptile

Comment thread eu_einvoice/locale/de.po Outdated
Comment thread eu_einvoice/locale/main.pot Outdated
@dafrose dafrose removed the conflicts label Jun 5, 2026
@barredterra

Copy link
Copy Markdown
Member

@greptileai

@barredterra barredterra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, LGTM

@barredterra barredterra merged commit 3b44291 into version-16-hotfix Jun 8, 2026
6 checks passed
@barredterra barredterra deleted the mergify/bp/version-16-hotfix/pr-247 branch June 8, 2026 12:07
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.

3 participants