oaubert / banquepostale-pdf-to-tsv

Convert PDF bank statements from La Banque Postale to usable text/tsv data
GNU General Public License v3.0
11 stars 3 forks source link

Script includes "Total des operations" in the details for last record #1

Closed geajack closed 2 years ago

geajack commented 2 years ago

For obvious reasons I can't include an example file to reproduce the bug, but at time of writing, the PDFs for my account all end with a line beginning "Total des operations..." indicating the total for the month. This script includes this in the description for the last transaction, like this:

2022/04/05      99.9   *********     PRELEVEMENT DE PayPal Europe S.a.r. / l. et Cie S.C.A REF : ********* PAYPAL VIRE ********** PAYPAL / IDENT : ************************ MANDAT : ****************
2022/04/05      -99.9   **********     PRELEVEMENT DE PayPal Europe S.a.r. / l. et Cie S.C.A REF : ********** PAYPAL VIRE ************* PAYPAL / **************************** / Total des opérations                 999.99
Metadata        9999.99 **********     Nouveau solde 08/04/2022
oaubert commented 2 years ago

Thanks. I added a small fix to your patch. I do not have any sample with only 1 value after "Total des opérations". I am wondering if there can be a negative value (in this case, the regexp should be fixed, and the amount test put back).