Account

NAME

App::Moneymoor::Model::Account - a place money actually sits.

SYNOPSIS


use App::Moneymoor::Model::Account;

my $current = App::Moneymoor::Model::Account.new(
    name => 'Current Account',
    type => 'cash',
);

my $visa = App::Moneymoor::Model::Account.new(
    name => 'Visa',
    type => 'credit',
    note => 'statement on the 14th',
);

# From a DBIish row hash (SQL column names, underscore form):
my $a = App::Moneymoor::Model::Account.new-from-row(%row);

say $a.is-on-budget;   # True for cash and credit, False for tracking
say $a.is-credit;      # True only for credit

DESCRIPTION

Three account types, and the difference between them is exactly which part of the budget they touch:

  • cash — current accounts, savings, physical cash. On budget: their combined balance is the money the envelopes partition, and it is the right-hand side of the master invariant.

  • credit — credit cards. On budget: spending from one is real spending and hits your envelopes, but the balance is debt, not cash. Every credit account owns a payment category that tracks the cash you have set aside to pay it.

  • tracking — mortgages, pensions, an investment account you want to see but not budget from. Off budget: their transactions never touch an envelope. Moving money to one is spending (categorized on the on-budget leg of the transfer); moving money from one is income.

closed hides an account from pickers without deleting its history — the same soft-retire idea as hiding a category. A closed account's transactions still count towards balances and the budget, because they really happened.

amount signs live on transactions, not here: an account has no stored balance at all. Balances are derived (see App::Moneymoor::Service::Budget), because a stored balance is a cache that will eventually disagree with the transactions that produced it.

ATTRIBUTES

  • id — primary key; absent on a not-yet-inserted row.

  • name — required, unique across accounts.

  • type — cash / credit / tracking; default cash.

  • note — free-form, default empty string.

  • closed — Bool; default False.

  • sort-order — display order; default 0.

  • created-at — gateway-managed timestamp.

METHODS

  • new-from-row(%row) — build from a DBIish row hash.

  • is-cash / is-credit / is-tracking — type predicates.

  • is-on-budget — True for cash and credit.

App::Moneymoor v0.4.2

YNAB-style envelope budgeting: a derivation engine

Authors

  • Matt Doughty

License

Artistic-2.0

Dependencies

DBIish:ver<0.6.7>:auth<zef:raku-community-modules>Notcurses::Native:ver<0.6.5+>:auth<zef:apogee>Selkie:ver<0.16.0+>:auth<zef:apogee>JSON::Fast:ver<0.19>:auth<cpan:TIMOTIMO>MacOS::NativeLib:ver<0.0.6>:auth<zef:lizmat>

Test Dependencies

Provides

  • App::Moneymoor
  • App::Moneymoor::Config
  • App::Moneymoor::DB
  • App::Moneymoor::Gateway::Account
  • App::Moneymoor::Gateway::Assignment
  • App::Moneymoor::Gateway::Category
  • App::Moneymoor::Gateway::Payee
  • App::Moneymoor::Gateway::Transaction
  • App::Moneymoor::Handlers::Boot
  • App::Moneymoor::Model::Account
  • App::Moneymoor::Model::Assignment
  • App::Moneymoor::Model::Category
  • App::Moneymoor::Model::CategoryGroup
  • App::Moneymoor::Model::Payee
  • App::Moneymoor::Model::Split
  • App::Moneymoor::Model::Transaction
  • App::Moneymoor::Screen::Accounts
  • App::Moneymoor::Screen::Budget
  • App::Moneymoor::Screen::Login
  • App::Moneymoor::Screen::Main
  • App::Moneymoor::Screen::Main::Keybinds
  • App::Moneymoor::Screen::Main::Modals
  • App::Moneymoor::Screen::Main::Subscriptions
  • App::Moneymoor::Screen::Reports
  • App::Moneymoor::Service::Budget
  • App::Moneymoor::Service::Icons
  • App::Moneymoor::Service::Target
  • App::Moneymoor::Service::Workspace
  • App::Moneymoor::StoreHandlers
  • App::Moneymoor::Theme
  • App::Moneymoor::Theme::Catppuccin
  • App::Moneymoor::Theme::Dracula
  • App::Moneymoor::Theme::Everforest
  • App::Moneymoor::Theme::Gruvbox
  • App::Moneymoor::Theme::Kanagawa
  • App::Moneymoor::Theme::Monokai
  • App::Moneymoor::Theme::Nord
  • App::Moneymoor::Theme::OneDark
  • App::Moneymoor::Theme::RosePine
  • App::Moneymoor::Theme::Solarized
  • App::Moneymoor::Theme::TokyoNight
  • App::Moneymoor::Themes
  • App::Moneymoor::UI
  • App::Moneymoor::Util::Money
  • App::Moneymoor::Util::Period
  • App::Moneymoor::View::BudgetRow
  • App::Moneymoor::View::EmptyState
  • App::Moneymoor::View::HintBar
  • App::Moneymoor::View::InspectorPane
  • App::Moneymoor::View::ModalChrome
  • App::Moneymoor::View::RegisterRow
  • App::Moneymoor::View::ReportRow
  • App::Moneymoor::Widget::BannerBar
  • App::Moneymoor::Widget::BootProgressModal

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.