ubl 0.0.3 → 0.1.0

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: b7910f61d2fb9d3441defbd3a471c8dee214fcc2328430ddc74564e03839e02f
4
+ data.tar.gz: 94702d68716de735e38896e7c927fadb216917f422b1ed9cc58f8aac697541aa
5
5
  SHA512:
6
- metadata.gz: defb4760407b2645e202042072a7e5ef70a931d9226405d6e455594a58b9d737a3f05ad5f8c36447be774a7c2afdfde9e95ea601ac2d1b5b2858637c2c1a2f1a
7
- data.tar.gz: ba81dad3036adf7487e85c369338b606c9e19c304483eafae29d04203353b686be70b85ca01260f65623c45b2dd593b469af1388394c19befaf22357569c5e0b
6
+ metadata.gz: 274419fa7cbf69522f8ba6ade35415aead6750e63efce27f623e136accb2705dd29fc339dfcdfea63f9a9a16fcf0bd3587ef07e46aa3d073048af2724ed6d19b
7
+ data.tar.gz: 52e29b3ecaa743ea11d525f743ec0de05207a4c0d2980509ee9ec53fd2ccffb8a6901ab4758ec9fcdc99713ca16411d483cd73fa63e05605dba5ac736a957496
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Ubl
4
4
 
5
- Generate UBL invoices and credit notes for Peppol
5
+ Generate UBL (Universal Business Language) documents, such as invoices and credit notes, compliant with the Peppol network.
6
6
 
7
7
  ## installation
8
8
 
@@ -20,15 +20,12 @@ 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
27
27
  invoice.invoice_nr = "INV-2025-001"
28
- invoice.issue_date = Date.new(2025, 6, 28)
29
- invoice.due_date = Date.new(2025, 7, 28)
30
- invoice.currency = "EUR"
31
- invoice.pdffile = __dir__ + "/invoice_test.pdf"
28
+ invoice.pdffile = "./invoice.pdf"
32
29
 
33
30
  invoice.add_supplier(
34
31
  name: "ACME Corp",
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.1.0"
5
5
  end
data/lib/ubl.rb CHANGED
@@ -1,8 +1,18 @@
1
1
  require_relative "ubl/builder"
2
2
 
3
+ ##
4
+ # Generate UBL (Universal Business Language) documents,
5
+ # such as invoices and credit notes, compliant with the Peppol network.
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.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - roel4d
@@ -37,7 +37,8 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: 0.3.0
40
- description: Generate UBL documents for Peppol
40
+ description: Generate UBL (Universal Business Language) documents, such as invoices
41
+ and credit notes, compliant with the Peppol network.
41
42
  email:
42
43
  - roel4d@webding.org
43
44
  executables: []
@@ -74,5 +75,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
75
  requirements: []
75
76
  rubygems_version: 3.6.7
76
77
  specification_version: 4
77
- summary: Generate UBL documents
78
+ summary: Generate UBL documents for Peppol
78
79
  test_files: []