{{ define "title" -}} {{ .Number | printf ( pgettext "Invoice %s" "title" )}} {{- end }} {{ define "content" }} {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.invoice*/ -}}

{{ .Number | printf ( pgettext "Invoice %s" "title" )}}

{{( pgettext "Date" "title" )}} {{ .Date | formatDate }}

{{ .Invoicer.Name }}
{{ .Invoicer.VATIN }}
{{ .Invoicer.Address }}
{{ .Invoicer.City }} ({{ .Invoicer.PostalCode}}), {{ .Invoicer.Province }}
{{ .Invoicer.Email }}
{{ .Invoicer.Phone }}
{{ .Invoicee.Name }}
{{ .Invoicee.VATIN }}
{{ .Invoicee.Address }}
{{ .Invoicee.City }} ({{ .Invoicee.PostalCode}}), {{ .Invoicee.Province }}
{{- $columns := 5 | add (len .TaxClasses) | add (boolToInt .HasDiscounts) -}} {{ if .HasDiscounts -}} {{ end -}} {{ range $class := .TaxClasses -}} {{ end -}} {{ $lastIndex := len .Products | sub 1 }} {{ range $index, $product := .Products -}} {{- if .Description }} {{ end -}} {{- if .Description }} {{- else }} {{- end -}} {{ if $.HasDiscounts -}} {{ end -}} {{ range $class := $.TaxClasses -}} {{ end -}} {{ if (eq $index $lastIndex) }} {{ range $tax := $.Taxes -}} {{- end }} {{ end }} {{- end }}
{{( pgettext "Concept" "title" )}} {{( pgettext "Price" "title" )}}{{( pgettext "Discount" "title" )}}{{( pgettext "Units" "title" )}} {{( pgettext "Subtotal" "title" )}}{{ . }}{{( pgettext "Total" "title" )}}
{{ .Name }}
{{ .Description }}{{ .Name }}{{ .Price | formatPrice }}{{ $product.Discount | formatPercent }}{{ .Quantity }} {{ .Subtotal | formatPrice }}{{ index $product.Taxes $class | formatPercent }}{{ .Total | formatPrice }}
{{( pgettext "Tax Base" "title" )}} {{ $.Subtotal | formatPrice }}
{{ index . 0 }} {{ index . 1 | formatPrice }}
{{( pgettext "Total" "title" )}} {{ $.Total | formatPrice }}
{{ if .Notes -}}

{{ .Notes }}

{{- end }}

{{ .PaymentInstructions }}

{{- end}}