From 6d1a3e3f0942d11df97b3d8338952161032573aa Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 18 Dec 2020 17:27:24 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 17f86a79..07be7ee8 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -45,7 +45,30 @@ TODO: //MIGRATE_OUTSTANDING comment tag The tag will contain the description for each ............................................................ - +**** +CREATE OR REPLACE FUNCTION PUBLIC.AYGETNAME(IN AYOBJECTID bigint, IN AYOBJECTTYPE integer) RETURNS text AS $BODY$ +DECLARE + aytable TEXT DEFAULT ''; + aynamecolumn TEXT DEFAULT 'name'; + returnstr TEXT DEFAULT ''; +BEGIN + -- Object type to table name + case ayobjecttype + when 8 then + aytable = 'acustomer'; + when 2 then + aytable = 'awidget'; + when 33 then + aytable = 'avendor'; + else + -- unknown or not supported just return default string + RETURN '-'; + end case; + EXECUTE format('SELECT %I FROM %I WHERE id = %L', aynamecolumn, aytable, ayobjectid) INTO returnstr; + RETURN returnstr; +END; +$BODY$ LANGUAGE PLPGSQL STABLE +**** currently doing: Reminder - was regular non followup schedulemarker, Review - was follow up schedule marker @@ -113,6 +136,11 @@ Preliminary order to get the ball rolling, these are the easiest starting point: When do this need to go back and do a bunch of //MIGRATE_OUTSTANDING i.e. show all + INVENTORY AND BALANCE STUFF + Best implemented as a stored procedure? + this example is exactly a bank balance + https://www.postgresqltutorial.com/postgresql-create-procedure/ + # V7 objects now TAGS, the following objects are imported as tags and suffixed with a period and then short versions of the object type in the tag name - Region