billme 0.20.0 → 0.37.0

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: ab9dd1720c0c90f627c83c99a472b3f2fe7ffc77
4
- data.tar.gz: c094399a416abb3a71111a28a2b008b907526051
3
+ metadata.gz: 23e661eb837110287f394e6643b4b2316b210803
4
+ data.tar.gz: 9ac336a2b29a0f78826cd9ae81634e896076a1b2
5
5
  SHA512:
6
- metadata.gz: c3986b761ef531eb2e1bce1c5641fd28abc8b6a833a217333bbf2ac7fde0cecb0e80cec29e805e41622c1b64b40cddae0862d719d59bea4a2bafb5dd8c1be380
7
- data.tar.gz: 607a56009abc943ea653f177571444bedb89db466c09b53979d2e57777904192f9c6a1f4cda6f169a0abd956c2415df560557d92f761d1569055c290db743305
6
+ metadata.gz: 5e4d7e35d9cc852aae4d7587bd2de13bed0e584a96e0827d92b744982f419ce8ae3514d913715acb09fe587f7a0f45e6836649f7faa157557e1e8c63014c3a86
7
+ data.tar.gz: d6fbf5f1e32f7dd82f1ed9f78793ab0a98411244dbb3f9fca222453b63cdc1af23e75298aa312fed74db127b2362a09cdafbd81b9c4a82cf26beefd31b890acd
data/billme.gemspec CHANGED
@@ -29,4 +29,5 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_development_dependency "bundler", "~> 1.9"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_runtime_dependency "i18n", "~> 0.7.0"
32
33
  end
@@ -0,0 +1,26 @@
1
+ en:
2
+ invoice: "INVOICE"
3
+ project: "PROJECT"
4
+ client: "CLIENT"
5
+ vat: "VAT"
6
+ address: "ADDRESS"
7
+ bill_date: "BILL DATE"
8
+ delivered: "DELIVERED"
9
+ due_date: "DUE DATE"
10
+ service: "SERVICE"
11
+ description: "DESCRIPTION"
12
+ price: "PRICE"
13
+ qty: "QUANTITY"
14
+ total: "TOTAL"
15
+ subtotal: "SUBTOTAL"
16
+ tax: "TAX"
17
+ notice: "NOTICE"
18
+ payment_method: "PAYMENT METHOD"
19
+ operator: "OPERATOR"
20
+ acc_number: "ACCOUNT NUMBER"
21
+ pay_id: "PAYMENT ID"
22
+ our_address: "Our addresses"
23
+ legal: "Legal"
24
+ iban: "IBAN"
25
+ swift: "SWIFT"
26
+ phone: "PHONE"
@@ -0,0 +1,26 @@
1
+ hr:
2
+ invoice: "RACUN"
3
+ project: "PROJEKT"
4
+ client: "KLIJENT"
5
+ vat: "OIB"
6
+ address: "ADRESA"
7
+ bill_date: "DATUM RACUNA"
8
+ delivered: "ISPORUCENO"
9
+ due_date: "ROK PLACANJA"
10
+ service: "USLUGA"
11
+ description: "OPIS"
12
+ price: "CIJENA"
13
+ qty: "KOLICINA"
14
+ total: "UKUPNO"
15
+ subtotal: "MEDJUIZNOS"
16
+ tax: "POREZ"
17
+ notice: "OPASKA"
18
+ payment_method: "NACIN PLACANJA"
19
+ operator: "OPERATOR"
20
+ acc_number: "BROJ RACUNA"
21
+ pay_id: "POZIV NA BROJ"
22
+ our_address: "Nase adrese"
23
+ legal: "Podaci o firmi"
24
+ iban: "IBAN"
25
+ swift: "SWIFT"
26
+ phone: "TELEFON"
@@ -1,3 +1,3 @@
1
1
  module Billme
2
- VERSION = "0.20.0"
2
+ VERSION = "0.37.0"
3
3
  end
@@ -15,7 +15,7 @@
15
15
  <img src="<%= @data[:logo] %>" alt="Logo">
16
16
  </div>
17
17
  <% end %>
