![]() |
A list of commands and help is available by typing:
bk help.
You can obtain specific help on a command by typing:
bk help <command>.
It is important to note that the -L option is used with the directory
that contains the BK subdirectory (in this distribution it is found
in the lib directory). You should only need to use this option if
you move the lib directory relative to the bin directory.
The -p must be passed the server name and port number in the form
SERVER:PORT. This command line option will override both the default
server and port and any values set by the environment variable BKPORT.
BKPORT, if set, must also be of the form SERVER:PORT.
The client's default setting for the server name is localhost. You may change this in the bk script if it is easier than setting an environment variable or creating an alias.
Here is a sample usage for modifying data in the invoice table. This usage would be identical (except for the command name) for any other existing table. The modify command is always the same as the table name.
invoice -- Create, delete, or edit an invoicebk invoice [ -t template ] [ ID ]
bk invoice -o [ -t template ] [ ID ]
bk invoice -d ID
bk invoice -i
'Invoice' creates and edits invoice values using an ASCII form. An invoice is an entry in the bookkeeping system.
With no arguments, 'invoice' creates a blank invoice form and invokes the user's editor. When the form is saved, an invoice of the form invNNNNNN is created. If an ID is given on the command line either that named ID will be created or, if the ID already exists, the invoice can be modified. Use the -t option to indicate an existing entry that will supply initial values.
The -d flag deletes the named invoice. The -o flag causes 'invoice' to write the invoice form to the standard output, instead of invoking the editor. The -i flag causes 'invoice' to read an invoice form from the standard input.
import -- Import raw data into a tablebk import [ -f SEP ] table
Import reads raw information from standard input and enters in into the specified table. The -f option specifies the field seperator (eg. -f : or -f XXX). The default seperator is a tab space (<TAB>).
The format of the raw data is: FieldName1<SEP>FieldName2<SEP>FieldName3... # A comment FieldData1<SEP>FieldData2<SEP>FieldData3... ...
Only the fields that you require, or want, have to be present. If the table's Unique ID field isn't present then a new ID will be generated automatically.
If you want a tab or newline (for MULTILINE fields), use 'T' and 'N' respectively (without the quotes, of course).
Here is a sample usage for listing data in the invoice table. This usage would be identical (except for the command name) for any other existing table. The listing command is always the plural form of the table's name.
invoices -- Display a list of invoicesbk invoices [ -f SEP ] [ -r ] [ -c FIELDS ] [ expression ]
bk invoices [ -f SEP ] [ -F ] [ -T ] [ -D ]Reports a list of all invoices currently known to the system. An expression may be any valid RDB expression. The -f option specifies the field seperator (eg. -f : or -f XXX). The default seperator is a tab space (<TAB>).
Use the -r flag to generate an entire RDB file instead of just a listing of entries.
The -c flag lets the user specify which fields (and which order) to report the entries. FIELDS must be one single argument if more than one field is requested (ie. -c 'Field1 Field2')
This command may also return the field names (-F), the field types (-T), and the Field descriptions (-D).
expired -- Generate a list of expired invoices, projects, and client contactsbk expired [ -e days -i -p -c ]
Expired generates a list of expired invoices (based on the Date it was generated and the Term set in their Client info), projects (based on either the EstimatedStart/StartDate or the EstimatedEnd/EndDate fields), and client contacts (based on ContactWhen).
Use the -e option to add or substract extra days to the search. For example, use '-e 90' to find all entries that have been expired for 90 days or longer. Use '-e -14' to find all entries that will expire within the next two weeks (or have already expired).
The default behaviour is to find all expired items. Use the '-i' option to get the list of expired invoices. Use the '-p' option to get the expired projects. Use the '-c' option to get the expired contacts.
tablelist -- List known tablesbk tablelist
Tablelist is used to list all of the tables that you can use for edit/modify/delete commands.
Any of these categories may be re-used in another or new table as long as the underlying values are still valid. Otherwise, it would be better if you created a new Field name.
You can also add more values to any Category.
The current classes of settings are:
/Expenditure/Horses/Deductibility 0.5
/NewID/Project/Prefix "HI MOM"
/NewID/Project/Prefix uc(substr($entry{ProjectClass}, 0, 2))
Please note that the values from a form are available using the $entry{FIELDNAME} format. Plain strings should always be in quotes.
/Tax/GST/TaxRate 0.07
0% is the default tax rate, if it isn't defined.
/UserInfo/BusinessLabel GST Number: R123456789
A setting for this is completely optional.
Refer to the file templates/data/empty/Setting.dat for more examples.
billem -- Generate invoices from project workbk billem [ -n ] [ projects... ]
Billem generates invoices based on finished projects, in the case of fixed price projects, and on work in progress (WIP), in the case of time and materials projects. If any project IDs are specified then only those will be be generated.
Use the -n to find out what projects would have been billed without it actually being generated.
NOTE: For Fixed price projects, if you specify a budget of 0 (or no budget at all) then existing invoices are used. Also, only one charge from one valid invoice will be used to updated the timesheets.
print -- Generate an invoice, quotation or check documentbk print [ -d doctype -q ] InvoiceID bk print [ -d doctype ] -c CheckNumber
Print generates a file containing information from one of: o the InvoiceID and related Charges o a group of Expense entries and their Supplier
If the invoice has no Date set then it defaults to today and this value is saved in the database.
If the expenses have no Paid date set then it defaults to today and this value is saved in the database. If the Paid date is set on any expenses or the supplier isn't unique then the operation aborts.
Use the -q option to indicate that this is only a quotation and not a real invoice. In this instance, the Date will not be set. If the Date is already set, you will get an error.
Use the -c option to indicate that you want to print out a check. The default is to expect an Invoice ID.
Use the -d option to specify a document type. Currently, the 'postscript' and 'text' types are available. Postscript is the default.
Currently there is only the income and expense summary
statements available.
Currently there is only the timesheet ad worksummary reports available.
Here is the general usage of the runbatch command:
runbatch -- Process recurring transactionsbk runbatch [ -d date ] [ -m mID ] [ cmds ... ]
Runbatch may be used to force the processing of recurring transaction or to run a memorized transaction. Optional commands may be added on the command line and they will evaluated before each transaction's commands.
Use the -m option to specify the Recurrence ID of a memorized transaction (ie. NextDate is empty and Interval is 'never'). Use the -d option to specify the date to run under. This may be useful, for example, to get ahead in your work.
It should be noted that the server will process recurring transactions automatically and periodically.