TicketBAI: enable exempt reasons & not-subject transactions#669
Open
StefanKert wants to merge 4 commits into
Open
TicketBAI: enable exempt reasons & not-subject transactions#669StefanKert wants to merge 4 commits into
StefanKert wants to merge 4 commits into
Conversation
…fVat Replaces the hard-coded 'subject, not exempt, S1' TicketBAI branch with a mapper-driven build of the Sujeta/Exenta, Sujeta/NoExenta and NoSujeta sub-branches per the table in fiskaltrust/market-es#97. ClaveRegimen is derived from the items (exports -> 02) instead of being pinned to 01. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SCU.ES Test Results 2 files 2 suites 0s ⏱️ Results for commit a843759. ♻️ This comment has been updated with latest results. |
Pins the produced TicketBAI XML for nine scenarios (single usual VAT, reverse charge, each exempt and not-subject branch, a mixed all-branches receipt, a mixed receipt with exports producing two Claves entries, and a foreign customer split across Entrega and PrestacionServicios). Run with UPDATE_TICKETBAI_SNAPSHOTS=1 to regenerate after a deliberate spec change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds 10 reference XMLs (NN [10]-[60]) from fiskaltrust/market-es#95 under TestData/TicketBAI/ReferenceSamples/ and a new acceptance test that asserts the factory produces matching CausaExencion / TipoNoExenta / CausaNoSujeta / ClaveRegimenIvaOpTrascendencia codes and lands in the same DesgloseFactura vs DesgloseTipoOperacion/Entrega vs PrestacionServicios branch as each published sample. NN [60] (foreign tax / IE) is documented but skipped pending a queue-es enum variant for it. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
Implements market-es#97 — replaces the hard-coded subject / not exempt / S1 TicketBAI branch with a mapper-driven build of all
<Sujeta>/<Exenta>,<Sujeta>/<NoExenta>and<NoSujeta>sub-branches based on the charge item'sNatureOfVat.TicketBaiNatureOfVatMappingcentralises theNatureOfVatES → (ClaveRegimen, Branch, CausaExencion?, TipoNoExenta?, CausaNoSujeta?)table from the issue.TicketBaiFactory.GetFacturaDetailsnow groups items byNatureOfVat, builds the correct branch combination, and applies the same logic inside the foreign-recipient<Entrega>/<PrestacionServicios>split.Clavesis derived from the items (exports →02, mixed → both01and02) instead of being pinned toItem01.Coverage of the spec table
ExteptArticle21<Exenta CausaExencion=E2>, Claves02ExteptArticle25<Exenta CausaExencion=E5>, Claves01ExteptArticle22<Exenta CausaExencion=E3>, Claves02ExteptArticle23And24<Exenta CausaExencion=E4>, Claves02NotSubjectLocationRules<NoSujeta Causa=RL>NotSubjectArticle7and14<NoSujeta Causa=OT>ExteptArticle20<Exenta CausaExencion=E1>ExteptOthers<Exenta CausaExencion=E6>ReverseCharge<NoExenta TipoNoExenta=S2>Out of scope (matches the issue's open questions)
ChargeItemCaseNatureOfVatESvalue yet; the mapper throwsNotSupportedExceptionif those ever show up.TypeOfService-based filter — the open question about queue-es carrying explicit goods-vs-services is unresolved upstream.Test plan
dotnet test scu-es/test/fiskaltrust.Middleware.SCU.ES.UnitTest— 17 new tests pass (11 mapping + 7 factory). Pre-existingVeriFactuTestcertificate-dependent cases unchanged.🤖 Generated with Claude Code