Moved the link to edit expense from the invoicer’s name to a menu

This menu will also have options like delete, and whatever we like to do
to expenses, like invoices do.
This commit is contained in:
jordi fita mas 2023-05-06 11:08:21 +02:00
parent 49c41681ce
commit 1415c3ef10
3 changed files with 74 additions and 46 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: numerus\n" "Project-Id-Version: numerus\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2023-05-03 12:40+0200\n" "POT-Creation-Date: 2023-05-06 11:03+0200\n"
"PO-Revision-Date: 2023-01-18 17:08+0100\n" "PO-Revision-Date: 2023-01-18 17:08+0100\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n" "Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Catalan <ca@dodds.net>\n" "Language-Team: Catalan <ca@dodds.net>\n"
@ -49,7 +49,7 @@ msgid "New Invoice"
msgstr "Nova factura" msgstr "Nova factura"
#: web/template/invoices/products.gohtml:48 #: web/template/invoices/products.gohtml:48
#: web/template/expenses/index.gohtml:25 web/template/products/index.gohtml:38 #: web/template/products/index.gohtml:38
msgctxt "product" msgctxt "product"
msgid "All" msgid "All"
msgstr "Tots" msgstr "Tots"
@ -135,12 +135,12 @@ msgid "Status"
msgstr "Estat" msgstr "Estat"
#: web/template/invoices/index.gohtml:51 web/template/contacts/index.gohtml:28 #: web/template/invoices/index.gohtml:51 web/template/contacts/index.gohtml:28
#: web/template/products/index.gohtml:40 #: web/template/expenses/index.gohtml:29 web/template/products/index.gohtml:40
msgctxt "title" msgctxt "title"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
#: web/template/invoices/index.gohtml:52 web/template/expenses/index.gohtml:29 #: web/template/invoices/index.gohtml:52 web/template/expenses/index.gohtml:30
msgctxt "title" msgctxt "title"
msgid "Amount" msgid "Amount"
msgstr "Import" msgstr "Import"
@ -150,7 +150,7 @@ msgctxt "title"
msgid "Download" msgid "Download"
msgstr "Descàrrega" msgstr "Descàrrega"
#: web/template/invoices/index.gohtml:54 #: web/template/invoices/index.gohtml:54 web/template/expenses/index.gohtml:31
msgctxt "title" msgctxt "title"
msgid "Actions" msgid "Actions"
msgstr "Accions" msgstr "Accions"
@ -161,6 +161,7 @@ msgid "Select invoice %v"
msgstr "Selecciona factura %v" msgstr "Selecciona factura %v"
#: web/template/invoices/index.gohtml:116 web/template/invoices/view.gohtml:19 #: web/template/invoices/index.gohtml:116 web/template/invoices/view.gohtml:19
#: web/template/expenses/index.gohtml:58
msgctxt "action" msgctxt "action"
msgid "Edit" msgid "Edit"
msgstr "Edita" msgstr "Edita"
@ -358,6 +359,11 @@ msgctxt "action"
msgid "New expense" msgid "New expense"
msgstr "Nova despesa" msgstr "Nova despesa"
#: web/template/expenses/index.gohtml:25
msgctxt "expense"
msgid "All"
msgstr "Totes"
#: web/template/expenses/index.gohtml:26 #: web/template/expenses/index.gohtml:26
msgctxt "title" msgctxt "title"
msgid "Contact" msgid "Contact"
@ -373,7 +379,7 @@ msgctxt "title"
msgid "Invoice Number" msgid "Invoice Number"
msgstr "Número de factura" msgstr "Número de factura"
#: web/template/expenses/index.gohtml:52 #: web/template/expenses/index.gohtml:68
msgid "No expenses added yet." msgid "No expenses added yet."
msgstr "No hi ha cap despesa." msgstr "No hi ha cap despesa."
@ -512,74 +518,74 @@ msgstr "No podeu deixar la contrasenya en blanc."
msgid "Invalid user or password." msgid "Invalid user or password."
msgstr "Nom dusuari o contrasenya incorrectes." msgstr "Nom dusuari o contrasenya incorrectes."
#: pkg/products.go:161 pkg/products.go:260 pkg/invoices.go:776 #: pkg/products.go:164 pkg/products.go:263 pkg/invoices.go:776
msgctxt "input" msgctxt "input"
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: pkg/products.go:166 pkg/products.go:287 pkg/expenses.go:158 #: pkg/products.go:169 pkg/products.go:290 pkg/expenses.go:158
#: pkg/invoices.go:187 pkg/invoices.go:597 pkg/invoices.go:1042 #: pkg/invoices.go:187 pkg/invoices.go:597 pkg/invoices.go:1042
#: pkg/contacts.go:256 #: pkg/contacts.go:256
msgctxt "input" msgctxt "input"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
#: pkg/products.go:170 pkg/invoices.go:191 #: pkg/products.go:173 pkg/invoices.go:191
msgctxt "input" msgctxt "input"
msgid "Tags Condition" msgid "Tags Condition"
msgstr "Condició de les etiquetes" msgstr "Condició de les etiquetes"
#: pkg/products.go:174 pkg/invoices.go:195 #: pkg/products.go:177 pkg/invoices.go:195
msgctxt "tag condition" msgctxt "tag condition"
msgid "All" msgid "All"
msgstr "Totes" msgstr "Totes"
#: pkg/products.go:175 pkg/invoices.go:196 #: pkg/products.go:178 pkg/invoices.go:196
msgid "Invoices must have all the specified labels." msgid "Invoices must have all the specified labels."
msgstr "Les factures han de tenir totes les etiquetes." msgstr "Les factures han de tenir totes les etiquetes."
#: pkg/products.go:179 pkg/invoices.go:200 #: pkg/products.go:182 pkg/invoices.go:200
msgctxt "tag condition" msgctxt "tag condition"
msgid "Any" msgid "Any"
msgstr "Qualsevol" msgstr "Qualsevol"
#: pkg/products.go:180 pkg/invoices.go:201 #: pkg/products.go:183 pkg/invoices.go:201
msgid "Invoices must have at least one of the specified labels." msgid "Invoices must have at least one of the specified labels."
msgstr "Les factures han de tenir com a mínim una de les etiquetes." msgstr "Les factures han de tenir com a mínim una de les etiquetes."
#: pkg/products.go:266 pkg/invoices.go:790 #: pkg/products.go:269 pkg/invoices.go:790
msgctxt "input" msgctxt "input"
msgid "Description" msgid "Description"
msgstr "Descripció" msgstr "Descripció"
#: pkg/products.go:271 pkg/invoices.go:794 #: pkg/products.go:274 pkg/invoices.go:794
msgctxt "input" msgctxt "input"
msgid "Price" msgid "Price"
msgstr "Preu" msgstr "Preu"
#: pkg/products.go:281 pkg/expenses.go:142 pkg/invoices.go:823 #: pkg/products.go:284 pkg/expenses.go:142 pkg/invoices.go:823
msgctxt "input" msgctxt "input"
msgid "Taxes" msgid "Taxes"
msgstr "Imposts" msgstr "Imposts"
#: pkg/products.go:306 pkg/profile.go:92 pkg/invoices.go:867 #: pkg/products.go:309 pkg/profile.go:92 pkg/invoices.go:867
msgid "Name can not be empty." msgid "Name can not be empty."
msgstr "No podeu deixar el nom en blanc." msgstr "No podeu deixar el nom en blanc."
#: pkg/products.go:307 pkg/invoices.go:868 #: pkg/products.go:310 pkg/invoices.go:868
msgid "Price can not be empty." msgid "Price can not be empty."
msgstr "No podeu deixar el preu en blanc." msgstr "No podeu deixar el preu en blanc."
#: pkg/products.go:308 pkg/invoices.go:869 #: pkg/products.go:311 pkg/invoices.go:869
msgid "Price must be a number greater than zero." msgid "Price must be a number greater than zero."
msgstr "El preu ha de ser un número major a zero." msgstr "El preu ha de ser un número major a zero."
#: pkg/products.go:310 pkg/expenses.go:180 pkg/expenses.go:185 #: pkg/products.go:313 pkg/expenses.go:180 pkg/expenses.go:185
#: pkg/invoices.go:877 #: pkg/invoices.go:877
msgid "Selected tax is not valid." msgid "Selected tax is not valid."
msgstr "Heu seleccionat un impost que no és vàlid." msgstr "Heu seleccionat un impost que no és vàlid."
#: pkg/products.go:311 pkg/expenses.go:181 pkg/expenses.go:186 #: pkg/products.go:314 pkg/expenses.go:181 pkg/expenses.go:186
#: pkg/invoices.go:878 #: pkg/invoices.go:878
msgid "You can only select a tax of each class." msgid "You can only select a tax of each class."
msgstr "Només podeu seleccionar un impost de cada classe." msgstr "Només podeu seleccionar un impost de cada classe."

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: numerus\n" "Project-Id-Version: numerus\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2023-05-03 12:40+0200\n" "POT-Creation-Date: 2023-05-06 11:03+0200\n"
"PO-Revision-Date: 2023-01-18 17:45+0100\n" "PO-Revision-Date: 2023-01-18 17:45+0100\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n" "Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Spanish <es@tp.org.es>\n" "Language-Team: Spanish <es@tp.org.es>\n"
@ -49,7 +49,7 @@ msgid "New Invoice"
msgstr "Nueva factura" msgstr "Nueva factura"
#: web/template/invoices/products.gohtml:48 #: web/template/invoices/products.gohtml:48
#: web/template/expenses/index.gohtml:25 web/template/products/index.gohtml:38 #: web/template/products/index.gohtml:38
msgctxt "product" msgctxt "product"
msgid "All" msgid "All"
msgstr "Todos" msgstr "Todos"
@ -135,12 +135,12 @@ msgid "Status"
msgstr "Estado" msgstr "Estado"
#: web/template/invoices/index.gohtml:51 web/template/contacts/index.gohtml:28 #: web/template/invoices/index.gohtml:51 web/template/contacts/index.gohtml:28
#: web/template/products/index.gohtml:40 #: web/template/expenses/index.gohtml:29 web/template/products/index.gohtml:40
msgctxt "title" msgctxt "title"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
#: web/template/invoices/index.gohtml:52 web/template/expenses/index.gohtml:29 #: web/template/invoices/index.gohtml:52 web/template/expenses/index.gohtml:30
msgctxt "title" msgctxt "title"
msgid "Amount" msgid "Amount"
msgstr "Importe" msgstr "Importe"
@ -150,7 +150,7 @@ msgctxt "title"
msgid "Download" msgid "Download"
msgstr "Descargar" msgstr "Descargar"
#: web/template/invoices/index.gohtml:54 #: web/template/invoices/index.gohtml:54 web/template/expenses/index.gohtml:31
msgctxt "title" msgctxt "title"
msgid "Actions" msgid "Actions"
msgstr "Acciones" msgstr "Acciones"
@ -161,6 +161,7 @@ msgid "Select invoice %v"
msgstr "Seleccionar factura %v" msgstr "Seleccionar factura %v"
#: web/template/invoices/index.gohtml:116 web/template/invoices/view.gohtml:19 #: web/template/invoices/index.gohtml:116 web/template/invoices/view.gohtml:19
#: web/template/expenses/index.gohtml:58
msgctxt "action" msgctxt "action"
msgid "Edit" msgid "Edit"
msgstr "Editar" msgstr "Editar"
@ -358,6 +359,11 @@ msgctxt "action"
msgid "New expense" msgid "New expense"
msgstr "Nuevo gasto" msgstr "Nuevo gasto"
#: web/template/expenses/index.gohtml:25
msgctxt "expense"
msgid "All"
msgstr "Todos"
#: web/template/expenses/index.gohtml:26 #: web/template/expenses/index.gohtml:26
msgctxt "title" msgctxt "title"
msgid "Contact" msgid "Contact"
@ -373,7 +379,7 @@ msgctxt "title"
msgid "Invoice Number" msgid "Invoice Number"
msgstr "Número de factura" msgstr "Número de factura"
#: web/template/expenses/index.gohtml:52 #: web/template/expenses/index.gohtml:68
msgid "No expenses added yet." msgid "No expenses added yet."
msgstr "No hay gastos." msgstr "No hay gastos."
@ -512,74 +518,74 @@ msgstr "No podéis dejar la contraseña en blanco."
msgid "Invalid user or password." msgid "Invalid user or password."
msgstr "Nombre de usuario o contraseña inválido." msgstr "Nombre de usuario o contraseña inválido."
#: pkg/products.go:161 pkg/products.go:260 pkg/invoices.go:776 #: pkg/products.go:164 pkg/products.go:263 pkg/invoices.go:776
msgctxt "input" msgctxt "input"
msgid "Name" msgid "Name"
msgstr "Nombre" msgstr "Nombre"
#: pkg/products.go:166 pkg/products.go:287 pkg/expenses.go:158 #: pkg/products.go:169 pkg/products.go:290 pkg/expenses.go:158
#: pkg/invoices.go:187 pkg/invoices.go:597 pkg/invoices.go:1042 #: pkg/invoices.go:187 pkg/invoices.go:597 pkg/invoices.go:1042
#: pkg/contacts.go:256 #: pkg/contacts.go:256
msgctxt "input" msgctxt "input"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
#: pkg/products.go:170 pkg/invoices.go:191 #: pkg/products.go:173 pkg/invoices.go:191
msgctxt "input" msgctxt "input"
msgid "Tags Condition" msgid "Tags Condition"
msgstr "Condición de las etiquetas" msgstr "Condición de las etiquetas"
#: pkg/products.go:174 pkg/invoices.go:195 #: pkg/products.go:177 pkg/invoices.go:195
msgctxt "tag condition" msgctxt "tag condition"
msgid "All" msgid "All"
msgstr "Todas" msgstr "Todas"
#: pkg/products.go:175 pkg/invoices.go:196 #: pkg/products.go:178 pkg/invoices.go:196
msgid "Invoices must have all the specified labels." msgid "Invoices must have all the specified labels."
msgstr "Las facturas deben tener todas las etiquetas." msgstr "Las facturas deben tener todas las etiquetas."
#: pkg/products.go:179 pkg/invoices.go:200 #: pkg/products.go:182 pkg/invoices.go:200
msgctxt "tag condition" msgctxt "tag condition"
msgid "Any" msgid "Any"
msgstr "Cualquiera" msgstr "Cualquiera"
#: pkg/products.go:180 pkg/invoices.go:201 #: pkg/products.go:183 pkg/invoices.go:201
msgid "Invoices must have at least one of the specified labels." msgid "Invoices must have at least one of the specified labels."
msgstr "Las facturas debent tener como mínimo una de las etiquetas." msgstr "Las facturas debent tener como mínimo una de las etiquetas."
#: pkg/products.go:266 pkg/invoices.go:790 #: pkg/products.go:269 pkg/invoices.go:790
msgctxt "input" msgctxt "input"
msgid "Description" msgid "Description"
msgstr "Descripción" msgstr "Descripción"
#: pkg/products.go:271 pkg/invoices.go:794 #: pkg/products.go:274 pkg/invoices.go:794
msgctxt "input" msgctxt "input"
msgid "Price" msgid "Price"
msgstr "Precio" msgstr "Precio"
#: pkg/products.go:281 pkg/expenses.go:142 pkg/invoices.go:823 #: pkg/products.go:284 pkg/expenses.go:142 pkg/invoices.go:823
msgctxt "input" msgctxt "input"
msgid "Taxes" msgid "Taxes"
msgstr "Impuestos" msgstr "Impuestos"
#: pkg/products.go:306 pkg/profile.go:92 pkg/invoices.go:867 #: pkg/products.go:309 pkg/profile.go:92 pkg/invoices.go:867
msgid "Name can not be empty." msgid "Name can not be empty."
msgstr "No podéis dejar el nombre en blanco." msgstr "No podéis dejar el nombre en blanco."
#: pkg/products.go:307 pkg/invoices.go:868 #: pkg/products.go:310 pkg/invoices.go:868
msgid "Price can not be empty." msgid "Price can not be empty."
msgstr "No podéis dejar el precio en blanco." msgstr "No podéis dejar el precio en blanco."
#: pkg/products.go:308 pkg/invoices.go:869 #: pkg/products.go:311 pkg/invoices.go:869
msgid "Price must be a number greater than zero." msgid "Price must be a number greater than zero."
msgstr "El precio tiene que ser un número mayor a cero." msgstr "El precio tiene que ser un número mayor a cero."
#: pkg/products.go:310 pkg/expenses.go:180 pkg/expenses.go:185 #: pkg/products.go:313 pkg/expenses.go:180 pkg/expenses.go:185
#: pkg/invoices.go:877 #: pkg/invoices.go:877
msgid "Selected tax is not valid." msgid "Selected tax is not valid."
msgstr "Habéis escogido un impuesto que no es válido." msgstr "Habéis escogido un impuesto que no es válido."
#: pkg/products.go:311 pkg/expenses.go:181 pkg/expenses.go:186 #: pkg/products.go:314 pkg/expenses.go:181 pkg/expenses.go:186
#: pkg/invoices.go:878 #: pkg/invoices.go:878
msgid "You can only select a tax of each class." msgid "You can only select a tax of each class."
msgstr "Solo podéis escoger un impuesto de cada clase." msgstr "Solo podéis escoger un impuesto de cada clase."

