ubl 0.1.2 → 0.1.3
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/lib/ubl/builder.rb +3 -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: 0d3674c799834fc218a997979a36b62a860aff2f08568f4b3e947a54ac693ec5
|
4
|
+
data.tar.gz: 827efecf61e25ae097ec832706ec5409e7893a202aac5d485e2e038c7af3caf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2df2c642ae9b96f7ccf9a46264eec67679d9fb70a044e846320aea5036f044d4899c04f49ca335182b3856042d967dce2898b850045f2a2785b4a7ff960c169
|
7
|
+
data.tar.gz: d0129370aa18020f080f0c71213ca9e1681a1d2900aa2ce9bb3081460de06a26feaaa8aa9c96c0d4ceca9470980ffa63d77a3ac9245499539acf8001a8598daa
|
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,
|
@@ -179,6 +180,7 @@ module Ubl
|
|
179
180
|
end
|
180
181
|
|
181
182
|
xml["cac"].Item do
|
183
|
+
xml["cbc"].Description line[:description]
|
182
184
|
xml["cbc"].Name line[:name]
|
183
185
|
xml["cac"].ClassifiedTaxCategory do
|
184
186
|
xml["cbc"].ID get_tax_category_id(line[:tax_rate])
|
data/lib/ubl/version.rb
CHANGED