billme 0.13.0 → 0.19.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: e0aa2c619e4d3ed3a0d7155eda9d2a925e878a9f
4
- data.tar.gz: 99451401737c4ddca46f4910357898cf4407a61d
3
+ metadata.gz: 83a50de3da8ed93ad81fac259507bb2d797f1473
4
+ data.tar.gz: 85b1e2af6d3ff305c22a0222936c73f461d3cfac
5
5
  SHA512:
6
- metadata.gz: d81c1a008294ca1394429b6ec7ad62106760f94e6bbebda1dbda78e4e3e65688baeca3b205cbaea2519e1ffd08c2b392b564c36ad84d2c48a93ede143dcb4611
7
- data.tar.gz: ba0a8b55e8405695591ba38e49fbf5328ff982aba0d49144a3a9a778fe2c4d3ad68a4e91989ad24c94a1c740836c279f22cb94b6c8f4a2319c13da9862980b74
6
+ metadata.gz: 04a50baf6661b93a32d4536b97e568e6b8c5cada5409adc37f819098051c70c2ebfb8010be4dd803eaa5865693448524cc139cb7162c412296601e0d10e4b0ba
7
+ data.tar.gz: d53eb9d46a6a9ed45812c0cf59f57b9f8f1cbee3c860c308aef05c9ed83f8e2a20c266d8aa5857617f4790c39a29086cf4288582900e9dedd3ef9ec770f9dbd7
data/example.rb CHANGED
@@ -13,6 +13,9 @@ Billme.bill do
13
13
  company_country "Universe"
14
14
  company_phone "+ 123 123 123 1"
15
15
  company_email "uss@ncc1701.com"
16
+ vat "123456789"
17
+ iban "XX123456789"
18
+ swift "XXX123"
16
19
  end
17
20
 
18
21
  client do
@@ -46,5 +49,8 @@ Billme.bill do
46
49
  other do
47
50
  notice "A finance charge of 1.5% will be made on unpaid balances after 30 days."
48
51
  footer "Invoice was created on a computer and is valid without the signature and seal."
52
+ payment_method "Credit card"
53
+ operator "Cpt Picard"
54
+ pay_number "2015-1-1"
49
55
  end
50
56
  end
@@ -2,4 +2,8 @@ class Object
2
2
  def self.demodulize
3
3
  self.to_s.gsub(/^.*::/, '')
4
4
  end
5
+
6
+ def show(input)
7
+ input ||= '-'
8
+ end
5
9
  end
@@ -1,3 +1,3 @@
1
1
  module Billme
2
- VERSION = "0.13.0"
2
+ VERSION = "0.19.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>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
- <% if @data[:company][:company_phone] %>
23
- <div>PHONE: <%= @data[:company][:company_phone] %></div>
20
+ <div><%= @data[:company][:company_name] %></div>
21
+ <% if @data[:company][:vat] %>
22
+ <div><%= @data[:company][:vat] %></div>
24
23
  <% end %>
25
- <% if @data[:client][:vat] %>
26
- <div>VAT ID: <%= @data[:client][:vat] %></div>
24
+ <div><%= @data[:company][:company_address] %><br /> <%= @data[:company][:company_city] %>, <%= @data[:company][:company_country] %></div>
25
+ <% if @data[:company][:company_phone] %>
26
+ <div><%= @data[:company][:company_phone] %></div>
27
27
  <% end %>
28
28
  <% if @data[:company][:company_email] %>
29
- <div>EMAIL: <a href="mailto:<%= @data[:company][:company_email] %>"><%= @data[:company][:company_email] %></a></div>
29
+ <div><a href="mailto:<%= @data[:company][:company_email] %>"><%= @data[:company][:company_email] %></a></div>
30
30
  <% end %>
31
31
  </div>
32
32
  <div id="project">
@@ -34,6 +34,7 @@
34
34
  <div><span>PROJECT</span> <%= @data[:client][:project_name] %></div>
35
35
  <% end %>
36
36
  <div><span>CLIENT</span> <%= @data[:client][:name] %></div>
37
+ <div><span>VAT</span> <%= @data[:client][:vat] %></div>
37
38
  <div><span>ADDRESS</span> <%= @data[:client][:address] %></div>
38
39
  <% if @data[:client][:email] %>
39
40
  <div><span>EMAIL</span> <a href="mailto:<%= @data[:client][:email] %>"><%= @data[:client][:email] %></a></div>
@@ -58,7 +59,7 @@
58
59
  <% @data[:services][:services].each do |service| %>
59
60
  <tr>
60
61
  <td class="service"><%= service[:name] %></td>
