feat: add BT-120 VAT exemption reason#247
Conversation
Greptile SummaryThis PR implements BT-120 (VAT exemption reason text) support for the EU e-invoice module by adding a "Default VAT exemption reason" setting in Confidence Score: 5/5Safe to merge — the feature is correctly scoped, BT-120 text is only emitted alongside BT-121 code, and import round-tripping is handled consistently. All changes are well-scoped: the exemption reason text is fetched once per invoice generation and applied only where the exemption reason code is already emitted, keeping BT-120 and BT-121 in sync. The import path is None-safe. No blocking issues were found. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as E Invoice Settings UI
participant DB as Frappe DB
participant Gen as EInvoiceGenerator
participant XML as CII XML
UI->>DB: Save vat_exemption_reason_text (BT-120)
note over Gen: create_einvoice()
Gen->>DB: get_single_value("E Invoice Settings", "vat_exemption_reason_text")
DB-->>Gen: reason_text (or "")
alt Zero-rate item (rate == 0)
Gen->>XML: set exemption_reason_code (BT-121)
Gen->>XML: set exemption_reason (BT-120) via _set_optional_vat_exemption_reason_text
end
alt No taxes (empty invoice)
Gen->>XML: set exemption_reason_code (BT-121)
Gen->>XML: set exemption_reason (BT-120) via _set_optional_vat_exemption_reason_text
end
note over Gen: Import flow (e_invoice_import.py)
XML-->>Gen: parse tax.exemption_reason._text
Gen->>DB: store in E Invoice Trade Tax.vat_exemption_reason_text
Reviews (1): Last reviewed commit: "feat: add BT-120 VAT exemption reason" | Re-trigger Greptile |
|
@Mergifyio backport version-16-hotfix version-15-hotfix |
✅ Backports have been createdDetails
Cherry-pick of cec83b5 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
Cherry-pick of cec83b5 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Adds a BT-120 textfield for the VAT exemption reason to the E-Invoice Settings: #183