polish_invoicer 0.0.22 → 0.0.23

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: 1bbbaf6dd22f1ca0dfd4f627786d5920d0049ba0
4
- data.tar.gz: 76135c62048b56eb389db332cbdd91dd1d38190d
3
+ metadata.gz: 9f720394b35d68552ab3e36b2db34f213024797d
4
+ data.tar.gz: 70e8b6d45d50b0f255d665d9ccea85d5d5dd354f
5
5
  SHA512:
6
- metadata.gz: 5a759c2a9719a86b724ebd83fc3f77e117e133c17634f862276dd46cdbd982c9c73e8a667e4e04d25170e68d5d1567e4edb7687db1e2adb3900302c6c0a60f11
7
- data.tar.gz: 978e0aee7188484af39afc06dc1f10d057f08240e244f30b7298ca460e671c192285ecb373347cba0722beee81bb583fbed859cb36fb12568f37903c5b591e5e
6
+ metadata.gz: 9a898a23b93bdc22b4b8acde9d1acc24447551dabef29b8bcaf5fedebeef68ba188f1ec51e1f5bccdb3fb072d218234e1bdbd6c7318871d338876d1917e2e130
7
+ data.tar.gz: 78870d3a6072be8f966b57f752c8b360aca9bbdedc7bfe3e8056e2eb6de9235e08c5387b527a54f99640c485dd58931263d5d39d945b87ba79502d2deec72673
@@ -80,6 +80,10 @@ module PolishInvoicer
80
80
  Presenter.new(self).data
81
81
  end
82
82
 
83
+ def exchanged_tax
84
+ (vat_value * exchange_rate)
85
+ end
86
+
83
87
  private
84
88
 
85
89
  def set_defaults
@@ -31,7 +31,7 @@ module PolishInvoicer
31
31
  end
32
32
 
33
33
  def copy_additional_params
34
- %w[net_value vat_value gross_value].each do |field|
34
+ %w[net_value vat_value gross_value exchanged_tax].each do |field|
35
35
  @out[field.to_sym] = @invoice.send(field)
36
36
  end
37
37
  end
@@ -45,7 +45,7 @@ module PolishInvoicer
45
45
  end
46
46
 
47
47
  def format_prices
48
- %w[net_value vat_value gross_value].each do |field|
48
+ %w[net_value vat_value gross_value exchanged_tax].each do |field|
49
49
  v = @invoice.send(field)
50
50
  next unless v
51
51
  @out[field.to_sym] = sprintf('%02.2f', v).tr('.', ',')
@@ -1,3 +1,3 @@
1
1
  module PolishInvoicer
2
- VERSION = '0.0.22'.freeze
2
+ VERSION = '0.0.23'.freeze
3
3
  end
data/tpl/invoice-en.slim CHANGED
@@ -180,6 +180,14 @@ html
180
180
  em Exchange rate:
181
181
  .col-xs-6
182
182
  = exchange_rate
183
+ - unless reverse_charge
184
+ .row
185
+ .col-xs-6
186
+ | Podatek w PLN:
187
+ .small
188
+ em Exchanged tax amount:
189
+ .col-xs-6
190
+ = "#{exchanged_tax} PLN"
183
191
 
184
192
  .col-xs-6
185
193
  - if comments.any?
data/tpl/invoice.slim CHANGED
@@ -105,6 +105,8 @@ html
105
105
  - if currency != 'PLN'
106
106
  br
107
107
  | Kurs waluty:
108
+ br
109
+ | Podatek w PLN:
108
110
  .col-xs-3
109
111
  b = "#{gross_value} #{currency}"
110
112
  br
@@ -120,6 +122,8 @@ html
120
122
  - if currency != 'PLN'
121
123
  br
122
124
  = exchange_rate
125
+ br
126
+ = "#{exchanged_tax} PLN"
123
127
  - if comments.any?
124
128
  .col-xs-6
125
129
  b Uwagi:
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.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Macuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2018-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler