billme 0.6.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79874c966435e3d0ddd1c24f89c0f9c48caa02a4
4
- data.tar.gz: 7ef092fc9824125c5dfe536525a8a24b8ad75c30
3
+ metadata.gz: e0aa2c619e4d3ed3a0d7155eda9d2a925e878a9f
4
+ data.tar.gz: 99451401737c4ddca46f4910357898cf4407a61d
5
5
  SHA512:
6
- metadata.gz: ed7f4d316bf7590867c869dcd164a3733aef0ed4b8e61da257fc3c557cdf6d15b664d9f592384850fef65a0bf956ddec14a8fe02ad706c5a9d6f18f996df6583
7
- data.tar.gz: 85b243b99c2cc772280d54ba491301fbed6868c4c8620c02730da064a58f30cbaf1cc5d3bca5bba2d8aa3b1621d777a5b7a2158495cb27ffb79ad5c108194492
6
+ metadata.gz: d81c1a008294ca1394429b6ec7ad62106760f94e6bbebda1dbda78e4e3e65688baeca3b205cbaea2519e1ffd08c2b392b564c36ad84d2c48a93ede143dcb4611
7
+ data.tar.gz: ba0a8b55e8405695591ba38e49fbf5328ff982aba0d49144a3a9a778fe2c4d3ad68a4e91989ad24c94a1c740836c279f22cb94b6c8f4a2319c13da9862980b74
data/example.rb CHANGED
@@ -20,6 +20,7 @@ Billme.bill do
20
20
  name "Federation"
21
21
  date "2015-05-05"
22
22
  due_date "2015-06-05"
23
+ bill_date "2015-06-01"
23
24
  address "Earth"
24
25
  email "starfleet@earth.com"
25
26
  vat "1234567891011"
@@ -27,18 +28,17 @@ Billme.bill do
27
28
 
28
29
  services do
29
30
  tax "0.25"
31
+ currency "$"
30
32
  service do
31
33
  name "Engage Romulans"
32
34
  description "Warmup for battle"
33
35
  unit "1000"
34
- currency "$"
35
36
  quantity "1"
36
37
  end
37
38
  service do
38
39
  name "Rescue mission"
39
40
  description "Rescue captive away teams"
40
41
  unit "2000"
41
- currency "$"
42
42
  quantity "2"
43
43
  end
44
44
  end
@@ -25,6 +25,7 @@ module Billme
25
25
  @data[:services] = section.data
26
26
  @data[:services][:total] = section.total
27
27
  @data[:services][:subtotal] = section.subtotal
28
+ @data[:services][:tax_percentage] = section.data[:tax].to_f * 100
28
29
  @data[:services][:tax] = section.total - section.subtotal
29
30
  end
30
31
 
@@ -1,3 +1,3 @@
1
1
  module Billme
2
- VERSION = "0.6.0"
2
+ VERSION = "0.13.0"
3
3
  end
@@ -17,16 +17,16 @@
17
17
  <% end %>
18
18
  <h1>INVOICE <%= @data[:number] %></h1>
19
19
  <div id="company" class="clearfix">
20
- <div><%= @data[:company][:company_name] %></div>
21
- <div><%= @data[:company][:company_address] %><br /> <%= @data[:company][:company_city] %>, <%= @data[:company][:company_country] %></div>
20
+ <div>ISSUED BY: <%= @data[:company][:company_name] %></div>
21
+ <div>ADDRESS: <%= @data[:company][:company_address] %><br /> <%= @data[:company][:company_city] %>, <%= @data[:company][:company_country] %></div>
22
22
  <% if @data[:company][:company_phone] %>
23
- <div><%= @data[:company][:company_phone] %></div>
23
+ <div>PHONE: <%= @data[:company][:company_phone] %></div>
24
24
  <% end %>
25
25
  <% if @data[:client][:vat] %>
26
26
  <div>VAT ID: <%= @data[:client][:vat] %></div>
27
27
  <% end %>
28
28
  <% if @data[:company][:company_email] %>
29
- <div><a href="mailto:<%= @data[:company][:company_email] %>"><%= @data[:company][:company_email] %></a></div>
29
+ <div>EMAIL: <a href="mailto:<%= @data[:company][:company_email] %>"><%= @data[:company][:company_email] %></a></div>
30
30
  <% end %>
31
31
  </div>
32
32
  <div id="project">
@@ -38,7 +38,8 @@
38
38
  <% if @data[:client][:email] %>
39
39
  <div><span>EMAIL</span> <a href="mailto:<%= @data[:client][:email] %>"><%= @data[:client][:email] %></a></div>
40
40
  <% end %>
41
- <div><span>DATE</span> <%= @data[:client][:date] %></div>
41
+ <div><span>BILL DATE</span> <%= @data[:client][:bill_date] %></div>
42
+ <div><span>DELIVERED</span> <%= @data[:client][:date] %></div>
42
43
  <div><span>DUE DATE</span> <%= @data[:client][:due_date] %></div>
43
44
  </div>
44
45
  </header>
@@ -58,23 +59,23 @@
58
59
  <tr>
59
60
  <td class="service"><%= service[:name] %></td>
