factur-x-builder 0.1.0 → 0.1.1

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: 73b17dce8190b48d61b4b2f1d521396374ef906351888926d986fb45268f0226
4
- data.tar.gz: a35e0da9ed5066ef58d5ba29adf2168d86de8d16c3ec8bfee0d5503aae282de2
3
+ metadata.gz: ac6a0f9f68bea474096e87b73b676318343d3aff63d83dbc452f742a67ebb8f8
4
+ data.tar.gz: 7c07d34573f36f5f16ce094ab8f84df948d288ab052e3a3c69ea1370176b1470
5
5
  SHA512:
6
- metadata.gz: ca76d2866e7950a772f07b2dc4b17ea2390a1ea8f1b450b2daff5d21347662b0f32cc8bb2e33bc020c39e12d9a5a40096e33b1912a56bdd7ebc5d1a9fc50ca28
7
- data.tar.gz: d5661ef43aad892fd4bb67a56714455c1b959545e13cbf4ecb6d88292e41d5bf8e1087277d0999fe4473b0e941010d60a7f34b6d0215ba5e1cc214c84f90c981
6
+ metadata.gz: 3cff2a09eae0ec30028c99e5453a5149154b9b45869dfa4bd88950e4803aeb58af4455f49b154f2e1b715ffe5877e38cdff482b0e190a57bab9fc4cc9af1afdd
7
+ data.tar.gz: 7376dda081fe40784a55c71554215951cf7ec4d0f2a2f67e76e0370bbf0b8b927da565e1754722e2890b8591becb670ce3472d523f0040569f05a9d65e56e72e
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
  .ruby-version
12
12
  .nvmrc
13
13
  .DS_Store
14
+ *.gem
data/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
+ ## [Unreleased]
2
+
3
+ ### Fixed
4
+
5
+ - The vendored XSD files were renamed without updating the `schemaLocation` of the files that
6
+ import them, which made every `FacturX.build` raise `Nokogiri::XML::SyntaxError`. A test now
7
+ checks that the schema compiles and that every `schemaLocation` resolves to an existing file.
8
+
9
+ ### Added
10
+
11
+ - `Party#legal_information` (BT-33, seller additional legal information), emitted as
12
+ `SellerTradeParty/Description`: legal form, share capital, RCS registration, or a registered
13
+ office that differs from the invoicing establishment. EN 16931 allows a single postal address
14
+ per party, so this is the only structured place for a second one.
15
+
1
16
  ## [0.1.0] - 2026-08-05
2
17
 
3
18
  - Initial release
19
+
4
20
  ### Added
5
21
 
6
22
  - `FacturX.build` generates an EN 16931 `factur-x.xml` document from invoicing domain objects:
data/README.md CHANGED
@@ -112,6 +112,32 @@ FacturX.violations(invoice) # => ["...", "..."]
112
112
  FacturX.valid?(invoice) # => false
