-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Hello, I recently ran an import of transactions from my bank. There were a couple of issues with the import that may have caused some problems -
- The code/reference character limit is 16 chrs, my bank does not provide a unique transaction code in a single column, so I had to concatentate two columns in a CSV and select that as a code. The resulting column was over 16 characters. During import this was caught as an error and displayed but I noticed that the table column type for transactions.code and transactions.reference is varchar(255).
Changing the validation to 255 chrs max in the import method allowed the transactions to be imported without issue.
Additionally, I noticed there are no keys on those two columns which could cause some performance issues when looking up transactions by code. - The import kept on timing out due to the FCGI timeout being 30s. I switched this to 600s and the import progressed.
- Finally, the POSTed transaction data could not be JSON decoded successfully as there were two instances of an extra " character inside a field that threw json_decode(). This wasn't picked up when uploading the transaction CSV - the JSON encoded data that it was tripping on looked like this:
... ,"import-transaction-13-number":" 201410"","import-transaction-13-description":"DIRECT CREDIT","import-transaction-13-date":"2015-04-16","import-transaction-13-amount":"200","import-transaction-13-transfer_account":"","import-transaction-13-transaction-transfer":"ignore", ...
The relevant line in the CSV looks like this:
...,20150416,XXX10,200,DIRECT CREDIT,XXXXX 12345678,"P 201501-3, 201410","XXXXX 12345678 - P 201501-3, 201410"
Note that the "import-transaction-13-number" is "201410" so I think it's tripping up on the "P 201501-3, 201410" cell with a comma in it. That cell is the payment reference field from the bank (who include spaces).
The last field is used as the transaction code.
Without digging further into the code, I was wondering why the import doesn't POST the forn data as an array which would be handle in PHP as an array. It seems to be encoding, POSTing a string, then the import method in PHP is running a json_decode() and tripping up.
With that in mind and maybe it affected the 'Transfer' - once I imported all the transactions and had select a 'Transfer' account I noticed that the line item is noted as a 'Decrease' within the account I had imported it into but an 'Increase' on the account I selected as a 'Transfer'.
As an example in my import account I see a "DEBIT CARD FEE" for $3.00 marked as a Decrease. I select 'Transfer' to the 'Bank Service Charge' acocunt and the same transaction when viewing the Bank Service Charge account from Chart Of Accounts is listed as Increase $3.00.
The same transaction is now listed under two accounts, as a decrease and an increase.
Maybe I'm misundertanding 'Transfer' but I was thinking I could import transactions into one account then move (Transfer) those transactions to their relevant sub accounts and would appear only once ?
Thanks
James