-
Notifications
You must be signed in to change notification settings - Fork 0
mtodd/tab
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
h1. Tab Keep track of office tabs. h2. Models Users: id, name Orders: id, LineItems LineItems: id, order_id, name, cost, quantity Transactions (Debits, Credits): id, type, line_item_id, user_id, amount, balance h2. Scenarios * Bob orders a pizza. Bob, Joe, and Clint split the cost. o = Order.create li = LineItem.create( :order => o, :name => "Lg Antico Pizza", :cost => 20_00, :quantity => 1 ) # Bob has paid $20 into the system, giving him credit Credit.create(:line_item => li, :user => bob, :amount => 20_00) # Each person owes $20 / 3, including Bob (he did eat, right?) individual_cost = li.cost / users.size # $20.00 / 3 users.each do |u| Debit.create( :line_item => li, :user => u, :amount => individual_cost) end
About
Keeps track of inter-office tabs
Resources
Stars
Watchers
Forks
Releases
No releases published