Accounting system BOKIN

Edition 0.5, for BOKIN version 0.5

20 July 2008

by Tama Communications Corporation


Copyright (C) 2005, 2008 Tama Communications Corporation This is the first edition of the BOKIN documentation,
and is consistent with 0.5.
Published by Tama Communications Corporation
Tama-shi, Tokyo, Japan.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

1. Overview of the tool

1.1 What is BOKIN?

BOKIN is an accounting system based on double-entry bookkeeping. BOKIN is free software, and is commercial (for-profit) software based on BOKIN model. The name BOKIN has two meanings: bookkeeping (BOokKeepINg) in English and collecting donations (BO=collect, KIN=money) in Japanese.

Since BOKIN is a batch based system, it doesn't require any GUI. Instead, BOKIN use GNU Make to do the accounting calculations.

1.2 What is BOKIN model?

BOKIN model is a business model of obtaining proceeds by widely collecting donations while distributing free software. For more information, see section B. Business Model.

1.3 What software is required to use BOKIN?

BOKIN runs on a POSIX compatible operating system like GNU or BSD. The following two software are required:

GNU Guile
GNU Guile (1) is a Scheme implementation of GNU Project. Scheme is a kind of Lisp language. BOKIN is almost written in GNU Guile.
GNU Make
Originally, GNU Make (2) is a tool which controls the generation of executables from the program's source files, but in BOKIN, it is used for accounting calculations.

The following software are not necessarily needed but are recommended, since BOKIN is constructed on the assumption of the use of them. Seeing these software, you might understand the reason why BOKIN has neither database facility nor network facility.

In this manual, these programs are not treated.

CVS
CVS (3) is a version control system. Originally, CVS is used for sharing source code of programs, but in BOKIN, we can use it as a multi-user accouting database system with history function.
SSH
SSH (4) is a secure shell for remote login. Using SSH with CVS, you can safely update your accounting database from all over the world.
GnuPG
GnuPG (5) is a OpenPGP implementation of GNU Project. It can be used to encrypt data and create digital signatures. In BOKIN, we can use it for digital signature of financial statement.

2. Concept of BOKIN

The following four entities, Pair, Account, Account Tree and Transaction are the central conponents of the BOKIN financial data model.

2.1 Pair

Pair is the essence of double-entry bookkeeping. Internally of the BOKIN system, all numerical values are expressed as pair.

A pair has two entries, debit and credit. This is presented as follows:

	(debit . credit)

For example, if the debit is 200 and the credit is 100 then it is presented like this:

	(200 . 100)

Addition of pairs is the addition of each elements.

	(200 . 100) + (50 . 10) => (250 . 110)

There is no subtraction in pairs; there is only addition. When the debit and the credit is equal like follows, we call it is in balance.

	(100 . 100)

The name such as debit and credit is not significant. If you are a Lisp programmer then you may call them car and cdr else left and right, as long as they are used consistently.

Pair is used for the value of account described in the next section.

2.2 Account

Account is variable for accounting calculation. An account has a name and a value; the value is always pair. For example, if the debit of the assets is 200 and the credit is 100 then it is presented like this:

	assets (200 . 100)

We can refer this account by the account name assets.

Account is prepared according to the economical realities. In general, at least five basic accounts should be prepared. They are assets, liabilities, stockholders-equity, expenses and revenues.

2.3 Account Tree

All accounts are part of account tree. You can freely define your account tree according to your business. In detail of the format, see section 6.9 account - format of the account definition file. BOKIN includes some pre-defined account definition files.

The definition is like follows:

%debit                                            (UPPER LEVEL)
01 assets                                         ROOT ACCOUNT
   02 current-assets                              BRANCH ACCOUNT
      03 cash-on-hand-and-in-banks                BRANCH ACCOUNT
         04 cash                                  LEAF ACCOUNT
         04 current-deposit                       LEAF ACCOUNT
         04 ordinary-current-deposit              LEAF ACCOUNT
         ...                                      (LOWER LEVEL)

The %debit at the head means that the following accounts are debit type. There are four account types, debit, credit, open and close in BOKIN. Most accounts belong to debit type or credit type.

The number at the head of each line is account level, which expresses the degree of abstraction of account. Accounts whose level is 1 (the most abstract level) are called root account. The five basic accounts, that is, assets, liabilities, stockholders-equity, expenses and revenues should be defined as root accounts. Additionally, BOKIN use three special root accounts, profit-and-loss, opening-balance and closing-balance.

Accounts which has no lower level account (the most concrete level) are called leaf account. Accounts which is nether root account nor leaf account, are called branch account.

