2 Commits 4570b10da7 ... b0c8c6d8b0

Autor SHA1 Mensagem Data
  Daniel Sheffield b0c8c6d8b0 add examples 6 meses atrás
  Daniel Sheffield 47b010f993 Added mapping for online Woolworths orders and TOFS orders 6 meses atrás
2 arquivos alterados com 16 adições e 0 exclusões
  1. 14 0
      example.sql
  2. 2 0
      reconcile.py

+ 14 - 0
example.sql

@@ -1,6 +1,20 @@
 -- Insert a tag if it got missed
 --INSERT INTO tags_map (transaction_id, tag_id) VALUES(2247, 11);
+
+-- Check your filter is correct first!
 SELECT * FROM transactions t
 	LEFT JOIN tags_map ON (transaction_id = t.id)
 	LEFT JOIN tags tg ON (tag_id = tg.id)
 	WHERE transaction_id = 2247;
+
+
+-- Move from date to datej
+--UPDATE public.transactions
+--    -- Set the correct date on all rows that match the filter: Noon NZ time on 30 April 2024 (use exact time if known)
+--    SET  ts=('2024-04-30 12:00'::timestamp with time zone AT TIME ZONE 'UTC')
+--    -- Filter to the rows you want to alter: Noon NZ time on 15 April 2024 (use exact time if knwon)
+--    WHERE ts::date = ('2024-04-15 12:00'::timestamp with time zone AT TIME ZONE 'UTC')::date;
+
+-- Check your filter is correct first!
+SELECT *, sum(price) OVER () FROM  public.transactions
+WHERE ts::date = ('2024-04-15 12:00'::timestamp with time zone AT TIME ZONE 'UTC')::date and store_id = 8;

+ 2 - 0
reconcile.py

@@ -59,6 +59,8 @@ STORE_CODES = {
     'Fruit King' : 'FK',
     'Fresh Choice': 'FC',
     'FC12-3189-0013895-00': 'DV',
+    'ORGANIC FOOD SH' : 'TOFS',
+    'WWNZ' : 'CD',
 }
 
 user = os.getenv('USER')