vnc-console há 7 meses atrás
pai
commit
dc4ff94085
2 ficheiros alterados com 58 adições e 0 exclusões
  1. 51 0
      CSVLoaderRIDEW.py
  2. 7 0
      pymt940/private.py

+ 51 - 0
CSVLoaderRIDEW.py

@@ -0,0 +1,51 @@
+'''Created 15 Jun 2023 Levi'''
+
+# from datetime import date
+import os
+from jinja2 import (Environment, PackageLoader)
+from pymt940.languages import LANG
+from pymt940 import (PaymentsProcessorBtrl, private)  # utils
+
+templates = Environment(loader=PackageLoader('pymt940', 'templates'))
+# body_template = 'body_incomes.txt'
+body_template = 'body_payments.txt'
+template = templates.get_template(body_template)
+home = os.path.expanduser('~')
+downloads_dir = os.path.join(home, 'Downloads', 'mentor', 'import', 'RIDEWAVE')
+
+currency = 'ron'
+# currency = 'eur'
+# currency = 'usd'
+# currency = 'huf'
+acc_currency = 'accountron'
+# acc_currency = 'accounteur'
+# acc_currency = 'accountusd'
+# acc_currency = 'accounthuf'
+
+processor = PaymentsProcessorBtrl(os.path.join(downloads_dir, private.RIDEW[currency]), private.RIDEW['name'],
+                                  account_name=private.RIDEW[acc_currency]['name'],
+                                  account_number=private.RIDEW[acc_currency]['number'],
+                                  currency=private.RIDEW[acc_currency]['currency'],
+                                  account_location=private.RIDEW['location'],
+                                  account_agency=private.RIDEW['agency'],
+                                  account_symbol=private.RIDEW['symbol'])
+
+
+if __name__ == '__main__':
+    if 'incomes' in body_template:
+        processor.process_income_data(lang=LANG.RO, day_slice=(0, 2))
+        symbol = 411.01
+        kind = 'TotalIncasari'
+        output_file = os.path.join(downloads_dir, 'mentor_incasari.txt')
+    else:
+        processor.process_payment_data(lang=LANG.RO, day_slice=(0, 2))
+        symbol = 401
+        kind = 'TotalPlati'
+        output_file = os.path.join(downloads_dir, 'mentor_plati.txt')
+
+    data = processor.to_dict(kind=kind, month_back=1,
+                             std_client='_RIDEWAVE SRL', acc_symbol=symbol)
+    output = template.render(data)
+    print(output)
+    with open(output_file, 'w') as text:
+        text.write(output)

+ 7 - 0
pymt940/private.py

@@ -61,3 +61,10 @@ DECOR = {'name': 'FEROTI',
          'location': 'CLUJ-NAPOCA', 'agency': 'CLUJ', 'symbol': 'BT',
          'ron': 'RO54BTRL01301202I02674XX.csv',
          'eur': 'RO29BTRL01304202I02674XX.csv'}
+
+RIDEW = {'name': 'RIDEW',
+         'accountron': {'name': 'BTRL RON', 'number': 'RO69BTRLRONCRT0CP9775401', 'currency': 'Lei'},
+         'accounteur': {'name': '', 'number': '', 'currency': 'EUR'},
+         'location': 'CLUJ-NAPOCA', 'agency': 'CLUJ-NAPOCA', 'symbol': 'TRANSILVANIA',
+         'ron': 'RO69BTRLRONCRT0CP9775401.csv',
+         'eur': ''}