system76 / beansbooks

A revolutionary cloud accounting platform designed for small and medium businesses.
129 stars 36 forks source link

Import Transactions - Quotes in CSV #236

Open funnylookinhat opened 9 years ago

funnylookinhat commented 9 years ago

Unmatched quotes in the CSV are not being escaped correctly. From #234

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:

POST DATA:

... ,"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", ...

CSV:

...,20150416,XXX10,200,DIRECT CREDIT,XXXXX               12345678,"P 201501-3, 201410","XXXXX               12345678 - P 201501-3, 201410"
MrJamesEllis commented 9 years ago

I'll try to put together a CSV file that reproduces this for you.