einvoicing 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a112029dd945f7dfbdc67dcf4ee76420d1708284a7bb18d6c04a2c32de2a7015
4
- data.tar.gz: 6f4a1302247e1b572b9713b51d4605d4e354c9000159d5755e36c1331ba70090
3
+ metadata.gz: ebdccf05d23870723b8c45634ecfa3f19f587c8e2bf4b3f1e3652b84a2874b13
4
+ data.tar.gz: f329a5f6d4a3c2ba2d7bfce7c935d81964208158f43e4760c8723d1606a3f9c5
5
5
  SHA512:
6
- metadata.gz: ecf8f50fc15ce50e55506a7c74ab492d0a2b23987d29087a6555c229d62b9c03848d459b22da07e1428fd79ab0445da5726670f324823af36f611d61bdd0fdad
7
- data.tar.gz: e7867f59abf64d56f82fe5903d5e76994986ee3e64445a49897fd25929e19b5afc245905955b749f06ecff83e893f9bfbfa676079a5ce7622f85441106ebf4db
6
+ metadata.gz: 035345b680196da8a9daf0ad6d603c7bc5da458f75ee9939d491e6a3812ef0e01d4feb492474b0ff083c129c2e5d751dcfaddd8104c0b428b057980c01347f53
7
+ data.tar.gz: da8d6e8c4d27a445caa3159bb866242c2da2b206421959ee32083c40e88d480a55138224aeb8bbc9f32adfbec235662338f6d019aa34c2fa4bc94462be33b2f8
data/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.9.2] - 2026-08-06
11
+
12
+ ### Fixed
13
+ - CII announced a SIRET under `schemeID="0002"`, which is SIRENE — the nine-digit SIREN. A fourteen-digit SIRET now goes out as `0009`, the ISO 6523 code that actually labels it. Neither the XSD nor the EN 16931 Schematron catches the mismatch, because both values are just strings to them; a Plateforme Agréée checks it, and refuses the document. Chorus Pro keeps the literal `SIRET` scheme it predates the codelist with
14
+
10
15
  ## [0.9.1] - 2026-08-06
11
16
 
12
17
  ### Added
@@ -125,13 +125,27 @@ module Einvoicing
125
125
  end
126
126
  private_class_method :header_trade_agreement
127
127
 
128
+ # ISO 6523 identifier scheme for a French legal registration (BT-30 /
129
+ # BT-47). The code has to match the *length* of the number it labels:
130
+ # 0002 is SIRENE, which is the 9-digit SIREN, and a 14-digit SIRET
131
+ # announced as 0002 is what a Plateforme Agréée rejects the document for.
132
+ # Chorus Pro predates the codelist and wants the literal word instead.
133
+ SIREN_SCHEME = "0002"
134
+ SIRET_SCHEME = "0009"
135
+
136
+ def self.legal_id_scheme(party, profile)
137
+ return "SIRET" if profile == :chorus_pro && party.siret
138
+
139
+ party.siret ? SIRET_SCHEME : SIREN_SCHEME
140
+ end
141
+ private_class_method :legal_id_scheme
142
+
128
143
  def self.party_xml(b, party, profile)
129
144
  b.text("ram:Name", party.name)
130
145
  legal_id = party.siret || party.siren
131
146
  if legal_id
132
147
  b.tag("ram:SpecifiedLegalOrganization") do
133
- scheme = (profile == :chorus_pro && party.siret) ? "SIRET" : "0002"
134
- b.text("ram:ID", legal_id, "schemeID" => scheme)
148
+ b.text("ram:ID", legal_id, "schemeID" => legal_id_scheme(party, profile))
135
149
  end
136
150
  end
137
151
  b.tag("ram:PostalTradeAddress") do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Einvoicing
4
- VERSION = "0.9.1"
4
+ VERSION = "0.9.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: einvoicing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Le Ray