Browse Source

more store codes and better handling of them

Daniel Sheffield 7 tháng trước cách đây
mục cha
commit
628d49e4a8
1 tập tin đã thay đổi với 9 bổ sung3 xóa
  1. 9 3
      reconcile.py

+ 9 - 3
reconcile.py

@@ -30,11 +30,12 @@ STORE_CODES = {
     'countdown': 'CD',
     'pak n save': 'PnS',
     'SEAFOOD BAZAAR': 'SB',
-    'THE ORGANIC FOOD SHOP HAMILTON': 'TOFS',
+    'GORDONTON FARM SHOP': 'GFS',
+    'THE FARM SHOP': 'GFS',
+    'THE ORGANIC FOOD SHOP': 'TOFS',
     'TOFS' : 'TOFS',
     'WHATAWHATA BERRY FARM': 'Farm',
     'TAUPIRI DAIRY TAUPIRI': 'TD',
-    'THE FARM SHOP': 'GFS',
     'Dreamview Cre': 'DV',
     'new world': 'NW',
     'BIN INN': 'BI',
@@ -45,6 +46,9 @@ STORE_CODES = {
     'REDUCED' : 'RTC',
     'Summerglow' : 'SG',
     'IHERB' : 'iHerb',
+    'Health Post' :  'HP',
+    'Scotsburn' : 'SF',
+    'Fruit King' : 'FK',
 }
 
 user = os.getenv('USER')
@@ -64,7 +68,7 @@ def get_record_from_database(date, store, tags):
 
 def get_store_code(store, value, user_data=dict()):
     for k, v in STORE_CODES.items():
-        if k.lower() in store.lower():
+        if k.lower() in store.lower() or k.lower().replace(' ', '') in store.lower():
             return v
 
     if store not in user_data:
@@ -151,6 +155,8 @@ if __name__ == '__main__':
         ('Root Account:Liabilities', True),
         ('Root Account:Equity', True),
         ('Root Account:Income', True),
+        ('Root Account:Expenses:NZD:Food:Groceries:Fee', True),
+        ('Root Account:Expenses:NZD:Food:Groceries:Rebates', True),
     ]
     whitelist = [
         # name, also_children