go/svc/invoice: template changes for EU VAT invoices, restore FV/ numbering
diff --git a/go/svc/invoice/model.go b/go/svc/invoice/model.go
index 51fe850..d628e1a 100644
--- a/go/svc/invoice/model.go
+++ b/go/svc/invoice/model.go
@@ -105,11 +105,7 @@
invoice.State = pb.Invoice_STATE_SEALED
// TODO(q3k): this should be configurable.
- if language == "pl" {
- invoice.FinalUid = fmt.Sprintf("FV/%s", finalUid)
- } else {
- invoice.FinalUid = fmt.Sprintf("%s", finalUid)
- }
+ invoice.FinalUid = fmt.Sprintf("FV/%s", finalUid)
invoice.Date = sealTime.UnixNano()
calculateInvoiceData(invoice)
@@ -230,7 +226,7 @@
}
if s.finalUid.Valid {
p.State = pb.Invoice_STATE_SEALED
- p.FinalUid = fmt.Sprintf("%s", s.finalUid.String)
+ p.FinalUid = fmt.Sprintf("FV/%s", s.finalUid.String)
p.Date = s.sealedTime.Int64
} else {
p.State = pb.Invoice_STATE_PROFORMA
diff --git a/go/svc/invoice/templates/invoice_en.html b/go/svc/invoice/templates/invoice_en.html
index fb2af50..d661732 100644
--- a/go/svc/invoice/templates/invoice_en.html
+++ b/go/svc/invoice/templates/invoice_en.html
@@ -147,7 +147,7 @@
{{ end }}
{{ if .ReverseVAT }}
- <li><b>(reverse charge applies)</b></li>
+ <li><b>(reverse charge / obciążenie odwrotne)</b></li>
{{ end }}
</ul>
</div>
@@ -155,33 +155,43 @@
<div style="clear: both; height: 1em;"></div>
<table class="items">
<tr>
- <th style="width: 60%;">Description</th>
- <th>Price<br />(ex. VAT)</th>
+ <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>
- <th>Total<br />(net)</th>
- <th>Total<br />(inc. VAT)</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 .ReverseVAT }} (reverse charge applies){{ end }} {{ if .USCustomer }}(VAT zero rate){{ end }}</td>
+ <td colspan="5" class="lhead">VAT Total {{ if .USCustomer }}(VAT zero rate){{ end }}</td>
<td>{{ .VATTotal }}</td>
</tr>
+ {{ end }}
<tr>
- <td colspan="5" class="lhead"><b>Total</b></td>
+ <td colspan="{{ if .ReverseVAT }}3{{ else }}5{{ end }}" class="lhead"><b>Total</b></td>
<td><b>{{ .Total }}</b></td>
</tr>
</table>