The initial value of each account is (0 . 0). After some calculations, account tree might become like follows:

%debit
01 assets (3250000 . 250000)
   02 current-assets (3000000 . 250000)
      03 cash-on-hand-and-in-banks (3000000 . 250000)
         04 cash (0 . 0)
         04 current-deposit (0 . 0)
         04 ordinary-current-deposit (3000000 . 250000)
         ...

Calculation is done as tree calculation described below.

2.3.1 Tree Calculation

Addition to an account is done as tree calculation, that is, it is always done against a leaf account first and is applied to all the upper level accounts afterwards.

For example, when (2 . 1) is added to the account C shown below,

01 A (0 . 0)
   02 B (0 . 0)
      03 C (0 . 0)-!-
   03 D (0 . 0)
      03 E (0 . 0)

the calculation is done like follows:

01 A (2 . 1)-!-        + (2 . 1)
   02 B (2 . 1)-!-       + (2 . 1)
      03 C (2 . 1)-!-      + (2 . 1)
   02 D (0 . 0)
      03 E (0 . 0)

Continuously, when (3 . 2) is added to the account E, the calculation is done like follows:

01 A (5 . 3)-!-        + (3 . 2)
   02 B (2 . 1)
      03 C (2 . 1)
   03 D (3 . 2)-!-       + (3 . 2)
      03 E (3 . 2)-!-      + (3 . 2)

As a result, each account has the total of the lower level accounts.

The first target of tree calculation must be a leaf account, but exceptionally, a branch account is acceptable only when all of the lower accounts become in balance as a result. It is used for profit and loss calculation.

Tree calculation is done as part of transaction described in the next section.

2.3.2 Balance of Account

The balance of account is calculated from the debit and the credit. If the account belongs to debit type, the balance is debit - credit else credit - debit. The list of the balance of an account tree is called a balance sheet.

Let's make a small balance sheet from the following tree:

%debit
01 A (5 . 3)
   02 B (2 . 1)
      03 C (2 . 1)
   03 D (3 . 2)
      03 E (3 . 2)

The balance sheet of above account tree is like follows:

%debit
01 A 2                  = 5 - 3
   02 B 1               = 2 - 1
      03 C 1            = 2 - 1
   03 D 1               = 3 - 2
      03 E 1            = 3 - 2

A term end balance sheet is the most important material of the financial statement.

2.3.3 Path Name

You can use path name to identify an account. Path means the route from an account to the root account; path name is made by concatnating account names using `/'. Using path name, you can use duplicate accounts in a tree.

For example, if your account tree is like follows, the name ABC-bank is no longer unique.

%debit
01 assets
   02 current-assets
      03 cash-on-hand-and-in-banks
         04 cash
         04 current-deposit
            05 ABC-bank                    DEFINED
         04 ordinary-current-deposit
            05 ABC-bank                    DEFINED AGAIN
         ...

You can identify the ABC-bank in the current-deposit as current-deposit/ABC-bank. This method of account name specification is similar to UNIX file system. Following path names are all correct:

current-deposit/ABC-bank
cash-on-hand-and-in-banks/current-deposit/ABC-bank
current-assets/cash-on-hand-and-in-banks/current-deposit/ABC-bank
assets/current-assets/cash-on-hand-and-in-banks/current-deposit/ABC-bank
/assets/current-assets/cash-on-hand-and-in-banks/current-deposit/ABC-bank

In the last example, the `/' at the head of the name means that the assets is a root account. Please notice that just ABC-bank is no longer correct, since it is not unique.

2.4 Transaction

A transaction consists of a date and two or more accounts with value; the values are added to the correspoinding accounts in the account tree.

A transaction changes an accout tree from a corrct status to another correct one, by forcing some constraints. Most important constraint is that a transaction always has at least two accounts, and the total of accounts is always in balance. BOKIN system check it for each transaction. As a result, transaction, though it is not complete, ensure the constant correctness of the account tree.

2.4.1 Slip

The entry of every day is done to slip files. A line of slip file contains a slip, which constructs a transaction. For example, a rental house rent directly paid from the savings on June 8 in 2005 should be written as follows:

20050608 rental-house-rent/100000 ordinary-current-deposit/100000

The account names above must be defined in your account definition file. The value is not pair but a natural number. See section 3. How to write Slips in detail.

2.4.2 S-transaction

Slip files are sorted and converted into S-transaction by BOKIN commands. S-transaction is internal format of transaction and is presented as S-expression of Scheme language.

20050608 rental-house-rent/100000 ordinary-current-deposit/100000

=> ((2005 6 8) (("rental-house-rent" (100000 . 0))  (CONTINUE)
                                ("ordinary-current-deposit" (0 . 100000))))

