-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinvoice.html
More file actions
executable file
·41 lines (39 loc) · 2.31 KB
/
invoice.html
File metadata and controls
executable file
·41 lines (39 loc) · 2.31 KB
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
<!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" dir="ltr" lang="en-US" style="height: 100%;">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="model.js"></script>
</head>
<body style="height: 100%; font-family: monospace;">
<script>
document.write(' <textarea style="width: 100%; height: 100%;">\n');
document.write(' INVOICE\n\n\n');
clientName = getName();
document.write(' for ' + clientName['title'] + ' ' + clientName['firstname'] + ' ' + clientName['surname'] + '\n');
address = getAddress();
document.write(' ' + address['number'] + ' ' + address['street'] + '\n');
document.write(' ' + address['city'] + ' ' + address['postcode'] + '\n');
document.write(' ' + address['country'] + '\n\n\n');
document.write(' ------------------------------------------------------------------------------\n');
basket = readBasket();
productDetails = getProductDetails();
for (var product in basket) {
if (basket[product] > 0) {
document.write(' ' + productDetails[product]["name"] + ' ' + productDetails[product]["units"] + " x " + basket[product] + '\n');
document.write(' £' + productDetails[product]["price"]*basket[product] + '\n');
}
}
document.write(' ------------------------------------------------------------------------------\n');
document.write(' TOTAL\n');
var totals = calculateTotals();
document.write(' ' + totals["total"] + ' inc. VAT\n');
document.write(' ' + totals["vat"] + ' ex. VAT\n');
document.write(' ' + totals["totalnovat"] + ' VAT paid\n\n');
cardDetails = getCardDetails();
document.write(' Paid by ' + cardDetails['cardtype'] + ' ' + cardDetails['cardnumber'].substr(-4) + ' (only last four digits given)\n');
document.write(' ------------------------------------------------------------------------------\n');
document.write(' </textarea>\n');
</script>
</body>
</html>