summaryrefslogtreecommitdiffstats
path: root/templates/invoice.gohtml
diff options
context:
space:
mode:
Diffstat (limited to 'templates/invoice.gohtml')
-rw-r--r--templates/invoice.gohtml118
1 files changed, 118 insertions, 0 deletions
diff --git a/templates/invoice.gohtml b/templates/invoice.gohtml
new file mode 100644
index 0000000..fe7fece
--- /dev/null
+++ b/templates/invoice.gohtml
@@ -0,0 +1,118 @@
+<header>
+ <article class="company">
+ <h2>{{ index .translations.invoice_from .ctx.lang }}</h2>
+ {{ tpl (file.Read "templates/company.gohtml")
+ (dict
+ "ctx" .ctx
+ "data" .data
+ "translations" .translations) }}
+ </article>
+
+ <article class="metadata">
+ <table>
+ <tr>
+
+ {{ if (eq .data.type "invoice") }}
+ <td><h2>{{ index .translations.invoice .ctx.lang }}</h2></td>
+ {{ else }}
+ <td><h2>{{ index .translations.quote .ctx.lang }}</h2></td>
+ {{ end }}
+ <td><h2>#{{ .data.number }}</h2></td>
+ </tr>
+ <tr>
+
+ {{ if (eq .data.type "invoice") }}
+ <td>{{ index .translations.invoice_issued_at .ctx.lang }}</td>
+ {{ else }}
+ <td>{{ index .translations.quote_issued_at .ctx.lang }}</td>
+ {{ end }}
+
+ <td>{{ .data.date.Format "2006-01-02" }}</td>
+ </tr>
+
+ {{ if (eq .data.type "invoice") }}
+ <tr>
+ <td>{{ index .translations.invoice_due_at .ctx.lang }}</td>
+ <td>{{ .data.due_date.Format "2006-01-02" }}</td>
+ </tr>
+ {{ end }}
+ </table>
+ </article>
+</header>
+
+<section>
+ <article class="client">
+ <h2>{{ index .translations.invoice_to .ctx.lang }}</h2>
+ <ul>
+ <li>{{ .data.client.name }}</li>
+ <li>{{ .data.client.address }}</li>
+ <li>{{ .data.client.email }}</li>
+ </ul>
+ </article>
+</section>
+
+<section>
+ <article class="items">
+ <table>
+ <thead>
+ <tr>
+ <th>{{ index .translations.item .ctx.lang }}</th>
+ <th>{{ index .translations.rate .ctx.lang }}</th>
+ <th>{{ index .translations.quantity .ctx.lang }}</th>
+ <th>{{ index .translations.amount .ctx.lang }}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ $ctx := .ctx }}
+ {{ range .data.items }}
+ <tr>
+ <td>
+ {{ index .name $ctx.lang }}
+ {{ if (has .comment $ctx.lang) }}
+ <p class="comment">{{ index .comment $ctx.lang }}</p>
+ {{ end }}
+ </td>
+ <td>{{ .rate }}</td>
+ <td>{{ .qty }}</td>
+ <td>{{ .sum }}</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ <tfoot>
+ <tr>
+ <td colspan="3">{{ index .translations.total_in .ctx.lang }} {{ .data.currency }}</td>
+ <td>{{ .data.total }}</td>
+ </tr>
+ </tfoot>
+ </table>
+ </article>
+</section>
+
+<section>
+ {{ if .data.notes }}
+ <article class="notes">
+ <p>{{ index .data.notes .ctx.lang }}</p>
+ </article>
+ {{ end }}
+</section>
+
+<footer>
+ {{ if (eq .data.type "invoice") }}
+ <article class="bank">
+ <h2>{{ index .translations.bank_details .ctx.lang }}</h2>
+ <table>
+ <tr><td>{{ index .translations.bank_name .ctx.lang }}</td><td>{{ .data.bank.name }}</td></tr>
+ <tr><td>SWIFT</td><td>{{ .data.bank.swift }}</td></tr>
+ <tr><td>IBAN</td><td>{{ .data.bank.iban }}</td></tr>
+ </table>
+ </article>
+ {{ end }}
+
+ <article class="tax">
+ <h2>{{ index .translations.tax_details .ctx.lang }}</h2>
+ <table>
+ <tr><td>SIRET</td><td>{{ .data.tax.siret }}</td></tr>
+ <tr><td>{{ index .translations.tax_vat .ctx.lang }}</td><td>{{ index .data.tax.vat .ctx.lang }}</td></tr>
+ </table>
+ </article>
+</footer>
remember that computers suck.