You can see the value is converted into pair. Above S-transaction means adding (100000 . 0) to the account named rental-house-rent and adding (0 . 100000) to the account named ordinary-current-deposit. All accounts is defined in the account tree, and the addition is done as tree calculation.

3. How to write Slips

Since BOKIN is a batch based system, and now it doesn't have any input program, you must write your slip files by hand.

The slip files are files consisting of newline separated records, one per slip. For each slip a single line should be present with the following information:

date
slip date(8 digits)
debit
Left side of the slip
credit
Right side of the slip
comment
Any note(optional)

Fields are separated by any number of blanks and/or tab characters, but the comment field can contains blanks. See section 6.10 slip - format of the slip file in detail.

For example, a rental house rent directly paid from the savings on June 8 in 2005 should be written as follows:

20050608 rental-house-rent/100000 ordinary-current-deposit/100000 It's expensive!

20050608 is date, rental-house-rent/100000 is left side, ordinary-current-deposit/100000 is right side and It's expensive! is comment.

Basically, this form is the same as a usual transfer slip. If you don't know how to write transfer slip, please consult one of the primer of bookkeeping.

3.1 Auto Completion

Only one value can be omitted in a slip because the total of debit and the total of credit is equal in a transaction. BOKIN complete the omitted value. Thus, the following two slips are equivalent.

20050608 rental-house-rent/100000 ordinary-current-deposit/100000
20050608 rental-house-rent/100000 ordinary-current-deposit

You can use this function for automatic calculation. When you buy the one hundred of stock of XYZ-company at the price 200 with 150 fee, and sell them at the price 220 with 150 fee, you can write slips like follows:

20050625 securities/XYZ-company/20150 ABC-stock-company
20050628 ABC-stock-company/22000,profit-on-securities-sold  (CONTINUE)
                                          securities/XYZ-company/20150
20050628 agiotage-commission/150 ABC-stock-company

The profit-on-securities-sold is automatically calculated.

3.2 Scheme Expression

Any scheme expression is acceptable as an account value. The example ahead can be rewritten like follows:

20050625 securities/XYZ-company/(+ (* 200 100) 150) ABC-stock-company
20050628 ABC-stock-company/(* 220 100),profit-on-securities-sold  (CONTINUE)
                                          securities/XYZ-company/(balance)
20050628 agiotage-commission/150 ABC-stock-company

The (+ (* 200 100) 150) is evaluated, and becomes 20150. The (balance) is a built-in function of BOKIN which returns the current balance of the account. You can define your own custom functions too.

3.3 Custom Functions

Let's assume that you need a function which converts sales into including tax of 5%. It is convenient if the following function is available.

20050731        accounts-receivable       sales/(include-tax 100000)

This is equivalent with the following.

20050731        accounts-receivable       sales/105000

