numerus/web/template/quotes
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
..
edit.gohtml Add HTTP controller and view to add quotes 2023-06-07 16:35:31 +02:00
index.gohtml Add HTTP controller and view to add quotes 2023-06-07 16:35:31 +02:00
new.gohtml Add HTTP controller and view to add quotes 2023-06-07 16:35:31 +02:00
product-form.gohtml Add HTTP controller and view to add quotes 2023-06-07 16:35:31 +02:00
products.gohtml Add HTTP controller and view to add quotes 2023-06-07 16:35:31 +02:00
view.gohtml Allow empty contact and payment method for quotes 2023-06-08 13:05:41 +02:00