113
113
  ```
114
114
 
115
+ ### One address per party
116
+
117
+ EN 16931 gives each party exactly one `PostalTradeAddress`, and it must be the address of the
118
+ establishment identified by the SIRET carried in `GlobalID`. There is no second slot: the element
119
+ that would hold a registered office, `SpecifiedLegalOrganization/PostalTradeAddress`, exists in the
120
+ `extended` XSD but the French CTC schematron forbids it (`CII-SR-225`), as it forbids
121
+ `ShipFromTradeParty` (`CII-SR-166`).
122
+
123
+ When the registered office differs from the invoicing establishment, it belongs in BT-33:
124
+
125
+ ```ruby
126
+ FacturX::Party.new(
127
+ name: "OFFICE DE TOURISME DES MONTS FICTIFS - Établissement de Chambéry",
128
+ legal_information: "SARL au capital de 50 000 € - RCS Clermont-Ferrand 398 765 438 - " \
129
+ "Siège social : 4 boulevard des Sources, 63240 LE MONT-FICTIF",
130
+ siret: "39876543800005",
131
+ siren: "398765438",
132
+ vat_number: "FR79398765438",
133
+ address: FacturX::Address.new(line_one: "8 rue des Entrepôts", postcode: "73000",
134
+ city: "Chambéry", country_code: "FR")
135
+ )
136
+ ```
137
+
138
+ BT-33 is free text — the counterpart of `cbc:CompanyLegalForm` in UBL. Receivers display it, they do
139
+ not parse it.
140
+
115
141
  ### Profiles
116
142
 
117
143
  By default the French e-invoicing rules apply on top of EN 16931: an invoicing mode (BT-23) and the
@@ -306,6 +306,7 @@ module FacturX
306
306
  xml["ram"].send(element_name) do
307
307
  text(xml, :GlobalID, party.global_id, scheme_attribute(party.global_id_scheme))
308
308
  text(xml, :Name, party.name)
309
+ text(xml, :Description, party.legal_information)
309
310
  emit_legal_organization(xml, party)
310
311
  emit_contact(xml, party)
311
312
  emit_address(xml, party.address)
@@ -9,18 +9,26 @@ module FacturX
9
9
  # (scheme 0009), `siren` the legal organization ID (scheme 0002), and
10
10
  # `routing_id` the electronic address (scheme 0225) used to route the
11
11
  # invoice through the PPF, defaulting to the SIRET.
12
+ #
13
+ # `legal_information` is BT-33, the seller's additional legal information:
14
+ # legal form, share capital, RCS registration, and any other statement the
15
+ # printed invoice must carry. A party holds a single postal address, so this
16
+ # is also where a registered office that differs from the invoicing
17
+ # establishment belongs.
12
18
  class Party
13
- attr_reader :name, :trading_name, :siret, :siren, :vat_number, :tax_id,
19
+ attr_reader :name, :trading_name, :legal_information, :siret, :siren, :vat_number, :tax_id,
14
20
  :address, :contact, :global_id, :global_id_scheme,
15
21
  :legal_id, :legal_id_scheme, :routing_id, :routing_id_scheme
16
22
 
17
23
  def initialize(name:, address: nil, contact: nil, trading_name: nil,
24
+ legal_information: nil,
18
25
  siret: nil, siren: nil, vat_number: nil, tax_id: nil,
19
26
  global_id: nil, global_id_scheme: nil,
20
27
  legal_id: nil, legal_id_scheme: nil,
21
28
  routing_id: :derive_from_siret, routing_id_scheme: nil)
22
29
  @name = name
23
30
  @trading_name = trading_name
31
+ @legal_information = legal_information
24
32
  @address = address
25
33
  @contact = contact
26
34
  @siret = siret
@@ -5,8 +5,8 @@
5
5
  xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
6
6
  targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
7
7
  elementFormDefault="qualified">
8
- <xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="Factur-X_1.09_EN16931_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
9
- <xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="Factur-X_1.09_EN16931_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
8
+ <xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="Factur-X_1.09_EN16931_QualifiedDataType_100.xsd"/>
9
+ <xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="Factur-X_1.09_EN16931_UnqualifiedDataType_100.xsd"/>
10
10
  <xs:complexType name="CreditorFinancialAccountType">
11
11
  <xs:sequence>
12
12
  <xs:element name="IBANID" type="udt:IDType" minOccurs="0"/>
@@ -6,9 +6,9 @@
6
6
  xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
7
7
  targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
8
8
  elementFormDefault="qualified">
9
- <xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="Factur-X_1.09_EN16931_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
10
- <xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="Factur-X_1.09_EN16931_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
11
- <xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="Factur-X_1.09_EN16931_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
9
+ <xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="Factur-X_1.09_EN16931_QualifiedDataType_100.xsd"/>
10
+ <xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="Factur-X_1.09_EN16931_ReusableAggregateBusinessInformationEntity_100.xsd"/>
11
+ <xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="Factur-X_1.09_EN16931_UnqualifiedDataType_100.xsd"/>
12
12
  <xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
13
13
  <xs:complexType name="CrossIndustryInvoiceType">
14
14
  <xs:sequence>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FacturX
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factur-x-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hotentic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-09 00:00:00.000000000 Z
11
+ date: 2026-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri