Bug with import CSV, missing bills with payer==ower
Hi Julien Veyssier,
first of all... VERY, VERY NICE APP, really. If you know how, it has a lot of ways to make more than a "split bill" app.
Well now the important thing.
If you import a project, from a previous CORRECTLY Cospend exported project in a csv file, if the origin project has bills that has the same user for "payer_name" and for "owers", all the bills with this condition GETS SILENTLY LOST, in the imported new project
EXAMPLE:
what,amount,date,timestamp,payer_name,payer_weight,payer_active,owers,repeat,repeatallactive,repeatuntil,categoryid,paymentmode,comment
deleteMeIfYouWant,1,1970-01-01,0,"miguel",1,1,"miguel",n,,,,,
deleteMeIfYouWant,1,1970-01-01,0,"monica",1,1,"monica",n,,,,,
"Transfer 1",5000,2017-07-05,1499293860,"miguel",1,1,"monica",n,0,,1227,t,""
"Transfer 2",5000,2017-07-05,1499293860,"monica",1,1,"miguel",n,0,,1227,t,""
**"Transfer 3",5000,2017-07-05,1499293860,"miguel",1,1,"miguel",n,0,,1227,t,"" <---- THIS BILL IT'S NO GOING TO BE IMPORTED TO THE NEW PROJECT.**
**"Transfer 3",5000,2017-07-05,1499293860,"monica",1,1,"monica",n,0,,1227,t,"" <---- THIS BILL IT'S NO GOING TO BE IMPORTED TO THE NEW PROJECT.**
The exported .csv of the project was totally correct (all the bills were in the .csv), but when you import this .csv (naming it with a different project name), all the bills were "payer_name" and "owers" are the same, don't get imported. The rest of bills that don't accomplish this condition gets correctly imported.
What is the big PROBLEM, that Cospend don't say ANYTHING about have lost XX bills in the import process. It seems to have imported CORRECTLY the project when it's not the true. It SILENTLY lost XX bills.
I WAS VERY LUCKY because I notice it because the cursor of scroll bar showed too big and I was sure that I had more bills (if all the bills had been imported, the cursor scroll bar were been showed small).
I took me a long-crazy time guessing what had been happened (looking in the exported .csv) until I find out what was the real problem. At first I though the problem was the "comments" because I'd changed the Cospend version from 0.4.4?¿ to 0.5.4.
You could think that why a bill has the same "payer_name" that "owers". By a lot of reasons: It's a no complete bill (you have to finish the owers), a bill only inputed to yourself (or other person to herself) only to have the log, etc... and last reason, and more important, BECAUSE the program permits it, if it could be done by the gui, and exported to .csv, IT MUST WORK TO IMPORT LIKE THAT (or unless advise that it's not correctly imported).
So... few suggestions:
-
Permit import a bill from .csv file where "payer_name" and "owers" are the same. (IF IT DON'T BREAK ANYTHING, IF DO... PLEASE PUT A BANNER SHOWING IT AT THE EXPORT AND THE IMPORT OPERATION)
-
A counter in the GUI that shows the total number of bills of a project (like it's for "members")
-
If's possible, this counter in the GUI will show the "relative_bill"/total_bills_from_project, when you have select a bill. So example: if you have a project with 100 bills, and you have selected the "middle bill" it must show "counter: 50/100".
To last begs...
- When you put a "negative" payment in the bill, make that it shows in the selected "owers" in the view of the bill, like you do when it's a "positive" payment.
5. IT WILL BE ESPECTACULAR THE POSSIBILITY FROM COPYING/MOVING BILLS FROM ONE PROJECT TO ANOTHER DIRECTLY FROM THE GUI... (if the destination project have the "members" of the bill of the origin project... and if not... could be ask for them ;-) ).
Thanks in advance... REALLY A NICE JOB. Thanks a lot for it.
Miguel.
PD: The problem happened in the 0.5.4 version of cospend, i don't know if it happens in 0.4.4?¿ PDD: I has 1500 bills in the related project... i'd lost 800 of them if i didn't notice the problem :-/.... :-). PDDD: I think... I could add more suggestions... but but know... I think it's more than enough work ;-)