polish_invoicer 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99331e91cb089f78113b0e0a0b0d0daf1fa7cf85
4
- data.tar.gz: 71a3cca89953f482b894a07cc929183ad35a090f
3
+ metadata.gz: 52d3a43a6d0c5c147dbd4eeb8e8cb5049b963c69
4
+ data.tar.gz: 856cc3a64bef075bcc9b81cea182799e8df3c3fc
5
5
  SHA512:
6
- metadata.gz: 676c01dc481ea6e097ae22dcf1cad4852f1574d32a05833a5b82e207e4508658c9dc611cf0bb86a1e5fd7da06583376938f38cf9c91c753f582f2d3e7b7be503
7
- data.tar.gz: 1b1db5b4e45145488107754ce54851cbdd600a8b93e3141e3bef44a9e0e10a8b5a45c5646d3b3fbc5b7aef3e7413d0d21b21203814d635dd3d8d192cba7efbf4
6
+ metadata.gz: d243cb095fc4c73ba77c9fefc60db15ea018605927abcaa1e94845e03892bbf4f9de604556c2109a88254507ff9c4ed8861415756a7ff2d7b7fab491b12e076d
7
+ data.tar.gz: e5323c89595f6b96f052eab0b0f4990e63b1ad63f48103012db9df4be8ccc71392fb1215359aafdc0b9fb102ae12c2ea517306db33cd43b7facdce41a2e4e681
data/README.md CHANGED
@@ -96,6 +96,8 @@ invoice.save_to_pdf('/path/to/invoice.pdf')
96
96
  # wartość domyślna: 'Przelew'
97
97
  :foreign_buyer, # nabywcą jest firma spoza Polski
98
98
  # wartość domyślna: false (boolean)
99
+ :reverse_charge # faktura z odwrotnym obciążeniem VAT
100
+ # wartość domyślna: false (boolean)
99
101
 
100
102
  ### Parametry dodatkowe
101
103
 
data/doc/invoice.rb CHANGED
@@ -13,12 +13,13 @@ invoice = PolishInvoicer::Invoice.new(
13
13
  '10-043 Olsztyn'],
14
14
  buyer_nip: '987-654-32-10', # NIP nabywcy
15
15
  item_name: 'Usługi programistyczne', # nazwa usługi
16
- price: 3500, # cena (domyślnie brutto)
16
+ price: 100, # cena (domyślnie brutto)
17
17
  payment_date: Date.today + 14, # data płatności
18
- # gross_price: false,
18
+ gross_price: false,
19
19
  # proforma: true,
20
20
  # paid: false,
21
- # foreign_buyer: true
21
+ foreign_buyer: true,
22
+ reverse_charge: true
22
23
  )
23
24
  invoice.save_to_html('/tmp/invoice.html')
24
25
  invoice.save_to_pdf('/tmp/invoice.pdf')
@@ -22,6 +22,7 @@ module PolishInvoicer
22
22
  :proforma, # znacznik faktury pro-forma, domyślnie: false (boolean)
23
23
  :no_vat_reason, # podstawa prawna zwolnienia z VAT (string)
24
24
  :foreign_buyer, # nabywcą jest firma spoza Polski, domyślnie: false (boolean)
25
+ :reverse_charge # faktura z odwrotnym obciążeniem VAT
25
26
  ].freeze
26
27
 
27
28
  attr_accessor(*AVAILABLE_PARAMS)
@@ -86,6 +87,7 @@ module PolishInvoicer
86
87
  @paid = true
87
88
  @proforma = false
88
89
  @foreign_buyer = false
90
+ @reverse_charge = false
89
91
  end
90
92
 
91
93
  def validate!
@@ -59,6 +59,9 @@ module PolishInvoicer
59
59
  unless [true, false].include?(@invoice.foreign_buyer)
60
60
  @errors[:foreign_buyer] = 'Znacznik zagranicznego nabywcy musi być podany jako boolean'
61
61
  end
62
+ unless [true, false].include?(@invoice.reverse_charge)
63
+ @errors[:reverse_charge] = 'Znacznik odwrotnego obciążenia VAT musi być podany jako boolean'
64
+ end
62
65
  end
63
66
 
64
67
  def check_dates
@@ -1,3 +1,3 @@
1
1
  module PolishInvoicer
2
- VERSION = '0.0.10'.freeze
2
+ VERSION = '0.0.11'.freeze
3
3
  end
data/tpl/invoice-en.slim CHANGED
@@ -101,6 +101,19 @@ html
101
101
  | Wart. netto
102
102
  .small
103
103
  em Net amount
104
+ - unless reverse_charge
105
+ th.text-center width="1%"
106
+ | VAT
107
+ .small
108
+ em VAT
109
+ th.text-center width="7%"
110
+ | Kwota VAT
111
+ .small
112
+ em VAT amount
113
+ th.text-center width="7%"
114
+ | Wart. brutto
115
+ .small
116
+ em Gross amount
104
117
  tr
105
118
  td = item_name
106
119
  - if pkwiu
@@ -111,6 +124,10 @@ html
111
124
  em 1 service
112
125
  td.text-center = net_value
113
126
  td.text-center = net_value
127
+ - unless reverse_charge
128
+ td.text-center = vat
129
+ td.text-center = vat_value
130
+ td.text-center = gross_value
114
131
  tr
115
132
  td colspan="#{pkwiu ? 3 : 2}"
116
133
  |  
@@ -119,6 +136,10 @@ html
119
136
  .small
120
137
  em Total
121
138
  td.text-center = net_value
139
+ - unless reverse_charge
140
+ td.text-center = vat
141
+ td.text-center = vat_value
142
+ th.text-center = gross_value
122
143
 
123
144
  br
124
145
 
@@ -130,7 +151,7 @@ html
130
151
  .small
131
152
  em Total to pay:
132
153
  .col-xs-6
133
- b = "#{net_value} PLN"
154
+ b = "#{reverse_charge == true ? net_value : gross_value} PLN"
134
155
  .row
135
156
  .col-xs-6
136
157
  | Zapłacono:
@@ -138,7 +159,7 @@ html
138
159
  em Amount paid:
139
160
  .col-xs-6
140
161
  - if paid
141
- = "#{net_value} PLN"
162
+ = "#{reverse_charge == true ? net_value : gross_value} PLN"
142
163
  - else
143
164
  | 0,00 PLN
144
165
  .row
@@ -150,7 +171,7 @@ html
150
171
  - if paid
151
172
  | 0,00 PLN
152
173
  - else
153
- = "#{net_value} PLN"
174
+ = "#{reverse_charge == true ? net_value : gross_value} PLN"
154
175
 
155
176
  .col-xs-6
156
177
  - if comments.any?
@@ -161,9 +182,10 @@ html
161
182
  = line
162
183
  br
163
184
 
164
- br
165
- br
185
+ - if reverse_charge
186
+ br
187
+ br
166
188
 
167
- b Do rozliczenia podatku VAT zobowiązany jest nabywca usługi (odwrotne obciążenie)
168
- .small
169
- em Levy of VAT reverse charged to recipient of service (reverse charge)
189
+ b Do rozliczenia podatku VAT zobowiązany jest nabywca usługi (odwrotne obciążenie)
190
+ .small
191
+ em Levy of VAT reverse charged to recipient of service (reverse charge)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polish_invoicer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Macuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-11 00:00:00.000000000 Z
11
+ date: 2017-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler