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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/einvoicing/formats/cii.rb +16 -2
- data/lib/einvoicing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ebdccf05d23870723b8c45634ecfa3f19f587c8e2bf4b3f1e3652b84a2874b13
|
|
4
|
+
data.tar.gz: f329a5f6d4a3c2ba2d7bfce7c935d81964208158f43e4760c8723d1606a3f9c5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
data/lib/einvoicing/version.rb
CHANGED