You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Read regime, exemption, and identity-type from es-tbai-* extensions
Wires the converter to read three new gobl tbai-addon extensions and
folds the existing legacy paths into fallbacks:
- es-tbai-regime: per-combo `ClaveRegimenIvaOpTrascendencia` value. The
addon now normalizes this from per-combo signals (export, surcharge,
simplified-scheme) or to 01 by default; explicit values are preserved.
Legacy inference in `collectRegimeCodes` is kept as fallback for
documents not run through the addon.
- es-tbai-exemption: with the addon's S2 mapping for reverse-charge,
the breakdown dispatcher now routes S2 to Sujeta/NoExenta/TipoNoExenta
instead of CausaExencion. VT/IE join OT/RL in NoSujeta. The tag-based
reverse-charge fallback is preserved.
- es-tbai-identity-type: read on customer identities to select the L7
IDType in IDOtro; falls back to the existing key->code map when the
extension is absent.
Bumps gobl to the pseudo-version that ships both extensions in the
tbai addon. Regenerates test/data and test/data/out fixtures so the
extension values are present where normalization sets them.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -224,6 +224,10 @@ The following extension can be applied to each line tax:
224
224
225
225
_(\*) As noted elsewhere, `RL` will be set automatically set in invoices using the `customer-rates` tax tag. It can also be set explicitly using the `es-tbai-exemption` extension in invoices not using that tag._
226
226
227
+
-`es-tbai-regime` - sets the `ClaveRegimenIvaOpTrascendencia` field per VAT/IGIC tax combo. Codes follow the TicketBAI XSD list (`01`–`17`, `51`–`53`). If not provided, GOBL fills it in during normalization from per-combo signals — `tax.KeyExport` → `02`, equivalence-surcharge rate → `51`, the invoice-level `simplified-scheme` tag → `52`, otherwise `01`. Set it explicitly when none of those defaults applies (e.g. travel agencies → `05`, cash accounting → `07`, OSS/IOSS → `17`); explicit values are always preserved.
228
+
229
+
-`es-tbai-identity-type` - sets the `IDType` value under `IDOtro` for the customer's identity (L7 list, codes `02`–`06`). Normalization maps `org.IdentityKeyPassport` → `03`, `IdentityKeyForeign` → `04`, `IdentityKeyResident` → `05`, `IdentityKeyOther` → `06`. Set it explicitly on an identity with no key (or to override). Spanish NIFs use the `NIF` field directly, and EU/non-EU tax IDs map to `IDOtro/IDType``02`/`04` automatically.
230
+
227
231
### Use-Cases
228
232
229
233
Under what situations should the TicketBAI system be expected to function:
0 commit comments