@@ -82,7 +82,7 @@ def from_pdf(self, filepath):
8282 pages = "all" , # End -1
8383 flavor = "stream" ,
8484 table_areas = ["60,629,573,51" ],
85- columns = ["75,112,440,526 " ],
85+ columns = ["75,115,455 " ],
8686 split_text = True
8787 )
8888
@@ -103,11 +103,11 @@ def from_pdf(self, filepath):
103103 if row [2 ].replace (' ' , '' ).lower ().startswith ('alterkontostand' ):
104104 # Last row before transactions
105105 start_index = self .all_rows .index (row ) + 1
106- date_tx_year = row [2 ][- 4 :] # Jahr für die Transaktionen merken
107106
108107 if row [2 ].replace (' ' , '' ).lower ().startswith ('neuerkontostand' ):
109108 # First row after transactions + final line
110109 end_index = self .all_rows .index (row ) - 1
110+ date_tx_year = row [2 ][- 4 :] # Jahr für die Transaktionen merken
111111 break
112112
113113 if date_tx_year is None or re .match (r'^\d{4}$' , date_tx_year ) is None :
@@ -125,8 +125,9 @@ def from_pdf(self, filepath):
125125 continue # Skip Header and unvalid Rows
126126
127127 # Positives 'Haben' oder negatives 'Soll'
128- amount = f'-{ row [3 ]} ' if row [3 ] else row [4 ]
129- amount = amount [:- 2 ].replace ('.' , '' ).replace (',' , '.' )
128+ amount_prefix = '' if row [3 ][- 1 ] == 'H' else '-'
129+ amount = f"{ amount_prefix } { re .sub (r'H|S' , '' , row [3 ]).strip ()} "
130+ amount = amount .replace ('.' , '' ).replace (',' , '.' )
130131
131132 line = {
132133 'date_tx' : self ._parse_from_strftime (f"{ row [0 ]} { date_tx_year } " , "%d.%m.%Y" ),
0 commit comments