60
61
  <td class="desc"><%= service[:description] %></td>
61
- <td class="unit"><%= service[:unit] %><%= service[:currency] %></td>
62
+ <td class="unit"><%= service[:unit] %><%= @data[:services][:currency] %></td>
62
63
  <td class="qty"><%= service[:quantity] %></td>
63
- <td class="total"><%= service[:quantity].to_i * service[:unit].to_i %><%= service[:currency] %></td>
64
+ <td class="total"><%= service[:quantity].to_i * service[:unit].to_i %><%= @data[:services][:currency] %></td>
64
65
  </tr>
65
66
  <% end %>
66
67
  <tr>
67
- <td colspan="4">SUBTOTAL</td>
68
- <td class="total"><%= @data[:services][:subtotal] %></td>
68
+ <td colspan="3">SUBTOTAL</td>
69
+ <td class="total"><td class="total"><%= @data[:services][:subtotal] %><%= @data[:services][:currency] %></td></td>
69
70
  </tr>
70
71
  <tr>
71
- <td colspan="4">TAX 25%</td>
72
- <td class="total"><td class="total"><%= @data[:services][:tax] %></td>
72
+ <td colspan="3">TAX <%= @data[:services][:tax_percentage] %>%</td>
73
+ <td class="total"><td class="total"><%= @data[:services][:tax] %><%= @data[:services][:currency] %></td>
73
74
  </td>
74
75
  </tr>
75
76
  <tr>
76
- <td colspan="4" class="grand total">TOTAL</td>
77
- <td class="grand total"><td class="total"><%= @data[:services][:total] %></td>
77
+ <td colspan="3" class="grand total">TOTAL</td>
78
+ <td class="grand total"><td class="total"><%= @data[:services][:total] %><%= @data[:services][:currency] %></td>
78
79
  </td>
79
80
  </tr>
80
81
  </tbody>
@@ -55,7 +55,7 @@ h1 {
55
55
  color: #5D6975;
56
56
  text-align: right;
57
57
  width: 52px;
58
- margin-right: 10px;
58
+ margin-right: 12px;
59
59
  display: inline-block;
60
60
  font-size: 0.8em;
61
61
  }
data/output.html CHANGED
@@ -62,7 +62,7 @@ h1 {
62
62
  color: #5D6975;
63
63
  text-align: right;
64
64
  width: 52px;
65
- margin-right: 10px;
65
+ margin-right: 21px;
66
66
  display: inline-block;
67
67
  font-size: 0.8em;
68
68
  }
@@ -148,14 +148,16 @@ footer {
148
148
 
149
149
  <h1>INVOICE 2016-1-1</h1>
150
150
  <div id="company" class="clearfix">
151
- <div>Enterprise LLC</div>
152
- <div>The Neutral Zone 123<br /> Beta Quadrant, Universe</div>
151
+ <div>ISSUED BY: Enterprise LLC</div>
152
+ <div>ADDRESS: The Neutral Zone 123<br /> Beta Quadrant, Universe</div>
153
153
 
154
- <div>+ 123 123 123 1</div>
154
+ <div>PHONE: + 123 123 123 1</div>
155
155
 
156
156
 
157
+ <div>VAT ID: 1234567891011</div>
157
158
 
158
- <div><a href="mailto:uss@ncc1701.com">uss@ncc1701.com</a></div>
159
+
160
+ <div>EMAIL: <a href="mailto:uss@ncc1701.com">uss@ncc1701.com</a></div>
159
161
 
160
162
  </div>
161
163
  <div id="project">
@@ -167,7 +169,8 @@ footer {
167
169
 
168
170
  <div><span>EMAIL</span> <a href="mailto:starfleet@earth.com">starfleet@earth.com</a></div>
169
171
 
170
- <div><span>DATE</span> 2015-05-05</div>
172
+ <div><span>BILL DATE</span> 2015-06-01</div>
173
+ <div><span>DATE DELIVERED</span> 2015-05-05</div>
171
174
  <div><span>DUE DATE</span> 2015-06-05</div>
172
175
  </div>
173
176
  </header>
@@ -201,17 +204,17 @@ footer {
201
204
  </tr>
202
205
 
203
206
  <tr>
204
- <td colspan="4">SUBTOTAL</td>
205
- <td class="total">3750.0</td>
207
+ <td colspan="3">SUBTOTAL</td>
208
+ <td class="total"><td class="total">3750.0$</td></td>
206
209
  </tr>
207
210
  <tr>
208
- <td colspan="4">TAX 25%</td>
209
- <td class="total"><td class="total">1250.0</td>
211
+ <td colspan="3">TAX 25.0%</td>
212
+ <td class="total"><td class="total">1250.0$</td>
210
213
  </td>
211
214
  </tr>
212
215
  <tr>
213
- <td colspan="4" class="grand total">TOTAL</td>
214
- <td class="grand total"><td class="total">5000</td>
216
+ <td colspan="3" class="grand total">TOTAL</td>
217
+ <td class="grand total"><td class="total">5000$</td>
215
218
  </td>
216
219
  </tr>
217
220
  </tbody>
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.6.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hrvoje G