polish_invoicer 0.0.2 → 0.0.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.
- data/README.md +1 -1
- data/lib/polish_invoicer/validator.rb +0 -1
- data/lib/polish_invoicer/version.rb +1 -1
- data/test/test_generator.rb +27 -0
- data/test/validator_test.rb +1 -1
- data/tpl/invoice.slim +2 -1
- metadata +6 -4
data/README.md
CHANGED
@@ -77,7 +77,6 @@ invoice.save_to_pdf('/path/to/invoice.pdf')
|
|
77
77
|
:seller, # adres sprzedawcy (tablica stringów)
|
78
78
|
:seller_nip, # NIP sprzedawcy (string)
|
79
79
|
:buyer, # adres nabywcy (tablica stringów)
|
80
|
-
:buyer_nip, # NIP nabywcy (string)
|
81
80
|
:item_name, # nazwa usługi (string)
|
82
81
|
:price, # cena w złotych (float)
|
83
82
|
:payment_date, # termin płatności (date)
|
@@ -98,6 +97,7 @@ invoice.save_to_pdf('/path/to/invoice.pdf')
|
|
98
97
|
|
99
98
|
### Parametry dodatkowe
|
100
99
|
|
100
|
+
:buyer_nip, # NIP nabywcy (string)
|
101
101
|
:comments, # uwagi (string lub tablica stringów)
|
102
102
|
:pkwiu, # numer PKWiU (string)
|
103
103
|
:no_vat_reason, # podstawa prawna zwolnienia z VAT (string)
|
@@ -35,7 +35,6 @@ module PolishInvoicer
|
|
35
35
|
check_blank(:payment_type, 'Rodzaj płatności nie może być pusty')
|
36
36
|
check_blank(:payment_date, 'Termin płatności nie może być pusty')
|
37
37
|
check_blank(:seller_nip, 'NIP sprzedawcy nie może być pusty')
|
38
|
-
check_blank(:buyer_nip, 'NIP nabywcy nie może być pusty')
|
39
38
|
end
|
40
39
|
|
41
40
|
def check_not_nil
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'polish_invoicer'
|
3
|
+
|
4
|
+
i = PolishInvoicer::Invoice.new({
|
5
|
+
number: '1/2014', create_date: Date.today, trade_date: Date.today,
|
6
|
+
seller: ['Abaka sp. z o.o.', 'ul. Jasna 10', '10-234 Kraków'],
|
7
|
+
buyer: ['Fabryki słodyczy S.A.', 'ul. Słodka 12/34', '12-345 Warszawa'],
|
8
|
+
item_name: 'Jakiś długi tytuł i jeszcze jakieś informacje na różne tematy oraz dodatkowy komentarz w sprawie różnej.',
|
9
|
+
price: 123.45, payment_date: Date.today,
|
10
|
+
comments: 'Test uwag', footer: 'Stopka faktury plus tekst promocyjny',
|
11
|
+
seller_nip: '123-456-78-90', buyer_nip: '987-654-32-10'
|
12
|
+
})
|
13
|
+
|
14
|
+
i.save_to_pdf('/tmp/invoice-default.pdf')
|
15
|
+
i.paid = false
|
16
|
+
i.save_to_pdf('/tmp/invoice-not-paid.pdf')
|
17
|
+
i.proforma = true
|
18
|
+
i.save_to_pdf('/tmp/invoice-proforma.pdf')
|
19
|
+
i.comments = ['Ala ma kota', 'Ula ma psa']
|
20
|
+
i.save_to_pdf('/tmp/invoice-array-comments.pdf')
|
21
|
+
i.pkwiu = '82.3.2'
|
22
|
+
i.save_to_pdf('/tmp/invoice-pkwiu-proforma.pdf')
|
23
|
+
i.proforma = false
|
24
|
+
i.save_to_pdf('/tmp/invoice-pkwiu-fv.pdf')
|
25
|
+
i.vat = -1
|
26
|
+
i.no_vat_reason = 'Zwolnienie przedmiotowe na podstawie art. 123 ust. 3 pkt. 10'
|
27
|
+
i.save_to_pdf('/tmp/invoice-pkwiu-fv-reason.pdf')
|
data/test/validator_test.rb
CHANGED
data/tpl/invoice.slim
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polish_invoicer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-02-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- polish_invoicer.gemspec
|
105
105
|
- test/invoice_test.rb
|
106
106
|
- test/presenter_test.rb
|
107
|
+
- test/test_generator.rb
|
107
108
|
- test/test_helper.rb
|
108
109
|
- test/validator_test.rb
|
109
110
|
- test/vat_test.rb
|
@@ -124,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
125
|
version: '0'
|
125
126
|
segments:
|
126
127
|
- 0
|
127
|
-
hash:
|
128
|
+
hash: 4200718627998780674
|
128
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
130
|
none: false
|
130
131
|
requirements:
|
@@ -133,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
134
|
version: '0'
|
134
135
|
segments:
|
135
136
|
- 0
|
136
|
-
hash:
|
137
|
+
hash: 4200718627998780674
|
137
138
|
requirements: []
|
138
139
|
rubyforge_project:
|
139
140
|
rubygems_version: 1.8.25
|
@@ -143,6 +144,7 @@ summary: Creates polish invoices and proforms as HTML or PDF files
|
|
143
144
|
test_files:
|
144
145
|
- test/invoice_test.rb
|
145
146
|
- test/presenter_test.rb
|
147
|
+
- test/test_generator.rb
|
146
148
|
- test/test_helper.rb
|
147
149
|
- test/validator_test.rb
|
148
150
|
- test/vat_test.rb
|