Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/default/css/style.css">
<style>
body {
color: #555;
font-size: 1em;
font-family: Arial, Verdana, sans-serif;
}
table {
width:100%;
border-spacing:0;
border-collapse: collapse;
}
.text-right {
text-align: right;
}
.color-l { color: #aaa; }
.color-n { color: #888; }
.color-d { color: #555; }
.border-bottom-l {
border-bottom-width: 1px;
border-style: solid;
border-color: #aaa;
}
.border-bottom-n {
border-bottom-width: 1px;
border-style: solid;
border-color: #888;
}
.border-bottom-d {
border-bottom-width: 1px;
border-style: solid;
border-color: #555;
}
.border-top-l {
border-top-width: 1px;
border-style: solid;
border-color: #aaa;
}
.border-top-n {
border-top-width: 1px;
border-style: solid;
border-color: #888;
}
.border-top-d {
border-top-width: 1px;
border-style: solid;
border-color: #555;
}
.background-l { background-color: #eee; }
#header table {
width:100%;
padding: 0;
}
.company-details,
.company-details h3,
.company-details p,
.invoice-details {
text-align: right;
}
.company-name,
.invoice-id {
color: #333 !important;
}
.invoice-details td {
padding: 0.2em 0.3em;
}
.invoice-items td,
.invoice-items th {
padding: 0.2em 0.4em 0.4em;
}
.seperator {
height: 25px;
margin-bottom: 15px;
}
</style>
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width:70%">
<div style="display: block; height: 2cm"></div>
<div class="invoice-to">
<p><?php echo lang('bill_to'); ?>:</p>
<p><b><?php echo $invoice->client_name; ?></b><br/>
<?php if ($invoice->client_address_1) {
echo $invoice->client_address_1 . '<br/>';
} ?>
<?php if ($invoice->client_address_2) {
echo $invoice->client_address_2 . '<br/>';
} ?>
<?php if ($invoice->client_city) {
echo $invoice->client_city . ' ';
} ?>
<?php if ($invoice->client_zip) {
echo $invoice->client_zip . '<br/>';
} ?>
<?php if ($invoice->client_state) {
echo $invoice->client_state . '<br/>';
} ?>
<?php if ($invoice->client_phone) { ?>
<abbr>P:</abbr><?php echo $invoice->client_phone; ?><br/>
<?php } ?>
</p>
</div>
</td>
<td class="text-right" style="width:30%;">
<div class="company-details">
<?php echo invoice_logo_pdf(); ?>
<h3 class="company-name text-right">
<?php echo $invoice->user_name; ?>
</h3>
<p class="text-right">
<?php if ($invoice->user_address_1) {
echo $invoice->user_address_1 . '<br/>';
}?>
<?php if ($invoice->user_address_2) {
echo $invoice->user_address_2 . '<br/>';
} ?>
<?php if ($invoice->user_city) {
echo $invoice->user_city . ' ';
} ?>
<?php if ($invoice->user_zip) {
echo $invoice->user_zip . '<br/>';
} ?>
<?php if ($invoice->user_state) {
echo $invoice->user_state . '<br/>';
} ?>
<?php if ($invoice->user_phone) {
?><abbr>P:</abbr><?php echo $invoice->user_phone; ?><br><?php
} ?>
<?php if ($invoice->user_fax) {
?><abbr>F:</abbr><?php echo $invoice->user_fax; ?><?php
} ?>
</p>
</div>
<br/>
<div class="invoice-details">
<table>
<tbody>
<tr>
<td class="text-right color-n">
<?php echo lang('invoice_date'); ?>:
</td>
<td class="text-right color-n">
<?php echo date_from_mysql($invoice->invoice_date_created, TRUE); ?>
</td>
</tr>
<tr>
<td class="text-right color-n">
<?php echo lang('due_date'); ?>:
</td>
<td class="text-right color-n">
<?php echo date_from_mysql($invoice->invoice_date_due, TRUE); ?>
</td>
</tr>
<tr>
<td class="text-right color-n">
<?php echo lang('amount_due'); ?>:
</td>
<td class="text-right color-n">
<?php echo format_currency($invoice->invoice_balance); ?>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</table>
</div>
<br/>
<h2 class="invoice-id"><?php echo lang('invoice'); ?> <?php echo $invoice->invoice_number; ?></h2>
<br/>
<div class="invoice-items">
<table class="table table-striped" style="width: 100%;">
<thead>
<tr class="border-bottom-d">
<th class="color-d"><?php echo lang('item'); ?></th>
<th class="color-d"><?php echo lang('description'); ?></th>
<th class="text-right color-d"><?php echo lang('qty'); ?></th>
<th class="text-right color-d"><?php echo lang('price'); ?></th>
<th class="text-right color-d"><?php echo lang('total'); ?></th>
</tr>
</thead>
<tbody>
<?php
$linecounter = 0;
foreach ($items as $item) { ?>
<tr class="border-bottom-n <?php echo ($linecounter % 2 ? 'background-l' : '')?>">
<td><?php echo $item->item_name; ?></td>
<td><?php echo nl2br($item->item_description); ?></td>
<td class="text-right">
<?php echo format_amount($item->item_quantity); ?>
</td>
<td class="text-right">
<?php echo format_currency($item->item_price); ?>
</td>
<td class="text-right">
<?php echo format_currency($item->item_subtotal); ?>
</td>
</tr>
<?php $linecounter++; ?>
<?php } ?>
</tbody>
</table>
<table>
<tr>
<td class="text-right">
<table class="amount-summary">
<tr>
<td class="text-right color-n">
<?php echo lang('subtotal'); ?>:
</td>
<td class="text-right color-n">
<?php echo format_currency($invoice->invoice_item_subtotal); ?>
</td>
</tr>
<?php if ($invoice->invoice_item_tax_total > 0) { ?>
<tr>
<td class="text-right color-n">
<?php echo lang('item_tax'); ?>
</td>
<td class="text-right color-n">
<?php echo format_currency($invoice->invoice_item_tax_total); ?>
</td>
</tr>
<?php } ?>
<?php foreach ($invoice_tax_rates as $invoice_tax_rate) : ?>
<tr>
<td class="text-right color-n">
<?php echo $invoice_tax_rate->invoice_tax_rate_name . ' ' . $invoice_tax_rate->invoice_tax_rate_percent; ?>%
</td>
<td class="text-right color-n">
<?php echo format_currency($invoice_tax_rate->invoice_tax_rate_amount); ?>
</td>
</tr>
<?php endforeach ?>
<tr class="border-top-l amount-total">
<td class="text-right color-d">
<?php echo lang('total'); ?>:
</td>
<td class="text-right color-d">
<?php echo format_currency($invoice->invoice_total); ?>
</td>
</tr>
<tr>
<td class="text-right color-d">
<?php echo lang('paid'); ?>:
</td>
<td class="text-right color-d">
<?php echo format_currency($invoice->invoice_paid) ?>
</td>
</tr>
<tr>
<td class="text-right color-d">
<b><?php echo lang('balance'); ?>:</b>
</td>
<td class="text-right color-d">
<b><?php echo format_currency($invoice->invoice_balance) ?></b>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="seperator border-bottom-l"></div>
<?php if ($invoice->invoice_terms) { ?>
<h4><?php echo lang('terms'); ?></h4>
<p><?php echo nl2br($invoice->invoice_terms); ?></p>
<?php } ?>
</div>
</body>
</html>