short:
When adding a new bill, the distribution of the amount over the selected members should be modifyable and not evenly.
usecase:
our main use case is when someone orders meals for the coworkers. As every menu could cost a different amount, an even splitting and distribution of the amount is not what we want.
With the current implementation a workaround would be that every single item on the bill (from the restaurant) would lead to a separate bill between the buyer and the member.
proposal:
"For whom" should have a checkbox "custom" which switches from checkboxes to textboxes (alternatively: when checked, a member entry gets a textbox). Also in this state the "How much" textbox gets readonly.
Now you can insert custom amounts next to each member which updates the now readonly "How much" box.
Also this of course has an corresponding effect on the data behind.
Link issues together to show that they're related.
Learn more.
Activity
Sort or filter
Newest first
Oldest first
Show all activity
Show comments only
Show history only
Ghost Userchanged title from FP: custom distribution of bill over the selected members to Feature Proposal: custom distribution of bill over the selected members
changed title from FP: custom distribution of bill over the selected members to Feature Proposal: custom distribution of bill over the selected members
I reckon the use case does exist but I don't know if the benefit of this feature would be worth the effort to implement it.
Indeed it's already possible to use Cospend is such cases. Bill just needs to be split which takes more time to create in MoneyBuster/Cospend than what you propose but is also more intuitive and stays similar to what IHateMoney does. I'd like to stay close to the "IHateMoney" standard . I think the concept of member's weight is already a bit too complex for this kind of tool.
I would like to keep things basic and simple concept-wise, implementation-wise and interface-wise.
Having said all that, I still like the feature.
Can you think about more use cases?
I thought it could be useful for a trimestrial electricity bill in a shared house if some member were not there during a month and shouldn't pay for the 3 months but in fact there still is a manual calculation to do to get the individual amounts so it can be done as easily by splitting the bill in multiple ones.
Well, you are right, after all it is only a convenience-Feature. But perhaps that wouldn't be such a big issue after all, if it gets only implemented as that.
Means: same (or simillar) UI as described above, but instead of ONE bill it creates a multitude of bills under the hood.
That should keep the changes to UI only while still providing the functionality.
Another usecase would be the similar as the electricity bill you described: Some shared house with 3 people, one does not own a computer and rarely cooks himself so they agree they do not split the bill 1:1:1 but rather 0.5:1:1
Or people go out at night, share the bill, but one is the driver and so does not consume any drinks. (i guess that is a bit fabricated, at least i am used to always paying my own bill when going out).
Honestly - in my daily use i would have MORE cases where the distribution is custom than cases where it really should be evenly distributed.
Another use-case:
one person has an Amazon account and orders items for his family - because he is the one that has Amazon Prime. So one order has multiple items in it, some for the brother, some for the parents, some for himself.
When entering this in the App/Nextcloud he only wants ONE click for the order, even if under the hood it gets divided into several bills.
I'd really like to take part in the coding, but sadly i have really, really little spare time apart from my job and my 6 months old daughter... <3
I'll try to dive in on the weekend, did not really wrap my head around your source code yet.
Excellent idea. It solves the implementation problem if it's just implemented on the UI side and triggers multiple bills creation. Don't worry if you don't have enough time. We're not in a rush and i'll probably do it soon.
Giving the idea and producing a brainstorm is already great! Thanks a lot!
Uff, just checked the code - last time i coded in php is at least 10 years ago... ;-)
And tho i know js, i am not nearly coding at the level you are - i think i propably would break more than i would deliver. I think i better go and check over at the Android client, that's at least something where i already have the IDEs installed. ;-)
Don't underestimate yourself! Developing in Php/JS is not so different from Java/Android and if the fun is there, it makes it easier! I thought i would not be able to produce stable and functionnal Android apps when i first started last december. Finally, thanks to the great model app i forked (Nextcloud notes for Android), i reached a satisfying first app in a couple of weeks, with my nose bleeding but still . Ok i had plenty of time back then.
I don't use any IDE to develop in Php/JS. Good old Vim well configured still has not been defeated by web-focused IDEs. But I have to admit Android-Studio is almost mandatory for Android dev though. It's incredibly improving speed and comfort.
It seems hard to think about a simple way to bring this feature to MoneyBuster. This part of the UI is less flexible there. Anyway i don't mind if MoneyBuster does not contain this feature.
Hey how, here is the new feature . It's been pushed to master if you want to try it.
Little manual: In the new bill screen (not when editing existing bill) there is a new button "custom amount per member" which toggles the new edition mode. Checkboxes are replaced by number inputs. Main amount and repeat fields are disabled. Main amount is updated when individual amounts are set. There is a "create bills" button which triggers the creation of a new bill for each individual amount correctly set.
I'm interested in your opinion and testing on all that. I might have made mistakes and subjective unintuitive choices.
I got a few problems with the database, i got it fixed and created a merge-request.
'repeat' seems to be a keywoard in MariaDB (i use MariaDB, i do not know, perhaps it's different in MySQL).
All queries that select from the 'repeat' column must escape that.
SELECT id, what, date, amount, payerid, repeat FROM oc_cospend_bills WHERE projectid='test' ORDER BY date ASC
must become
SELECT id, what, date, amount, payerid, `repeat` FROM oc_cospend_bills WHERE projectid='test' ORDER BY date ASC
I did that, not it works. I am just struggling with creating a branch/pull-request...
(just a sidenote: column-names should always be escaped anyways in my opinion. )
Hey, thanks. You're the first contributor to Cospend. Champain!
Great you managed to make a merge request. I think you made it inside Gitlab directly by editing in my repo which is fine. The usual way to do it is to fork the repository (which I saw you did) then clone the repo on your computer, then make commits in your master branch or any branch you want. Then push those changes to your gitlab forked repo. Then when you visit the branch of your repo in Gitlab, you can make a merge request addressed to the original repo, the one you forked from.
It is advised to push your changes in a different branch than your master. Your master can get the new changes from the original repo (mine). Then it's convenient to have your master up to date with mine in case you want to create another branch on your side to make other changes and produce another merge request.
Let's sum up the commands. Assuming you already have a clone you own :
git clone https://gitlab.com/werner.schiller/cospend-nc cospendcd cospendgit checkout -b fix-buggy-db# make changesgit commit -a-m"ow yeah it works now"git push origin fix-buggy-db
Then on Gitlab: create a merge request from your repo, branch fix-buggy-db to my repo's master.
Then, later, whether I have merged your request or not, you can update your master with mine. Assuming you're using the clone from previous commands:
git checkout mastergit pull https://gitlab.com/eneiluj/cospend-nc master# and if you want to make new fixes/additions taking my master as a starting point:git checkout -b another-mistake-from-eneiluj# etc...
I agree all db field names should be escaped. I think I already asked myself about that years ago and probably feared it would be different from one database management system to another... Do you know if '`' is working in SQLite, MariaDB/MySQL and PostreSQL?
I don't know about the "enter to validate" thing. More specifically we could trigger the save action when enter is pressed in the "what" or "amount" fields but not generally when enter is pressed anywhere.
Great!
btw - i know how to work with git, just gitlab did not take my gmail credentials, so i had to edit in the web. And then somehow i could not use the online IDE (therefore the fork), i just was not able to commit, no idea why. So i had to try a third way...
About the quotes:
Backticks works in MySQL and MariaDB but - according to here - not in PostgreSQL. Also it's a bit of a problem when writing SQL queries in bash.
What I would do:
for each target DB system write a separate Layer that handles the queries. I know how to do that in C# and python and propably in java, but sorry, my lack in php experience and knowledge prevents me from implementing. I will try, but i fear you would not like it. But i will try.
or at least some small hacky querybuilder with minimal ioc (factory injection on startup, so the DB-system check is only done once).
something like that.
I'll spike it today and make a pullrequest / mergerequest when i am satisfied.
anyway - i think this issue is closed.