polish_invoicer 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,3 +1,3 @@
1
1
  module PolishInvoicer
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -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')
@@ -124,7 +124,7 @@ module PolishInvoicer
124
124
 
125
125
  def test_seller_and_buyer_nip_presence
126
126
  check_error(:seller_nip)
127
- check_error(:buyer_nip)
127
+ check_ok(:buyer_nip)
128
128
  check_ok(:seller_nip, '123')
129
129
  check_ok(:buyer_nip, '123')
130
130
  end
data/tpl/invoice.slim CHANGED
@@ -38,7 +38,8 @@ html
38
38
  - buyer.each do |line|
39
39
  = line
40
40
  br
41
- = "NIP: #{buyer_nip}"
41
+ - if buyer_nip
42
+ = "NIP: #{buyer_nip}"
42
43
 
43
44
  hr
44
45
 
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.2
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-01-21 00:00:00.000000000 Z
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: -4309936482089687920
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: -4309936482089687920
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