Show the tax details form in a dialog using HTMx

This commit is contained in:
jordi fita mas 2023-03-21 11:58:54 +01:00
parent 9e757cb9f4
commit b1e3afc48b
6 changed files with 290 additions and 249 deletions

View File

@ -175,14 +175,20 @@ func HandleCompanyTaxDetailsForm(w http.ResponseWriter, r *http.Request, _ httpr
return
}
if ok := form.Validate(r.Context(), conn); !ok {
w.WriteHeader(http.StatusUnprocessableEntity)
if !IsHTMxRequest(r) {
w.WriteHeader(http.StatusUnprocessableEntity)
}
mustRenderTaxDetailsForm(w, r, form)
return
}
company := mustGetCompany(r)
conn.MustExec(r.Context(), "update company set business_name = $1, vatin = ($11 || $2)::vatin, trade_name = $3, phone = parse_packed_phone_number($4, $11), email = $5, web = $6, address = $7, city = $8, province = $9, postal_code = $10, country_code = $11, currency_code = $12, invoice_number_format = $13, legal_disclaimer = $14 where company_id = $15", form.BusinessName, form.VATIN, form.TradeName, form.Phone, form.Email, form.Web, form.Address, form.City, form.Province, form.PostalCode, form.Country, form.Currency, form.InvoiceNumberFormat, form.LegalDisclaimer, company.Id)
http.Redirect(w, r, companyURI(company, "/tax-details"), http.StatusSeeOther)
return
if IsHTMxRequest(r) {
w.Header().Set("HX-Trigger", "closeModal")
w.WriteHeader(http.StatusNoContent)
} else {
http.Redirect(w, r, companyURI(company, "/tax-details"), http.StatusSeeOther)
}
}
func mustRenderTaxDetailsForm(w http.ResponseWriter, r *http.Request, form *taxDetailsForm) {
@ -219,7 +225,7 @@ func mustRenderTexDetailsPage(w http.ResponseWriter, r *http.Request, page *TaxD
company := mustGetCompany(r)
page.Taxes = mustGetTaxes(r.Context(), conn, company)
page.PaymentMethods = mustCollectPaymentMethods(r.Context(), conn, company)
mustRenderAppTemplate(w, r, "tax-details.gohtml", page)
mustRenderModalTemplate(w, r, "tax-details.gohtml", page)
}
func mustGetCompany(r *http.Request) *Company {
@ -344,7 +350,11 @@ func HandleDeleteCompanyTax(w http.ResponseWriter, r *http.Request, params httpr
}
conn := getConn(r)
conn.MustExec(r.Context(), "delete from tax where tax_id = $1", taxId)
http.Redirect(w, r, companyURI(mustGetCompany(r), "/tax-details"), http.StatusSeeOther)
if IsHTMxRequest(r) {
w.WriteHeader(http.StatusOK)
} else {
http.Redirect(w, r, companyURI(mustGetCompany(r), "/tax-details"), http.StatusSeeOther)
}
}
func HandleAddCompanyTax(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
@ -361,12 +371,18 @@ func HandleAddCompanyTax(w http.ResponseWriter, r *http.Request, _ httprouter.Pa
return
}
if !form.Validate() {
w.WriteHeader(http.StatusUnprocessableEntity)
if !IsHTMxRequest(r) {
w.WriteHeader(http.StatusUnprocessableEntity)
}
mustRenderTaxForm(w, r, form)
return
}
conn.MustExec(r.Context(), "insert into tax (company_id, tax_class_id, name, rate) values ($1, $2, $3, $4 / 100::decimal)", company.Id, form.Class, form.Name, form.Rate.Integer())
http.Redirect(w, r, companyURI(company, "/tax-details"), http.StatusSeeOther)
if IsHTMxRequest(r) {
mustRenderTaxForm(w, r, newTaxForm(r.Context(), conn, company, locale))
} else {
http.Redirect(w, r, companyURI(company, "/tax-details"), http.StatusSeeOther)
}
}
type paymentMethodForm struct {
@ -421,7 +437,11 @@ func HandleDeletePaymentMethod(w http.ResponseWriter, r *http.Request, params ht
}
conn := getConn(r)
conn.MustExec(r.Context(), "delete from payment_method where payment_method_id = $1", paymentMethodId)
http.Redirect(w, r, companyURI(mustGetCompany(r), "/tax-details"), http.StatusSeeOther)
if IsHTMxRequest(r) {
w.WriteHeader(http.StatusOK)
} else {
http.Redirect(w, r, companyURI(mustGetCompany(r), "/tax-details"), http.StatusSeeOther)
}
}
func HandleAddPaymentMethod(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
@ -438,10 +458,16 @@ func HandleAddPaymentMethod(w http.ResponseWriter, r *http.Request, _ httprouter
return
}
if !form.Validate() {
w.WriteHeader(http.StatusUnprocessableEntity)
if !IsHTMxRequest(r) {
w.WriteHeader(http.StatusUnprocessableEntity)
}
mustRenderPaymentMethodForm(w, r, form)
return
}
conn.MustExec(r.Context(), "insert into payment_method (company_id, name, instructions) values ($1, $2, $3)", company.Id, form.Name, form.Instructions)
http.Redirect(w, r, companyURI(company, "/tax-details"), http.StatusSeeOther)
if IsHTMxRequest(r) {
mustRenderPaymentMethodForm(w, r, newPaymentMethodForm(locale))
} else {
http.Redirect(w, r, companyURI(company, "/tax-details"), http.StatusSeeOther)
}
}

234
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: 2023-03-13 14:50+0100\n"
"POT-Creation-Date: 2023-03-21 11:56+0100\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"
@ -18,156 +18,156 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
#: web/template/invoices/products.gohtml:2
#: web/template/invoices/products.gohtml:19
#: web/template/invoices/products.gohtml:23
msgctxt "title"
msgid "Add Products to Invoice"
msgstr "Afegeix productes a la factura"
#: web/template/invoices/products.gohtml:9 web/template/invoices/new.gohtml:9
#: web/template/invoices/index.gohtml:8 web/template/invoices/view.gohtml:9
#: web/template/invoices/index.gohtml:9 web/template/invoices/view.gohtml:9
#: web/template/invoices/edit.gohtml:9 web/template/contacts/new.gohtml:9
#: web/template/contacts/index.gohtml:8 web/template/contacts/edit.gohtml:9
#: web/template/profile.gohtml:9 web/template/tax-details.gohtml:8
#: web/template/products/new.gohtml:9 web/template/products/index.gohtml:8
#: web/template/contacts/index.gohtml:9 web/template/contacts/edit.gohtml:9
#: web/template/profile.gohtml:9 web/template/tax-details.gohtml:9
#: web/template/products/new.gohtml:9 web/template/products/index.gohtml:9
#: web/template/products/edit.gohtml:9
msgctxt "title"
msgid "Home"
msgstr "Inici"
#: web/template/invoices/products.gohtml:10 web/template/invoices/new.gohtml:10
#: web/template/invoices/index.gohtml:2 web/template/invoices/index.gohtml:9
#: web/template/invoices/index.gohtml:2 web/template/invoices/index.gohtml:10
#: web/template/invoices/view.gohtml:10 web/template/invoices/edit.gohtml:10
msgctxt "title"
msgid "Invoices"
msgstr "Factures"
#: web/template/invoices/products.gohtml:12 web/template/invoices/new.gohtml:2
#: web/template/invoices/new.gohtml:11 web/template/invoices/new.gohtml:15
#: web/template/invoices/new.gohtml:11 web/template/invoices/new.gohtml:19
msgctxt "title"
msgid "New Invoice"
msgstr "Nova factura"
#: web/template/invoices/products.gohtml:47
#: web/template/products/index.gohtml:21
#: web/template/invoices/products.gohtml:51
#: web/template/products/index.gohtml:24
msgctxt "product"
msgid "All"
msgstr "Tots"
#: web/template/invoices/products.gohtml:48
#: web/template/products/index.gohtml:22
#: web/template/invoices/products.gohtml:52
#: web/template/products/index.gohtml:25
msgctxt "title"
msgid "Name"
msgstr "Nom"
#: web/template/invoices/products.gohtml:49
#: web/template/invoices/view.gohtml:56 web/template/products/index.gohtml:23
#: web/template/invoices/products.gohtml:53
#: web/template/invoices/view.gohtml:59 web/template/products/index.gohtml:26
msgctxt "title"
msgid "Price"
msgstr "Preu"
#: web/template/invoices/products.gohtml:63
#: web/template/products/index.gohtml:37
#: web/template/invoices/products.gohtml:67
#: web/template/products/index.gohtml:40
msgid "No products added yet."
msgstr "No hi ha cap producte."
#: web/template/invoices/products.gohtml:71 web/template/invoices/new.gohtml:63
#: web/template/invoices/edit.gohtml:64
#: web/template/invoices/products.gohtml:75 web/template/invoices/new.gohtml:67
#: web/template/invoices/edit.gohtml:68
msgctxt "action"
msgid "Add products"
msgstr "Afegeix productes"
#: web/template/invoices/new.gohtml:44 web/template/invoices/view.gohtml:61
#: web/template/invoices/edit.gohtml:45
#: web/template/invoices/new.gohtml:48 web/template/invoices/view.gohtml:64
#: web/template/invoices/edit.gohtml:49
msgctxt "title"
msgid "Subtotal"
msgstr "Subtotal"
#: web/template/invoices/new.gohtml:54 web/template/invoices/view.gohtml:65
#: web/template/invoices/view.gohtml:105 web/template/invoices/edit.gohtml:55
#: web/template/invoices/new.gohtml:58 web/template/invoices/view.gohtml:68
#: web/template/invoices/view.gohtml:108 web/template/invoices/edit.gohtml:59
msgctxt "title"
msgid "Total"
msgstr "Total"
#: web/template/invoices/new.gohtml:66 web/template/invoices/edit.gohtml:67
#: web/template/invoices/new.gohtml:70 web/template/invoices/edit.gohtml:71
msgctxt "action"
msgid "Update"
msgstr "Actualitza"
#: web/template/invoices/new.gohtml:68 web/template/invoices/index.gohtml:19
#: web/template/invoices/new.gohtml:72 web/template/invoices/index.gohtml:20
msgctxt "action"
msgid "New invoice"
msgstr "Nova factura"
#: web/template/invoices/index.gohtml:17
#: web/template/invoices/index.gohtml:18
msgctxt "action"
msgid "Download invoices"
msgstr "Descarrega factures"
#: web/template/invoices/index.gohtml:28
#: web/template/invoices/index.gohtml:31
msgctxt "invoice"
msgid "All"
msgstr "Totes"
#: web/template/invoices/index.gohtml:29 web/template/invoices/view.gohtml:28
#: web/template/invoices/index.gohtml:32 web/template/invoices/view.gohtml:31
msgctxt "title"
msgid "Date"
msgstr "Data"
#: web/template/invoices/index.gohtml:30
#: web/template/invoices/index.gohtml:33
msgctxt "title"
msgid "Invoice Num."
msgstr "Núm. factura"
#: web/template/invoices/index.gohtml:31 web/template/contacts/index.gohtml:22
#: web/template/invoices/index.gohtml:34 web/template/contacts/index.gohtml:25
msgctxt "title"
msgid "Customer"
msgstr "Client"
#: web/template/invoices/index.gohtml:32
#: web/template/invoices/index.gohtml:35
msgctxt "title"
msgid "Status"
msgstr "Estat"
#: web/template/invoices/index.gohtml:33
#: web/template/invoices/index.gohtml:36
msgctxt "title"
msgid "Tags"
msgstr "Etiquetes"
#: web/template/invoices/index.gohtml:34
#: web/template/invoices/index.gohtml:37
msgctxt "title"
msgid "Amount"
msgstr "Import"
#: web/template/invoices/index.gohtml:35
#: web/template/invoices/index.gohtml:38
msgctxt "title"
msgid "Download"
msgstr "Descàrrega"
#: web/template/invoices/index.gohtml:36
#: web/template/invoices/index.gohtml:39
msgctxt "title"
msgid "Actions"
msgstr "Accions"
#: web/template/invoices/index.gohtml:43
#: web/template/invoices/index.gohtml:46
msgctxt "action"
msgid "Select invoice %v"
msgstr "Selecciona factura %v"
#: web/template/invoices/index.gohtml:92 web/template/invoices/view.gohtml:16
#: web/template/invoices/index.gohtml:95 web/template/invoices/view.gohtml:16
msgctxt "action"
msgid "Edit"
msgstr "Edita"
#: web/template/invoices/index.gohtml:98 web/template/invoices/view.gohtml:15
#: web/template/invoices/index.gohtml:101 web/template/invoices/view.gohtml:15
msgctxt "action"
msgid "Duplicate"
msgstr "Duplica"
#: web/template/invoices/index.gohtml:108
#: web/template/invoices/index.gohtml:111
msgid "No invoices added yet."
msgstr "No hi ha cap factura."
#: web/template/invoices/view.gohtml:2 web/template/invoices/view.gohtml:27
#: web/template/invoices/view.gohtml:2 web/template/invoices/view.gohtml:30
msgctxt "title"
msgid "Invoice %s"
msgstr "Factura %s"
@ -177,32 +177,32 @@ msgctxt "action"
msgid "Download invoice"
msgstr "Descarrega factura"
#: web/template/invoices/view.gohtml:55
#: web/template/invoices/view.gohtml:58
msgctxt "title"
msgid "Concept"
msgstr "Concepte"
#: web/template/invoices/view.gohtml:58
#: web/template/invoices/view.gohtml:61
msgctxt "title"
msgid "Discount"
msgstr "Descompte"
#: web/template/invoices/view.gohtml:60
#: web/template/invoices/view.gohtml:63
msgctxt "title"
msgid "Units"
msgstr "Unitats"
#: web/template/invoices/view.gohtml:95
#: web/template/invoices/view.gohtml:98
msgctxt "title"
msgid "Tax Base"
msgstr "Base imposable"
#: web/template/invoices/edit.gohtml:2 web/template/invoices/edit.gohtml:15
#: web/template/invoices/edit.gohtml:2 web/template/invoices/edit.gohtml:19
msgctxt "title"
msgid "Edit Invoice “%s”"
msgstr "Edició de la factura «%s»"
#: web/template/invoices/edit.gohtml:69
#: web/template/invoices/edit.gohtml:73
msgctxt "action"
msgid "Edit invoice"
msgstr "Edita factura"
@ -212,83 +212,83 @@ msgctxt "title"
msgid "Dashboard"
msgstr "Tauler"
#: web/template/app.gohtml:20
#: web/template/app.gohtml:22
msgctxt "menu"
msgid "Account"
msgstr "Compte"
#: web/template/app.gohtml:26
#: web/template/app.gohtml:28
msgctxt "menu"
msgid "Tax Details"
msgstr "Configuració fiscal"
#: web/template/app.gohtml:34
#: web/template/app.gohtml:36
msgctxt "action"
msgid "Logout"
msgstr "Surt"
#: web/template/app.gohtml:43
#: web/template/app.gohtml:45
msgctxt "nav"
msgid "Dashboard"
msgstr "Tauler"
#: web/template/app.gohtml:44
#: web/template/app.gohtml:46
msgctxt "nav"
msgid "Invoices"
msgstr "Factures"
#: web/template/app.gohtml:45
#: web/template/app.gohtml:47
msgctxt "nav"
msgid "Products"
msgstr "Productes"
#: web/template/app.gohtml:46
#: web/template/app.gohtml:48
msgctxt "nav"
msgid "Contacts"
msgstr "Contactes"
#: web/template/contacts/new.gohtml:2 web/template/contacts/new.gohtml:11
#: web/template/contacts/new.gohtml:15
#: web/template/contacts/new.gohtml:19
msgctxt "title"
msgid "New Contact"
msgstr "Nou contacte"
#: web/template/contacts/new.gohtml:10 web/template/contacts/index.gohtml:2
#: web/template/contacts/index.gohtml:9 web/template/contacts/edit.gohtml:10
#: web/template/contacts/index.gohtml:10 web/template/contacts/edit.gohtml:10
msgctxt "title"
msgid "Contacts"
msgstr "Contactes"
#: web/template/contacts/new.gohtml:31 web/template/contacts/index.gohtml:13
#: web/template/contacts/new.gohtml:35 web/template/contacts/index.gohtml:14
msgctxt "action"
msgid "New contact"
msgstr "Nou contacte"
#: web/template/contacts/index.gohtml:21
#: web/template/contacts/index.gohtml:24
msgctxt "contact"
msgid "All"
msgstr "Tots"
#: web/template/contacts/index.gohtml:23
#: web/template/contacts/index.gohtml:26
msgctxt "title"
msgid "Email"
msgstr "Correu-e"
#: web/template/contacts/index.gohtml:24
#: web/template/contacts/index.gohtml:27
msgctxt "title"
msgid "Phone"
msgstr "Telèfon"
#: web/template/contacts/index.gohtml:39
#: web/template/contacts/index.gohtml:42
msgid "No contacts added yet."
msgstr "No hi ha cap contacte."
#: web/template/contacts/edit.gohtml:2 web/template/contacts/edit.gohtml:15
#: web/template/contacts/edit.gohtml:2 web/template/contacts/edit.gohtml:19
msgctxt "title"
msgid "Edit Contact “%s”"
msgstr "Edició del contacte «%s»"
#: web/template/contacts/edit.gohtml:33
#: web/template/contacts/edit.gohtml:37
msgctxt "action"
msgid "Update contact"
msgstr "Actualitza contacte"
@ -304,118 +304,122 @@ msgid "Login"
msgstr "Entra"
#: web/template/profile.gohtml:2 web/template/profile.gohtml:10
#: web/template/profile.gohtml:14
#: web/template/profile.gohtml:18
msgctxt "title"
msgid "User Settings"
msgstr "Configuració usuari"
#: web/template/profile.gohtml:18
#: web/template/profile.gohtml:22
msgctxt "title"
msgid "User Access Data"
msgstr "Dades accés usuari"
#: web/template/profile.gohtml:24
#: web/template/profile.gohtml:28
msgctxt "title"
msgid "Password Change"
msgstr "Canvi contrasenya"
#: web/template/profile.gohtml:31
#: web/template/profile.gohtml:35
msgctxt "title"
msgid "Language"
msgstr "Idioma"
#: web/template/profile.gohtml:35 web/template/tax-details.gohtml:165
#: web/template/profile.gohtml:39 web/template/tax-details.gohtml:172
msgctxt "action"
msgid "Save changes"
msgstr "Desa canvis"
#: web/template/tax-details.gohtml:2 web/template/tax-details.gohtml:9
#: web/template/tax-details.gohtml:13
#: web/template/tax-details.gohtml:2 web/template/tax-details.gohtml:10
#: web/template/tax-details.gohtml:18
msgctxt "title"
msgid "Tax Details"
msgstr "Configuració fiscal"
#: web/template/tax-details.gohtml:31
#: web/template/tax-details.gohtml:35
msgctxt "title"
msgid "Currency"
msgstr "Moneda"
#: web/template/tax-details.gohtml:37
#: web/template/tax-details.gohtml:41
msgctxt "title"
msgid "Invoicing"
msgstr "Facturació"
#: web/template/tax-details.gohtml:54
#: web/template/tax-details.gohtml:53
msgid "Are you sure?"
msgstr "Nesteu segur?"
#: web/template/tax-details.gohtml:59
msgctxt "title"
msgid "Tax Name"
msgstr "Nom impost"
#: web/template/tax-details.gohtml:55
#: web/template/tax-details.gohtml:60
msgctxt "title"
msgid "Rate (%)"
msgstr "Percentatge"
#: web/template/tax-details.gohtml:56
#: web/template/tax-details.gohtml:61
msgctxt "title"
msgid "Class"
msgstr "Classe"
#: web/template/tax-details.gohtml:80
#: web/template/tax-details.gohtml:85
msgid "No taxes added yet."
msgstr "No hi ha cap impost."
#: web/template/tax-details.gohtml:86 web/template/tax-details.gohtml:146
#: web/template/tax-details.gohtml:91 web/template/tax-details.gohtml:152
msgctxt "title"
msgid "New Line"
msgstr "Nova línia"
#: web/template/tax-details.gohtml:100
#: web/template/tax-details.gohtml:105
msgctxt "action"
msgid "Add new tax"
msgstr "Afegeix nou impost"
#: web/template/tax-details.gohtml:116
#: web/template/tax-details.gohtml:121
msgctxt "title"
msgid "Payment Method"
msgstr "Mètode de pagament"
#: web/template/tax-details.gohtml:117
#: web/template/tax-details.gohtml:122
msgctxt "title"
msgid "Instructions"
msgstr "Instruccions"
#: web/template/tax-details.gohtml:140
#: web/template/tax-details.gohtml:146
msgid "No payment methods added yet."
msgstr "No hi ha cap mètode de pagament."
#: web/template/tax-details.gohtml:157
#: web/template/tax-details.gohtml:164
msgctxt "action"
msgid "Add new payment method"
msgstr "Afegeix nou mètode de pagament"
#: web/template/products/new.gohtml:2 web/template/products/new.gohtml:11
#: web/template/products/new.gohtml:15
#: web/template/products/new.gohtml:19
msgctxt "title"
msgid "New Product"
msgstr "Nou producte"
#: web/template/products/new.gohtml:10 web/template/products/index.gohtml:2
#: web/template/products/index.gohtml:9 web/template/products/edit.gohtml:10
#: web/template/products/index.gohtml:10 web/template/products/edit.gohtml:10
msgctxt "title"
msgid "Products"
msgstr "Productes"
#: web/template/products/new.gohtml:25 web/template/products/index.gohtml:13
#: web/template/products/new.gohtml:29 web/template/products/index.gohtml:14
msgctxt "action"
msgid "New product"
msgstr "Nou producte"
#: web/template/products/edit.gohtml:2 web/template/products/edit.gohtml:15
#: web/template/products/edit.gohtml:2 web/template/products/edit.gohtml:19
msgctxt "title"
msgid "Edit Product “%s”"
msgstr "Edició del producte «%s»"
#: web/template/products/edit.gohtml:26
#: web/template/products/edit.gohtml:30
msgctxt "action"
msgid "Update product"
msgstr "Actualitza producte"
@ -446,43 +450,43 @@ msgstr "No podeu deixar la contrasenya en blanc."
msgid "Invalid user or password."
msgstr "Nom dusuari o contrasenya incorrectes."
#: pkg/products.go:165 pkg/invoices.go:643
#: pkg/products.go:165 pkg/invoices.go:647
msgctxt "input"
msgid "Name"
msgstr "Nom"
#: pkg/products.go:171 pkg/invoices.go:648
#: pkg/products.go:171 pkg/invoices.go:652
msgctxt "input"
msgid "Description"
msgstr "Descripció"
#: pkg/products.go:176 pkg/invoices.go:652
#: pkg/products.go:176 pkg/invoices.go:656
msgctxt "input"
msgid "Price"
msgstr "Preu"
#: pkg/products.go:186 pkg/invoices.go:678
#: pkg/products.go:186 pkg/invoices.go:682
msgctxt "input"
msgid "Taxes"
msgstr "Imposts"
#: pkg/products.go:206 pkg/profile.go:92 pkg/invoices.go:717
#: pkg/products.go:206 pkg/profile.go:92 pkg/invoices.go:721
msgid "Name can not be empty."
msgstr "No podeu deixar el nom en blanc."
#: pkg/products.go:207 pkg/invoices.go:718
#: pkg/products.go:207 pkg/invoices.go:722
msgid "Price can not be empty."
msgstr "No podeu deixar el preu en blanc."
#: pkg/products.go:208 pkg/invoices.go:719
#: pkg/products.go:208 pkg/invoices.go:723
msgid "Price must be a number greater than zero."
msgstr "El preu ha de ser un número major a zero."
#: pkg/products.go:210 pkg/invoices.go:727
#: pkg/products.go:210 pkg/invoices.go:731
msgid "Selected tax is not valid."
msgstr "Heu seleccionat un impost que no és vàlid."
#: pkg/products.go:211 pkg/invoices.go:728
#: pkg/products.go:211 pkg/invoices.go:732
msgid "You can only select a tax of each class."
msgstr "Només podeu seleccionar un impost de cada classe."
@ -509,56 +513,56 @@ msgstr "Heu seleccionat una moneda que no és vàlida."
msgid "Invoice number format can not be empty."
msgstr "No podeu deixar el format del número de factura en blanc."
#: pkg/company.go:291
#: pkg/company.go:297
msgctxt "input"
msgid "Tax name"
msgstr "Nom impost"
#: pkg/company.go:297
#: pkg/company.go:303
msgctxt "input"
msgid "Tax Class"
msgstr "Classe dimpost"
#: pkg/company.go:300
#: pkg/company.go:306
msgid "Select a tax class"
msgstr "Escolliu una classe dimpost"
#: pkg/company.go:304
#: pkg/company.go:310
msgctxt "input"
msgid "Rate (%)"
msgstr "Percentatge"
#: pkg/company.go:327
#: pkg/company.go:333
msgid "Tax name can not be empty."
msgstr "No podeu deixar el nom de limpost en blanc."
#: pkg/company.go:328
#: pkg/company.go:334
msgid "Selected tax class is not valid."
msgstr "Heu seleccionat una classe dimpost que no és vàlida."
#: pkg/company.go:329
#: pkg/company.go:335
msgid "Tax rate can not be empty."
msgstr "No podeu deixar percentatge en blanc."
#: pkg/company.go:330
#: pkg/company.go:336
msgid "Tax rate must be an integer between -99 and 99."
msgstr "El percentatge ha de ser entre -99 i 99."
#: pkg/company.go:383
#: pkg/company.go:399
msgctxt "input"
msgid "Payment method name"
msgstr "Nom del mètode de pagament"
#: pkg/company.go:389
#: pkg/company.go:405
msgctxt "input"
msgid "Instructions"
msgstr "Instruccions"
#: pkg/company.go:407
#: pkg/company.go:423
msgid "Payment method name can not be empty."
msgstr "No podeu deixar el nom del mètode de pagament en blanc."
#: pkg/company.go:408
#: pkg/company.go:424
msgid "Payment instructions can not be empty."
msgstr "No podeu deixar les instruccions de pagament en blanc."
@ -598,7 +602,7 @@ msgstr "Escolliu un client a facturar."
msgid "invoices.zip"
msgstr "factures.zip"
#: pkg/invoices.go:408 pkg/invoices.go:836
#: pkg/invoices.go:408 pkg/invoices.go:840
msgid "Invalid action"
msgstr "Acció invàlida."
@ -657,38 +661,38 @@ msgstr "La data de facturació ha de ser vàlida."
msgid "Selected payment method is not valid."
msgstr "Heu seleccionat un mètode de pagament que no és vàlid."
#: pkg/invoices.go:633 pkg/invoices.go:638
#: pkg/invoices.go:637 pkg/invoices.go:642
msgctxt "input"
msgid "Id"
msgstr "Identificador"
#: pkg/invoices.go:661
#: pkg/invoices.go:665
msgctxt "input"
msgid "Quantity"
msgstr "Quantitat"
#: pkg/invoices.go:669
#: pkg/invoices.go:673
msgctxt "input"
msgid "Discount (%)"
msgstr "Descompte (%)"
#: pkg/invoices.go:716
#: pkg/invoices.go:720
msgid "Product ID can not be empty."
msgstr "No podeu deixar lidentificador del producte en blanc."
#: pkg/invoices.go:721
#: pkg/invoices.go:725
msgid "Quantity can not be empty."
msgstr "No podeu deixar la quantitat en blanc."
#: pkg/invoices.go:722
#: pkg/invoices.go:726
msgid "Quantity must be a number greater than zero."
msgstr "La quantitat ha de ser un número major a zero."
#: pkg/invoices.go:724
#: pkg/invoices.go:728
msgid "Discount can not be empty."
msgstr "No podeu deixar el descompte en blanc."
#: pkg/invoices.go:725
#: pkg/invoices.go:729
msgid "Discount must be a percentage between 0 and 100."
msgstr "El descompte ha de ser un percentatge entre 0 i 100."

234
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: 2023-03-13 14:50+0100\n"
"POT-Creation-Date: 2023-03-21 11:56+0100\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"
@ -18,156 +18,156 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: web/template/invoices/products.gohtml:2
#: web/template/invoices/products.gohtml:19
#: web/template/invoices/products.gohtml:23
msgctxt "title"
msgid "Add Products to Invoice"
msgstr "Añadir productos a la factura"
#: web/template/invoices/products.gohtml:9 web/template/invoices/new.gohtml:9
#: web/template/invoices/index.gohtml:8 web/template/invoices/view.gohtml:9
#: web/template/invoices/index.gohtml:9 web/template/invoices/view.gohtml:9
#: web/template/invoices/edit.gohtml:9 web/template/contacts/new.gohtml:9
#: web/template/contacts/index.gohtml:8 web/template/contacts/edit.gohtml:9
#: web/template/profile.gohtml:9 web/template/tax-details.gohtml:8
#: web/template/products/new.gohtml:9 web/template/products/index.gohtml:8
#: web/template/contacts/index.gohtml:9 web/template/contacts/edit.gohtml:9
#: web/template/profile.gohtml:9 web/template/tax-details.gohtml:9
#: web/template/products/new.gohtml:9 web/template/products/index.gohtml:9
#: web/template/products/edit.gohtml:9
msgctxt "title"
msgid "Home"
msgstr "Inicio"
#: web/template/invoices/products.gohtml:10 web/template/invoices/new.gohtml:10
#: web/template/invoices/index.gohtml:2 web/template/invoices/index.gohtml:9
#: web/template/invoices/index.gohtml:2 web/template/invoices/index.gohtml:10
#: web/template/invoices/view.gohtml:10 web/template/invoices/edit.gohtml:10
msgctxt "title"
msgid "Invoices"
msgstr "Facturas"
#: web/template/invoices/products.gohtml:12 web/template/invoices/new.gohtml:2
#: web/template/invoices/new.gohtml:11 web/template/invoices/new.gohtml:15
#: web/template/invoices/new.gohtml:11 web/template/invoices/new.gohtml:19
msgctxt "title"
msgid "New Invoice"
msgstr "Nueva factura"
#: web/template/invoices/products.gohtml:47
#: web/template/products/index.gohtml:21
#: web/template/invoices/products.gohtml:51
#: web/template/products/index.gohtml:24
msgctxt "product"
msgid "All"
msgstr "Todos"
#: web/template/invoices/products.gohtml:48
#: web/template/products/index.gohtml:22
#: web/template/invoices/products.gohtml:52
#: web/template/products/index.gohtml:25
msgctxt "title"
msgid "Name"
msgstr "Nombre"
#: web/template/invoices/products.gohtml:49
#: web/template/invoices/view.gohtml:56 web/template/products/index.gohtml:23
#: web/template/invoices/products.gohtml:53
#: web/template/invoices/view.gohtml:59 web/template/products/index.gohtml:26
msgctxt "title"
msgid "Price"
msgstr "Precio"
#: web/template/invoices/products.gohtml:63
#: web/template/products/index.gohtml:37
#: web/template/invoices/products.gohtml:67
#: web/template/products/index.gohtml:40
msgid "No products added yet."
msgstr "No hay productos."
#: web/template/invoices/products.gohtml:71 web/template/invoices/new.gohtml:63
#: web/template/invoices/edit.gohtml:64
#: web/template/invoices/products.gohtml:75 web/template/invoices/new.gohtml:67
#: web/template/invoices/edit.gohtml:68
msgctxt "action"
msgid "Add products"
msgstr "Añadir productos"
#: web/template/invoices/new.gohtml:44 web/template/invoices/view.gohtml:61
#: web/template/invoices/edit.gohtml:45
#: web/template/invoices/new.gohtml:48 web/template/invoices/view.gohtml:64
#: web/template/invoices/edit.gohtml:49
msgctxt "title"
msgid "Subtotal"
msgstr "Subtotal"
#: web/template/invoices/new.gohtml:54 web/template/invoices/view.gohtml:65
#: web/template/invoices/view.gohtml:105 web/template/invoices/edit.gohtml:55
#: web/template/invoices/new.gohtml:58 web/template/invoices/view.gohtml:68
#: web/template/invoices/view.gohtml:108 web/template/invoices/edit.gohtml:59
msgctxt "title"
msgid "Total"
msgstr "Total"
#: web/template/invoices/new.gohtml:66 web/template/invoices/edit.gohtml:67
#: web/template/invoices/new.gohtml:70 web/template/invoices/edit.gohtml:71
msgctxt "action"
msgid "Update"
msgstr "Actualizar"
#: web/template/invoices/new.gohtml:68 web/template/invoices/index.gohtml:19
#: web/template/invoices/new.gohtml:72 web/template/invoices/index.gohtml:20
msgctxt "action"
msgid "New invoice"
msgstr "Nueva factura"
#: web/template/invoices/index.gohtml:17
#: web/template/invoices/index.gohtml:18
msgctxt "action"
msgid "Download invoices"
msgstr "Descargar facturas"
#: web/template/invoices/index.gohtml:28
#: web/template/invoices/index.gohtml:31
msgctxt "invoice"
msgid "All"
msgstr "Todas"
#: web/template/invoices/index.gohtml:29 web/template/invoices/view.gohtml:28
#: web/template/invoices/index.gohtml:32 web/template/invoices/view.gohtml:31
msgctxt "title"
msgid "Date"
msgstr "Fecha"
#: web/template/invoices/index.gohtml:30
#: web/template/invoices/index.gohtml:33
msgctxt "title"
msgid "Invoice Num."
msgstr "Nº factura"
#: web/template/invoices/index.gohtml:31 web/template/contacts/index.gohtml:22
#: web/template/invoices/index.gohtml:34 web/template/contacts/index.gohtml:25
msgctxt "title"
msgid "Customer"
msgstr "Cliente"
#: web/template/invoices/index.gohtml:32
#: web/template/invoices/index.gohtml:35
msgctxt "title"
msgid "Status"
msgstr "Estado"
#: web/template/invoices/index.gohtml:33
#: web/template/invoices/index.gohtml:36
msgctxt "title"
msgid "Tags"
msgstr "Etiquetes"
#: web/template/invoices/index.gohtml:34
#: web/template/invoices/index.gohtml:37
msgctxt "title"
msgid "Amount"
msgstr "Importe"
#: web/template/invoices/index.gohtml:35
#: web/template/invoices/index.gohtml:38
msgctxt "title"
msgid "Download"
msgstr "Descargar"
#: web/template/invoices/index.gohtml:36
#: web/template/invoices/index.gohtml:39
msgctxt "title"
msgid "Actions"
msgstr "Acciones"
#: web/template/invoices/index.gohtml:43
#: web/template/invoices/index.gohtml:46
msgctxt "action"
msgid "Select invoice %v"
msgstr "Seleccionar factura %v"
#: web/template/invoices/index.gohtml:92 web/template/invoices/view.gohtml:16
#: web/template/invoices/index.gohtml:95 web/template/invoices/view.gohtml:16
msgctxt "action"
msgid "Edit"
msgstr "Editar"
#: web/template/invoices/index.gohtml:98 web/template/invoices/view.gohtml:15
#: web/template/invoices/index.gohtml:101 web/template/invoices/view.gohtml:15
msgctxt "action"
msgid "Duplicate"
msgstr "Duplicar"
#: web/template/invoices/index.gohtml:108
#: web/template/invoices/index.gohtml:111
msgid "No invoices added yet."
msgstr "No hay facturas."
#: web/template/invoices/view.gohtml:2 web/template/invoices/view.gohtml:27
#: web/template/invoices/view.gohtml:2 web/template/invoices/view.gohtml:30
msgctxt "title"
msgid "Invoice %s"
msgstr "Factura %s"
@ -177,32 +177,32 @@ msgctxt "action"
msgid "Download invoice"
msgstr "Descargar factura"
#: web/template/invoices/view.gohtml:55
#: web/template/invoices/view.gohtml:58
msgctxt "title"
msgid "Concept"
msgstr "Concepto"
#: web/template/invoices/view.gohtml:58
#: web/template/invoices/view.gohtml:61
msgctxt "title"
msgid "Discount"
msgstr "Descuento"
#: web/template/invoices/view.gohtml:60
#: web/template/invoices/view.gohtml:63
msgctxt "title"
msgid "Units"
msgstr "Unidades"
#: web/template/invoices/view.gohtml:95
#: web/template/invoices/view.gohtml:98
msgctxt "title"
msgid "Tax Base"
msgstr "Base imponible"
#: web/template/invoices/edit.gohtml:2 web/template/invoices/edit.gohtml:15
#: web/template/invoices/edit.gohtml:2 web/template/invoices/edit.gohtml:19
msgctxt "title"
msgid "Edit Invoice “%s”"
msgstr "Edición del la factura «%s»"
#: web/template/invoices/edit.gohtml:69
#: web/template/invoices/edit.gohtml:73
msgctxt "action"
msgid "Edit invoice"
msgstr "Editar factura"
@ -212,83 +212,83 @@ msgctxt "title"
msgid "Dashboard"
msgstr "Panel"
#: web/template/app.gohtml:20
#: web/template/app.gohtml:22
msgctxt "menu"
msgid "Account"
msgstr "Cuenta"
#: web/template/app.gohtml:26
#: web/template/app.gohtml:28
msgctxt "menu"
msgid "Tax Details"
msgstr "Configuración fiscal"
#: web/template/app.gohtml:34
#: web/template/app.gohtml:36
msgctxt "action"
msgid "Logout"
msgstr "Salir"
#: web/template/app.gohtml:43
#: web/template/app.gohtml:45
msgctxt "nav"
msgid "Dashboard"
msgstr "Panel"
#: web/template/app.gohtml:44
#: web/template/app.gohtml:46
msgctxt "nav"
msgid "Invoices"
msgstr "Facturas"
#: web/template/app.gohtml:45
#: web/template/app.gohtml:47
msgctxt "nav"
msgid "Products"
msgstr "Productos"
#: web/template/app.gohtml:46
#: web/template/app.gohtml:48
msgctxt "nav"
msgid "Contacts"
msgstr "Contactos"
#: web/template/contacts/new.gohtml:2 web/template/contacts/new.gohtml:11
#: web/template/contacts/new.gohtml:15
#: web/template/contacts/new.gohtml:19
msgctxt "title"
msgid "New Contact"
msgstr "Nuevo contacto"
#: web/template/contacts/new.gohtml:10 web/template/contacts/index.gohtml:2
#: web/template/contacts/index.gohtml:9 web/template/contacts/edit.gohtml:10
#: web/template/contacts/index.gohtml:10 web/template/contacts/edit.gohtml:10
msgctxt "title"
msgid "Contacts"
msgstr "Contactos"
#: web/template/contacts/new.gohtml:31 web/template/contacts/index.gohtml:13
#: web/template/contacts/new.gohtml:35 web/template/contacts/index.gohtml:14
msgctxt "action"
msgid "New contact"
msgstr "Nuevo contacto"
#: web/template/contacts/index.gohtml:21
#: web/template/contacts/index.gohtml:24
msgctxt "contact"
msgid "All"
msgstr "Todos"
#: web/template/contacts/index.gohtml:23
#: web/template/contacts/index.gohtml:26
msgctxt "title"
msgid "Email"
msgstr "Correo-e"
#: web/template/contacts/index.gohtml:24
#: web/template/contacts/index.gohtml:27
msgctxt "title"
msgid "Phone"
msgstr "Teléfono"
#: web/template/contacts/index.gohtml:39
#: web/template/contacts/index.gohtml:42
msgid "No contacts added yet."
msgstr "No hay contactos."
#: web/template/contacts/edit.gohtml:2 web/template/contacts/edit.gohtml:15
#: web/template/contacts/edit.gohtml:2 web/template/contacts/edit.gohtml:19
msgctxt "title"
msgid "Edit Contact “%s”"
msgstr "Edición del contacto «%s»"
#: web/template/contacts/edit.gohtml:33
#: web/template/contacts/edit.gohtml:37
msgctxt "action"
msgid "Update contact"
msgstr "Actualizar contacto"
@ -304,118 +304,122 @@ msgid "Login"
msgstr "Entrar"
#: web/template/profile.gohtml:2 web/template/profile.gohtml:10
#: web/template/profile.gohtml:14
#: web/template/profile.gohtml:18
msgctxt "title"
msgid "User Settings"
msgstr "Configuración usuario"
#: web/template/profile.gohtml:18
#: web/template/profile.gohtml:22
msgctxt "title"
msgid "User Access Data"
msgstr "Datos acceso usuario"
#: web/template/profile.gohtml:24
#: web/template/profile.gohtml:28
msgctxt "title"
msgid "Password Change"
msgstr "Cambio de contraseña"
#: web/template/profile.gohtml:31
#: web/template/profile.gohtml:35
msgctxt "title"
msgid "Language"
msgstr "Idioma"
#: web/template/profile.gohtml:35 web/template/tax-details.gohtml:165
#: web/template/profile.gohtml:39 web/template/tax-details.gohtml:172
msgctxt "action"
msgid "Save changes"
msgstr "Guardar cambios"
#: web/template/tax-details.gohtml:2 web/template/tax-details.gohtml:9
#: web/template/tax-details.gohtml:13
#: web/template/tax-details.gohtml:2 web/template/tax-details.gohtml:10
#: web/template/tax-details.gohtml:18
msgctxt "title"
msgid "Tax Details"
msgstr "Configuración fiscal"
#: web/template/tax-details.gohtml:31
#: web/template/tax-details.gohtml:35
msgctxt "title"
msgid "Currency"
msgstr "Moneda"
#: web/template/tax-details.gohtml:37
#: web/template/tax-details.gohtml:41
msgctxt "title"
msgid "Invoicing"
msgstr "Facturación"
#: web/template/tax-details.gohtml:54
#: web/template/tax-details.gohtml:53
msgid "Are you sure?"
msgstr "¿Estáis seguro?"
#: web/template/tax-details.gohtml:59
msgctxt "title"
msgid "Tax Name"
msgstr "Nombre impuesto"
#: web/template/tax-details.gohtml:55
#: web/template/tax-details.gohtml:60
msgctxt "title"
msgid "Rate (%)"
msgstr "Porcentaje"
#: web/template/tax-details.gohtml:56
#: web/template/tax-details.gohtml:61
msgctxt "title"
msgid "Class"
msgstr "Clase"
#: web/template/tax-details.gohtml:80
#: web/template/tax-details.gohtml:85
msgid "No taxes added yet."
msgstr "No hay impuestos."
#: web/template/tax-details.gohtml:86 web/template/tax-details.gohtml:146
#: web/template/tax-details.gohtml:91 web/template/tax-details.gohtml:152
msgctxt "title"
msgid "New Line"
msgstr "Nueva línea"
#: web/template/tax-details.gohtml:100
#: web/template/tax-details.gohtml:105
msgctxt "action"
msgid "Add new tax"
msgstr "Añadir nuevo impuesto"
#: web/template/tax-details.gohtml:116
#: web/template/tax-details.gohtml:121
msgctxt "title"
msgid "Payment Method"
msgstr "Método de pago"
#: web/template/tax-details.gohtml:117
#: web/template/tax-details.gohtml:122
msgctxt "title"
msgid "Instructions"
msgstr "Instrucciones"
#: web/template/tax-details.gohtml:140
#: web/template/tax-details.gohtml:146
msgid "No payment methods added yet."
msgstr "No hay métodos de pago."
#: web/template/tax-details.gohtml:157
#: web/template/tax-details.gohtml:164
msgctxt "action"
msgid "Add new payment method"
msgstr "Añadir nuevo método de pago"
#: web/template/products/new.gohtml:2 web/template/products/new.gohtml:11
#: web/template/products/new.gohtml:15
#: web/template/products/new.gohtml:19
msgctxt "title"
msgid "New Product"
msgstr "Nuevo producto"
#: web/template/products/new.gohtml:10 web/template/products/index.gohtml:2
#: web/template/products/index.gohtml:9 web/template/products/edit.gohtml:10
#: web/template/products/index.gohtml:10 web/template/products/edit.gohtml:10
msgctxt "title"
msgid "Products"
msgstr "Productos"
#: web/template/products/new.gohtml:25 web/template/products/index.gohtml:13
#: web/template/products/new.gohtml:29 web/template/products/index.gohtml:14
msgctxt "action"
msgid "New product"
msgstr "Nuevo producto"
#: web/template/products/edit.gohtml:2 web/template/products/edit.gohtml:15
#: web/template/products/edit.gohtml:2 web/template/products/edit.gohtml:19
msgctxt "title"
msgid "Edit Product “%s”"
msgstr "Edición del producto «%s»"
#: web/template/products/edit.gohtml:26
#: web/template/products/edit.gohtml:30
msgctxt "action"
msgid "Update product"
msgstr "Actualizar producto"
@ -446,43 +450,43 @@ msgstr "No podéis dejar la contraseña en blanco."
msgid "Invalid user or password."
msgstr "Nombre de usuario o contraseña inválido."
#: pkg/products.go:165 pkg/invoices.go:643
#: pkg/products.go:165 pkg/invoices.go:647
msgctxt "input"
msgid "Name"
msgstr "Nombre"
#: pkg/products.go:171 pkg/invoices.go:648
#: pkg/products.go:171 pkg/invoices.go:652
msgctxt "input"
msgid "Description"
msgstr "Descripción"
#: pkg/products.go:176 pkg/invoices.go:652
#: pkg/products.go:176 pkg/invoices.go:656
msgctxt "input"
msgid "Price"
msgstr "Precio"
#: pkg/products.go:186 pkg/invoices.go:678
#: pkg/products.go:186 pkg/invoices.go:682
msgctxt "input"
msgid "Taxes"
msgstr "Impuestos"
#: pkg/products.go:206 pkg/profile.go:92 pkg/invoices.go:717
#: pkg/products.go:206 pkg/profile.go:92 pkg/invoices.go:721
msgid "Name can not be empty."
msgstr "No podéis dejar el nombre en blanco."
#: pkg/products.go:207 pkg/invoices.go:718
#: pkg/products.go:207 pkg/invoices.go:722
msgid "Price can not be empty."
msgstr "No podéis dejar el precio en blanco."
#: pkg/products.go:208 pkg/invoices.go:719
#: pkg/products.go:208 pkg/invoices.go:723
msgid "Price must be a number greater than zero."
msgstr "El precio tiene que ser un número mayor a cero."
#: pkg/products.go:210 pkg/invoices.go:727
#: pkg/products.go:210 pkg/invoices.go:731
msgid "Selected tax is not valid."
msgstr "Habéis escogido un impuesto que no es válido."
#: pkg/products.go:211 pkg/invoices.go:728
#: pkg/products.go:211 pkg/invoices.go:732
msgid "You can only select a tax of each class."
msgstr "Solo podéis escoger un impuesto de cada clase."
@ -509,56 +513,56 @@ msgstr "Habéis escogido una moneda que no es válida."
msgid "Invoice number format can not be empty."
msgstr "No podéis dejar el formato del número de factura en blanco."
#: pkg/company.go:291
#: pkg/company.go:297
msgctxt "input"
msgid "Tax name"
msgstr "Nombre impuesto"
#: pkg/company.go:297
#: pkg/company.go:303
msgctxt "input"
msgid "Tax Class"
msgstr "Clase de impuesto"
#: pkg/company.go:300
#: pkg/company.go:306
msgid "Select a tax class"
msgstr "Escoged una clase de impuesto"
#: pkg/company.go:304
#: pkg/company.go:310
msgctxt "input"
msgid "Rate (%)"
msgstr "Porcentaje"
#: pkg/company.go:327
#: pkg/company.go:333
msgid "Tax name can not be empty."
msgstr "No podéis dejar el nombre del impuesto en blanco."
#: pkg/company.go:328
#: pkg/company.go:334
msgid "Selected tax class is not valid."
msgstr "Habéis escogido una clase impuesto que no es válida."
#: pkg/company.go:329
#: pkg/company.go:335
msgid "Tax rate can not be empty."
msgstr "No podéis dejar el porcentaje en blanco."
#: pkg/company.go:330
#: pkg/company.go:336
msgid "Tax rate must be an integer between -99 and 99."
msgstr "El porcentaje tiene que estar entre -99 y 99."
#: pkg/company.go:383
#: pkg/company.go:399
msgctxt "input"
msgid "Payment method name"
msgstr "Nombre del método de pago"
#: pkg/company.go:389
#: pkg/company.go:405
msgctxt "input"
msgid "Instructions"
msgstr "Instrucciones"
#: pkg/company.go:407
#: pkg/company.go:423
msgid "Payment method name can not be empty."
msgstr "No podéis dejar el nombre del método de pago en blanco."
#: pkg/company.go:408
#: pkg/company.go:424
msgid "Payment instructions can not be empty."
msgstr "No podéis dejar las instrucciones de pago en blanco."
@ -598,7 +602,7 @@ msgstr "Escoged un cliente a facturar."
msgid "invoices.zip"
msgstr "facturas.zip"
#: pkg/invoices.go:408 pkg/invoices.go:836
#: pkg/invoices.go:408 pkg/invoices.go:840
msgid "Invalid action"
msgstr "Acción inválida."
@ -657,38 +661,38 @@ msgstr "La fecha de factura debe ser válida."
msgid "Selected payment method is not valid."
msgstr "Habéis escogido un método de pago que no es válido."
#: pkg/invoices.go:633 pkg/invoices.go:638
#: pkg/invoices.go:637 pkg/invoices.go:642
msgctxt "input"
msgid "Id"
msgstr "Identificador"
#: pkg/invoices.go:661
#: pkg/invoices.go:665
msgctxt "input"
msgid "Quantity"
msgstr "Cantidad"
#: pkg/invoices.go:669
#: pkg/invoices.go:673
msgctxt "input"
msgid "Discount (%)"
msgstr "Descuento (%)"
#: pkg/invoices.go:716
#: pkg/invoices.go:720
msgid "Product ID can not be empty."
msgstr "No podéis dejar el identificador de producto en blanco."
#: pkg/invoices.go:721
#: pkg/invoices.go:725
msgid "Quantity can not be empty."
msgstr "No podéis dejar la cantidad en blanco."
#: pkg/invoices.go:722
#: pkg/invoices.go:726
msgid "Quantity must be a number greater than zero."
msgstr "La cantidad tiene que ser un número mayor a cero."
#: pkg/invoices.go:724
#: pkg/invoices.go:728
msgid "Discount can not be empty."
msgstr "No podéis dejar el descuento en blanco."
#: pkg/invoices.go:725
#: pkg/invoices.go:729
msgid "Discount must be a percentage between 0 and 100."
msgstr "El descuento tiene que ser un porcentaje entre 0 y 100."

View File

@ -696,6 +696,12 @@ dialog {
cursor: pointer;
}
/* HTMx */
tr.htmx-swapping td {
opacity: 0;
transition: opacity 1s ease-out;
}
/* Remix Icon */
@font-face {

View File

@ -23,7 +23,7 @@
</a>
</li>
<li role="presentation">
<a role="menuitem" href="{{ companyURI "/tax-details" }}">
<a role="menuitem" href="{{ companyURI "/tax-details" }}" data-hx-boost="true">
<i class="ri-vip-diamond-line"></i>
{{( pgettext "Tax Details" "menu" )}}
</a>

View File

@ -14,10 +14,10 @@
{{ define "content" }}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.TaxDetailsPage*/ -}}
<section class="dialog-content">
<section class="dialog-content" id="tax-details-dialog-content" data-hx-target="this">
<h2>{{(pgettext "Tax Details" "title")}}</h2>
{{ with .DetailsForm }}
<form id="details" method="POST">
<form id="details" method="POST" action="{{ companyURI "/tax-details" }}" data-hx-boost="true" data-hx-select="#tax-details-dialog-content">
{{ csrfToken }}
{{ template "input-field" .BusinessName }}
{{ template "input-field" .VATIN }}
@ -46,10 +46,11 @@
</form>
{{ end }}
<form id="newtax" method="POST" action="{{ companyURI "/tax" }}">
<form id="newtax" method="POST" action="{{ companyURI "/tax" }}" data-hx-boost="true" data-hx-select="#tax-details-dialog-content">
{{ csrfToken }}
</form>
{{ $confirm := ( gettext "Are you sure?" )}}
<fieldset>
<table>
<thead>
@ -61,7 +62,7 @@
<th></th>
</tr>
</thead>
<tbody>
<tbody data-hx-confirm="{{ $confirm }}" data-hx-target="closest tr" data-hx-swap="outerHTML swap:1s">
{{ with .Taxes }}
{{- range $tax := . }}
<tr>
@ -70,7 +71,7 @@
<td>{{ .Rate }}</td>
<td>{{ .Class }}</td>
<td>
<form method="POST" action="{{ companyURI "/tax"}}/{{ .Id }}">
<form method="POST" action="{{ companyURI "/tax"}}/{{ .Id }}" data-hx-boost="true">
{{ csrfToken }}
{{ deleteMethod }}
<button class="icon" aria-label="{{( gettext "Delete tax" )}}" type="submit"><i
@ -108,7 +109,7 @@
</table>
</fieldset>
<form id="new-payment-method" method="POST" action="{{ companyURI "/payment-method" }}">
<form id="new-payment-method" method="POST" action="{{ companyURI "/payment-method" }}" data-hx-boost="true" data-hx-select="#tax-details-dialog-content">
{{ csrfToken }}
</form>
@ -122,7 +123,7 @@
<th></th>
</tr>
</thead>
<tbody>
<tbody data-hx-confirm="{{ $confirm }}" data-hx-target="closest tr" data-hx-swap="outerHTML swap:1s">
{{ with .PaymentMethods }}
{{- range $method := . }}
<tr>
@ -130,7 +131,7 @@
<td>{{ .Name }}</td>
<td>{{ .Instructions }}</td>
<td>
<form method="POST" action="{{ companyURI "/payment-method"}}/{{ .Id }}">
<form method="POST" action="{{ companyURI "/payment-method"}}/{{ .Id }}" data-hx-boost="true">
{{ csrfToken }}
{{ deleteMethod }}
<button class="icon" aria-label="{{( gettext "Delete payment method" )}}"