konnectors / aprr

GNU Affero General Public License v3.0
0 stars 0 forks source link

Invoices are not linked into Banks #100

Open rclement opened 5 years ago

rclement commented 5 years ago

Hi!

When connecting the APRR konnector to my Cozy, the PDF invoices are properly downloaded into Cozy Drive. However, for each APRR billing entry on my bank account shown in Cozy Banks, there are no linked invoices to it. See screenshots below for details.

Is this an issue with the APRR konnector or with the Cozy Banks app?

Thanks!

Screenshots

screen shot 2019-02-01 at 09 25 11 Account is synchronized

screen shot 2019-02-01 at 09 25 48 PDF invoices are downloaded in Cozy Drive

screen shot 2019-02-01 at 09 26 14 No invoice is shown in Cozy Banks billing entries

rclement commented 5 years ago

While working on another konnector, I noticed that the APRR konnector is lacking an entry in manifest.konnector:

{
  ...
  "banksTransactionRegExp": "\\baprr\\b",
  ...
}

(Even though it is already specified in https://github.com/konnectors/aprr/blob/master/src/index.js#L48)

Would that solve the issue?

doubleface commented 5 years ago

@rclement I think this would help to solve the issue thanks. While you are at it. Can you give us an example of a bank operation label related to aprr ?

rclement commented 5 years ago

@doubleface As you can see on the last screenshot in the issue description ("No invoice is shown in Cozy Banks billing entries"), here is the bank operation label related to APRR: Prelevement Aprr

doubleface commented 5 years ago

@rclement Sorry, I did not see it. Version 1.1.2 may do the trick.

rclement commented 5 years ago

@doubleface I just tried with latest version 1.1.2, invoices are still not linked with bank statements.

Here are the steps I performed:

  1. Unlink any APRR account from the connector
  2. Delete the APRR connector with my Cozy instance
  3. Delete the APRR files from the Cozy Drive (removed the Administrative/APRR folder)
  4. Add the APRR connector to the Cozy instance
  5. Add APRR account and sync bills (bills are properly downloaded to Administrative/APRR)
  6. Bank statements display "+ My Invoices" button and offering to link APRR account: Bank statement screenshot

So compared to the previous version, it seems bank statements can now be linked with APRR bills but the linkage seems to fail.

Any ideas?

doubleface commented 5 years ago

Since I do not have any APRR account, It will be difficult for me to debug it. @sebdalink do you have the same problem?

doubleface commented 5 years ago

It may be a date problem. Please take the date of a bill file and try to find the corresponding bank operation by hand. What is the difference between them ?

rclement commented 5 years ago

@doubleface thanks for your input!

Here are my observations:

It seems there is always one month offset between the bank operation and the bill metadata, maybe the culprit comes from this.

rclement commented 5 years ago

@doubleface there is a similar issue with the Tag&Pass connector, so the following might be of help.

The culprit might come from the date metadata being outside of the bank statements matching window ([-15 ; +29] days):

Setting the date to the last day of the month might put the date in the proper matching window, using something like moment.endOf('month'). Unfortunately, the bills database may not be updated afterwards from the information I gathered.

doubleface commented 5 years ago

Isn't there any paiment date available in the web interface?

And yes, it will be difficult to update the date in the bills database since the date is used as a key to identify a bill. Isn't there any unique identifier available in the web interface?

sebdalink commented 5 years ago

Hi,

I've checked on bill PDF and we have a bank operation date on it. So I need to parse file to get and use it as the billing date. And for unique identifier, yes we have one directly on web interface but how can I use it on bill creation ?