ubl 0.1.2 → 0.1.4
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/README.md +0 -2
- data/lib/ubl/builder.rb +7 -1
- data/lib/ubl/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: b836f637ff328d802a153f14435dbcac26c2e58418b37f4e5e25fb8ddbac9e8d
|
4
|
+
data.tar.gz: f36bec9e4397143eaba0e981ea8ec15cced9c6ec259a35233784f715f7ee13ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 189367df9d3dc55375451c6daf8e69e378a97b6e6cc4fcd0f4f1cf466cac8668d2faa89136b706ad44cff4fc53cd27b8e4b8ef5827255dfd30e59e6af661d560
|
7
|
+
data.tar.gz: 399b53dee0eb30d5f64f56dedabb73c08f5a4f39f4597afd526ec367ed8d729e399015e81775055b4e9e38f9b255b46d1a4ed7e7a3407c49376c33013465e8c4
|
data/README.md
CHANGED
data/lib/ubl/builder.rb
CHANGED
@@ -58,12 +58,13 @@ module Ubl
|
|
58
58
|
}
|
59
59
|
end
|
60
60
|
|
61
|
-
def add_line(name:, quantity:, unit_price:, tax_rate: 21.0, unit: "ZZ")
|
61
|
+
def add_line(name:, quantity:, unit_price:, description: name, tax_rate: 21.0, unit: "ZZ")
|
62
62
|
line_extension_amount = (quantity * unit_price).round(2)
|
63
63
|
tax_amount = (line_extension_amount * (tax_rate / 100.0)).round(2)
|
64
64
|
|
65
65
|
@invoice_lines << {
|
66
66
|
id: (@invoice_lines.length + 1).to_s,
|
67
|
+
description: description,
|
67
68
|
name: name,
|
68
69
|
quantity: quantity,
|
69
70
|
unit: unit,
|
@@ -138,6 +139,10 @@ module Ubl
|
|
138
139
|
xml["cac"].Party do
|
139
140
|
xml["cbc"].EndpointID(schemeID: "0208") { xml.text party_data[:vat_id].gsub(/^[A-Za-z]+/, "") }
|
140
141
|
|
142
|
+
xml["cac"].PartyName do
|
143
|
+
xml["cbc"].Name party_data[:name]
|
144
|
+
end
|
145
|
+
|
141
146
|
if party_data[:address]
|
142
147
|
xml["cac"].PostalAddress do
|
143
148
|
xml["cbc"].StreetName party_data[:address] if party_data[:address]
|
@@ -179,6 +184,7 @@ module Ubl
|
|
179
184
|
end
|
180
185
|
|
181
186
|
xml["cac"].Item do
|
187
|
+
xml["cbc"].Description line[:description]
|
182
188
|
xml["cbc"].Name line[:name]
|
183
189
|
xml["cac"].ClassifiedTaxCategory do
|
184
190
|
xml["cbc"].ID get_tax_category_id(line[:tax_rate])
|
data/lib/ubl/version.rb
CHANGED