{{define "invoice_search_results"}} {{if .Error}}

{{.ErrorMsg}}

Search term: "{{.SearchTerm}}"

{{else if .NotFound}}

{{.ErrorMsg}}

Search term: "{{.SearchTerm}}"

{{else if .invoiceNumber}}

Invoice Details

{{if and (or (ne .status "void") (ne .status "processed")) (or (eq .status "draft") (eq .status "ok") (eq .status "pending_accounting") (eq .status "failed") )}} {{end}} {{if and (ne .status "void") (ne .status "processed")}} {{end}}

Invoice Number: {{.invoiceNumber}}

Total Price: ${{.totalPrice}}

Status: {{.status}}

{{with .customer}}

Customer: {{.name}}

{{end}} {{with .job}}

Job: {{.name}}

{{end}} {{with .location}}

Location: {{.name}}

{{end}} {{if .items}}

Items:

{{end}} {{else}}

Unexpected response. Please try again.

{{end}} {{end}}