cmc-sales/go/internal/cmc/documents/templates/invoice.html

419 lines
8.8 KiB
HTML
Raw Normal View History

2026-01-16 04:26:56 -08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{{if .InvoiceNumber}}{{.InvoiceNumber}}{{else}}CMC Invoice{{end}}</title>
<style>
@page {
size: A4;
margin: 15mm;
}
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 9pt;
line-height: 1.4;
margin: 0;
padding: 0;
color: #000;
}
a {
color: #0000FF;
text-decoration: underline;
}
.header {
text-align: center;
margin-bottom: 10mm;
}
.header h1 {
font-size: 20pt;
margin: 0 0 5mm 0;
font-weight: bold;
}
.address-boxes {
display: flex;
justify-content: space-between;
margin-bottom: 5mm;
}
.address-box {
width: 48%;
border: 1px solid #000;
padding: 3mm;
}
.address-box h3 {
font-size: 10pt;
margin: 0 0 2mm 0;
font-weight: bold;
}
.details-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 5mm;
margin-right: 0.2mm;
}
.details-table td {
border: 1px solid #000;
padding: 2mm;
}
.details-table td:first-child {
font-weight: bold;
width: 25%;
}
.line-items {
width: 99.5%;
border-collapse: collapse;
margin-bottom: 5mm;
table-layout: fixed;
margin-right: 1mm;
margin-left: auto;
}
.line-items th {
background-color: #f0f0f0;
border: 1px solid #000;
padding: 2mm;
font-weight: bold;
text-align: left;
}
.line-items td {
border: 1px solid #000;
padding: 2mm;
vertical-align: top;
}
.line-items .description {
width: 50%;
}
.line-items .qty {
width: 10%;
text-align: center;
}
.line-items .unit-price {
width: 13%;
text-align: right;
}
.line-items .discount {
width: 13%;
text-align: right;
}
.line-items .total {
width: 14%;
margin-top: 5mm;
}
.totals-table {
width: auto;
border-collapse: collapse;
border: 1px solid #000;
margin-right: 0.2mm;
}
.totals-table td {
padding: 1mm 3mm;
border: 1px solid #000;
}
.totals-table td:first-child {
text-align: left;
font-weight: bold;
width: 50%;
background-color: #f0f0f0; /* header-like label cell */
}
.totals-table td:last-child {
text-align: right;
width: 50%;
}
.totals-table .total-row td {
font-weight: bold;
font-size: 11pt;
padding-top: 2mm;
border-top: 1px solid #000;
}
.description strong {
font-weight: bold;
}
.description em {
font-style: italic;
}
.description ul {
margin: 2mm 0;
padding-left: 5mm;
}
.description ol {
margin: 2mm 0;
padding-left: 5mm;
}
.description li {
margin: 1mm 0;
}
.company-header {
text-align: center;
margin-bottom: 8mm;
border-bottom: 2px solid #000;
padding-bottom: 5mm;
}
.company-header h1 {
font-size: 24pt;
margin: 0;
font-weight: bold;
color: #003399;
}
.company-header p {
margin: 2mm 0;
font-size: 9pt;
}
.contact-details {
display: flex;
justify-content: space-between;
margin-bottom: 5mm;
font-size: 9pt;
}
.contact-col {
flex: 1;
}
.contact-col strong {
font-weight: bold;
}
.invoice-header {
display: flex;
justify-content: space-between;
margin-bottom: 5mm;
font-size: 10pt;
}
.invoice-info {
text-align: right;
}
.invoice-info div {
margin: 1mm 0;
}
.payment-box {
border: 1px solid #000;
padding: 3mm;
margin-top: 5mm;
font-size: 9pt;
}
.payment-box h4 {
margin: 0 0 2mm 0;
font-weight: bold;
font-size: 10pt;
}
.payment-box div {
margin: 1mm 0;
}
.logo {
width: 40mm;
height: auto;
display: block;
}
.company-info {
display: flex;
align-items: flex-start;
gap: 10mm;
margin-bottom: 0;
padding-bottom: 0;
}
.company-header {
flex: 1;
}
.company-header h1 {
color: #003399;
margin: 0;
font-size: 20pt;
}
.company-header p {
margin: 1mm 0;
font-size: 9pt;
}
.main-content {
display: flex;
gap: 10mm;
margin-bottom: 5mm;
}
.addresses-section {
flex: 1;
}
.payment-section {
display: none;
}
.payment-section h4 {
margin: 0 0 2mm 0;
font-weight: bold;
font-size: 10pt;
}
.payment-section div {
margin: 1mm 0;
font-size: 9pt;
}
.payment-box {
border: 1px solid #000;
padding: 3mm;
margin-top: 5mm;
font-size: 9pt;
}
.payment-box h4 {
margin: 0 0 2mm 0;
font-weight: bold;
font-size: 10pt;
}
.payment-box div {
margin: 1mm 0;
}
</style>
</head>
<body>
2026-01-20 23:43:55 -08:00
{{template "CompanyHeader" .}}
2026-01-16 04:26:56 -08:00
<!-- TAX INVOICE Section with Invoice Number and Date -->
<div style="display: flex; justify-content: space-between; align-items: center; margin: 2mm 0 3mm 0;">
<div style="flex: 1;"></div>
<div style="flex: 1; text-align: center;">
<h2 style="font-size: 16pt; margin: 0; font-weight: bold;">TAX INVOICE</h2>
</div>
<div style="flex: 1; text-align: right; font-size: 10pt;">
{{if .InvoiceNumber}}
<div style="font-weight: bold; margin-bottom: 1mm;">INVOICE# {{.InvoiceNumber}}</div>
{{end}}
{{if .IssueDateString}}
<div><strong>Date:</strong> {{.IssueDateString}}</div>
{{end}}
{{if .PageCount}}
<div><strong>Page:</strong> {{.CurrentPage}} of {{.PageCount}}</div>
{{end}}
</div>
</div>
<!-- Address Boxes -->
<div class="address-boxes" style="display: flex; gap: 5mm; margin-bottom: 3mm;">
<div class="address-box" style="flex: 1;">
<h3>Sold To / Invoice Address:</h3>
<div>{{.BillTo}}</div>
</div>
<div class="address-box" style="flex: 1; margin-right: 1mm; margin-left: auto;">
<h3>Delivery Address:</h3>
<div>{{.ShipTo}}</div>
</div>
</div>
<!-- Details Table - 5 Columns -->
<table class="line-items" style="margin-bottom: 3mm;">
<thead>
<tr>
<th style="width: 20%;">CUSTOMER ORDER NO</th>
<th style="width: 20%;">CMC JOB #</th>
<th style="width: 20%;">INCOTERMS 2010</th>
<th style="width: 20%;">PAYMENT TERMS</th>
<th style="width: 20%;">CUSTOMER ABN</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{.CustomerOrderNumber}}</td>
<td>{{.JobTitle}}</td>
<td>{{.FOB}}</td>
<td>{{.PaymentTerms}}</td>
<td>{{.CustomerABN}}</td>
</tr>
</tbody>
</table>
<!-- Currency Code Header (appears once, not repeated) -->
<div style="margin-bottom: 1mm; text-align: right; font-weight: bold; font-size: 9pt;">
Shown in {{.CurrencyCode}}
</div>
<!-- Line Items -->
<table class="line-items">
<thead>
<tr>
<th class="description">DESCRIPTION</th>
<th class="qty">QTY</th>
<th class="unit-price">UNIT PRICE</th>
<th class="discount">DISCOUNT</th>
<th class="total">TOTAL</th>
</tr>
</thead>
<tbody>
{{range .LineItems}}
<tr>
<td class="description"><strong>{{.Title}}</strong><br>{{.Description}}</td>
<td class="qty">{{.Quantity}}</td>
<td class="unit-price">{{formatPrice .GrossUnitPrice}}</td>
<td class="discount">{{formatDiscount .DiscountAmountTotal}}</td>
<td class="total">{{formatPrice .GrossPrice}}</td>
</tr>
{{end}}
</tbody>
</table>
<!-- Payment and Totals Side by Side -->
<div style="display: flex; gap: 10mm; align-items: flex-start; margin-top: 5mm;">
<div style="width: 50%; padding: 3mm; font-size: 9pt; border: 1px solid #000;">
<h4 style="margin: 0 0 1mm 0; font-weight: bold; font-size: 10pt;">MAKE PAYMENT TO:</h4>
<table style="width: 100%; border-collapse: collapse; font-size: 9pt; table-layout: fixed;">
<tr><td style="font-weight: bold; width: 40%; padding: 0.3mm 0; padding-right: 6mm; white-space: nowrap;">Account Name:</td><td style="padding: 0.3mm 0; white-space: nowrap;">CMC Technologies Pty Ltd</td></tr>
<tr><td style="font-weight: bold; width: 40%; padding: 0.3mm 0; padding-right: 6mm; white-space: nowrap;">BSB:</td><td style="padding: 0.3mm 0; white-space: nowrap;">062-458</td></tr>
<tr><td style="font-weight: bold; width: 40%; padding: 0.3mm 0; padding-right: 6mm; white-space: nowrap;">Account Number:</td><td style="padding: 0.3mm 0; white-space: nowrap;">10067982</td></tr>
<tr><td style="font-weight: bold; width: 40%; padding: 0.3mm 0; padding-right: 6mm; white-space: nowrap;">SWIFT Code:</td><td style="padding: 0.3mm 0; white-space: nowrap;">CTBAAU2S</td></tr>
<tr><td style="font-weight: bold; width: 40%; padding: 0.3mm 0; padding-right: 6mm; white-space: nowrap;">IBAN:</td><td style="padding: 0.3mm 0; white-space: nowrap;">0624581006782</td></tr>
</table>
</div>
<div style="width: 50%; margin-left: auto; margin-right: 1mm;">
<table class="totals-table" style="width: 100%;">
<tr><td>Subtotal:</td><td>{{formatTotal .Subtotal}}</td></tr>
{{if .ShowGST}}
<tr><td>GST (10%):</td><td>{{formatTotal .GSTAmount}}</td></tr>
{{end}}
<tr class="total-row"><td>TOTAL:</td><td>{{formatTotal .Total}}</td></tr>
</table>
</div>
</div>
</body>
</html>