To make such function include-tax, you should write a file named `custom.scm' in the project directory with the following contents.

(define-module (bokin transaction))

(define consume-tax-rate 0.05)
(define (include-tax price)
  (inexact->exact (+ price (* consume-tax-rate price))))

In custom functions, you can refer the following data.

current-tree
current-node
current-date

Referring to current-node, you can write a depreciation macro like follows:

20060331 depreciation accumulated-depreciation/(depr (balance "tools-and-implements") 5)

This example is included in the demo in the BOKIN package.

4. Getting started

This chapter explains the usage of BOKIN concretely.

  1. First of all, you should make a new company directory and the establishment period directory in it.
    $ mkdir company
    $ cd company
    $ mkdir 0
    
    The directory name "0" means establishment period. You should make period directories using the period number. Since it is not a free custom, you should follow this.
  2. Next, copy `subdir.mk' from the BOKIN system directory as Makefile and execute make setup.
    $ cp `bknconfig SYSTEM_DIRECTORY`/subdir.mk Makefile
    $ make setup
    Created BOKIN_ROOT.
    Created share.mk.
    Created 0/Makefile.
    $ ls
    0  Makefile  BOKIN_ROOT  share.mk
    
    The `BOKIN_ROOT' is just the mark of the project directory. The `share.mk' is a Makefile which is shared by all periods.
  3. Edit the `share.mk' and uncomment the line which includes DEFINE_DIRECTORY.
    [share.mk]
    #DEFINE_DIRECTORY := /usr/local/share/bokin/C
    =>DEFINE_DIRECTORY := /usr/local/share/bokin/C
    
    Since the `share.mk' is shared by all period directories, this definition influences all periods. The setting of the project directory ends by this.
  4. From now on, let's setup for each period directory. You must make `0/main.slip' from scratch. The contents is like follows:
    [0/main.slip]
    20050401 ordinary-current-deposit/3000000 capital-stock/3000000
    20050401 organization-expenses/250000 ordinary-current-deposit/250000
    
    If you cannot understand how to write slip file then you can copy `demo/C/0/main.slip' in this package here.
  5. Then please invoke make and show the `asset.balance'
    $ make
    
    (... LOG MESSAGES ...)
    
    $ cat 0/asset.balance 
    ;
    ; A trial balance produced by bknprint version 0.1
    ;
    ; File:      asset.balance
    ; Directory: /tmp/company/0
    ; Command:   /usr/local/bin/bknprint -v -b asset.snap -o asset.balance
    ;
    01 assets 3000000
       02 current-assets 2750000
          03 cash-on-hand-and-in-banks 2750000
             04 ordinary-current-deposit 2750000
       02 deferred-assets 250000
          03 organization-expenses 250000
    01 stockholders-equity 3000000
       02 capital-stock 3000000
    $ _
    
    This is the Balance Sheet of the establishment period of the company.
  6. Similary, let's make the period 1 directory and the slip file in it.
    $ mkdir 1
    $ make setup
    Created 1/Makefile.
    $ vi 1/main.slip                             (MAKE YOUR SLIP FILE)
    
    If you cannot understand how to write slip file then you can copy `demo/C/1/main.slip' in this package here.
  7. Then please invoke make and show the `asset.balance'
    $ make
    
    (... LOG MESSAGES ...)
    
    $ cat 1/asset.balance 
    ;
    ; A trial balance produced by bknprint version 0.1
    ;
    ; File:      asset.balance
    ; Directory: /tmp/company/1
    ; Command:   /usr/local/bin/bknprint -v -b asset.snap -o asset.balance
    ;
    01 assets 5141055
       02 current-assets 4521955
          03 cash-on-hand-and-in-banks 2021955
             04 cash 96273
             04 ordinary-current-deposit 1925682
          03 accounts-receivable 2500000
       02 fixed-assets 283100
          03 tangible-fixed-assets 83100
             04 tools-and-implements 120000
             04 accumulated-depreciation -36900
          03 investments-etc 200000
             04 deposit 200000
       02 deferred-assets 336000
          03 organization-expenses 200000
          03 pre-operating-expenses 136000
    01 liabilities 1552696
       02 current-liabilities 1552696
          03 call-money 351596
             04 short-term-loans-from-officers-and-employees 351596
          03 accounts-payable 1201100
             04 accrued-corporation-tax-etc 301100
             04 accrued-officers-salalies 900000
    01 stockholders-equity 3588359
       02 capital-stock 3000000
       02 surplus 588359
          03 unappropriated-profit 588359
             04 net-income 588359
    $ _
    
    This is the Balance Sheet of the 1st period. Similary, you can make Income Statement from `1/income.balance' and `1/profit.balance'. In near future, BOKIN will generate the TeX source of financial statement automatically.

5. How to execute demonstration

This chapter explains the usage of the demonstration files.

BOKIN package includes a demonstration of a small company of the year of establishment.

First of all, extract BOKIN package using tar command, and move to the `demo' directory.

$ tar xzvf bokin-XXXXX.tar.gz                (XXXXX IS VERSION NUMBER)
$ cd bokin-XXXXX/demo
$ ls
C  README  ja  setup.sh

If you would like to execute Japanese demonstration then move to `ja' directory else move to `C' directory, and invoke `../setup.sh' script.

$ cd C
$ ../setup.sh
Created BOKIN_ROOT.
Created 0/Makefile.
Created 1/Makefile.
$ _

Now, preparation was completed. Please type make, move to the `1' directory which means the period 1, and confirm the result.

$ make

(... LOG MESSAGES ...)

$ cd 1
$ ls
Makefile              forward-closing.trans  opening.balance
asset.balance         forward-opening.trans  opening.scm
asset.snap            income.balance         opening.snap
closing-profit.scm    income.snap            opening.trans
closing-transfer.scm  initial.balance        profit.balance
closing.balance       initial.snap           profit.snap
closing.snap          main.slip              user-transactions.scm
forward-closing.scm   opening-transfer.scm   user-transactions.trans
$ _

6. Reference manual

This chapter contains a reference manual of BOKIN commands. Though these commands except for bknfind are usually invoked by GNU Make, all commands can be individually invoked.

6.1 bknapply - apply transactions to the given snapshot

NAME

bknapply - apply transactions to the given snapshot

SYNOPSIS

bknapply [option ...] snapshot [S-transaction ...]
bknapply --help
bknapply --version