61
- <td class="desc"><%= service[:description] %></td>
62
+ <td class="desc"><%= service[:description] || '-' %></td>
62
63
  <td class="unit"><%= service[:unit] %><%= @data[:services][:currency] %></td>
63
64
  <td class="qty"><%= service[:quantity] %></td>
64
65
  <td class="total"><%= service[:quantity].to_i * service[:unit].to_i %><%= @data[:services][:currency] %></td>
@@ -75,7 +76,7 @@
75
76
  </tr>
76
77
  <tr>
77
78
  <td colspan="3" class="grand total">TOTAL</td>
78
- <td class="grand total"><td class="total"><%= @data[:services][:total] %><%= @data[:services][:currency] %></td>
79
+ <td class="grand total"><td class="grand total"><%= @data[:services][:total] %><%= @data[:services][:currency] %></td>
79
80
  </td>
80
81
  </tr>
81
82
  </tbody>
@@ -83,9 +84,36 @@
83
84
  <div id="notices">
84
85
  <div>NOTICE:</div>
85
86
  <div class="notice"><%= @data[:other][:notice] %></div>
87
+ <div>PAYMENT METHOD:</div>
88
+ <div class="notice"><%= @data[:other][:payment_method] %></div>
89
+ <div>OPERATOR:</div>
90
+ <div class="notice"><%= @data[:other][:operator] %></div>
91
+ <div>ACCOUNT NUMBER:</div>
92
+ <div class="notice"><%= @data[:company][:iban] %></div>
93
+ <div>PAYMENT ID:</div>
94
+ <div class="notice"><%= @data[:other][:pay_number] %></div>
86
95
  </div>
87
96
  </main>
88
97
  <footer>
98
+ <div id="other">
99
+ <div class="column-left">
100
+ <p class="title">Our addresses</p>
101
+ <p><%= @data[:company][:company_address] %></p>
102
+ <p><%= @data[:company][:company_city] %></p>
103
+ <p><%= @data[:company][:company_country] %></p>
104
+ </div>
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>
110
+ </div>
111
+ <div class="column-right">
112
+ <p class="title">Contact</p>
113
+ <p>EMAIL: <%= show(@data[:company][:company_email]) %> </p>
114
+ <p>PHONE: <%= show(@data[:company][:company_phone]) %> </p>
115
+ </div>
116
+ </div>
89
117
  <%= @data[:other][:footer] %>
90
118
  </footer>
91
119
  </body>
@@ -116,20 +116,39 @@ table td.total {
116
116
  }
117
117
 
118
118
  table td.grand {
119
- border-top: 1px solid #5D6975;;
119
+ border-top: 1px solid #5D6975;
120
120
  }
121
121
 
122
122
  #notices .notice {
123
123
  color: #5D6975;
124
124
  font-size: 1.2em;
125
+ margin-bottom: 10px;
126
+ }
127
+
128
+ #other {
129
+ color: #C1CED9;
130
+ font-size: 1.2em;
131
+ position: relative;
132
+ top: -20px;
133
+ text-align: center;
134
+ margin: 0 auto;
125
135
  }
126
136
 
137
+ #other .title {
138
+ font-size: 1.25em;
139
+ color: #5D6975;
140
+ }
141
+
142
+ .column-left{ float: left; width: 33%; }
143
+ .column-right{ float: right; width: 33%; }
144
+ .column-center{ display: inline-block; width: 33%; }
145
+
127
146
  footer {
128
147
  color: #5D6975;
129
148
  width: 100%;
130
149
  height: 30px;
131
- position: absolute;
132
- bottom: 0;
150
+ position: relative;
151
+ top: 100px;
133
152
  border-top: 1px solid #C1CED9;
134
153
  padding: 8px 0;
135
154
  text-align: center;
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: 21px;
65
+ margin-right: 12px;
66
66
  display: inline-block;
67
67
  font-size: 0.8em;
68
68
  }
@@ -123,20 +123,39 @@ table td.total {
123
123
  }
124
124
 
125
125
  table td.grand {
126
- border-top: 1px solid #5D6975;;
126
+ border-top: 1px solid #5D6975;
127
127
  }
128
128
 
129
129
  #notices .notice {
130
130
  color: #5D6975;
131
131
  font-size: 1.2em;
132
+ margin-bottom: 10px;
133
+ }
134
+
135
+ #other {
136
+ color: #C1CED9;
137
+ font-size: 1.2em;
138
+ position: relative;
139
+ top: -20px;
140
+ text-align: center;
141
+ margin: 0 auto;
142
+ }
143
+
144
+ #other .title {
145
+ font-size: 1.25em;
146
+ color: #5D6975;
132
147
  }
