Pratt 1.6.8-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/.exrc +61 -0
  2. data/.gitignore +6 -0
  3. data/History.txt +6 -0
  4. data/Manifest.txt +46 -0
  5. data/Pratt.gemspec +173 -0
  6. data/Pratt.mm +1867 -0
  7. data/README.txt +67 -0
  8. data/Rakefile +96 -0
  9. data/TODO +56 -0
  10. data/VERSION +1 -0
  11. data/bin/pratt +13 -0
  12. data/config.rb +19 -0
  13. data/db/sqlite_databases_go_here +0 -0
  14. data/db/zips.csv.zip +0 -0
  15. data/lib/models.rb +8 -0
  16. data/lib/pratt.rb +308 -0
  17. data/lib/pratt/core_ext.rb +6 -0
  18. data/lib/pratt/core_ext/array.rb +20 -0
  19. data/lib/pratt/core_ext/float.rb +29 -0
  20. data/lib/pratt/core_ext/nil.rb +5 -0
  21. data/lib/pratt/core_ext/numeric.rb +9 -0
  22. data/lib/pratt/core_ext/string.rb +31 -0
  23. data/lib/pratt/core_ext/time.rb +20 -0
  24. data/lib/pratt/dialogs.rb +81 -0
  25. data/lib/pratt/formatting.rb +19 -0
  26. data/lib/pratt/project_actions.rb +25 -0
  27. data/lib/pratt/reports.rb +140 -0
  28. data/models/app.rb +39 -0
  29. data/models/customer.rb +50 -0
  30. data/models/invoice.rb +28 -0
  31. data/models/invoice_whence.rb +18 -0
  32. data/models/payment.rb +22 -0
  33. data/models/pratt.rb +15 -0
  34. data/models/project.rb +89 -0
  35. data/models/whence.rb +77 -0
  36. data/models/zip.rb +27 -0
  37. data/pratt.mm +1875 -0
  38. data/spec/app_spec.rb +48 -0
  39. data/spec/array_spec.rb +24 -0
  40. data/spec/customer_spec.rb +31 -0
  41. data/spec/fixtures/empty_graph.expectation +8 -0
  42. data/spec/fixtures/graph.expectation +13 -0
  43. data/spec/fixtures/proportions.expectation +4 -0
  44. data/spec/float_spec.rb +24 -0
  45. data/spec/formatting_spec.rb +7 -0
  46. data/spec/money_spec.rb +9 -0
  47. data/spec/nil_class_spec.rb +8 -0
  48. data/spec/numeric_spec.rb +30 -0
  49. data/spec/payment_spec.rb +19 -0
  50. data/spec/pratt_spec.rb +106 -0
  51. data/spec/project_spec.rb +182 -0
  52. data/spec/rcov.opts +0 -0
  53. data/spec/report_action_spec.rb +83 -0
  54. data/spec/report_spec.rb +205 -0
  55. data/spec/seed_data.rb +33 -0
  56. data/spec/spec.opts +1 -0
  57. data/spec/spec_helper.rb +24 -0
  58. data/spec/string_ext_spec.rb +33 -0
  59. data/spec/whence_spec.rb +54 -0
  60. data/tasks/pratt.rb +87 -0
  61. data/templates/model.eruby +12 -0
  62. data/templates/spec.eruby +8 -0
  63. data/views/current.eruby +5 -0
  64. data/views/general-invoice.eruby +538 -0
  65. data/views/graph.eruby +16 -0
  66. data/views/invoice.eruby +148 -0
  67. data/views/main.rb +90 -0
  68. data/views/pid.eruby +3 -0
  69. data/views/pop.rb +78 -0
  70. data/views/proportions.eruby +4 -0
  71. data/views/raw.eruby +11 -0
  72. metadata +275 -0
