Annotation of RT/Invoicing/test.pl, Revision 1.1.1.1
1.1 andrew 1: #!/usr/bin/perl
2: # $AFresh1$
3: use strict;
4: use warnings;
5:
6: use Template;
7:
8: my %invoice = (
9: id => 1,
10: info1 => 'Visit me online at http://example.com',
11: info2 => 'Create a new ticket rt@example.com',
12: from => {
13: name => 'Example Company',
14: #attn => 'Jane Smith',
15: addr1 => '22115 Central Way',
16: addr2 => 'Suite C',
17: city => 'Anytown',
18: state => 'America',
19: zip => '11111',
20: phone => '(800) 555-1212',
21: email => 'company@example.com',
22: },
23: to => {
24: name => 'John Doe',
25: addr1 => '123 W Main St',
26: city => 'Anytown',
27: state => 'America',
28: zip => '11111',
29: },
30: projects => [
31: {
32: title => 'Weekly Retainer',
33: fees => [
34: {
35: contents => '2011-03-06 through 2011-03-12',
36: count => 1,
37: rate => 300,
38: },
39: {
40: contents => '2011-03-13 through 2011-03-19',
41: count => 1,
42: rate => 300,
43: },
44: ],
45: },
46: {
47: id => 60,
48: title => '60: A Special Project',
49: fees => [
50: {
51: contents => '2011-01-01: Talk a lot (727)',
52: count => 0.33,
53: rate => 75,
54: },
55: {
56: contents => '2011-01-15: Write Stuff (730)',
57: count => 1.5,
58: rate => 100,
59: },
60: ],
61: discounts => [
62: {
63: contents => 'Included Hours',
64: amount => .33 * 75,
65: },
66: {
67: contents => 'Included Hours',
68: amount => 1.5 * 100,
69: },
70: ],
71: },
72: {
73: id => 65,
74: title => '65: More work!',
75: fees => [
76: {
77: contents => '2011-01-06: Define Project (751)',
78: count => 0.33,
79: rate => 75,
80: },
81: {
82: contents => '2011-01-11: Code it up! (823)',
83: count => 5,
84: rate => 100,
85: },
86: {
87: contents => '2011-01-12: REdefine Project (903)',
88: count => 0.25,
89: rate => 75,
90: },
91: {
92: contents => '2011-01-13: Change everything: 933',
93: count => 3,
94: rate => 125,
95: },
96: ],
97: discounts => [
98: {
99: contents => 'Included Hours',
100: amount => (.33 * 75) + ( 3.33 * 100 ),
101: },
102: {
103: contents => 'Included Hours',
104: amount => (.25 * 75 ) + (2.25 * 100),
105: },
106: ],
107: },
108: {
109: id => 85,
110: title => '85: Replace stuff',
111: fees => [
112: {
113: contents => '2011-01-13: Go unplug, replace, replug (834)',
114: count => 2,
115: rate => 125,
116: },
117: ],
118: expenses => [
119: {
120: contents => '2x unbroken thingys',
121: amount => 25,
122: }
123: ],
124: },
125: {
126: id => 90,
127: title => '90: Make a two page invoice',
128: fees => [
129: {
130: contents => '2011-01-13: Add some stuff (834)',
131: count => 2,
132: rate => 125,
133: },
134: ],
135: },
136: ],
137: );
138:
139: my $tt = Template->new;
140:
141: $tt->process( 'invoice.tex.tt', \%invoice, 'invoice.pdf' ) || die $tt->error . "\n";
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>