133
148
 
149
+ .column-left{ float: left; width: 33%; }
150
+ .column-right{ float: right; width: 33%; }
151
+ .column-center{ display: inline-block; width: 33%; }
152
+
134
153
  footer {
135
154
  color: #5D6975;
136
155
  width: 100%;
137
156
  height: 30px;
138
- position: absolute;
139
- bottom: 0;
157
+ position: relative;
158
+ top: 100px;
140
159
  border-top: 1px solid #C1CED9;
141
160
  padding: 8px 0;
142
161
  text-align: center;
@@ -148,16 +167,16 @@ footer {
148
167
 
149
168
  <h1>INVOICE 2016-1-1</h1>
150
169
  <div id="company" class="clearfix">
151
- <div>ISSUED BY: Enterprise LLC</div>
152
- <div>ADDRESS: The Neutral Zone 123<br /> Beta Quadrant, Universe</div>
170
+ <div>Enterprise LLC</div>
153
171
 
154
- <div>PHONE: + 123 123 123 1</div>
172
+ <div>123456789</div>
155
173
 
174
+ <div>The Neutral Zone 123<br /> Beta Quadrant, Universe</div>
156
175
 
157
- <div>VAT ID: 1234567891011</div>
176
+ <div>+ 123 123 123 1</div>
158
177
 
159
178
 
160
- <div>EMAIL: <a href="mailto:uss@ncc1701.com">uss@ncc1701.com</a></div>
179
+ <div><a href="mailto:uss@ncc1701.com">uss@ncc1701.com</a></div>
161
180
 
162
181
  </div>
163
182
  <div id="project">
@@ -165,12 +184,13 @@ footer {
165
184
  <div><span>PROJECT</span> Battle engagement</div>
166
185
 
167
186
  <div><span>CLIENT</span> Federation</div>
187
+ <div><span>VAT</span> 1234567891011</div>
168
188
  <div><span>ADDRESS</span> Earth</div>
169
189
 
170
190
  <div><span>EMAIL</span> <a href="mailto:starfleet@earth.com">starfleet@earth.com</a></div>
171
191
 
172
192
  <div><span>BILL DATE</span> 2015-06-01</div>
173
- <div><span>DATE DELIVERED</span> 2015-05-05</div>
193
+ <div><span>DELIVERED</span> 2015-05-05</div>
174
194
  <div><span>DUE DATE</span> 2015-06-05</div>
175
195
  </div>
176
196
  </header>
@@ -214,7 +234,7 @@ footer {
214
234
  </tr>
215
235
  <tr>
216
236
  <td colspan="3" class="grand total">TOTAL</td>
217
- <td class="grand total"><td class="total">5000$</td>
237
+ <td class="grand total"><td class="grand total">5000$</td>
218
238
  </td>
219
239
  </tr>
220
240
  </tbody>
@@ -222,9 +242,36 @@ footer {
222
242
  <div id="notices">
223
243
  <div>NOTICE:</div>
224
244
  <div class="notice">A finance charge of 1.5% will be made on unpaid balances after 30 days.</div>
245
+ <div>PAYMENT METHOD:</div>
246
+ <div class="notice">Credit card</div>
247
+ <div>OPERATOR:</div>
248
+ <div class="notice">Cpt Picard</div>
249
+ <div>ACCOUNT NUMBER:</div>
250
+ <div class="notice">XX123456789</div>
251
+ <div>PAYMENT ID:</div>
252
+ <div class="notice">2015-1-1</div>
225
253
  </div>
226
254
  </main>
227
255
  <footer>
256
+ <div id="other">
257
+ <div class="column-left">
258
+ <p class="title">Our addresses</p>
259
+ <p>The Neutral Zone 123</p>
260
+ <p>Beta Quadrant</p>
261
+ <p>Universe</p>
262
+ </div>
263
+ <div class="column-center">
264
+ <p class="title">Legal</p>
265
+ <p>VAT: 123456789 </p>
266
+ <p>IBAN: XX123456789 </p>
267
+ <p>SWIFT: XXX123 </p>
268
+ </div>
269
+ <div class="column-right">
270
+ <p class="title">Contact</p>
271
+ <p>EMAIL: uss@ncc1701.com </p>
272
+ <p>PHONE: + 123 123 123 1 </p>
273
+ </div>
274
+ </div>
228
275
  Invoice was created on a computer and is valid without the signature and seal.
229
276
  </footer>
230
277
  </body>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hrvoje G
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-25 00:00:00.000000000 Z
11
+ date: 2016-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler