Repository navigation
fix(booking): no single BU key for reverse charge next to a taxed line - #1058
Merged
Merged
Conversation
taxKeyFor gave the reverse-charge key (94) to a whole booking as soon as the
receipt was flagged reverse_charge, even when another line charged German VAT.
One key would book the taxed part as reverse charge too, so such a receipt now
gets no key ('mixed'), like one with several rates. A reverse-charge line of
its own (0 % or a computed rate) and a rate without an amount keep the key.
Refs #932
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
taxKeyFor(app/src/lib/booking/tax-keys.js) gave the reverse-charge key (94 by default) to the whole booking as soon as the receipt was flaggedreverse_charge, even when another VAT line on the same receipt charged German VAT. One key would then book the taxed part as reverse charge too.Such a receipt now gets no key, with
via: 'mixed', like a receipt with several rates. The UI shows the existing hint for mixed rates ("bitte selbst prüfen").The §13b key is kept when the only VAT line is the reverse-charge line itself (0 %, or a computed rate with
category: 'reverse_charge'), and when a line has a rate but no amount, as a model sometimes reads it.Why
Found while extending #932 (the BU key by where the vendor sits): the issue notes that several rates on one invoice, including a taxed line next to an
AEline, need a split booking rather than one key.Tests
Two new cases in
app/src/lib/booking/booking.spec.js: the cases that keep the §13b key, and the mixed case on expense and income. All unit tests underapp/src/libpass; Prettier and ESLint are clean on both files.Refs #932
🤖 Generated with Claude Code