DESCRIPTION

The bknapply loads the given snapshot, applies the given transactions and print the new snapshot as the result. The transaction must be S-expression converted by bknparse(1). If no transaction is given, bknapply read from the standard input. By default, bknapply writes the results to the standard output.

OPTIONS

The following options are available:

`-o', `--output' output
Write output to output file instead of to the standard output.
`-f', `--force'
Make the snapshot up to date before reading.
`-v', `--verbose'
Be extra verbose.
`--help'
Print a usage message on standard output and exit successfully.
`--version'
Print version information on standard output then exit successfully.

DIAGNOSTICS

The bknapply exits with a non 0 value if an error occurred, 0 otherwise.

SEE ALSO

bknconfig(1), bknfind(1), bknparse(1), bknprint(1), bknsort(1), bknstate(1), bkntrans(1), account(5), slip(5).

AUTHOR

Tama Communications Corporation.

6.2 bknconfig - print out the configuration variables

NAME

bknconfig - print out the configuration variables

SYNOPSIS

bknconfig [name]
bknconfig --help
bknconfig --version

DESCRIPTION

The bknconfig prints out the names and values of the variables in the configuration, with one name/value pair per line. If name is specified, only its value is printed.

OPTIONS

The following options are available:

`-v', `--verbose'
Be extra verbose.
`--help'
Print a usage message on standard output and exit successfully.
`--version'
Print version information on standard output then exit successfully.

FILES

`system.conf'
System configuration file. This file is installed to the system data directory.
`user.conf'
User configuration file. This file must be put in the current directory, the project directory or the directories between two.

DIAGNOSTICS

The bknconfig exits with a non 0 value if an error occurred, 0 otherwise.

SEE ALSO

bknapply(1), bknfind(1), bknparse(1), bknprint(1), bknsort(1), bknstate(1), bkntrans(1), account(5), slip(5).

AUTHOR

Tama Communications Corporation.

6.3 bknfind - print lines matching an account

NAME

bknfind - print lines matching an account

SYNOPSIS

bknfind [option ...] account [S-transaction ...]
bknfind --help
bknfind --version

DESCRIPTION

The bknfind searches the given S-transaction files, or the default input files if no files are given for lines containing a match to the given account name. The default input files are `opening.scm' and `user-transactions.scm'. The matching means to be equal to the given account or equal to one of the descendants of it in an account tree.

The bknfind always writes the results to the standard output.

OPTIONS

The following options are available:

`-f', `--force'
Make the snapshot file up to date before reading.
`-b', `--balance'
Show the balance for each line. It assumes that the input lines are sorted by the date.
`-s', `--snapshot' snapshot
Load the given snapshot. The default is `initial.snap'.
`-v', `--verbose'
Be extra verbose.
`--help'
Print a usage message on standard output and exit successfully.
`--version'
Print version information on standard output then exit successfully.

DIAGNOSTICS

The bknfind exits with a non 0 value if an error occurred, 0 otherwise.

SEE ALSO

bknapply(1), bknconfig(1), bknparse(1), bknprint(1), bknsort(1), bknstate(1), bkntrans(1), account(5), slip(5).

AUTHOR

Tama Communications Corporation.

6.4 bknparse - compiler to convert transactions into S-transaction

NAME

bknparse - compiler to convert transactions into S-transaction

SYNOPSIS

bknparse [option ...] [transaction]
bknparse --help
bknparse --version

DESCRIPTION

The bknparse compiles descriptions of transaction within the transaction file, or the standard input if no file is given, and convert them into S-transaction. By default, bknparse writes the results to the standard output.

It assumes that the transaction file is sorted by the date. Otherwise, you can use bknsort(1) to do it.

OPTIONS

The following options are available:

`-o', `--output' output file
Write output to output file instead of to the standard output.
`-v', `--verbose'
Be extra verbose.
`--help'
Print a usage message on standard output and exit successfully.
`--version'
Print version information on standard output then exit successfully.

DIAGNOSTICS

The bknparse exits with a non 0 value if an error occurred, 0 otherwise.

SEE ALSO

bknapply(1), bknconfig(1), bknfind(1), bknprint(1), bknsort(1), bknstate(1), bkntrans(1), account(5), slip(5).

AUTHOR

Tama Communications Corporation.

6.5 bknprint - print out given account tree

NAME

bknprint - print out given account tree

SYNOPSIS

bknprint [option ...] [snapshot]
bknprint --help
bknprint --version

DESCRIPTION

The bknprint print the contents of the given snapshot, or the standard input if no files are given. By default, bknprint writes the results to the standard output.