18
- <h1>INVOICE <%= @data[:number] %></h1>
18
+ <h1><%= I18n.t :invoice %> <%= @data[:number] %></h1>
19
19
  <div id="company" class="clearfix">
20
20
  <div><%= @data[:company][:company_name] %></div>
21
21
  <% if @data[:company][:vat] %>
@@ -31,28 +31,28 @@
31
31
  </div>
32
32
  <div id="project">
33
33
  <% if @data[:client][:project_name] %>
34
- <div><span>PROJECT</span> <%= @data[:client][:project_name] %></div>
34
+ <div><span><%= I18n.t :project %></span> <%= @data[:client][:project_name] %></div>
35
35
  <% end %>
36
- <div><span>CLIENT</span> <%= @data[:client][:name] %></div>
37
- <div><span>VAT</span> <%= @data[:client][:vat] %></div>
38
- <div><span>ADDRESS</span> <%= @data[:client][:address] %></div>
36
+ <div><span><%= I18n.t :client %></span> <%= @data[:client][:name] %></div>
37
+ <div><span><%= I18n.t :vat %></span> <%= @data[:client][:vat] %></div>
38
+ <div><span><%= I18n.t :address %></span> <%= @data[:client][:address] %></div>
39
39
  <% if @data[:client][:email] %>
40
40
  <div><span>EMAIL</span> <a href="mailto:<%= @data[:client][:email] %>"><%= @data[:client][:email] %></a></div>
41
41
  <% end %>
42
- <div><span>BILL DATE</span> <%= @data[:client][:bill_date] %></div>
43
- <div><span>DELIVERED</span> <%= @data[:client][:date] %></div>
44
- <div><span>DUE DATE</span> <%= @data[:client][:due_date] %></div>
42
+ <div><span><%= I18n.t :bill_date %></span> <%= @data[:client][:bill_date] %></div>
43
+ <div><span><%= I18n.t :delivered %></span> <%= @data[:client][:date] %></div>
44
+ <div><span><%= I18n.t :due_date %></span> <%= @data[:client][:due_date] %></div>
45
45
  </div>
46
46
  </header>
47
47
  <main>
48
48
  <table>
49
49
  <thead>
50
50
  <tr>
51
- <th class="service">SERVICE</th>
52
- <th class="desc">DESCRIPTION</th>
53
- <th>PRICE</th>
54
- <th>QTY</th>
55
- <th>TOTAL</th>
51
+ <th class="service"><%= I18n.t :service %></th>
52
+ <th class="desc"><%= I18n.t :description %></th>
53
+ <th><%= I18n.t :price %></th>
54
+ <th><%= I18n.t :qty %></th>
55
+ <th><%= I18n.t :total %></th>
56
56
  </tr>
57
57
  </thead>
58
58
  <tbody>
@@ -66,52 +66,52 @@
66
66
  </tr>
67
67
  <% end %>
68
68
  <tr>
69
- <td colspan="3">SUBTOTAL</td>
69
+ <td colspan="3"><%= I18n.t :subtotal %></td>
70
70
  <td class="total"><td class="total"><%= @data[:services][:subtotal] %><%= @data[:services][:currency] %></td></td>
71
71
  </tr>
72
72
  <tr>
73
- <td colspan="3">TAX <%= @data[:services][:tax_percentage] %>%</td>
73
+ <td colspan="3"><%= I18n.t :tax %> <%= @data[:services][:tax_percentage] %>%</td>
74
74
  <td class="total"><td class="total"><%= @data[:services][:tax] %><%= @data[:services][:currency] %></td>
75
75
  </td>
76
76
  </tr>
77
77
  <tr>
78
- <td colspan="3" class="grand total">TOTAL</td>
78
+ <td colspan="3" class="grand total"><%= I18n.t :total %></td>
79
79
  <td class="grand total"><td class="grand total"><%= @data[:services][:total] %><%= @data[:services][:currency] %></td>
80
80
  </td>
81
81
  </tr>
82
82
  </tbody>
83
83
  </table>
84
84
  <div id="notices">
