go/svc/{invoice,speedtest} -> bgpwtf/
Continued from https://gerrit.hackerspace.pl/c/hscloud/+/71 .
Change-Id: I5aef587c7e9a4cec301e3c95530c33914851ad44
diff --git a/bgpwtf/invoice/templates/BUILD.bazel b/bgpwtf/invoice/templates/BUILD.bazel
new file mode 100644
index 0000000..4756da4
--- /dev/null
+++ b/bgpwtf/invoice/templates/BUILD.bazel
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//extras:bindata.bzl", "bindata")
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+bindata(
+ name = "templates_bindata",
+ srcs = glob(["*"]),
+ extra_args = ["."],
+ package = "templates",
+)
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ ":templates_bindata", # keep
+ ],
+ importpath = "code.hackerspace.pl/hscloud/bgpwtf/invoice/templates", # keep
+ visibility = ["//bgpwtf/invoice:__subpackages__"],
+)
diff --git a/bgpwtf/invoice/templates/invoice_en.html b/bgpwtf/invoice/templates/invoice_en.html
new file mode 100644
index 0000000..d661732
--- /dev/null
+++ b/bgpwtf/invoice/templates/invoice_en.html
@@ -0,0 +1,199 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8">
+ <title>Invoice 0001</title>
+ <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700" rel="stylesheet">
+ <style type="text/css">
+body {
+ background-color: #fff;
+ font-family: 'Roboto', sans-serif;
+ font-size: 1em;
+
+ padding: 2em;
+}
+ul {
+ list-style: none;
+ padding: 0;
+}
+ul li {
+ margin-bottom: 0.2em;
+}
+
+@page {
+ size: A4;
+ margin: 0;
+}
+div.rhs {
+ float: right;
+ width: 50%;
+ text-align: right;
+}
+div.lhs {
+ float: left;
+ text-align: left;
+ width: 50%;
+ min-height: 35em;
+}
+div.metadata {
+ margin-top: 2em;
+}
+div.invoicee {
+ margin-top: 9em;
+}
+h1 {
+ font-size: 1.5em;
+ margin: 0;
+ text-transform: uppercase;
+}
+h2 {
+ font-size: 1.2em;
+ margin: 0;
+}
+table.items {
+ text-align: right;
+ border-spacing: 0px;
+ border-collapse: collapse;
+ border: 0;
+ width: 100%;
+}
+table.items td,th {
+ border: 1px solid black;
+}
+table.items tr:first-child {
+ background-color: #eee;
+ color: #111;
+ padding: 0.8em;
+ text-align: left;
+}
+table.items td {
+ background-color: #fff;
+}
+table.items td,th {
+ padding: 0.5em 1em 0.5em 1em;
+}
+td.lhead {
+ border: 0 !important;
+ text-align: right;
+ text-transform: uppercase;
+ background: rgba(0, 0, 0, 0) !important;
+}
+div.bgtext {
+ z-index: -10;
+ position: absolute;
+ top: 140mm;
+ left: 0;
+ width: 100%;
+}
+div.bgtext div {
+ text-align: center;
+ font-size: 10em;
+ color: #ddd;
+ -webkit-transform: rotate(-45deg);
+ text-transform: uppercase;
+}
+ </style>
+ </head>
+ <body>
+ {{ if .Proforma }}
+ <div class="bgtext"><div>Proforma</div></div>
+ {{ end }}
+ <div class="rhs">
+ <div class="invoicer">
+ <ul>
+ {{ range $i, $e := .InvoicerBilling }}
+ {{ if eq $i 0 }}
+ <li><b>{{ $e }}</b></li>
+ {{ else }}
+ <li>{{ $e }}</li>
+ {{ end }}
+ {{ end }}
+ {{ if .InvoicerCompanyNumber }}
+ <li>{{ .InvoicerCompanyNumber }}</li>
+ {{ end }}
+ <li><b>Tax Number:</b> {{ .InvoicerVAT }}</li>
+ </ul>
+ </div>
+ <div class="metadata">
+ <ul>
+ <li><b>Invoice number:</b> {{ .InvoiceNumber }}</li>
+ <li><b>Date:</b> {{ .Date.Format "2006/01/02" }}</li>
+ <li><b>Due date:</b> {{ .DueDate.Format "2006/01/02" }}</li>
+ <li><b>IBAN:</b> {{ .IBAN }}</li>
+ <li><b>SWIFT/BIC:</b> {{ .SWIFT }}</li>
+ </ul>
+ </div>
+ </div>
+ <div class="lhs">
+ <div class="invoicee">
+ {{ if .Proforma }}
+ <h1>Proforma Invoice</h1>
+ {{ else }}
+ <h1>VAT Invoice</h1>
+ {{ end }}
+ <ul>
+ {{ range $i, $e := .InvoiceeBilling }}
+ {{ if eq $i 0 }}
+ <li><b>{{ $e }}</b></li>
+ {{ else }}
+ <li>{{ $e }}</li>
+ {{ end }}
+ {{ end }}
+ {{ if .USCustomer }}
+ <li>EIN: {{ .InvoiceeVAT }}</li>
+ <li><b>(VAT zero rate)</b></li>
+ {{ else }}
+ <li><b>NIP:</b> {{ .InvoiceeVAT }}</li>
+ {{ end }}
+
+ {{ if .ReverseVAT }}
+ <li><b>(reverse charge / obciążenie odwrotne)</b></li>
+ {{ end }}
+ </ul>
+ </div>
+ </div>
+ <div style="clear: both; height: 1em;"></div>
+ <table class="items">
+ <tr>
+ <th style="width: 60%;">Name of goods / service</th>
+ <th>Unit price<br />(net)</th>
+ <th>Qty</th>
+ {{ if not .ReverseVAT }}
+ <th>VAT rate</th>
+ {{ end }}
+ <th>Goods value<br />(net)</th>
+ {{ if not .ReverseVAT }}
+ <th>Goods value<br />(gross)</th>
+ {{ end }}
+ </tr>
+ {{ range .Items }}
+ <tr>
+ <td style="text-align: left;">{{ .Title }}</td>
+ <td>{{ .UnitPrice }}</td>
+ <td>{{ .Qty }}</td>
+ {{ if not $.ReverseVAT }}
+ <td>{{ .VATRate }}</td>
+ {{ end }}
+ <td>{{ .TotalNet }}</td>
+ {{ if not $.ReverseVAT }}
+ <td>{{ .Total }}</td>
+ {{ end }}
+ </tr>
+ {{ end }}
+ {{ if not .ReverseVAT }}
+ <tr>
+ <td colspan="5" class="lhead">Subtotal without VAT</td>
+ <td>{{ .TotalNet }}</td>
+ </tr>
+ <tr>
+ <td colspan="5" class="lhead">VAT Total {{ if .USCustomer }}(VAT zero rate){{ end }}</td>
+ <td>{{ .VATTotal }}</td>
+ </tr>
+ {{ end }}
+ <tr>
+ <td colspan="{{ if .ReverseVAT }}3{{ else }}5{{ end }}" class="lhead"><b>Total</b></td>
+ <td><b>{{ .Total }}</b></td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/bgpwtf/invoice/templates/invoice_pl.html b/bgpwtf/invoice/templates/invoice_pl.html
new file mode 100644
index 0000000..df49da8
--- /dev/null
+++ b/bgpwtf/invoice/templates/invoice_pl.html
@@ -0,0 +1,190 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8">
+ <title>Invoice 0001</title>
+ <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700" rel="stylesheet">
+ <style type="text/css">
+body {
+ background-color: #fff;
+ font-family: 'Roboto', sans-serif;
+ font-size: 1em;
+
+ padding: 2em;
+}
+ul {
+ list-style: none;
+ padding: 0;
+}
+ul li {
+ margin-bottom: 0.2em;
+}
+
+@page {
+ size: A4;
+ margin: 0;
+}
+div.rhs {
+ float: right;
+ width: 50%;
+ text-align: right;
+}
+div.lhs {
+ float: left;
+ text-align: left;
+ width: 50%;
+ min-height: 35em;
+}
+div.metadata {
+ margin-top: 2em;
+}
+div.invoicee {
+ margin-top: 9em;
+}
+h1 {
+ font-size: 1.5em;
+ margin: 0;
+ text-transform: uppercase;
+}
+h2 {
+ font-size: 1.2em;
+ margin: 0;
+}
+table.items {
+ text-align: right;
+ border-spacing: 0px;
+ border-collapse: collapse;
+ border: 0;
+ width: 100%;
+}
+table.items td,th {
+ border: 1px solid black;
+}
+table.items tr:first-child {
+ background-color: #eee;
+ color: #111;
+ padding: 0.8em;
+ text-align: left;
+}
+table.items td {
+ background-color: #fff;
+}
+table.items td,th {
+ padding: 0.5em 1em 0.5em 1em;
+}
+td.lhead {
+ border: 0 !important;
+ text-align: right;
+ text-transform: uppercase;
+ background: rgba(0, 0, 0, 0) !important;
+}
+div.bgtext {
+ z-index: -10;
+ position: absolute;
+ top: 140mm;
+ left: 0;
+ width: 100%;
+}
+div.bgtext div {
+ text-align: center;
+ font-size: 10em;
+ color: #ddd;
+ -webkit-transform: rotate(-45deg);
+ text-transform: uppercase;
+}
+ </style>
+ </head>
+ <body>
+ {{ if .Proforma }}
+ <div class="bgtext"><div>Proforma</div></div>
+ {{ end }}
+ <div class="rhs">
+ <div class="invoicer">
+ <ul>
+ {{ range $i, $e := .InvoicerBilling }}
+ {{ if eq $i 0 }}
+ <li><b>{{ $e }}</b></li>
+ {{ else }}
+ <li>{{ $e }}</li>
+ {{ end }}
+ {{ end }}
+ {{ if .InvoicerCompanyNumber }}
+ <li>{{ .InvoicerCompanyNumber }}</li>
+ {{ end }}
+ <li><b>NIP:</b> {{ .InvoicerVAT }}</li>
+ </ul>
+ </div>
+ <div class="metadata">
+ <ul>
+ <li><b>Numer faktury:</b> {{ .InvoiceNumber }}</li>
+ <li><b>Data wystawienia:</b> {{ .Date.Format "2006/01/02" }}</li>
+ <li><b>Termin płatności:</b> {{ .DueDate.Format "2006/01/02" }}</li>
+ <li><b>IBAN:</b> {{ .IBAN }}</li>
+ <li><b>SWIFT/BIC:</b> {{ .SWIFT }}</li>
+ </ul>
+ </div>
+ </div>
+ <div class="lhs">
+ <div class="invoicee">
+ {{ if .Proforma }}
+ <h1>Faktura Proforma</h1>
+ {{ else }}
+ <h1>Faktura VAT</h1>
+ {{ end }}
+ <h2>nr. {{ .InvoiceNumber }}</h2>
+ <ul>
+ {{ range $i, $e := .InvoiceeBilling }}
+ {{ if eq $i 0 }}
+ <li><b>{{ $e }}</b></li>
+ {{ else }}
+ <li>{{ $e }}</li>
+ {{ end }}
+ {{ end }}
+ {{ if .USCustomer }}
+ <li>EIN: {{ .InvoiceeVAT }}</li>
+ <li><b>(VAT zero rate)</b></li>
+ {{ else }}
+ <li><b>NIP:</b> {{ .InvoiceeVAT }}</li>
+ {{ end }}
+
+ {{ if .ReverseVAT }}
+ <li><b>(nie podlega VAT)</b></li>
+ {{ end }}
+ </ul>
+ </div>
+ </div>
+ <div style="clear: both; height: 1em;"></div>
+ <table class="items">
+ <tr>
+ <th style="width: 60%;">Nazwa towaru lub usługi</th>
+ <th>Cena<br />netto</th>
+ <th>Ilość</th>
+ <th>VAT (%)</th>
+ <th>Wartość<br />netto</th>
+ <th>Wartość<br />brutto</th>
+ </tr>
+ {{ range .Items }}
+ <tr>
+ <td style="text-align: left;">{{ .Title }}</td>
+ <td>{{ .UnitPrice }}</td>
+ <td>{{ .Qty }}</td>
+ <td>{{ .VATRate }}</td>
+ <td>{{ .TotalNet }}</td>
+ <td>{{ .Total }}</td>
+ </tr>
+ {{ end }}
+ <tr>
+ <td colspan="5" class="lhead">RAZEM netto</td>
+ <td>{{ .TotalNet }}</td>
+ </tr>
+ <tr>
+ <td colspan="5" class="lhead">VAT{{ if .ReverseVAT }} (nie podlega){{ end }} {{ if .USCustomer }}(nie podlega){{ end }}</td>
+ <td>{{ .VATTotal }}</td>
+ </tr>
+ <tr>
+ <td colspan="5" class="lhead"><b>RAZEM brutto</b></td>
+ <td><b>{{ .Total }}</b></td>
+ </tr>
+ </table>
+ </body>
+</html>