Skip to content

Instantly share code, notes, and snippets.

@nyarly
Created February 27, 2014 23:01
Show Gist options
  • Save nyarly/9261519 to your computer and use it in GitHub Desktop.
Save nyarly/9261519 to your computer and use it in GitHub Desktop.
module Accounting
module Handling
def revenue_account(name)
Plutus::Revenue.find_or_create_by(:name => name)
end
def asset_account(name)
Plutus::Assets.find_or_create_by(:name => name)
end
def received_sponsorships_account
revenue_account("Received Sponsorships")
end
def assignable_sponsorship_budget
asset_account("Assignable Sponsorship Budget")
end
def operating_budget_name
"Operating Budget"
end
def operating_budget
asset_account(operating_budget_name)
end
def reserved_meal_fund(restaurant)
asset_account(restaurant.role.reserved_meal_funds_name)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment