Commit Graph

7 Commits

Author SHA1 Message Date
jordi fita mas b3004486f0 Properly register array and composite PostgreSQL types with pgtype
I have moved everything into a different file, even though it is related
to “db”, because it was starting to get a bit ugly.

Apparently i was doing too much work and had to read the code to
understand what i was supposed to do, because pgtypes’ documentation,
as all other projects from the same author, is almost non-existent.
2023-02-20 11:42:21 +01:00
jordi fita mas 98ac17a129 Call add_invoice when adding invoice from Go
I needed to add binary encoding function for the new_invoice_product
type, and currently it is not correct: i hardcoded the OID values, but
they are going to be different on a different database.
2023-02-19 23:53:06 +01:00
jordi fita mas 045bf7ff6a Add the formnovalidate attribute to update and add products buttons
They are to complete the invoice, so it can be in an invalid date, but
we do not want to force people to finish all required inputs before they
can add products or update quantities, do we?

Now had to add the empty option label for customer in all cases, because
it could be empty, although that should be done regardless in case
someone has a browser that does not validate fields.
2023-02-14 12:55:19 +01:00
jordi fita mas 989c1717e5 Rename mustGetInvoiceEntries to mustCollectInvoiceEntries
I have seen that pgx has the CollectRows function to do the same job as
that function.  I can not use CollectRows because it uses generics and
requires Go 1.18, but i have adopted the same nomenclature they use.
2023-02-14 12:34:50 +01:00
jordi fita mas 3891a01fd5 Fix use of API methods not available in Go 1.16
Apparently, url.Values.Has and math.MaxInt was added to Go 1.17,
but on Debian Bullseye there is only Go 1.16.  I do not want to
install a new version of Go to the server unless there is an
overwhelming reason, and a couple of methods are not.  Thus, now i use
Go 1.16 too on my development machine, to avoid situations like this.
2023-02-13 10:32:26 +01:00
jordi fita mas 4903c8a3b9 Add the form to add products to an invoice and create invoices too
Still missing: the invoice number, that requires more tables and
possibly a PL/pgSQL function to do it properly.
2023-02-12 21:06:48 +01:00
jordi fita mas 5c15b9de20 Add the bare-bones form for invoices 2023-02-11 22:16:48 +01:00