Rename “Payment method” to “Invoicing method”

This is only for user-visible strings; the name from the point of view
of code and database remains the same.

This is an attempt to force a distinction between payment method, used
in invoices, and payment accounts, for payments.

Closes #100.
This commit is contained in:
jordi fita mas 2024-09-06 12:13:27 +02:00
parent 16e80b5ae0
commit 2eecdcfc3e
7 changed files with 199 additions and 147 deletions

View File

@ -778,7 +778,7 @@ func newPaymentMethodForm(locale *Locale) *paymentMethodForm {
locale: locale,
Name: &InputField{
Name: "method_name",
Label: pgettext("input", "Payment method name", locale),
Label: pgettext("input", "Invoicing method name", locale),
Type: "text",
Required: true,
},
@ -821,7 +821,7 @@ func (form *paymentMethodForm) Parse(r *http.Request) error {
func (form *paymentMethodForm) Validate() bool {
validator := newFormValidator()
validator.CheckRequiredInput(form.Name, gettext("Payment method name can not be empty.", form.locale))
validator.CheckRequiredInput(form.Name, gettext("Invoicing method name can not be empty.", form.locale))
validator.CheckRequiredInput(form.Instructions, gettext("Payment instructions can not be empty.", form.locale))
return validator.AllOK()
}

View File

@ -868,7 +868,7 @@ func newInvoiceForm(ctx context.Context, conn *Conn, locale *Locale, company *Co
PaymentMethod: &SelectField{
Name: "payment_method",
Required: true,
Label: pgettext("input", "Payment Method", locale),
Label: pgettext("input", "Invoicing Method", locale),
Selected: []string{mustGetDefaultPaymentMethod(ctx, conn, company)},
Options: mustGetPaymentMethodOptions(ctx, conn, company),
},
@ -925,7 +925,7 @@ func (form *invoiceForm) Validate() bool {
if validator.CheckRequiredInput(form.Date, gettext("Invoice date can not be empty.", form.locale)) {
validator.CheckValidDate(form.Date, gettext("Invoice date must be a valid date.", form.locale))
}
validator.CheckValidSelectOption(form.PaymentMethod, gettext("Selected payment method is not valid.", form.locale))
validator.CheckValidSelectOption(form.PaymentMethod, gettext("Selected invoicing method is not valid.", form.locale))
allOK := validator.AllOK()
for _, product := range form.Products {

View File

@ -707,8 +707,8 @@ func newQuoteForm(ctx context.Context, conn *Conn, locale *Locale, company *Comp
},
PaymentMethod: &SelectField{
Name: "payment_method",
Label: pgettext("input", "Payment Method", locale),
EmptyLabel: gettext("Select a payment method.", locale),
Label: pgettext("input", "Invoicing Method", locale),
EmptyLabel: gettext("Select a invoicing method.", locale),
Options: mustGetPaymentMethodOptions(ctx, conn, company),
},
}
@ -752,7 +752,7 @@ func (form *quoteForm) Validate() bool {
validator.CheckValidDate(form.Date, gettext("Quotation date must be a valid date.", form.locale))
}
if form.PaymentMethod.String() != "" {
validator.CheckValidSelectOption(form.PaymentMethod, gettext("Selected payment method is not valid.", form.locale))
validator.CheckValidSelectOption(form.PaymentMethod, gettext("Selected invoicing method is not valid.", form.locale))
}
allOK := validator.AllOK()

158
po/ca.po
View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: numerus\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-08-30 02:37+0200\n"
"POT-Creation-Date: 2024-09-06 12:07+0200\n"
"PO-Revision-Date: 2023-01-18 17:08+0100\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
@ -458,32 +458,67 @@ msgctxt "title"
msgid "Edit Quotation “%s”"
msgstr "Edició del pressupost «%s»"
#: web/template/app.gohtml:20
msgctxt "nav"
msgid "Dashboard"
msgstr "Tauler"
#: web/template/app.gohtml:21
msgctxt "nav"
msgid "Quotations"
msgstr "Pressuposts"
#: web/template/app.gohtml:22
msgctxt "nav"
msgid "Invoices"
msgstr "Factures"
#: web/template/app.gohtml:23
msgctxt "nav"
msgid "Expenses"
msgstr "Despeses"
#: web/template/app.gohtml:24
msgctxt "nav"
msgid "Payments"
msgstr "Pagaments"
#: web/template/app.gohtml:25
msgctxt "nav"
msgid "Products"
msgstr "Productes"
#: web/template/app.gohtml:26
msgctxt "nav"
msgid "Contacts"
msgstr "Contactes"
#: web/template/app.gohtml:37
msgctxt "menu"
msgid "Account"
msgstr "Compte"
#: web/template/app.gohtml:30
#: web/template/app.gohtml:43
msgctxt "menu"
msgid "Tax Details"
msgstr "Configuració fiscal"
#: web/template/app.gohtml:36 web/template/company/invoicing.gohtml:3
#: web/template/app.gohtml:49 web/template/company/invoicing.gohtml:3
msgctxt "title"
msgid "Invoicing and Quoting"
msgstr "Facturació i pressuposts"
#: web/template/app.gohtml:42 web/template/company/taxes.gohtml:3
#: web/template/app.gohtml:55 web/template/company/taxes.gohtml:3
msgctxt "title"
msgid "Taxes"
msgstr "Imposts"
#: web/template/app.gohtml:48 web/template/payments/methods/index.gohtml:3
#: web/template/app.gohtml:61 web/template/payments/methods/index.gohtml:3
msgctxt "title"
msgid "Payment Methods"
msgstr "Mètodes de pagament"
msgid "Invoicing Methods"
msgstr "Mètodes de facturació"
#: web/template/app.gohtml:54 web/template/payments/accounts/new.gohtml:11
#: web/template/app.gohtml:67 web/template/payments/accounts/new.gohtml:11
#: web/template/payments/accounts/index.gohtml:3
#: web/template/payments/accounts/index.gohtml:11
#: web/template/payments/accounts/edit.gohtml:11
@ -491,55 +526,16 @@ msgctxt "title"
msgid "Payment Accounts"
msgstr "Comptes de pagament"
#: web/template/app.gohtml:60
#: web/template/app.gohtml:73
msgctxt "menu"
msgid "Switch Company"
msgstr "Canvi dempresa"
#: web/template/app.gohtml:68
#: web/template/app.gohtml:81
msgctxt "action"
msgid "Logout"
msgstr "Surt"
#: web/template/app.gohtml:77
msgctxt "nav"
msgid "Dashboard"
msgstr "Tauler"
#: web/template/app.gohtml:78
msgctxt "nav"
msgid "Quotations"
msgstr "Pressuposts"
#: web/template/app.gohtml:79
msgctxt "nav"
msgid "Invoices"
msgstr "Factures"
#: web/template/app.gohtml:80
msgctxt "nav"
msgid "Expenses"
msgstr "Despeses"
#: web/template/app.gohtml:81
msgctxt "nav"
msgid "Payments"
msgstr "Pagaments"
#: web/template/app.gohtml:82
msgctxt "nav"
msgid "Products"
msgstr "Productes"
#: web/template/app.gohtml:83
msgctxt "nav"
msgid "Contacts"
msgstr "Contactes"
#: web/template/app.gohtml:91
msgid "<a href=\"https://numerus.cat/\">Numerus</a> Version: %s"
msgstr "<a href=\"https://numerus.cat/\">Numerus</a> versió: %s"
#: web/template/contacts/new.gohtml:2 web/template/contacts/new.gohtml:11
#: web/template/contacts/new.gohtml:19
msgctxt "title"
@ -837,8 +833,8 @@ msgstr "Per defecte"
#: web/template/payments/methods/index.gohtml:24
msgctxt "title"
msgid "Payment Method"
msgstr "Mètode de pagament"
msgid "Invoicing Method"
msgstr "Mètode de facturació"
#: web/template/payments/methods/index.gohtml:25
msgctxt "title"
@ -846,8 +842,8 @@ msgid "Instructions"
msgstr "Instruccions"
#: web/template/payments/methods/index.gohtml:72
msgid "No payment methods added yet."
msgstr "No hi ha cap mètode de pagament."
msgid "No invoicing methods added yet."
msgstr "No hi ha cap mètode de facturació."
#: web/template/payments/methods/index.gohtml:90
msgctxt "action"
@ -856,13 +852,13 @@ msgstr "Estableix"
#: web/template/payments/methods/index.gohtml:100
msgctxt "title"
msgid "New Payment Method"
msgstr "Nou mètode de pagament"
msgid "New Invoicing Method"
msgstr "Nou mètode de facturació"
#: web/template/payments/methods/index.gohtml:109
msgctxt "action"
msgid "Add new payment method"
msgstr "Afegeix nou mètode de pagament"
msgid "Add new invoicing method"
msgstr "Afegeix nou mètode de facturació"
#: web/template/payments/methods/edit.gohtml:18
msgctxt "action"
@ -1216,8 +1212,8 @@ msgstr "El percentatge ha de ser entre -99 i 99."
#: pkg/company.go:781
msgctxt "input"
msgid "Payment method name"
msgstr "Nom del mètode de pagament"
msgid "Invoicing method name"
msgstr "Nom del mètode de facturació"
#: pkg/company.go:787
msgctxt "input"
@ -1225,14 +1221,14 @@ msgid "Instructions"
msgstr "Instruccions"
#: pkg/company.go:824
msgid "Payment method name can not be empty."
msgstr "No podeu deixar el nom del mètode de pagament en blanc."
msgid "Invoicing method name can not be empty."
msgstr "No podeu deixar el nom del mètode de facturació en blanc."
#: pkg/company.go:825
msgid "Payment instructions can not be empty."
msgstr "No podeu deixar les instruccions de pagament en blanc."
#: pkg/company.go:912 pkg/quote.go:755 pkg/invoices.go:928
#: pkg/company.go:912
msgid "Selected payment method is not valid."
msgstr "Heu seleccionat un mètode de pagament que no és vàlid."
@ -1312,12 +1308,12 @@ msgstr "Notes"
#: pkg/quote.go:710 pkg/invoices.go:871
msgctxt "input"
msgid "Payment Method"
msgstr "Mètode de pagament"
msgid "Invoicing Method"
msgstr "Mètode de facturació"
#: pkg/quote.go:711
msgid "Select a payment method."
msgstr "Escolliu un mètode de pagament."
msgid "Select a invoicing method."
msgstr "Escolliu un mètode de facturació."
#: pkg/quote.go:747
msgid "Selected quotation status is not valid."
@ -1335,6 +1331,10 @@ msgstr "No podeu deixar la data del pressupost en blanc."
msgid "Quotation date must be a valid date."
msgstr "La data del pressupost ha de ser vàlida."
#: pkg/quote.go:755 pkg/invoices.go:928
msgid "Selected invoicing method is not valid."
msgstr "Heu seleccionat un mètode de facturació que no és vàlid."
#: pkg/quote.go:889 pkg/quote.go:894 pkg/invoices.go:1120 pkg/invoices.go:1125
msgctxt "input"
msgid "Id"
@ -1672,6 +1672,32 @@ msgctxt "input"
msgid "Holded Excel file"
msgstr "Fitxer Excel del Holded"
#~ msgctxt "input"
#~ msgid "Payment method name"
#~ msgstr "Nom del mètode de pagament"
#~ msgctxt "title"
#~ msgid "Payment Methods"
#~ msgstr "Mètodes de pagament"
#~ msgid "<a href=\"https://numerus.cat/\">Numerus</a> Version: %s"
#~ msgstr "<a href=\"https://numerus.cat/\">Numerus</a> versió: %s"
#~ msgctxt "title"
#~ msgid "Payment Method"
#~ msgstr "Mètode de pagament"
#~ msgid "No payment methods added yet."
#~ msgstr "No hi ha cap mètode de pagament."
#~ msgctxt "title"
#~ msgid "New Payment Method"
#~ msgstr "Nou mètode de pagament"
#~ msgctxt "input"
#~ msgid "Payment Method"
#~ msgstr "Mètode de pagament"
#~ msgid "Selected invoice status is not valid."
#~ msgstr "Heu seleccionat un estat de factura que no és vàlid."

158
po/es.po
View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: numerus\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-08-30 02:37+0200\n"
"POT-Creation-Date: 2024-09-06 12:07+0200\n"
"PO-Revision-Date: 2023-01-18 17:45+0100\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Spanish <es@tp.org.es>\n"
@ -458,32 +458,67 @@ msgctxt "title"
msgid "Edit Quotation “%s”"
msgstr "Edición del presupuesto «%s»"
#: web/template/app.gohtml:20
msgctxt "nav"
msgid "Dashboard"
msgstr "Panel"
#: web/template/app.gohtml:21
msgctxt "nav"
msgid "Quotations"
msgstr "Presupuestos"
#: web/template/app.gohtml:22
msgctxt "nav"
msgid "Invoices"
msgstr "Facturas"
#: web/template/app.gohtml:23
msgctxt "nav"
msgid "Expenses"
msgstr "Gastos"
#: web/template/app.gohtml:24
msgctxt "nav"
msgid "Payments"
msgstr "Pagos"
#: web/template/app.gohtml:25
msgctxt "nav"
msgid "Products"
msgstr "Productos"
#: web/template/app.gohtml:26
msgctxt "nav"
msgid "Contacts"
msgstr "Contactos"
#: web/template/app.gohtml:37
msgctxt "menu"
msgid "Account"
msgstr "Cuenta"
#: web/template/app.gohtml:30
#: web/template/app.gohtml:43
msgctxt "menu"
msgid "Tax Details"
msgstr "Configuración fiscal"
#: web/template/app.gohtml:36 web/template/company/invoicing.gohtml:3
#: web/template/app.gohtml:49 web/template/company/invoicing.gohtml:3
msgctxt "title"
msgid "Invoicing and Quoting"
msgstr "Facturación y presupuestos"
#: web/template/app.gohtml:42 web/template/company/taxes.gohtml:3
#: web/template/app.gohtml:55 web/template/company/taxes.gohtml:3
msgctxt "title"
msgid "Taxes"
msgstr "Impuestos"
#: web/template/app.gohtml:48 web/template/payments/methods/index.gohtml:3
#: web/template/app.gohtml:61 web/template/payments/methods/index.gohtml:3
msgctxt "title"
msgid "Payment Methods"
msgstr "Métodos de pago"
msgid "Invoicing Methods"
msgstr "Métodos de facturación"
#: web/template/app.gohtml:54 web/template/payments/accounts/new.gohtml:11
#: web/template/app.gohtml:67 web/template/payments/accounts/new.gohtml:11
#: web/template/payments/accounts/index.gohtml:3
#: web/template/payments/accounts/index.gohtml:11
#: web/template/payments/accounts/edit.gohtml:11
@ -491,55 +526,16 @@ msgctxt "title"
msgid "Payment Accounts"
msgstr "Cuenta de pago"
#: web/template/app.gohtml:60
#: web/template/app.gohtml:73
msgctxt "menu"
msgid "Switch Company"
msgstr "Cambio de empresa"
#: web/template/app.gohtml:68
#: web/template/app.gohtml:81
msgctxt "action"
msgid "Logout"
msgstr "Salir"
#: web/template/app.gohtml:77
msgctxt "nav"
msgid "Dashboard"
msgstr "Panel"
#: web/template/app.gohtml:78
msgctxt "nav"
msgid "Quotations"
msgstr "Presupuestos"
#: web/template/app.gohtml:79
msgctxt "nav"
msgid "Invoices"
msgstr "Facturas"
#: web/template/app.gohtml:80
msgctxt "nav"
msgid "Expenses"
msgstr "Gastos"
#: web/template/app.gohtml:81
msgctxt "nav"
msgid "Payments"
msgstr "Pagos"
#: web/template/app.gohtml:82
msgctxt "nav"
msgid "Products"
msgstr "Productos"
#: web/template/app.gohtml:83
msgctxt "nav"
msgid "Contacts"
msgstr "Contactos"
#: web/template/app.gohtml:91
msgid "<a href=\"https://numerus.cat/\">Numerus</a> Version: %s"
msgstr "<a href=\"https://numerus.cat/\">Numerus</a> versión: %s"
#: web/template/contacts/new.gohtml:2 web/template/contacts/new.gohtml:11
#: web/template/contacts/new.gohtml:19
msgctxt "title"
@ -837,8 +833,8 @@ msgstr "Por defecto"
#: web/template/payments/methods/index.gohtml:24
msgctxt "title"
msgid "Payment Method"
msgstr "Método de pago"
msgid "Invoicing Method"
msgstr "Método de facturación"
#: web/template/payments/methods/index.gohtml:25
msgctxt "title"
@ -846,8 +842,8 @@ msgid "Instructions"
msgstr "Instrucciones"
#: web/template/payments/methods/index.gohtml:72
msgid "No payment methods added yet."
msgstr "No hay métodos de pago."
msgid "No invoicing methods added yet."
msgstr "No hay métodos de facturación."
#: web/template/payments/methods/index.gohtml:90
msgctxt "action"
@ -856,13 +852,13 @@ msgstr "Establecer"
#: web/template/payments/methods/index.gohtml:100
msgctxt "title"
msgid "New Payment Method"
msgstr "Nuevo método de pago"
msgid "New Invoicing Method"
msgstr "Nuevo método de facturación"
#: web/template/payments/methods/index.gohtml:109
msgctxt "action"
msgid "Add new payment method"
msgstr "Añadir nuevo método de pago"
msgid "Add new invoicing method"
msgstr "Añadir nuevo método de facturación"
#: web/template/payments/methods/edit.gohtml:18
msgctxt "action"
@ -1216,8 +1212,8 @@ msgstr "El porcentaje tiene que estar entre -99 y 99."
#: pkg/company.go:781
msgctxt "input"
msgid "Payment method name"
msgstr "Nombre del método de pago"
msgid "Invoicing method name"
msgstr "Nombre del método de facturación"
#: pkg/company.go:787
msgctxt "input"
@ -1225,14 +1221,14 @@ msgid "Instructions"
msgstr "Instrucciones"
#: pkg/company.go:824
msgid "Payment method name can not be empty."
msgstr "No podéis dejar el nombre del método de pago en blanco."
msgid "Invoicing method name can not be empty."
msgstr "No podéis dejar el nombre del método de facturación en blanco."
#: pkg/company.go:825
msgid "Payment instructions can not be empty."
msgstr "No podéis dejar las instrucciones de pago en blanco."
#: pkg/company.go:912 pkg/quote.go:755 pkg/invoices.go:928
#: pkg/company.go:912
msgid "Selected payment method is not valid."
msgstr "Habéis escogido un método de pago que no es válido."
@ -1312,12 +1308,12 @@ msgstr "Notas"
#: pkg/quote.go:710 pkg/invoices.go:871
msgctxt "input"
msgid "Payment Method"
msgstr "Método de pago"
msgid "Invoicing Method"
msgstr "Método de facturación"
#: pkg/quote.go:711
msgid "Select a payment method."
msgstr "Escoged un método e pago."
msgid "Select a invoicing method."
msgstr "Escoged un método de facturación."
#: pkg/quote.go:747
msgid "Selected quotation status is not valid."
@ -1335,6 +1331,10 @@ msgstr "No podéis dejar la fecha del presupuesto en blanco."
msgid "Quotation date must be a valid date."
msgstr "La fecha de presupuesto debe ser válida."
#: pkg/quote.go:755 pkg/invoices.go:928
msgid "Selected invoicing method is not valid."
msgstr "Habéis escogido un método de facturación que no es válido."
#: pkg/quote.go:889 pkg/quote.go:894 pkg/invoices.go:1120 pkg/invoices.go:1125
msgctxt "input"
msgid "Id"
@ -1672,6 +1672,32 @@ msgctxt "input"
msgid "Holded Excel file"
msgstr "Archivo Excel de Holded"
#~ msgctxt "input"
#~ msgid "Payment method name"
#~ msgstr "Nombre del método de pago"
#~ msgctxt "title"
#~ msgid "Payment Methods"
#~ msgstr "Métodos de pago"
#~ msgid "<a href=\"https://numerus.cat/\">Numerus</a> Version: %s"
#~ msgstr "<a href=\"https://numerus.cat/\">Numerus</a> versión: %s"
#~ msgctxt "title"
#~ msgid "Payment Method"
#~ msgstr "Método de pago"
#~ msgid "No payment methods added yet."
#~ msgstr "No hay métodos de pago."
#~ msgctxt "title"
#~ msgid "New Payment Method"
#~ msgstr "Nuevo método de pago"
#~ msgctxt "input"
#~ msgid "Payment Method"
#~ msgstr "Método de pago"
#~ msgid "Selected invoice status is not valid."
#~ msgstr "Habéis escogido un estado de factura que no es válido."

View File

@ -58,7 +58,7 @@
<li role="presentation">
<a role="menuitem" href="{{ companyURI "/payment-methods"}}">
<i class="ri-money-euro-circle-line"></i>
{{( pgettext "Payment Methods" "title" )}}
{{( pgettext "Invoicing Methods" "title" )}}
</a>
</li>
<li role="presentation">

View File

@ -1,6 +1,6 @@
{{ define "title" -}}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentMethodsPage*/ -}}
{{( pgettext "Payment Methods" "title" )}}
{{( pgettext "Invoicing Methods" "title" )}}
{{- end }}
{{ define "breadcrumbs" -}}
@ -21,7 +21,7 @@
<thead>
<tr>
<th>{{( pgettext "Default" "title" )}}</th>
<th>{{( pgettext "Payment Method" "title" )}}</th>
<th>{{( pgettext "Invoicing Method" "title" )}}</th>
<th>{{( pgettext "Instructions" "title" )}}</th>
<th></th>
<th></th>
@ -47,7 +47,7 @@
<td>{{ .Instructions }}</td>
<td>
<a href="{{ companyURI "/payment-methods"}}/{{ .Id }}/edit"
aria-label="{{( gettext "Edit payment method" )}}"
aria-label="{{( gettext "Edit invoicing method" )}}"
data-hx-boost="true"
data-hx-push-url="false"
><i class="ri-edit-2-line"></i></a>
@ -60,7 +60,7 @@
>
{{ csrfToken }}
{{ deleteMethod }}
<button class="icon" aria-label="{{( gettext "Delete payment method" )}}"
<button class="icon" aria-label="{{( gettext "Delete invoicing method" )}}"
><i class="ri-delete-back-2-line"></i></button>
</form>
</td>
@ -69,7 +69,7 @@
{{- end }}
{{ else }}
<tr>
<td colspan="5">{{( gettext "No payment methods added yet." )}}</td>
<td colspan="5">{{( gettext "No invoicing methods added yet." )}}</td>
</tr>
{{ end }}
</tbody>
@ -97,7 +97,7 @@
</table>
<form method="POST" action="{{ companyURI "/payment-methods" }}" data-hx-boost="true">
<h3>{{( pgettext "New Payment Method" "title")}}</h3>
<h3>{{( pgettext "New Invoicing Method" "title")}}</h3>
<fieldset>
{{ csrfToken }}
{{ with .Form -}}
@ -106,7 +106,7 @@
{{- end }}
</fieldset>
<footer>
<button>{{( pgettext "Add new payment method" "action" )}}</button>
<button>{{( pgettext "Add new invoicing method" "action" )}}</button>
</footer>
</form>
</section>