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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07e7d21d74c69ab965fe5a9968fd7404629079233b2fd6554e7fac2f51aff5e6
4
- data.tar.gz: e13d2459ed88883a5206449565fb665bee8a59a097bbccf489c975be4ace1489
3
+ metadata.gz: b836f637ff328d802a153f14435dbcac26c2e58418b37f4e5e25fb8ddbac9e8d
4
+ data.tar.gz: f36bec9e4397143eaba0e981ea8ec15cced9c6ec259a35233784f715f7ee13ea
5
5
  SHA512:
6
- metadata.gz: 02d979487d2aafb9c96ab9ce923cb19f1821fd8850f8766a584ff0b5f06f86d5993747c0378c1eff62ef701518fe40876915d2234477f52bcb8e4c41660ef6f1
7
- data.tar.gz: 73a22110aa073edce5165461c9883ec1796d92e5ded7b320de8c0de220d82f6755f2407e74fe9bd43dd95f545ca19390e78e1e3d17d518fdb8db284a1ae9f2c8
6
+ metadata.gz: 189367df9d3dc55375451c6daf8e69e378a97b6e6cc4fcd0f4f1cf466cac8668d2faa89136b706ad44cff4fc53cd27b8e4b8ef5827255dfd30e59e6af661d560
7
+ data.tar.gz: 399b53dee0eb30d5f64f56dedabb73c08f5a4f39f4597afd526ec367ed8d729e399015e81775055b4e9e38f9b255b46d1a4ed7e7a3407c49376c33013465e8c4
data/README.md CHANGED
@@ -1,5 +1,3 @@
1
- [![Gem Version](https://badge.fury.io/rb/ubl.svg)](https://badge.fury.io/rb/ubl)
2
-
3
1
  # Ubl
4
2
 
5
3
  Generate and validate UBL (Universal Business Language) documents, such as invoices and credit notes, compliant with the Peppol network.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ubl
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ubl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - roel4d