Skip to content

Commit

Permalink
Fix empty field OrderReference/ID
Browse files Browse the repository at this point in the history
The spec is no longer alloowing empty elements.

Specifying a sales_order_reference but _not_ a purchase_order_reference
lead to having an empty OrderReference/ID field.
  • Loading branch information
phillipp authored and corny committed Dec 14, 2024
1 parent 14b7b86 commit c4467a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/xrechnung.rb
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ def to_xml(indent: 2, target: "")
unless self.class.members[:purchase_order_reference].optional && purchase_order_reference.nil? &&
self.class.members[:sales_order_reference].optional && sales_order_reference.nil?
xml.cac :OrderReference do
xml.cbc :ID, purchase_order_reference
unless self.class.members[:purchase_order_reference].optional && purchase_order_reference.nil?
xml.cbc :ID, purchase_order_reference
end
unless self.class.members[:sales_order_reference].optional && sales_order_reference.nil?
xml.cbc :SalesOrderID, sales_order_reference
end
Expand Down

0 comments on commit c4467a0

Please sign in to comment.