PTA(1) General Commands Manual PTA(1)

ptaplain text accounting

pta [-abcnps] [-L de]

The Plain Text Accounting program reads bookkeeping journals that users are expected to create and maintain with arbitrary text editors and writes account lists, balances, and cost center assessments to standard output. All input files are ascii(7) text files, using strings of one or more space characters as field separators. Blank lines and lines starting with hash characters (‘#’) are ignored and can be used for comments.

To familiarize themselves with the terminology used by pta, new users are invited to read pta-glossary(7) first. In the following, terms defined in the glossary are when first used.

If none of the options -abcnps is specified to pta, -abcps is assumed.

The options are as follows:

Print account lists. For each account, the account number, the account title, and the account type are printed, followed by a table of account entries in chronological order, one per line. From left to right, the table columns contain the date, the booking identifier, the contra account, the debit amount, the credit amount, the running total, and the text string. The account balance can be found in the running total column of the last line of the table.

If an account contains at least one subaccount, all entries associated with any subaccount are omitted from the table. Instead, the list of all entries that are not associated with any subaccount is followed by one line for each subaccount, containing only the balance of the subaccount, the running total of the account, and the title of the subaccount, but omitting dates, booking ids, contra accounts, and amounts of individual entries in the subaccount. This is intended to make the account list more readable and more informative.

Print the sheet. Each line in the table represents one account. From left to right, the columns are account number, account balance (debit), account balance (credit), and account title. The balance sheet is followed by a listing of statistical accounts as defined in pta-accounts(5).
Print the accounts and balances for each cost center. For each cost center, all related account entries are printed, grouped by accounts, followed by a balance sheet for the cost center.
de
In standard output, use German instead of English terms. There are no plans to fully internationalize pta. This options is only intended to make the output look more consistent with pta-accounts(5) and pta-journal(5) files using the German language for text strings.
Does not produce any output. This option can be used to only check for parsing errors.
Print and losses generated by financial investments. This includes both realized and unrealized profits without distinguishing the two kinds; to see realized profits and losses only, look at account lists instead. From left to right, the columns of the tables are the date, the booking identifier, the individual amount of a profit or revenue (without a sign) or of a loss or expense (with a minus sign), the relative size of the amount in percent of the current value of the asset, the current value of the asset before the respective event, the relative profit or loss from the event per year, the name of the cost center, and a text string.

If some units of the investment were already owned at the beginning of the accounting period, the first line of the table contains the book value of the asset at the beginning of the accounting period instead of the current value before the event, such that the first line of the table informs about the unrealized profit accumulated during earlier accounting periods.

Whenever the journal contains lines quoting the current price of the asset, a line appears in the profit table giving the unrealized profit or loss resulting from the price change since the previous change in the number of units owned, or since the beginning of the accounting period, whichever is later. Such unrealized profits or losses do not change the book value of the asset.

The profit table does not contain lines for purchases and sells because these are considered to be executed at the current price; by definition, they do not generate profits or losses but only realize them. There are often lines listing surcharges and fees related to purchases and sells, though.

In lines listing revenues like interest or dividends and costs like surcharges and fees, the text string is the original text string from the respective .

The profit table ends with a line summing up the total profit or loss during the current accounting period. Lines that do not contribute to this sum because they are related to previous accounting period rather than to the current one or because they are included in later lines are marked with double trailing dashes (‘--’). On this final line, the column for the current value of the asset contains the average market value of the investment held during the accounting period, and the two columns for the relative profit or loss are calculated in relation to this average.

Print subaccount lists. For each subaccount, the account naumber, account name, account type, and subaccount name are printed, followed by a table table of account entries as documented for the -a option.

./accounts.txt
account definition list, see pta-accounts(5)
accounts.example.en
example account list with English account titles
accounts.example.de
example account list with German account titles
./journal.txt
main input file, see pta-journal(5)
journal.example.en
example input file

The pta utility exits 0 on success, and >0 if an error occurs.

pta-accounts(5), pta-journal(5), pta-glossary(7)

Ingo Schwarze <schwarze@openbsd.org>

Currently, pta has the following limitations:

October 4, 2020 OpenBSD 6.7