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 +4 -4
- data/README.md +1 -1
- data/lib/ubl/builder.rb +2 -4
- data/lib/ubl/version.rb +1 -1
- data/lib/ubl.rb +19 -2
- 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: f257c1e68bac4286b082be4900f49a27fc736a69dc7cafa7de79cca2219e9035
|
4
|
+
data.tar.gz: 15be033154369701934e55ddc4ae34a2270032f129e8f9409927a4b06174f00e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63d7d62032fc619e8756655f2e737cc17bb5f54b9452478bdf15aadb3c040430f54a1db90e647fe5696182c719f33f2d22ff3649d5ade31c38ed8f8758f8f99d
|
7
|
+
data.tar.gz: 8e9ef76a121e0288be720acd30d14bb38747c0ed5e19f22abed25ec5768ba57ca4640d17dd547ce0b9f7be988d139cac7a667a4e3085ee4dac871c39b82c37fd
|
data/README.md
CHANGED
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(
|
19
|
-
@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
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
|
-
|
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
|
-
|
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
|
|