OPTIONS

The following options are available:

`-a', `--alternative'
Show the alternative name if the account has alternative name and the balance is smaller than 0. For example, show 'ordinary-loss' instead of 'ordinary-income'.
`-b', `--balance'
Show the balance for each account. Generally this output is called Trial Balance of Balances.
`-o', `--output' output file
Write output to output file instead of to the standard output.
`-p', `--pair'
Show the pair for each account. This is the default. Generally this output is called Trial Balance of Totals.
`-l', `--level' n
Print only nodes under the level n.
`-v', `--verbose'
Be extra verbose.
`--help'
Print a usage message on standard output and exit successfully.
`--version'
Print version information on standard output then exit successfully.

DIAGNOSTICS

The bknprint exits with a non 0 value if an error occurred, 0 otherwise.

SEE ALSO

bknapply(1), bknconfig(1), bknfind(1), bknparse(1), bknsort(1), bknstate(1), bkntrans(1), account(5), slip(5).

AUTHOR

Tama Communications Corporation.

6.6 bknsort - sort lines of slips

NAME

bknsort - sort lines of slips

SYNOPSIS

bknsort [option ...] [slip ...]
bknsort --help
bknsort --version

DESCRIPTION

The bknsort sorts all the lines by the date from the given slip files, or the standard input if no files are given. By default, bknsort writes the results to the standard output.

OPTIONS

The following options are available:

`-o', `--output' output file
Write output to output file instead of to the standard output.
`-v', `--verbose'
Be extra verbose.
`--help'
Print a usage message on standard output and exit successfully.
`--version'
Print version information on standard output then exit successfully.

DIAGNOSTICS

The bknsort exits with a non 0 value if an error occurred, 0 otherwise.

SEE ALSO

bknapply(1), bknconfig(1), bknfind(1), bknparse(1), bknprint(1), bknstate(1), bkntrans(1), account(5), slip(5).

AUTHOR

Tama Communications Corporation.

6.7 bknstate - make a TeX source of financial statement.

NAME

bknstate - make a TeX source of financial statement.

SYNOPSIS

bknstate [option ...] asset [income profit]
bknstate --help
bknstate --version

DESCRIPTION

The bknstate generates a TeX source of financial statement. The arguments should be snapshot file. Bknstate print balance sheet if asset snapshot is specified, and print income statement if income and profit snapshot are specified.

The present version is only for Japanese, and assumes `ja/account.def'. The version in the future will support other language, and the specification will be greatly changed.

OPTIONS

The following options are available:

`-o', `--output' output
Write output to output file instead of to the standard output.
`-l', `--level' n
Descend at most n account levels. The default is 4.
`-v', `--verbose'
Be extra verbose.
`--help'
Print a usage message on standard output and exit successfully.
`--version'
Print version information on standard output then exit successfully.

DIAGNOSTICS

The bknstate exits with a non 0 value if an error occurred, 0 otherwise.

SEE ALSO

bknapply(1), bknconfig(1), bknfind(1), bknparse(1), bknprint(1), bknsort(1), bkntrans(1), account(5), slip(5).

AUTHOR

Tama Communications Corporation.

6.8 bkntrans - convert the given snapshot to transactions

NAME

bkntrans - convert the given snapshot to transactions

SYNOPSIS

bkntrans [option ...] [snapshot]
bkntrans --help
bkntrans --version

DESCRIPTION

The bkntrans generates the closing or the opening transactions for given snapshot or the standard input if no files are given. Applying the closing transactions to a snapshot, the snapshot will be in balance; opening transactions are the reverse.

By default, bkntrans writes the results to the standard output.

OPTIONS

The following options are available:

`-p', `--open'
Generate opening transactions.
`-c', `--close'
Generate closing transactions. This is the default.
`-o', `--output' output file
Write output to output file instead of to the standard output.
`-v', `--verbose'
Be extra verbose.
`--help'
Print a usage message on standard output and exit successfully.
`--version'
Print version information on standard output then exit successfully.

DIAGNOSTICS

The bkntrans exits with a non 0 value if an error occurred, 0 otherwise.

SEE ALSO

bknapply(1), bknconfig(1), bknfind(1), bknparse(1), bknprint(1), bknsort(1), bknstate(1), account(5), slip(5).

AUTHOR

Tama Communications Corporation.

6.9 account - format of the account definition file

NAME

account - format of the account definition file

DESCRIPTION

The account definition file contains information regarding the account tree. For each account a single line should be present with the following information:

