ubl 0.0.3 → 0.0.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: 1f37938a0758a7354e8fa16557aeadbb9733e8c249a649b17eb9095f2ba5fd97
4
- data.tar.gz: 58b6ae9d4e7ed3701e01bfb05a0fe2b958d2f5adbd8f006912fe95a1ce8f9924
3
+ metadata.gz: f257c1e68bac4286b082be4900f49a27fc736a69dc7cafa7de79cca2219e9035
4
+ data.tar.gz: 15be033154369701934e55ddc4ae34a2270032f129e8f9409927a4b06174f00e
5
5
  SHA512:
6
- metadata.gz: defb4760407b2645e202042072a7e5ef70a931d9226405d6e455594a58b9d737a3f05ad5f8c36447be774a7c2afdfde9e95ea601ac2d1b5b2858637c2c1a2f1a
7
- data.tar.gz: ba81dad3036adf7487e85c369338b606c9e19c304483eafae29d04203353b686be70b85ca01260f65623c45b2dd593b469af1388394c19befaf22357569c5e0b
6
+ metadata.gz: 63d7d62032fc619e8756655f2e737cc17bb5f54b9452478bdf15aadb3c040430f54a1db90e647fe5696182c719f33f2d22ff3649d5ade31c38ed8f8758f8f99d
7
+ data.tar.gz: 8e9ef76a121e0288be720acd30d14bb38747c0ed5e19f22abed25ec5768ba57ca4640d17dd547ce0b9f7be988d139cac7a667a4e3085ee4dac871c39b82c37fd
data/README.md CHANGED
@@ -20,7 +20,7 @@ gem install ubl
20
20
 
21
21
  ## Example
22
22
 
23
- ```
23
+ ```ruby
24
24
  require "ubl"
25
25
 
26
26
  invoice = Ubl::Invoice.new
data/lib/ubl/builder.rb CHANGED
@@ -5,8 +5,6 @@ require "date"
5
5
  require "base64"
6
6
 
7
7
  module Ubl
8
- class Error < StandardError; end
9
-
10
8
  class UblBuilder
11
9
  attr_accessor :invoice_nr, :issue_date, :due_date, :currency, :supplier,
12
10
  :customer, :invoice_lines, :tax_total, :legal_monetary_total, :pdffile
@@ -15,8 +13,8 @@ module Ubl
15
13
  CUSTOMIZATION_UBL_BE = "urn:cen.eu:en16931:2017#conformant#urn:UBL.BE:1.0.0.20180214"
16
14
  PROFILE_ID = "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0"
17
15
 
18
- def initialize(ubl_be = false)
19
- @ubl_be = ubl_be
16
+ def initialize(extension = nil)
17
+ @ubl_be = extension == "UBL_BE"
20
18
  @issue_date = Date.today
21
19
  @due_date = @issue_date + 30
22
20
  @currency = "EUR"
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.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
data/lib/ubl.rb CHANGED
@@ -1,8 +1,18 @@
1
1
  require_relative "ubl/builder"
2
2
 
3
+ ##
4
+ # The Invoice and CreditNote class generates UBL (Universal Business Language) compliant XML
5
+ # documents following PEPPOL standards.
3
6
  module Ubl
4
7
  class Invoice < UblBuilder
5
- def initialize(ubl_be = false)
8
+ ##
9
+ # Creates a new Invoice instance.
10
+ #
11
+ # == Parameters
12
+ # * +extension+ - (String) Optional. Set to +"UBL_BE"+ to generate UBL.BE compliant invoices
13
+ # for Belgian requirements. Defaults to +nil+ for standard PEPPOL format.
14
+ #
15
+ def initialize(extension = nil)
6
16
  super
7
17
  end
8
18
 
@@ -28,7 +38,14 @@ module Ubl
28
38
  end
29
39
 
30
40
  class CreditNote < UblBuilder
31
- def initialize(ubl_be = false)
41
+ ##
42
+ # Creates a new CreditNote instance.
43
+ #
44
+ # == Parameters
45
+ # * +extension+ - (String) Optional. Set to +"UBL_BE"+ to generate UBL.BE compliant
46
+ # credit notes for Belgian requirements. Defaults to +nil+ for standard PEPPOL format.
47
+ #
48
+ def initialize(extension = nil)
32
49
  super
33
50
  end
34
51
 
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.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - roel4d