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 +4 -4
- data/billme.gemspec +1 -0
- data/config/locales/en.yml +26 -0
- data/config/locales/hr.yml +26 -0
- data/lib/billme/version.rb +1 -1
- data/lib/billme/views/bill.html.erb +27 -27
- data/lib/billme.rb +6 -0
- data/output.html +2 -0
- metadata +17 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23e661eb837110287f394e6643b4b2316b210803
|
4
|
+
data.tar.gz: 9ac336a2b29a0f78826cd9ae81634e896076a1b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e4d7e35d9cc852aae4d7587bd2de13bed0e584a96e0827d92b744982f419ce8ae3514d913715acb09fe587f7a0f45e6836649f7faa157557e1e8c63014c3a86
|
7
|
+
data.tar.gz: d6fbf5f1e32f7dd82f1ed9f78793ab0a98411244dbb3f9fca222453b63cdc1af23e75298aa312fed74db127b2362a09cdafbd81b9c4a82cf26beefd31b890acd
|
data/billme.gemspec
CHANGED
@@ -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"
|
data/lib/billme/version.rb
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
<img src="<%= @data[:logo] %>" alt="Logo">
|
16
16
|
</div>
|
17
17
|
<% end %>
|
18
|
-
<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
|
34
|
+
<div><span><%= I18n.t :project %></span> <%= @data[:client][:project_name] %></div>
|
35
35
|
<% end %>
|
36
|
-
<div><span
|
37
|
-
<div><span
|
38
|
-
<div><span
|
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
|
43
|
-
<div><span
|
44
|
-
<div><span
|
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"
|
52
|
-
<th class="desc"
|
53
|
-
<th
|
54
|
-
<th
|
55
|
-
<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"
|
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"
|
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"
|
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
|
85
|
+
<div><%= I18n.t :notice %>:</div>
|
86
86
|
<div class="notice"><%= @data[:other][:notice] %></div>
|
87
|
-
<div
|
87
|
+
<div><%= I18n.t :payment_method %>:</div>
|
88
88
|
<div class="notice"><%= @data[:other][:payment_method] %></div>
|
89
|
-
<div
|
89
|
+
<div><%= I18n.t :operator %>:</div>
|
90
90
|
<div class="notice"><%= @data[:other][:operator] %></div>
|
91
|
-
<div
|
91
|
+
<div><%= I18n.t :acc_number %>:</div>
|
92
92
|
<div class="notice"><%= @data[:company][:iban] %></div>
|
93
|
-
<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"
|
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"
|
107
|
-
<p
|
108
|
-
<p
|
109
|
-
<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
|
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
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.
|
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
|