@@ -0,0 +1,12 @@
1
+ class <%= klass.capitalize.singularize %> < ActiveRecord::Base
2
+
3
+ class << self
4
+ def migrate up = :up
5
+ ActiveRecord::Schema.define do
6
+ create_table :<%= klass.downcase.pluralize %> do |t|
7
+ end if up == :up
8
+ drop_table :<%= klass.downcase.pluralize %> if up == :down
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+ require 'pratt'
3
+
4
+ describe <%= klass.capitalize.singularize %> do
5
+ it "has a test" do
6
+ flunk
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ projects: <%= @project_names.join ' ' %>
2
+ <% if @last_whence.end_at.nil? %>
3
+ started: <%= @last_whence.start_at.strftime(Pratt::FMT).send(:blue) %>
4
+ next prompt: <%= ( @time_til / 60.0 ).format_integer.yellow %> min <%= ( @time_til % 60 ).format_integer.yellow %> sec
5
+ <% end %>
@@ -0,0 +1,538 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <!--This file was converted to xhtml by OpenOffice.org - see http://xml.openoffice.org/odf2xhtml for more info.-->
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ <title xml:lang="en-US">Frogstarr78 Software Invoice</title>
7
+
8
+ <style type="text/css">
9
+ @page { }
10
+ body {
11
+ padding: 15px;
12
+ }
13
+ table {
14
+ border-collapse: collapse;
15
+ border-spacing: 0;
16
+ empty-cells: show
17
+ }
18
+ td, th {
19
+ vertical-align: top;
20
+ font-size: 10pt;
21
+ }
22
+ * {
23
+ margin: 0;
24
+ }
25
+ .Default {
26
+ font-family: Arial;
27
+ }
28
+ .ce1 {
29
+ color: #4CBB17;
30
+ font-family: sans-serif;
31
+ font-size: 16pt;
32
+ font-variant: small-caps;
33
+ }
34
+ .ce11 {
35
+ font-family: Arial;
36
+ border: 1px solid #666666;
37
+ border-top: none;
38
+ vertical-align: top;
39
+ text-align: left ! important;
40
+ margin-left: 0in;
41
+ }
42
+ .ce12 {
43
+ font-family: Arial;
44
+ border-style: none;
45
+ vertical-align: top;
46
+ text-align: center ! important;
47
+ margin-left: 0in;
48
+ font-size: 10pt;
49
+ font-style: normal;
50
+ text-shadow: none;
51
+ text-decoration: none ! important;
52
+ font-weight: normal;
53
+ }
54
+ .ce13 {
55
+ font-family: Arial;
56
+ border-style: none;
57
+ vertical-align: top;
58
+ text-align: center ! important;
59
+ margin-left: 0in;
60
+ font-size: 10pt;
61
+ font-style: normal;
62
+ text-shadow: none;
63
+ text-decoration: none ! important;
64
+ font-weight: normal;
65
+ }
66
+ .ce14 {
67
+ font-family: Trebuchet MS;
68
+ border-style: none;
69
+ vertical-align: top;
70
+ text-align: center ! important;
71
+ margin-left: 0in;
72
+ font-size: 12pt;
73
+ font-style: italic;
74
+ text-shadow: none;
75
+ text-decoration: none ! important;
76
+ font-weight: bold;
77
+ }
78
+ .ce15 {
79
+ font-family: Trebuchet MS;
80
+ border-style: none;
81
+ vertical-align: top;
82
+ text-align: right ! important;
83
+ margin-left: 0in;
84
+ color: #4CBB17;
85
+ font-size: 28pt;
86
+ font-style: normal;
87
+ text-shadow: none;
88
+ text-decoration: none ! important;
89
+ font-weight: bold;
90
+ }
91
+ .ce16 {
92
+ font-family: Arial;
93
+ border-style: none;
94
+ vertical-align: top;
95
+ text-align: center ! important;
96
+ margin-left: 0in;
97
+ }
98
+ .ce18 {
99
+ font-family: Arial;
100
+ border: none;
101
+ border-bottom: 1px solid #000000;
102
+ vertical-align: top;
103
+ text-align: center ! important;
104
+ margin-left: 0in;
105
+ }
106
+ .ce20 {
107
+ font-family: Trebuchet MS;
108
+ background-color: transparent;
109
+ vertical-align: top;
110
+ text-align: left ! important;
111
+ margin-left: 0in;
112
+ font-size: 10pt;
113
+ font-style: normal;
114
+ text-shadow: none;
115
+ text-decoration: none ! important;
116
+ font-weight: bold;
117
+ }
118
+ .ce21 {
119
+ font-family: Trebuchet MS;
120
+ font-size: 10pt;
121
+ font-style: normal;
122
+ text-shadow: none;
123
+ text-decoration: none ! important;
124
+ font-weight: bold;
125
+ }
126
+ .ce22 {
127
+ font-family: Arial;
128
+ border: none;
129
+ border-right: 1px solid #000000;
130
+ vertical-align: top;
131
+ text-align: center ! important;
132
+ margin-left: 0in;
133
+ }
134
+ .ce25 {
135
+ font-family: Arial;
136
+ border: none;
137
+ vertical-align: top;
138
+ text-align: center ! important;
139
+ margin-left: 0in;
140
+ font-size: 10pt;
141
+ font-style: normal;
142
+ text-shadow: none;
143
+ text-decoration: none ! important;
144
+ font-weight: normal;
145
+ }
146
+ .ce26 {
147
+ font-family: Trebuchet MS;
148
+ border-style: none;
149
+ vertical-align: top;
150
+ text-align: center ! important;
151
+ margin-left: 0in;
152
+ font-size: 10pt;
153
+ font-style: normal;
154
+ text-shadow: none;
155
+ text-decoration: none ! important;
156
+ font-weight: bold;
157
+ }
158
+ .ce28 {
159
+ font-size: 10pt;
160
+ font-style: normal;
161
+ text-shadow: none;
162
+ text-decoration: none ! important;
163
+ font-weight: normal;
164
+ }
165
+ .ce29 {
166
+ font-family: Arial;
167
+ border: 1px solid #000000;
168
+ vertical-align: top;
169
+ text-align: center ! important;
170
+ margin-left: 0in;
171
+ }
172
+ .ce3 {
173
+ font-family: Arial;
174
+ font-size: 10pt;
175
+ font-style: normal;
176
+ text-shadow: none;
177
+ text-decoration: none ! important;
178
+ font-weight: normal;
179
+ }
180
+ .ce31 {
181
+ font-family: Arial;
182
+ border-bottom: none;
183
+ border-left: 0.0879cm solid #000000;
184
+ border-right: 0.0879cm solid #000000;
185
+ border-top: none;
186
+ }
187
+ .ce32 {
188
+ font-family: Arial;
189
+ border: 0.0879cm solid #000000;
190
+ border-top: none;
191
+ }
192
+ .ce34 {
193
+ font-family: Arial;
194
+ border: none;
195
+ }
196
+ .ce35 {
197
+ font-family: Arial;
198
+ border: none;
199
+ border-bottom: 0.1049cm double #000000;
200
+ background-color: transparent;
201
+ }
202
+ .ce36 {
203
+ font-family: Trebuchet MS;
204
+ border-bottom: 0.1049cm double #000000;
205
+ background-color: transparent;
206
+ font-size: 10pt;
207
+ font-style: normal;
208
+ text-shadow: none;
209
+ text-decoration: none
210
+ }
211
+ .ce5 {
212
+ background-color: #4CBB17;
213
+ border: none;
214
+ color: #ffffff;
215
+ font-family: Trebuchet MS;
216
+ font-size: 10pt;
217
+ font-style: normal;
218
+ font-weight: bold;
219
+ margin-left: 0in;
220
+ text-align: center ! important;
221
+ text-decoration: none ! important;
222
+ text-shadow: none;
223
+ vertical-align: top;
224
+ }
225
+ .ce30 {
226
+ border: 0.0879cm solid #000000;
227
+ border-bottom: none;
228
+ }
229
+ .ceN {
230
+ vertical-align: top;
231
+ text-align: left ! important;
232
+ margin-left: 0in;
233
+ font-size: 10pt;
234
+ font-style: normal;
235
+ text-shadow: none;
236
+ text-decoration: none ! important;
237
+ font-weight: normal;
238
+ }
239
+ .ce6 {
240
+ padding-left: 7px;
241
+ font-family: Arial;
242
+ border-bottom: none;
243
+ border-left: 1px solid #000000;
244
+ border-right: 1px solid #000000;
245
+ border-top: none;
246
+
247
+ }
248
+ .ce8 {
249
+ font-family: Trebuchet MS;
250
+ border: none;
251
+ border-bottom: 1px solid #666666;
252
+ background-color: #c0c0c0;
253
+ font-weight: bold;
254
+ }
255
+ .ce10 {
256
+ font-family: Arial;
257
+ border: 1px solid #666666;
258
+ border-bottom: none;
259
+ border-top: none;
260
+ }
261
+ .ro1 {
262
+ height: 0.4736in;
263
+ }
264
+ .ro2 {
265
+ height: 0.1736in;
266
+ }
267
+ .ro3 {
268
+ height: 0.1807in;
269
+ }
270
+ .ro4 {
271
+ height: 0.2071in;
272
+ }
273
+
274
+ .TN {
275
+ font-style: normal;
276
+ text-shadow: none;
277
+ font-weight: normal;
278
+ text-decoration: none;
279
+ font-family: Trebuchet MS;
280
+ }
281
+
282
+ .T1 {
283
+ float: left;
284
+ font-size: 38pt;
285
+ text-decoration: underline;
286
+ }
287
+ .T2 {
288
+ font-size: 16pt;
289
+ }
290
+ .T3 {
291
+ font-family: Arial;
292
+ font-size: 10pt;
293
+ }
294
+ </style>
295
+
296
+ </head>
297
+
298
+ <body dir="ltr">
299
+ <table border="0" cellspacing="0" cellpadding="0" class="ta1">
300
+ <colgroup>
301
+ <col width="224"/>
302
+ <col width="181"/>
303
+ <col width="100"/>
304
+ <col width="100"/>
305
+ <col width="140"/>
306
+ </colgroup>
307
+
308
+ <tr class="ro1">
309
+ <td colspan="3" class="ce1">
310
+ <p>
311
+ <span style="float:left;">
312
+ <span style="float: left; height: 25px; padding-top: 11px;">
313
+ Frogstarr
314
+ </span>
315
+
316
+ <span style="float: left; clear: left;">
317
+ Software
318
+ </span>
319
+ </span>
320
+ <span class="TN T1">78</span>
321
+ </p>
322
+ </td>
323
+ <td colspan="2" class="ce15">
324
+ <p>INVOICE</p>
325
+ </td>
326
+ </tr>
327
+
328
+ <tr class="ro2">
329
+ <td colspan="2" class="ce3">
330
+ <p>312 NW 7<span class="TN T3">th</span></p>
331
+ </td>
332
+ <td class="Default"> </td>
333
+ <td class="ce20">
334
+ <p>DATE:</p>
335
+ </td>
336
+ <td style="text-align: right; background-color: #AAE09A;" class="ce29">
337
+ <p><%= when_to.send("beginning_of_#{scale}").strftime(Pratt::INVOICE_FMT) %> to <%= when_to.send("end_of_#{scale}").strftime(Pratt::INVOICE_FMT) %></p>
338
+ </td>
339
+ </tr>
340
+ <tr class="ro2">
341
+ <td colspan="2" class="ce3">
342
+ <p>Milton-Freewater, OR 97862</p>
343
+ </td>
344
+ <td class="Default"> </td>
345
+ <td class="ce20">
346
+ <p>INVOICE #</p>
347
+ </td>
348
+ <td class="ce29 ce28">
349
+ <p><%= project.customer.id %>-<%= when_to.week %>-01</p>
350
+ </td>
351
+ </tr>
352
+ <tr class="ro3">
353
+ <td colspan="2" class="ce3">
354
+ <p>Phone: 509-730-5401</p>
355
+ </td>
356
+ <td class="Default"> </td>
357
+ <td class="ce21">
358
+ <p>Customer ID</p>
359
+ </td>
360
+ <td style="text-align: right;" class="ce29">
361
+ <p><%= project.customer.id %></p>
362
+ </td>
363
+ </tr>
364
+
365
+ <tr class="ro2">
366
+ <td colspan="5" class="Default"> </td>
367
+ </tr>
368
+ <tr class="ro2">
369
+ <td colspan="5" class="Default"> </td>
370
+ </tr>
371
+
372
+ <tr class="ro2">
373
+ <td style="border-bottom: 1px solid #000000; text-align: left;" class="ce5">
374
+ <p>BILL TO:</p>
375
+ </td>
376
+ </tr>
377
+ <tr class="ro2">
378
+ <td class="ce3">
379
+ <p><%= project.customer.name %></p>
380
+ </td>
381
+ </tr>
382
+ <%
383
+ if project.customer.address
384
+ %>
385
+ <tr class="ro2">
386
+ <td class="ce3">
387
+ <p><%= project.customer.address %></p>
388
+ </td>
389
+ </tr>
390
+ <%
391
+ end
392
+
393
+ if project.customer.company_name
394
+ %>
395
+ <tr class="ro2">
396
+ <td class="ce3">
397
+ <p><%= project.customer.company_name %></p>
398
+ </td>
399
+ </tr>
400
+ <%
401
+ end
402
+
403
+ if project.customer.zip
404
+ %>
405
+ <tr class="ro2">
406
+ <td class="ce3">
407
+ <p><%= project.customer.city_state_zip %></p>
408
+ </td>
409
+ </tr>
410
+ <%
411
+ end
412
+
413
+ if project.customer.phone
414
+ %>
415
+ <tr class="ro2">
416
+ <td class="ce3">
417
+ <p><%= project.customer.phone.pretty_print %></p>
418
+ </td>
419
+ </tr>
420
+ <%
421
+ end
422
+ %>
423
+ <tr class="ro2">
424
+ <td class="Default"> </td>
425
+ </tr>
426
+ <tr class="ro2">
427
+ <td colspan="2" class="ce5">
428
+ <p>DESCRIPTION</p>
429
+ </td>
430
+ <td class="ce5">
431
+ <p>HOURS</p>
432
+ </td>
433
+ <td class="ce5">
434
+ <p>RATE</p>
435
+ </td>
436
+ <td class="ce5 ce30">
437
+ <p>AMOUNT</p>
438
+ </td>
439
+ </tr>
440
+
441
+ <% @projects.each do |project| %>
442
+ <tr class="ro2">
443
+ <td colspan="2" class="ceN ce6">
444
+ <p><%= project.name %></p>
445
+ </td>
446
+ <td style="text-align:right; " class="ce16">
447
+ <p><%= project.time_spent(scale, when_to).pretty_print %></p>
448
+ </td>
449
+ <td style="text-align:right; " class="ce22">
450
+ <p><%= project.payment.pretty_print %></p>
451
+ </td>
452
+ <td style="text-align:right; " class="ce31">
453
+ <p><%= project.amount( project.time_spent( scale, when_to ) ).pretty_print %></p>
454
+ </td>
455
+ </tr>
456
+ <% end %>
457
+ <tr class="ro2">
458
+ <td colspan="2" style="border: 1px solid black; border-top: none;"> </td>
459
+ <td class="ce18"> </td>
460
+ <td style="border-right: 1px solid #000000;" class="ce18"> </td>
461
+ <td class="ce32"> </td>
462
+ </tr>
463
+
464
+ <tr class="ro2">
465
+ <td colspan="2" class="Default"> </td>
466
+ <td class="Default"> </td>
467
+ <td class="Default ce35">
468
+ <!--p>SUBTOTAL</p-->
469
+ </td>
470
+ <td style="text-align:right; " class="ce36">
471
+ <!--p><%= project.amount( project.time_spent( scale, when_to ) ).pretty_print %></p-->
472
+ </td>
473
+ </tr>
474
+ <tr class="ro2">
475
+ <td colspan="2" class="ceN ce8">
476
+ <p>OTHER COMMENTS</p>
477
+ </td>
478
+ <td class="Default"> </td>
479
+ <td class="ce21">
480
+ <p>TOTAL</p>
481
+ </td>
482
+ <td style="text-align:right; " class="ce21 ce34">
483
+ <p><%= project.amount( project.time_spent( scale, when_to ) ).pretty_print %></p>
484
+ </td>
485
+ </tr>
486
+ <tr class="ro2">
487
+ <td colspan="2" class="ceN ce10">
488
+ <p>1. Total payment due in 30 days</p>
489
+ </td>
490
+ </tr>
491
+ <tr class="ro2">
492
+ <td colspan="2" class="ceN ce10">
493
+ <p>2. Please include the invoice number on your check</p>
494
+ </td>
495
+ <td class="Default"> </td>
496
+ <td colspan="2" class="ce25">
497
+ <p>Make all checks payable to</p>
498
+ </td>
499
+ </tr>
500
+
501
+ <tr class="ro2">
502
+ <td colspan="2" class="ceN ce10"> </td>
503
+ <td class="Default"> </td>
504
+ <td colspan="2" class="ce26">
505
+ <p>Frogstarr78 Software</p>
506
+ </td>
507
+ </tr>
508
+
509
+ <tr class="ro2">
510
+ <td colspan="2" class="ce11"> </td>
511
+ </tr>
512
+ <tr class="ro2">
513
+ <td colspan="5" class="Default"> </td>
514
+ </tr>
515
+
516
+ <tr class="ro2">
517
+ <td colspan="5" class="ce12">
518
+ <p>If you have any questions about this invoice, please contact</p>
519
+ </td>
520
+ </tr>
521
+ <tr class="ro3">
522
+ <td colspan="5" class="ce13">
523
+ <p>
524
+ Scott Noel-Hemming, 509.301.6893, <a href="mailto:frogstarr78@gmail.com">frogstarr78@gmail.com</a>
525
+ </p>
526
+ </td>
527
+ </tr>
528
+ <tr class="ro2">
529
+ <td colspan="5" class="Default"> </td>
530
+ </tr>
531
+ <tr class="ro4">
532
+ <td colspan="5" class="ce14">
533
+ <p>Thank You For Your Business!</p>
534
+ </td>
535
+ </tr>
536
+ </table>
537
+ </body>
538
+ </html>