Skip to content

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

Open
mergify[bot] wants to merge 1 commit intoversion-15-hotfixfrom
mergify/bp/version-15-hotfix/pr-247
Open

feat: add BT-120 VAT exemption reason (backport #247)#255
mergify[bot] wants to merge 1 commit intoversion-15-hotfixfrom
mergify/bp/version-15-hotfix/pr-247

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Apr 27, 2026

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
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Apr 27, 2026

Cherry-pick of cec83b5 has failed:

On branch mergify/bp/version-15-hotfix/pr-247
Your branch is up to date with 'origin/version-15-hotfix'.

You are currently cherry-picking commit cec83b5.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   eu_einvoice/european_e_invoice/custom/sales_invoice.py
	modified:   eu_einvoice/european_e_invoice/doctype/e_invoice_import/e_invoice_import.py
	modified:   eu_einvoice/european_e_invoice/doctype/e_invoice_settings/e_invoice_settings.json
	modified:   eu_einvoice/european_e_invoice/doctype/e_invoice_settings/e_invoice_settings.py
	modified:   eu_einvoice/european_e_invoice/doctype/e_invoice_trade_tax/e_invoice_trade_tax.json
	modified:   eu_einvoice/european_e_invoice/doctype/e_invoice_trade_tax/e_invoice_trade_tax.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   eu_einvoice/locale/de.po
	both modified:   eu_einvoice/locale/main.pot

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

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This backport of #247 adds a configurable BT-120 VAT exemption reason text field to E Invoice Settings and correctly wires it into both the export path (written only to zero-rated/exempt trade-tax lines) and the import path (read from exemption_reason._text on parsed XML).

  • Blocker: eu_einvoice/locale/de.po and eu_einvoice/locale/main.pot both contain unresolved git merge conflict markers (<<<<<<< HEAD / ======= / >>>>>>>). These make both files unparseable by any standard .po/.pot tool, which will break the German translation catalogue at runtime. The conflicts must be resolved before merging.

Confidence Score: 1/5

Not safe to merge — unresolved git conflict markers in both locale files will break translation loading at runtime.

Two P0 findings (unresolved merge conflicts in de.po and main.pot) pull the score to the floor. The Python and JSON changes themselves are correct and well-structured.

eu_einvoice/locale/de.po and eu_einvoice/locale/main.pot must have their merge conflicts resolved.

Important Files Changed

Filename Overview
eu_einvoice/locale/de.po Contains multiple unresolved git merge conflict markers; file is not parseable as a valid .po file
eu_einvoice/locale/main.pot Contains multiple unresolved git merge conflict markers; file is not parseable as a valid .pot template
eu_einvoice/european_e_invoice/custom/sales_invoice.py Adds BT-120 exemption reason text to trade tax entries; correctly guards application to zero-rated/exempt lines only; also adds a safe getattr guard for supplier_numbers
eu_einvoice/european_e_invoice/doctype/e_invoice_import/e_invoice_import.py Parses BT-120 exemption reason text from imported XML using the same sentinel-accessor pattern used for other fields; adds from future import annotations
eu_einvoice/european_e_invoice/doctype/e_invoice_settings/e_invoice_settings.json Adds new Section Break and Small Text field for the global default VAT exemption reason text
eu_einvoice/european_e_invoice/doctype/e_invoice_trade_tax/e_invoice_trade_tax.json Adds read-only vat_exemption_reason_text Small Text field to the child table used when importing e-invoices
eu_einvoice/european_e_invoice/doctype/e_invoice_settings/e_invoice_settings.py Adds auto-generated type hint for the new vat_exemption_reason_text field; no logic changes
eu_einvoice/european_e_invoice/doctype/e_invoice_trade_tax/e_invoice_trade_tax.py Adds auto-generated type hint for the new vat_exemption_reason_text field; no logic changes

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[EInvoiceGenerator.create_einvoice] -->|reads once| B[frappe.db.get_single_value\nE Invoice Settings\nvat_exemption_reason_text]
    B --> C[self.vat_exemption_reason_text]
    C --> D[_add_item]
    D -->|rate == 0| E[set exemption_reason_code]
    E --> F[_set_optional_vat_exemption_reason_text\nli.settlement.trade_tax]
    C --> G[_add_empty_tax]
    G --> H[set exemption_reason_code]
    H --> I[_set_optional_vat_exemption_reason_text\ntrade_tax]
    F --> J[BT-120 in XML output]
    I --> J
    K[EInvoiceImport.parse_tax] -->|reads from XML| L[tax.exemption_reason._text]
    L --> M[t.vat_exemption_reason_text\nin E Invoice Trade Tax child row]
Loading

Reviews (1): Last reviewed commit: "feat: add BT-120 VAT exemption reason (#..." | Re-trigger Greptile

Comment thread eu_einvoice/locale/de.po
Comment on lines 183 to 187
@@ -183,6 +187,7 @@ msgstr "E-Rechnung konnte nicht validiert werden."
msgid "Charge Total"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 Unresolved merge conflicts in locale file

de.po contains raw git conflict markers (<<<<<<< HEAD, =======, >>>>>>> cec83b5). A standard .po parser (e.g. Babel) treats these as illegal syntax and will fail to load the translation catalogue entirely, breaking all German UI strings in the module. The same issue is present in main.pot. Both files need a clean merge resolution before this branch can be shipped.

Comment on lines 523 to +529
msgstr ""

#: eu_einvoice/european_e_invoice/doctype/e_invoice_import/e_invoice_import.py:119
#: eu_einvoice/european_e_invoice/doctype/e_invoice_import/e_invoice_import.py:120
msgid "Please create or select a supplier before submitting"
msgstr ""

#: eu_einvoice/european_e_invoice/doctype/e_invoice_import/e_invoice_import.py:125
#: eu_einvoice/european_e_invoice/doctype/e_invoice_import/e_invoice_import.py:126
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 Unresolved merge conflict markers

main.pot contains raw git conflict markers just like de.po. These must be resolved so the template file is a valid .pot file again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant