Compare commits
No commits in common. "a5dc434aa2d6881c232f24ade7a28f106b2a6355" and "47c23fc4cc2fede472e0ec97082d21c78eb72983" have entirely different histories.
a5dc434aa2
...
47c23fc4cc
|
@ -26,6 +26,7 @@ type InvoiceEntry struct {
|
|||
Number string
|
||||
Total string
|
||||
CustomerName string
|
||||
CustomerSlug string
|
||||
Tags []string
|
||||
Status string
|
||||
StatusLabel string
|
||||
|
@ -53,6 +54,7 @@ func mustCollectInvoiceEntries(ctx context.Context, conn *Conn, company *Company
|
|||
, invoice_date
|
||||
, invoice_number
|
||||
, contact.business_name
|
||||
, contact.slug
|
||||
, array_agg(coalesce(tag.name::text, ''))
|
||||
, invoice.invoice_status
|
||||
, isi18n.name
|
||||
|
@ -69,6 +71,7 @@ func mustCollectInvoiceEntries(ctx context.Context, conn *Conn, company *Company
|
|||
, invoice_date
|
||||
, invoice_number
|
||||
, contact.business_name
|
||||
, contact.slug
|
||||
, invoice.invoice_status
|
||||
, isi18n.name
|
||||
, total
|
||||
|
@ -81,7 +84,7 @@ func mustCollectInvoiceEntries(ctx context.Context, conn *Conn, company *Company
|
|||
var entries []*InvoiceEntry
|
||||
for rows.Next() {
|
||||
entry := &InvoiceEntry{}
|
||||
if err := rows.Scan(&entry.Slug, &entry.Date, &entry.Number, &entry.CustomerName, &entry.Tags, &entry.Status, &entry.StatusLabel, &entry.Total); err != nil {
|
||||
if err := rows.Scan(&entry.Slug, &entry.Date, &entry.Number, &entry.CustomerName, &entry.CustomerSlug, &entry.Tags, &entry.Status, &entry.StatusLabel, &entry.Total); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
entries = append(entries, entry)
|
||||
|
@ -144,7 +147,7 @@ func ServeInvoice(w http.ResponseWriter, r *http.Request, params httprouter.Para
|
|||
w.Header().Set("Content-Type", "application/pdf")
|
||||
mustWriteInvoicePdf(w, r, inv)
|
||||
} else {
|
||||
mustRenderMainTemplate(w, r, "invoices/view.gohtml", inv)
|
||||
mustRenderAppTemplate(w, r, "invoices/view.gohtml", inv)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
aria-label="{{ $title }}"
|
||||
title="{{ $title }}"/></td>
|
||||
<td>{{ .Date|formatDate }}</td>
|
||||
<td><a href="{{ companyURI "/invoices/"}}{{ .Slug }}" data-hx-target="main" data-hx-boost="true">{{ .Number }}</a></td>
|
||||
<td>{{ .CustomerName }}</td>
|
||||
<td><a href="{{ companyURI "/invoices/"}}{{ .Slug }}">{{ .Number }}</a></td>
|
||||
<td><a href="{{ companyURI "/contacts/"}}{{ .CustomerSlug }}">{{ .CustomerName }}</a></td>
|
||||
<td>
|
||||
<details class="invoice-status menu">
|
||||
<summary class="invoice-status-{{ .Status }}">{{ .StatusLabel }}</summary>
|
||||
|
@ -76,7 +76,7 @@
|
|||
<td>
|
||||
{{- range $index, $tag := .Tags }}
|
||||
{{- if gt $index 0 }}, {{ end -}}
|
||||
<a href="?tag={{ . }}" data-hx-target="main" data-hx-boost="true">{{ . }}</a>
|
||||
<a href="?tag={{ . }}">{{ . }}</a>
|
||||
{{- end }}
|
||||
</td>
|
||||
<td class="numeric">{{ .Total|formatPrice }}</td>
|
||||
|
|
Loading…
Reference in New Issue