complete implementation of the revenue sharing model #3
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "dachary/accountant:wip-share"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
See the leading comment for a detailed explanation.
Signed-off-by: Loïc Dachary loic@dachary.org
@ -3,0 +69,4 @@
members = [["a", 10, 5], ["b", 450, 25], ["c", 0, 0]]
payable, payments = share_income(members)
assert payable == [["a", 10, 5], ["b", 20, 25]]
assert payments == {"a": [("b", 5)]}
Why does
a
give their whole income tob
, who already has an income of 25?It's the other way around :-) "a" receives 5 from "b".
Aha okay, might have missed the comments that specified the structure 😅
@ -3,0 +35,4 @@
# For instance in the if the 'members' argument is [['isabelle', 200, 10]], the
# shares will be [['isabelle', 10, 10]] where the 200 expense was reduced to a
# share of 10 because there only is 10 income available.
#
The comment explaining the structure is here @gusted.
It doesn't mention the result structure which is
member: getting paid by and how much
Right: I meant what is below these lines... but it only shows the above. I'll try again.
@ -3,0 +50,4 @@
# 'marie': [('isabelle', 200), ('john', 50)],
# 'lucie': [('john', 10)],
# }
#
The comment explaining the structure is here @gusted.
Looks according to spec!