Skip to content

Commit

Permalink
Added templates
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Jul 28, 2015
1 parent 07e8fb5 commit b19a463
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 0 deletions.
87 changes: 87 additions & 0 deletions tt_lib/invoice.tt
@@ -0,0 +1,87 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf8" />
<title>Invoice [% inv.id | format('%05d') %]</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="logo"><img src="magnum_header.png"></div>
<div id="from">86&nbsp;Fernlea&nbsp;Road<br />
London<br />
SW12&nbsp;9RW<br />
accounts@mag-sol.com</div>
<div id="date">[% inv.date.strftime('%d %B %Y') %]</div>
<div id="to">[% FOREACH line = inv.customer.name_addr %]
[% line %]<br />
[% END -%]</div>

<div id="refs">Invoice&nbsp;No:&nbsp;[% inv.id | format('%05d') -%]
[% IF inv.contract %] (covers [% inv.date.strftime('%B %Y') %])[% END -%]
[% IF inv.cust_ref || inv.contract.cust_ref %] <br/> [% inv.contract.cust_ref_desc || 'PO Number' %]: [% inv.cust_ref || inv.contract.cust_ref; END; IF inv.contract && inv.contract.cust_contact %] <br /> [% inv.contract.cust_contact_desc || 'Customer Contact' %]: [% inv.contract.cust_contact; END %]</div>

<table id="lines">
[% IF inv.has_vat_lines;
FOREACH line = inv.vat_lines -%]
<tr>
<td>[% IF line.week.id %][% THEN %]w/c [% line.week.start.strftime('%d %B %Y') %]<br />[% END %]
[% line.description %]</td>
<td class="amt">&pound;[% line.amount | format('%.2f')%]</td>
</tr>
[% END %]
<tr>
<td class="total">Sub Total</td>
<td class="amt line">&pound;[% inv.vat_total | format('%.2f') %]</td>
</tr>
<tr>
<td class="total">VAT @ [% inv.vat_rate %]%</td>
<td class="amt">&pound;[% inv.vat |format('%.2f') %]</td>
</tr>
[% END %]
[% IF inv.vat_lines.count -%]
<tr><td colspan="2"><i>Zero VAT Items</i></td></tr>
[% FOREACH line = inv.vat_lines -%]
<tr>
<td>[% IF line.week.id %][% THEN %]w/c [% line.week %]<br />[% END %]
[% line.description %]</td>
<td class="amt">&pound;[% line.amount %]</td>
</tr>
[% END %]
<tr>
<td class="total">Zero VAT Total</td>
<td class="amt line">&pound;[% inv.zerovat_total |format('%.2f') %]</td>
</tr>
[% END %]
[% IF inv.vatexempt_lines -%]
<tr>
<td colspan="2"><i>VAT Exempt Items</i></td>
</tr>
[% FOREACH line = inv.vatexempt_lines -%]
<tr>
<td>[% IF line.week.id %][% THEN %]w/c [% line.week %]<br />[% END %]
[% line.description %] &pound;[% line.amount %]</td>
</tr>
[% END %]
<tr>
<td class="total">VAT Exempt Total</td>
<td class="amt line">&pound;[% inv.vatexempt_total |format('%.2f') %]</td>
</tr>
[% END %]
<tr>
<td class="total">Grand Total</td>
<td class="amt grand">&pound;[% inv.grand_total|format('%.2f') %]</td>
</tr>
</table>

<div id="footer"><p>Terms:&nbsp;30&nbsp;days<br />
<b>Due date: [% inv.date.add( days => 30 ).strftime('%d %B %Y') %]</b></p>
<p>[%#Please&nbsp;make&nbsp;cheques&nbsp;payable&nbsp;to&nbsp;Magnum&nbsp;Solutions&nbsp;Ltd<br />%]
For&nbsp;electronic&nbsp;payments&nbsp;use<br />
Sort&nbsp;Code:&nbsp;40-01-07&nbsp;/&nbsp;Acct:&nbsp;81687166<br />
IBAN:&nbsp;GB90&nbsp;MIDL&nbsp;400107&nbsp;81687166&nbsp;/&nbsp;SWIFT:&nbsp;MIDLGB2105G<br />
Quote&nbsp;invoice&nbsp;number&nbsp;[% inv.id | format('%05d') %]</p>
<p>Registered&nbsp;in&nbsp;England&nbsp;and&nbsp;Wales:&nbsp;3035701</p>
<p>VAT&nbsp;Registration&nbsp;Number:&nbsp;657&nbsp;0528&nbsp;27</p></div>
</body>
</html>
45 changes: 45 additions & 0 deletions tt_lib/timesheet.tt
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf8" />
<title>Timesheet - Magnum Solutions [% weeks.0.days.0.day_date.strftime('%B %Y') %]</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>
<h1>Consultant Timesheet</h1>
<table class="head">
<tr><th>Consultant Name</th><td>[% weeks.0.contract.employee.name %]</td></tr>
<tr><th>Month</th><td>[% weeks.0.days.last.day_date.strftime('%B %Y') %]</td></tr>
<tr><th>Client Reference</th><td>[% inv.cust_ref || inv.contract.cust_ref %]</td></tr>
<tr><th>Rate (hourly or daily)</th><td>£[% weeks.0.contract.rate %]/[% weeks.0.contract.rate_unit %]</td></tr>
</table>
[% day_names = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
'Friday', 'Saturday' ] -%]
[% grand_total = 0 -%]
<table class="weeks">
<tr><th>w/c</th>
[%- FOREACH day_name IN day_names; '<th>'; day_name.substr(0, 3); '</th>'; END -%]
<th>Total</th></tr>
[% FOREACH week IN weeks -%]
<tr><th>[% week.start.strftime('%d %b'); total = 0 %]</th>
[%- FOREACH day_name IN day_names -%]
[% day = week.get_day(day_name);
IF day;
'<td'; IF day.is_weekend; ' class="weekend"'; END; '>'; day.units; total = total + day.units;
ELSE;
'<td class="not_month">&nbsp;';
END -%]
</td>
[%- END; '<td>'; total; '</td>'; grand_total = grand_total + total %]</tr>
[% END -%]
<tr><th colspan="8" class="grand">Grand Total</th><td>[% grand_total %]</td></th>
</table>

<table class="sigs">
<tr class="sigs"><td><img src="davesig.png" alt="D M Cross"></td><td>&nbsp;</td></tr>
<tr><td>.................................</td><td>.................................</td></tr>
<tr><td>Signed - Consultant</td><td>Signed - Client</td></tr>
</table>
</html>
</body>

0 comments on commit b19a463

Please sign in to comment.