diff --git a/build_json.xlsx b/build_json.xlsx index 204a1a4..0117acb 100644 Binary files a/build_json.xlsx and b/build_json.xlsx differ diff --git a/event_log.md b/event_log.md new file mode 100644 index 0000000..ef5ae6c --- /dev/null +++ b/event_log.md @@ -0,0 +1,6 @@ +event log + + collection of dissimilar items + -> trigger based on insert adds to GL + -> gl adds to balance based on GL trigger + ? how is fiscal period determined \ No newline at end of file diff --git a/new_format.pgsql b/new_format.pgsql new file mode 100644 index 0000000..0b9f4a4 --- /dev/null +++ b/new_format.pgsql @@ -0,0 +1,5 @@ +WITH j AS ( +SELECT + JSONB_PRETTY($${"vendor":"Drug Mart","date":"2017-08-20","instrument":"Discover Card","module":"MJE_O","offset":"dcard","total":18.25,"item":[{"item":"Green Chili","amount":1.49,"reason":"food"},{"item":"Black Beans","amount":1.6,"reason":"food"},{"item":"Distilled Water","amount":7.12,"reason":"food"},{"item":"Fruit Preservative","amount":3.99,"reason":"food"},{"item":"Watch Battery","amount":3.79,"reason":"supplies"},{"item":"Sales Tax","amount":"0.26","reason":"taxes"}],"gl":[{"gl":"food","amount":1.49,"reason":"food","item":"Green Chili"},{"gl":"food","amount":1.6,"reason":"food","item":"Black Beans"},{"gl":"food","amount":7.12,"reason":"food","item":"Distilled Water"},{"gl":"food","amount":3.99,"reason":"food","item":"Fruit Preservative"},{"gl":"supplies","amount":3.79,"reason":"supplies","item":"Watch Battery"},{"gl":"taxes","amount":"0.26","reason":"taxes","item":"Sales Tax"},{"gl":"dcard","amount":-1.49,"reason":"food","item":"Green Chili"},{"gl":"dcard","amount":-1.6,"reason":"food","item":"Black Beans"},{"gl":"dcard","amount":-7.12,"reason":"food","item":"Distilled Water"},{"gl":"dcard","amount":-3.99,"reason":"food","item":"Fruit Preservative"},{"gl":"dcard","amount":-3.79,"reason":"supplies","item":"Watch Battery"},{"gl":"dcard","amount":-0.26,"reason":"taxes","item":"Sales Tax"}]}$$::JSONB) as r +) +select j.r->'vendor' from j \ No newline at end of file