Banking Journal

Blueprint: banking-journal

Overview

The banking journal allows the recording of transactions that include a cash account as a part of the the transaction. This includes receiving and paying money. In each of these transactions the transaction will include 1 cash account and, generally, one or more non-cash accounts. The banking journal will not allow a single transaction to span different funds. It will support transfers between cash accounts within the same fund. If a fund has only 1 cash account then the choice of which cash fund to use is implicit in the choice of the non-cash account(s) in the transaction.

Design

There will be command line options to support the following activities:

  • deposit to a cash account
  • record a cheque payment from a cash account
  • transfer money between cash accounts
  • set a default cash account for a fund with more than one cash account
  • list the transactions for a given period of time

The deposit, cheque payment, and transfer activities correspond to external transaction. The only means of undoing the effects of a transaction is with an offsetting transaction.

All of the transaction activities will accept an effective date, which may not be the date that the transaction is recorded. They will also track the date the transaction is entered (the "as of" date) but that date will always be the actual date the transaction is recorded. There will not be a mechanism to set it from the command line.

Command Line Options

Note: All command lines will also accept standard database connection parameters to identify the database to which to connect.

Action Command Line
deposit acct bank-deposit account code:amount [, account code:amount] [--to-account cash account] [--date effective date]
payment acct bank-payment account code:amount [, account code:amount] [--from-account cash account] [--date effective date]
transfer acct bank-transfer --from-account cash account --to-account cash account [--date effective date]
set default acct set-default-bank cash account
list transactions acct bank-list [--from-date date] [--to-date date] [--as-of date]

All the accounts for a given transaction must be in the same fund. All the cash account parameters must refer to cash accounts.

If an optional cash account parameter is not provided then the transaction will use the default cash account for the fund that the other accounts belong to. If an optional effective date is not provided then the transaction will use the current date.

The from and to dates for listing transactions specify the effective dates for the transactions to be listed. The as-of date includes only transactions that were entered on or before the specified date. The default as-of date for listing transactions is the same as the to-date.

Domain Model

Entities: Cash Account, Transaction, Account Entry, Journal, Bank Journal

A cash account is a refinement of an account that is restricted to being an asset account and tracks some additional information that relates it to an external account (i.e a bank account).

An account entry is an account, amount pair.

A transaction is a collection of account entries with an effective date and an "as-of" date. The total of the debit amounts in the entries must equal the total of the credit amounts. The effective date and the "as-of" date need not be the same. The accounts involved in the account entries for a given transaction must all come from the same fund.

A journal is a collection of transaction.

A (or the) bank journal is a refinement of a journal for which each transaction necessarily includes at lease one cash account in one of the account entries.

A transaction contains a list of account,amount pairs. The total of the credit amounts and the debit amounts in the transaction must be the same. The transaction also has an effective date and an "as-of" or entry date.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License