account level
The degree of abstraction of account. It must be natural number. Top level is always 1, and the lower level is larger than it.
account name
Account names are sequences of letters, digits, underscores(_), hyphens(-) and colons(:) that do not begin with a digit. (This limitation will be loosened in the future.) Account name must be unique among the same level of the tree.

Fields are separated by any number of blanks and/or tab characters. Lines whose first character is a semicolon ; are comments, and are ignored. Blank lines which consist only of spaces, tabs or newlines are also ignored. Lines whose first character is a percent-sign % are meta records. These are four meta records as follows:

%debit
The accounts from here belong to debit type.
%credit
The accounts from here belong to credit type.
%open
The account follows is opening account.
%close
The account follows is close account.

The account name field might contain a slash-sign / separated subfields as follows:

positive name
It is used when the balance is zero or positive.
negative name
It is used when the balance is negative.

The name of this type is used for 'profit and loss' account. For example, 'operating-income/operating-loss' means 'operating-loss' if the balance is negative, else 'operating-income'.

EXAMPLES

	%debit
	01 assets
	   02 current-assets
	      03 cash-on-hand-and-in-banks
		 04 cash
		 04 current-deposit
		 04 ordinary-current-deposit
	      03 bill-receivable
	...
	%credit
	01 liabilities
	   02 current-liabilities
	      03 bill-payable
	      03 accounts-payable
	      03 call-money
		 04 short-term-loans-from-officers-and-employees
	...

SEE ALSO

bknapply(1), bknconfig(1), bknfind(1), bknparse(1), bknprint(1), bknsort(1), bkntrans(1), transaction(5).

AUTHOR

Tama Communications Corporation.

6.10 slip - format of the slip file

NAME

slip - format of the slip file

DESCRIPTION

The slip files are files consisting of newline separated records, one per slip. For each slip a single line should be present with the following information:

date
Slip date
debit
Left side of the slip
credit
Right side of the slip
comment
Any note(optional)

Fields are separated by any number of blanks and/or tab characters, but the comment field can contains blanks.

Lines whose first character is a semicolon ; are comments, and are ignored. Blank lines which consist only of spaces, tabs or newlines are also ignored.

The debit and credit are comma separated list which are not empty, whose element contains an account name and the value splitted by /. The account must be a leaf account; but exceptionally, a branch account is acceptable only when all of the lower accounts become in balance as a result. The value must be a natural number or any scheme expression.

Only one value per one slip can be omitted with /.

BUILT-IN FUNCTIONS

(balance [account])
Return the balance of the account.

EXAMPLES

	20040510 ordinary-current-deposit/3000000 capital-stock/3000000 Comment.
	20040510 organization-expenses/250000 ordinary-current-deposit
	20050625 securities/XYZ-company/(+ (* 200 100) 150) ABC-stock-company

SEE ALSO

bknapply(1), bknconfig(1), bknfind(1), bknparse(1), bknprint(1), bknsort(1), bkntrans(1), account(5).

AUTHOR

Tama Communications Corporation.

A. Copying This Manual

A.1 GNU Free Documentation License

Version 1.2, November 2002
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
  1. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
  2. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, @acronym{SGML} or @acronym{XML} using a publicly available @acronym{DTD}, and standard-conforming simple @acronym{HTML}, PostScript or @acronym{PDF} designed for human modification. Examples of transparent image formats include @acronym{PNG}, @acronym{XCF} and @acronym{JPG}. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, @acronym{SGML} or @acronym{XML} for which the @acronym{DTD} and/or processing tools are not generally available, and the machine-generated @acronym{HTML}, PostScript or @acronym{PDF} produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
  3. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies.
  4. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
  5. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
    1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
    2. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
    3. State on the Title page the name of the publisher of the Modified Version, as the publisher.
    4. Preserve all the copyright notices of the Document.
    5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
    6. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
    7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
    8. Include an unaltered copy of this License.
    9. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
    10. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
    11. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
    12. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
    13. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version.
    14. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section.
    15. Preserve any Warranty Disclaimers.
    If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
  6. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements."
  7. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
  8. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.
  9. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
  10. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
  11. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.

A.1.1 ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:

  Copyright (C)  year  your name.
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.2
  or any later version published by the Free Software Foundation;
  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  Texts.  A copy of the license is included in the section entitled ``GNU
  Free Documentation License''.

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this:

    with the Invariant Sections being list their titles, with
    the Front-Cover Texts being list, and with the Back-Cover Texts
    being list.

If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.

If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.

B. Business Model

B.1 The BOKIN Model Definition

Version 1.0, December 17, 2005
Copyright (C) 2005 Tama Communications Corporation

Everyone is permitted to copy and distribute verbatim copies
of this document, but changing it is not allowed.