85
- <div>NOTICE:</div>
85
+ <div><%= I18n.t :notice %>:</div>
86
86
  <div class="notice"><%= @data[:other][:notice] %></div>
87
- <div>PAYMENT METHOD:</div>
87
+ <div><%= I18n.t :payment_method %>:</div>
88
88
  <div class="notice"><%= @data[:other][:payment_method] %></div>
89
- <div>OPERATOR:</div>
89
+ <div><%= I18n.t :operator %>:</div>
90
90
  <div class="notice"><%= @data[:other][:operator] %></div>
91
- <div>ACCOUNT NUMBER:</div>
91
+ <div><%= I18n.t :acc_number %>:</div>
92
92
  <div class="notice"><%= @data[:company][:iban] %></div>
93
- <div>PAYMENT ID:</div>
93
+ <div><%= I18n.t :pay_id %>:</div>
94
94
  <div class="notice"><%= @data[:other][:pay_number] %></div>
95
95
  </div>
96
96
  </main>
97
97
  <footer>
98
98
  <div id="other">
99
99
  <div class="column-left">
100
- <p class="title">Our addresses</p>
100
+ <p class="title"><%= I18n.t :our_address %></p>
101
101
  <p><%= @data[:company][:company_address] %></p>
102
102
  <p><%= @data[:company][:company_city] %></p>
103
103
  <p><%= @data[:company][:company_country] %></p>
104
104
  </div>
105
105
  <div class="column-center">
106
- <p class="title">Legal</p>
107
- <p>VAT: <%= show(@data[:company][:vat]) %> </p>
108
- <p>IBAN: <%= show(@data[:company][:iban]) %> </p>
109
- <p>SWIFT: <%= show(@data[:company][:swift]) %> </p>
106
+ <p class="title"><%= I18n.t :legal %></p>
107
+ <p><%= I18n.t :vat %>: <%= show(@data[:company][:vat]) %> </p>
108
+ <p><%= I18n.t :iban %>: <%= show(@data[:company][:iban]) %> </p>
109
+ <p><%= I18n.t :swift %>: <%= show(@data[:company][:swift]) %> </p>
110
110
  </div>
111
111
  <div class="column-right">
112
112
  <p class="title">Contact</p>
113
113
  <p>EMAIL: <%= show(@data[:company][:company_email]) %> </p>
114
- <p>PHONE: <%= show(@data[:company][:company_phone]) %> </p>
114
+ <p><%= I18n.t :phone %>: <%= show(@data[:company][:company_phone]) %> </p>
115
115
  </div>
116
116
  </div>
117
117
  <p>
data/lib/billme.rb CHANGED
@@ -4,6 +4,12 @@ require_relative "billme/factory"
4
4
  require_relative "billme/section"
5
5
  require_relative "billme/services_section"
6
6
  require_relative "billme/service_details"
7
+ require 'i18n'
8
+
9
+ lang_path = File.expand_path('../../config', __FILE__)
10
+ I18n.load_path = Dir["#{lang_path}/locales/*.yml"]
11
+ I18n.backend.load_translations
12
+ I18n.default_locale = :en
7
13
 
8
14
  module Billme
9
15
  def self.bill(&block)
data/output.html CHANGED
@@ -272,7 +272,9 @@ footer {
272
272
  <p>PHONE: + 123 123 123 1 </p>
273
273
  </div>
274
274
  </div>
275
+ <p>
275
276
  Invoice was created on a computer and is valid without the signature and seal.
277
+ </p>
276
278
  </footer>
277
279
  </body>
278
280
  </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.37.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hrvoje G
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: i18n
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.7.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.7.0
41
55
  description: This gem generates invoice based on data provided. The output will be
42
56
  an erb generated HTML file and return html string as result. It is in very early
43
57
  stage and will support other features soon.
@@ -57,6 +71,8 @@ files:
57
71
  - billme.gemspec
58
72
  - bin/console
59
73
  - bin/setup
74
+ - config/locales/en.yml
75
+ - config/locales/hr.yml
60
76
  - example.rb
61
77
  - lib/billme.rb
62
78
  - lib/billme/factory.rb