More on what we give up, when we deny ourselves the right to send HTML email.  This is a new section to the document I showed you all before.  Have a look at the table.  Try changing the window geometry and font size.  Even try border cases, like stupidly large windows with stupidly small fonts, or stupidly large fonts.  Have a look at it under Print Preview, to get an idea of it on paper.  Anyone can look fabulous in email if one assumes a reasonably modern HTML render engine.  The trick is to write simple HTML.

Email Notifications

User email address and notification preferences are captured using a new User Preferences page.  Users set their preferences using the new web program, preferences.cgi.

ALTER TABLE customers ADD COLUMN email_address VARCHAR(80);
ALTER TABLE customers ADD COLUMN mail_price_changes CHARACTER(1);
UPDATE customers SET mail_price_changes = 'F';

Special Project SRP

Cost Price SRP
Low High
$5.80 $7.00 $9.95
$7.01 $9.60 $12.95
$9.61 $11.20 $14.95
$11.21 $13.50 $17.95
$13.51 $14.90 $19.95
$14.91 $15.65 $22.95
$15.66 $18.50 $24.95
$18.51 $20.42 $29.95
$20.43 $23.83 $34.95

Customer use a lookup table to determine the SRP for Special Project stock.  Prices for stock outside the bounds of the table are marked up by 25% plus GST, and sold at the 95th cent of that dollar.  This formula has been embodied in a function so that Special Project price change lists can include the Special Project SRP.  The function will need to be updated should Customer change their formula.

CREATE OR REPLACE FUNCTION special_project_srp(numeric) RETURNS numeric AS '
DECLARE
	price ALIAS FOR $1;
	result numeric;
BEGIN
	IF price < 5.80 THEN
		result := trunc(price * 1.25 * 1.1) + 0.95;
	ELSIF price <= 7.00 THEN
		result := 9.95;
	ELSIF price <= 9.60 THEN
		result := 12.95;
	ELSIF price <= 11.20 THEN
		result := 14.95;
	ELSIF price <= 13.50 THEN
		result := 17.95;
	ELSIF price <= 14.00 THEN
		result := 19.95;
	ELSIF price <= 15.65 THEN
		result := 22.95;
	ELSIF price <= 18.50 THEN
		result := 24.95;
	ELSIF price <= 20.42 THEN
		result := 29.95;
	ELSIF price <= 23.83 THEN
		result := 34.95;
	ELSE
		result := trunc(price * 1.25 * 1.1) + 0.95;
	END IF;
	RETURN result;
END;
' LANGUAGE plpgsql;

To answer the unasked, I edited this with my current favorite HTML editor, vi.  You should have a look at the HTML; you'll be surprised how simple it is.