From 2417b4ebd2b87d7cd7dd94569b04da519bccdd1a Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Tue, 28 Mar 2023 09:50:19 +0200 Subject: [PATCH] Remove the link to edit contact from the invoice table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We agreed with Oriol that this link would only serve to confuse people. I initially added the link because i thought it was a shame to have to navigate to the contact section to look or change the info of a customer that you have an invoice for in front of you. However, it makes little sense to be able to edit the contact from both sections, and we do not have a “view page” for contacts to link to, thus the removal. --- pkg/invoices.go | 5 +---- web/template/invoices/index.gohtml | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/invoices.go b/pkg/invoices.go index 61668a9..f7c5672 100644 --- a/pkg/invoices.go +++ b/pkg/invoices.go @@ -26,7 +26,6 @@ type InvoiceEntry struct { Number string Total string CustomerName string - CustomerSlug string Tags []string Status string StatusLabel string @@ -54,7 +53,6 @@ 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 @@ -71,7 +69,6 @@ func mustCollectInvoiceEntries(ctx context.Context, conn *Conn, company *Company , invoice_date , invoice_number , contact.business_name - , contact.slug , invoice.invoice_status , isi18n.name , total @@ -84,7 +81,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.CustomerSlug, &entry.Tags, &entry.Status, &entry.StatusLabel, &entry.Total); err != nil { + if err := rows.Scan(&entry.Slug, &entry.Date, &entry.Number, &entry.CustomerName, &entry.Tags, &entry.Status, &entry.StatusLabel, &entry.Total); err != nil { panic(err) } entries = append(entries, entry) diff --git a/web/template/invoices/index.gohtml b/web/template/invoices/index.gohtml index 4f8c435..283d5e8 100644 --- a/web/template/invoices/index.gohtml +++ b/web/template/invoices/index.gohtml @@ -50,7 +50,7 @@ title="{{ $title }}"/> {{ .Date|formatDate }} {{ .Number }} - {{ .CustomerName }} + {{ .CustomerName }}