View File

@ -22,11 +22,13 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<th>{{( pgettext "All" "product" )}}</th> <th>{{( pgettext "All" "expense" )}}</th>
<th>{{( pgettext "Contact" "title" )}}</th> <th>{{( pgettext "Contact" "title" )}}</th>
<th>{{( pgettext "Invoice Date" "title" )}}</th> <th>{{( pgettext "Invoice Date" "title" )}}</th>
<th>{{( pgettext "Invoice Number" "title" )}}</th> <th>{{( pgettext "Invoice Number" "title" )}}</th>
<th>{{( pgettext "Tags" "title" )}}</th>
<th>{{( pgettext "Amount" "title" )}}</th> <th>{{( pgettext "Amount" "title" )}}</th>
<th>{{( pgettext "Actions" "title" )}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -34,8 +36,7 @@
{{- range . }} {{- range . }}
<tr> <tr>
<td></td> <td></td>
<td><a href="{{ companyURI "/expenses/"}}{{ .Slug }}" <td>{{ .InvoicerName }}</td>
data-hx-target="main" data-hx-boost="true">{{ .InvoicerName }}</a></td>
<td>{{ .InvoiceDate|formatDate }}</td> <td>{{ .InvoiceDate|formatDate }}</td>
<td>{{ .InvoiceNumber }}</td> <td>{{ .InvoiceNumber }}</td>
<td> <td>
@ -45,11 +46,26 @@
{{- end }} {{- end }}
</td> </td>
<td class="numeric">{{ .Amount | formatPrice }}</td> <td class="numeric">{{ .Amount | formatPrice }}</td>
<td class="actions">
<details class="menu">
<summary><i class="ri-more-line"></i></summary>
<ul role="menu" class="action-menu">
<li role="presentation">
<a role="menuitem" href="{{ companyURI "/expenses"}}/{{ .Slug }}"
data-hx-target="main" data-hx-boost="true"
>
<i class="ri-edit-line"></i>
{{( pgettext "Edit" "action" )}}
</a>
</li>
</ul>
</details>
</td>
</tr> </tr>
{{- end }} {{- end }}
{{ else }} {{ else }}
<tr> <tr>
<td colspan="5">{{( gettext "No expenses added yet." )}}</td> <td colspan="7">{{( gettext "No expenses added yet." )}}</td>
</tr> </tr>
{{ end }} {{ end }}
</tbody> </tbody>