numerus/pkg
jordi fita mas 6c3a3ff232 Allow empty contact and payment method for quotes
I have to use a value to be used as “none” for payment method and
contact.  In PL/pgSQL add_quote and edit_quote functions, that value is
NULL, while in forms it is the empty string.  I can not simply pass the
empty string for either of these fields because PL/pgSQL expects
(nullable) integers, and "" is not a valid integer and is not NULL
either.  A conversion is necessary.

Apparently, Go’s nil is not a valid representation for SQL’s NULL with
pgx, and had to use sql.NullString instead.

I also needed to coalesce contact’s VATIN and phone, because null values
can not be scanned to *string.  I did not do that before because
`coalesce(vatin, '')` throws an error that '' is not a valid VATIN and
just left as is, wrongly expecting that pgx would do the job of leaving
the string blank for me.  It does not.

Lastly, i can not blindly write Quotee’s tax details in the quote’s view
page, or we would see the (), characters for the empty address info.
2023-06-08 13:05:41 +02:00
..
company.go Allow to change the current year’s invoice number counter 2023-05-31 20:01:00 +02:00
contacts.go There is no need for array_to_string() in tags 2023-05-27 21:36:10 +02:00
dashboard.go Add tooltips to the SVG chart with date and amount 2023-05-21 19:22:46 +02:00
db.go Properly register array and composite PostgreSQL types with pgtype 2023-02-20 11:42:21 +01:00
expenses.go There is no need for array_to_string() in tags 2023-05-27 21:36:10 +02:00
form.go Allow empty contact and payment method for quotes 2023-06-08 13:05:41 +02:00
htmx.go Use HTMx to add product rows “inline” in the invoice form 2023-04-24 02:00:38 +02:00
invoices.go Add HTTP controller and view to add quotes 2023-06-07 16:35:31 +02:00
locale.go Add currency_pattern to language relation 2023-02-23 12:12:33 +01:00
logger.go Move source file to the root of pkg 2023-01-17 10:40:22 +01:00
login.go Replace default router with github.com/julienschmidt/httprouter 2023-02-03 12:30:56 +01:00
pgtypes.go Add HTTP controller and view to add quotes 2023-06-07 16:35:31 +02:00
products.go There is no need for array_to_string() in tags 2023-05-27 21:36:10 +02:00
profile.go Create constants for the HTMX request and response headers used 2023-04-06 12:07:20 +02:00
quote.go Allow empty contact and payment method for quotes 2023-06-08 13:05:41 +02:00
recover.go Gofmt recover.go 2023-01-22 20:37:34 +01:00
router.go Add HTTP controller and view to add quotes 2023-06-07 16:35:31 +02:00
template.go Begin the dashboard with expenses, gross income, net income, and taxes 2023-05-16 14:56:49 +02:00