Introduction

BOKIN Model is a business model to obtain proceeds by widely collecting donations while developing and distributing free software. This model is constructed not to take away consumer's freedom of software.

The business which comply with the following criteria can be called a business based on BOKIN Model.

Criteria

  1. CORPORATION
    The person who start a business based on BOKIN Model must be a business corporation registered in the home country. (Herein after called the corporation)
  2. FREE SOFTWARE
    The corporation develops free software. (Herein after called the BOKINware)
  3. LICENSE
    The corporation distributes the BOKINware under GNU GPL (GNU General Public License) and GNU FDL (GNU Free Documentation License). Exceptionally, external packages which the BOKINware uses, small supporting files, short manuals and rough documentation can use simple all-permissive license, compatible with GNU GPL.
  4. COPYRIGHT MANAGEMENT
    The corporation manages copyright on the BOKINware for consumers to keep on using it at ease.
  5. MAILING LIST
    The corporation maintains mailing lists for consumers to cooperate one another. The list members, including the corporation, don't owe any duty. The mailing lists should include the following two at least. The mailing lists can be replaced with a similar communication tool. The corporation can decide the operation policy of the list, but must not obstruct the list members to cooperate one another.
  6. COLLECTING DONATIONS
    The corporation collects donations widely as its proceeds. The corporation must not offer the donor an individual supply of profit.
  7. DONOR LIST
    The corporation open the donor list to the public. The donor list includes the following information. When donor's name and nationality are unknown or the donor prefers to remain anonymous, they are treated as anonymous. The BOKINware should contain the donor list as a file named `DONORS'. It is preferable that the list is open to the public even on the Internet.
  8. BOKIN MODEL DEFINITION
    The BOKINware should contain the present definition as a file named `BOKIN_MODEL'.

Renewal

The author may publish revised and/or new versions of the BOKIN Model Definition from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

B.2 Frequently Asked Questions

Version 1.0, December 17, 2005
Copyright (C) 2005 Tama Communications Corporation

Everyone is permitted to copy and distribute verbatim copies
of this document, but changing it is not allowed.

BOKIN Model Frequently Asked Questions

  1. What does BOKIN mean?
    BOKIN means collecting donations in Japanese. (BO=collect, KIN=money)
  2. What is the purpose to require the person who start a BOKIN model business being a registered corporation?
    The purpose is to prevent people from donating to the person who does not exist actually.
  3. Is annoying copyright management necessary?
    Yes, it is. Copyright management is absolutely necessary for consumers to keep on using the BOKINware at ease. It is dangerous to use the software whose copyright is not neatly managed. If you use such software, you might suddenly be prohibited to use it, or be claimed a license fee of high priced. These are not imaginary fears but troubles of reality.
  4. Why is program license limited to GNU GPL?
    Because GNU GPL defends consumers in two points.
  5. What is the purpose of the donor list?
    There are two purposes.
  6. Is donation spent on the BOKINware?
    It depends on the management of the corporation. Since donations become the proceeds of the corporation, the corporation itself decides the usage under its freedom.
  7. Is the donor list kept true?
    It is very difficult to mix lies in the public information, because it is checked by various methods.
  8. Why is the corporation prohibited from doing an individual supply of profit for the donors?
    When individual supply of profit becomes ordinary, donation fall into the payment for the profit. We cannot call it donation. BOKIN Model business should be supported only by people's free will.

Concept Index

Jump to: a - b - c - d - f - g - i - l - p - r - s - t

a

  • account, account
  • account tree
  • b

  • balance
  • balance sheet
  • bknapply
  • bknconfig
  • bknfind
  • bknparse
  • bknprint
  • bknsort
  • bknstate
  • bkntrans
  • BOKIN model
  • branch account, branch account
  • c

  • credit
  • CVS
  • d

  • debit
  • double-entry bookkeeping
  • f

  • FDL, GNU Free Documentation License
  • financial statement
  • g

  • GNU Guile
  • GNU Make
  • GNU Project
  • i

  • in balance
  • l

  • leaf account
  • p

  • Pair
  • r

  • root account
  • s

  • S-expression
  • S-transaction
  • slip, slip
  • SSH
  • t

  • The BOKIN Model Definition
  • transaction
  • tree calculation
  • Account Title Index

    Jump to: a - c - e - l - o - p - r - s

    a

  • assets
  • c

  • closing-balance
  • e

  • expenses
  • l

  • liabilities
  • o

  • opening-balance
  • p

  • profit-and-loss
  • r

  • revenues
  • s

  • stockholders-equity

  • This document was generated on July, 20 2008 using texi2html 1.57.