Răsfoiți Sursa

implemented separate symbols for all banks

vnc-console 7 luni în urmă
părinte
comite
3422c65f60
3 a modificat fișierele cu 36 adăugiri și 5 ștergeri
  1. 9 0
      pymt940/CSV2MentorBrd.py
  2. 9 0
      pymt940/CSV2MentorOtp.py
  3. 18 5
      pymt940/CSV2MentorRncb.py

+ 9 - 0
pymt940/CSV2MentorBrd.py

@@ -157,6 +157,15 @@ class PaymentsProcessorBrd:
                             df.loc[index, 'Name'] = name
         df['Transaction details'] = df['Detalii']
         df['day'] = df['Data inregistrarii'].str.slice(*day_slice)
+        df.loc[df['Transaction details'].str.lower().str.startswith('comision'), 'symbols'] = 627
+        df.loc[df['Transaction details'].str.lower().str.startswith('abonament'), 'symbols'] = 627
+        # df.loc[df['Transaction details'].str.lower().str.startswith('inchidere depozit'), 'symbols'] = 508.01
+        df.loc[df['symbols'] == 627, 'types'] = 'DIRECT PE CHELTUIELI'
+
+        df.loc[df['Transaction details'].str.lower().str.startswith('dobanda'), 'symbols'] = 766
+        # df.loc[df['Transaction details'].str.lower().str.startswith('alimentare cont depozit'), 'symbols'] = 508.01
+        df.loc[df['symbols'] == 766, 'types'] = 'DIRECT PE VENITURI'
+        # df.loc[df['symbols'] == 508.01, 'types'] = direction
 
         unique_count = df['day'].nunique()
         self.doc_list = list(range(1, unique_count + 1))

+ 9 - 0
pymt940/CSV2MentorOtp.py

@@ -177,6 +177,15 @@ class PaymentsProcessorOtp:
                             df.loc[index, 'Name'] = name
         df['Transaction details'] = df['Explicatie']
         df['day'] = df['Data op.'].str.slice(*day_slice)
+        df.loc[df['Transaction details'].str.lower().str.startswith('comision'), 'symbols'] = 627
+        df.loc[df['Transaction details'].str.lower().str.startswith('abonament'), 'symbols'] = 627
+        # df.loc[df['Transaction details'].str.lower().str.startswith('inchidere depozit'), 'symbols'] = 508.01
+        df.loc[df['symbols'] == 627, 'types'] = 'DIRECT PE CHELTUIELI'
+
+        df.loc[df['Transaction details'].str.lower().str.startswith('dobanda'), 'symbols'] = 766
+        # df.loc[df['Transaction details'].str.lower().str.startswith('alimentare cont depozit'), 'symbols'] = 508.01
+        df.loc[df['symbols'] == 766, 'types'] = 'DIRECT PE VENITURI'
+        # df.loc[df['symbols'] == 508.01, 'types'] = direction
 
         unique_count = df['day'].nunique()
         self.doc_list = list(range(1, unique_count + 1))

+ 18 - 5
pymt940/CSV2MentorRncb.py

@@ -72,7 +72,11 @@ class PaymentsProcessorRncb:
     def account_symbol(self, value):
         self._account_symbol = value
 
-    def process_payment_data(self, day_slice=(0, 2)):
+    def process_payment_data(self, day_slice=(0, 2), direction='DIRECT PE CHELTUIELI'):
+        '''@direction values:
+           'DIRECT PE VENITURI'
+           'DIRECT PE CHELTUIELI'
+        '''
         df_dict = get_partners(self.partner_data)
         fiscal_codes = df_dict['CodFiscal']
         mentor_names = df_dict['Denumire']
@@ -88,10 +92,10 @@ class PaymentsProcessorRncb:
         payments_df['types'] = ''
         payments_df.loc[payments_df['symbols'] == '', 'symbols'] = 401
         payments_df.loc[payments_df['types'] == '', 'types'] = 'ALIMENTARE CREDIT'
-        self._calculate_payment_attributes(payments_df, mentor_names=mentor_names, day_slice=day_slice)
+        self._calculate_payment_attributes(payments_df, mentor_names=mentor_names, direction=direction, day_slice=day_slice)
         return payments_df
 
-    def process_income_data(self, day_slice=(0, 2)):
+    def process_income_data(self, day_slice=(0, 2), direction='DIRECT PE VENITURI'):
         df_dict = get_partners(self.partner_data)
         fiscal_codes = df_dict['CodFiscal']
         mentor_names = df_dict['Denumire']
@@ -109,10 +113,10 @@ class PaymentsProcessorRncb:
         income_df['types'] = ''
         income_df.loc[income_df['symbols'] == '', 'symbols'] = 411.01
         income_df.loc[income_df['types'] == '', 'types'] = 'ALIMENTARE CREDIT'
-        self._calculate_payment_attributes(income_df, mentor_names, day_slice=day_slice)
+        self._calculate_payment_attributes(income_df, mentor_names, direction=direction, day_slice=day_slice)
         return income_df
 
-    def _calculate_payment_attributes(self, df, mentor_names, day_slice=(0, 2)):
+    def _calculate_payment_attributes(self, df, mentor_names, direction, day_slice=(0, 2)):
         # df['Amount'] = df['Credit'].map(str).apply(dig_it).map(abs)
         df['Name'] = df['Tranzactii finalizate (detalii)'].apply(re_check_rncb)
         names = [name for name in df['Name'] if name != '']
@@ -134,6 +138,15 @@ class PaymentsProcessorRncb:
                             df.loc[index, 'Name'] = name
         df['Transaction details'] = df['Tranzactii finalizate (detalii)']
         df['day'] = df['Data finalizarii tranzactiei'].str.slice(*day_slice)
+        df.loc[df['Transaction details'].str.lower().str.startswith('comision'), 'symbols'] = 627
+        df.loc[df['Transaction details'].str.lower().str.startswith('abonament'), 'symbols'] = 627
+        df.loc[df['Transaction details'].str.lower().str.startswith('inchidere depozit'), 'symbols'] = 508.01
+        df.loc[df['symbols'] == 627, 'types'] = 'DIRECT PE CHELTUIELI'
+
+        df.loc[df['Transaction details'].str.lower().str.startswith('dobanda'), 'symbols'] = 766
+        df.loc[df['Transaction details'].str.lower().str.startswith('alimentare cont depozit'), 'symbols'] = 508.01
+        df.loc[df['symbols'] == 766, 'types'] = 'DIRECT PE VENITURI'
+        df.loc[df['symbols'] == 508.01, 'types'] = direction
 
         unique_count = df['day'].nunique()
         self.doc_list = list(range(1, unique_count + 1))