Insert some spacing

This commit is contained in:
thdox 2013-05-05 22:37:39 +02:00
parent 3e95bdd43f
commit 1e1275d25b
2 changed files with 284 additions and 31 deletions

View file

@ -8,6 +8,7 @@
@c needs. @c needs.
@copying @copying
Copyright @copyright{} 2013, Craig Earls. All rights reserved. Copyright @copyright{} 2013, Craig Earls. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@ -15,17 +16,21 @@ modification, are permitted provided that the following conditions are
met: met:
@itemize @itemize
@item @item
Redistributions of source code must retain the above copyright notice, Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
@item @item
Redistributions in binary form must reproduce the above copyright Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
@item @item
Neither the name of New Artisans LLC nor the names of its contributors Neither the name of New Artisans LLC nor the names of its contributors
may be used to endorse or promote products derived from this software may be used to endorse or promote products derived from this software
without specific prior written permission. without specific prior written permission.
@end itemize @end itemize
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
@ -39,6 +44,7 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@end copying @end copying
@dircategory Major Modes @dircategory Major Modes
@ -333,21 +339,25 @@ states unless specifically instructed to use them. Ledger-mode assigns
some additional meaning to the states: some additional meaning to the states:
@itemize @itemize
@item Uncleared. @item Uncleared.
No state. This is equivalent to sticking a check in the mail. It has No state. This is equivalent to sticking a check in the mail. It has
been obligated, but not been cashed by the recipient. It could also been obligated, but not been cashed by the recipient. It could also
apply to credit/debit card transactions that have not been cleared into apply to credit/debit card transactions that have not been cleared into
your account balance. You bank may call these transactions ``pending'', your account balance. You bank may call these transactions ``pending'',
but Ledger-mode uses a slightly different meaning. but Ledger-mode uses a slightly different meaning.
@item Pending. @item Pending.
Ledger-mode's reconciliation function see pending transactions as an Ledger-mode's reconciliation function see pending transactions as an
intermediate step in reconciling an account. When doing intermediate step in reconciling an account. When doing
a reconciliation (@pxref{Reconciliation}), marking a transaction as a reconciliation (@pxref{Reconciliation}), marking a transaction as
pending means that you have seen the transaction finally recorded by the pending means that you have seen the transaction finally recorded by the
recipient, but you have not completely reconciled the account. recipient, but you have not completely reconciled the account.
@item Cleared. @item Cleared.
The transaction has been completely recognized by all parties to the The transaction has been completely recognized by all parties to the
transaction. transaction.
@end itemize @end itemize
@kindex C-c C-e @kindex C-c C-e
@ -433,18 +443,24 @@ transactions. For details of the regular expression syntax, see
using the @file{demo.ledger} are given here: using the @file{demo.ledger} are given here:
@table @samp @table @samp
@item Groceries @item Groceries
Show only transactions that have a posting to the @samp{Groceries} Show only transactions that have a posting to the @samp{Groceries}
account. account.
@item ^2011/01 @item ^2011/01
Show only transactions occurring in January of 2011. Show only transactions occurring in January of 2011.
@item ^2011/.*/25 @item ^2011/.*/25
Show only transactions occurring on the 25th of the month in 2011. Show only transactions occurring on the 25th of the month in 2011.
@item auto @item auto
Show only transactions with payees or accounts or comments containing. Show only transactions with payees or accounts or comments containing.
@samp{auto} @samp{auto}
@item harley$ @item harley$
Show only transactions with any line ending with @samp{harley}. Show only transactions with any line ending with @samp{harley}.
@end table @end table
To show back all transactions simply invoke @samp{Narrow to Regex} or To show back all transactions simply invoke @samp{Narrow to Regex} or
@ -604,16 +620,21 @@ Typing @kbd{C-c C-o C-r} or using menu @samp{Ledger Run Report} prompt
for the name of a saved report. The built-in reports are: for the name of a saved report. The built-in reports are:
@table @var @table @var
@item bal @item bal
Produce a balance reports of all accounts. Produce a balance reports of all accounts.
@item reg @item reg
Produce a register report of all transactions. Produce a register report of all transactions.
@item payee @item payee
Prompt for a payee, then produce a register report of all transactions Prompt for a payee, then produce a register report of all transactions
involving that payee. involving that payee.
@item account @item account
Prompt for an account, then produce a register report of all Prompt for an account, then produce a register report of all
transactions involving that account. transactions involving that account.
@end table @end table
@node Adding and Editing Reports, Reversing Report Order, Running Basic Reports, The Report Buffer @node Adding and Editing Reports, Reversing Report Order, Running Basic Reports, The Report Buffer
@ -662,16 +683,20 @@ expansion to prompt the user for the account to use. There are four
variables that can be expanded to run a report: variables that can be expanded to run a report:
@table @var @table @var
@item ledger-file @item ledger-file
Returns the file to be operated on. Returns the file to be operated on.
@item payee @item payee
Prompts for a payee. Prompts for a payee.
@item account @item account
Prompt for an account. Prompt for an account.
@c FIXME : is it 'value' or 'tag' for '@item value' just below? @c FIXME : is it 'value' or 'tag' for '@item value' just below?
@item value @item value
Prompt for a tag value. Prompt for a tag value.
@end table @end table
You can use these expansion values in your ledger report commands. For You can use these expansion values in your ledger report commands. For
@ -751,14 +776,18 @@ for Ledger under the data options. Alternately you can choose
@cindex customization, ledger-mode @cindex customization, ledger-mode
@ftable @option @ftable @option
@item ledger-occur-use-face-shown @item ledger-occur-use-face-shown
If non-nil, use a custom face for transactions shown in If non-nil, use a custom face for transactions shown in
@option{ledger-occur} mode using @option{ledger-occur-xact-face}. @option{ledger-occur} mode using @option{ledger-occur-xact-face}.
@item ledger-clear-whole-transactions @item ledger-clear-whole-transactions
If non-nil, clear whole transactions, not individual postings. If non-nil, clear whole transactions, not individual postings.
@item ledger-highlight-xact-under-point @item ledger-highlight-xact-under-point
If non-nil, highlight transaction under point using If non-nil, highlight transaction under point using
@option{ledger-font-highlight-face}. @option{ledger-font-highlight-face}.
@end ftable @end ftable
@node Ledger Reconcile Customization Group, Ledger Report Customization Group, Ledger Customization Group, Customization Variables @node Ledger Reconcile Customization Group, Ledger Report Customization Group, Ledger Customization Group, Customization Variables
@ -766,23 +795,30 @@ If non-nil, highlight transaction under point using
@cindex customization, reconcile @cindex customization, reconcile
@ftable @option @ftable @option
@item ledger-reconcile-default-commodity @item ledger-reconcile-default-commodity
The default commodity for use in target calculations in ledger The default commodity for use in target calculations in ledger
reconcile. Defaults to @samp{$} (USD). reconcile. Defaults to @samp{$} (USD).
@item ledger-recon-buffer-name @item ledger-recon-buffer-name
Name to use for reconciliation buffer. Defaults to @file{*Reconcile*}. Name to use for reconciliation buffer. Defaults to @file{*Reconcile*}.
@item ledger-narrow-on-reconcile @item ledger-narrow-on-reconcile
If non-nil, limit transactions shown in main buffer to those matching If non-nil, limit transactions shown in main buffer to those matching
the reconcile regex. the reconcile regex.
@item ledger-buffer-tracks-reconcile-buffer @item ledger-buffer-tracks-reconcile-buffer
If non-nil, then when the cursor is moved to a new transaction in the If non-nil, then when the cursor is moved to a new transaction in the
reconcile window. reconcile window.
@item ledger-reconcile-force-window-bottom @item ledger-reconcile-force-window-bottom
If non-nil, make the reconcile window appear along the bottom of the If non-nil, make the reconcile window appear along the bottom of the
register window and resize. register window and resize.
@item ledger-reconcile-toggle-to-pending @item ledger-reconcile-toggle-to-pending
If non-nil, then toggle between uncleared and pending @samp{!}. If If non-nil, then toggle between uncleared and pending @samp{!}. If
false toggle between uncleared and cleared @samp{*}. false toggle between uncleared and cleared @samp{*}.
@end ftable @end ftable
@node Ledger Report Customization Group, Ledger Faces Customization Group, Ledger Reconcile Customization Group, Customization Variables @node Ledger Report Customization Group, Ledger Faces Customization Group, Ledger Reconcile Customization Group, Customization Variables
@ -790,11 +826,14 @@ false toggle between uncleared and cleared @samp{*}.
@cindex customization, report @cindex customization, report
@ftable @option @ftable @option
@item ledger-reports @item ledger-reports
Definition of reports to run. Definition of reports to run.
@item ledger-report-format-specifiers @item ledger-report-format-specifiers
An alist mapping ledger report format specifiers to implementing An alist mapping ledger report format specifiers to implementing
functions. functions.
@end ftable @end ftable
@node Ledger Faces Customization Group, Ledger Post Customization Group, Ledger Report Customization Group, Customization Variables @node Ledger Faces Customization Group, Ledger Post Customization Group, Ledger Report Customization Group, Customization Variables
@ -804,38 +843,55 @@ functions.
Ledger Faces: Ledger-mode highlighting Ledger Faces: Ledger-mode highlighting
@ftable @option @ftable @option
@item ledger-font-uncleared-face @item ledger-font-uncleared-face
Default face for Ledger. Default face for Ledger.
@item ledger-font-cleared-face @item ledger-font-cleared-face
Default face for cleared @samp{*} transactions. Default face for cleared @samp{*} transactions.
@item ledger-font-highlight-face @item ledger-font-highlight-face
Default face for transaction under point. Default face for transaction under point.
@item ledger-font-pending-face @item ledger-font-pending-face
Default face for pending @samp{!} transactions. Default face for pending @samp{!} transactions.
@item ledger-font-other-face @item ledger-font-other-face
Default face for other transactions. Default face for other transactions.
@item ledger-font-posting-account-face @item ledger-font-posting-account-face
Face for Ledger accounts. Face for Ledger accounts.
@item ledger-font-posting-account-cleared-face @item ledger-font-posting-account-cleared-face
Face for cleared Ledger accounts. Face for cleared Ledger accounts.
@item ledger-font-posting-account-pending-face @item ledger-font-posting-account-pending-face
Face for Ledger pending accounts. Face for Ledger pending accounts.
@item ledger-font-posting-amount-face @item ledger-font-posting-amount-face
Face for Ledger amounts. Face for Ledger amounts.
@item ledger-occur-narrowed-face @item ledger-occur-narrowed-face
Default face for Ledger occur mode hidden transactions. Default face for Ledger occur mode hidden transactions.
@item ledger-occur-xact-face @item ledger-occur-xact-face
Default face for Ledger occur mode shown transactions. Default face for Ledger occur mode shown transactions.
@item ledger-font-comment-face @item ledger-font-comment-face
Face for Ledger comments. Face for Ledger comments.
@item ledger-font-reconciler-uncleared-face @item ledger-font-reconciler-uncleared-face
Default face for uncleared transactions in the reconcile window. Default face for uncleared transactions in the reconcile window.
@item ledger-font-reconciler-cleared-face @item ledger-font-reconciler-cleared-face
Default face for cleared @samp{*} transactions in the reconcile window. Default face for cleared @samp{*} transactions in the reconcile window.
@item ledger-font-reconciler-pending-face @item ledger-font-reconciler-pending-face
Default face for pending @samp{!} transactions in the reconcile window. Default face for pending @samp{!} transactions in the reconcile window.
@item ledger-font-report-clickable-face @item ledger-font-report-clickable-face
FIXME FIXME
@end ftable @end ftable
@node Ledger Post Customization Group, Ledger Exec Customization Group, Ledger Faces Customization Group, Customization Variables @node Ledger Post Customization Group, Ledger Exec Customization Group, Ledger Faces Customization Group, Customization Variables
@ -845,16 +901,22 @@ FIXME
Ledger Post: Ledger Post:
@ftable @option @ftable @option
@item ledger-post-auto-adjust-amounts @item ledger-post-auto-adjust-amounts
If non-nil, then automatically align amounts to column specified in If non-nil, then automatically align amounts to column specified in
@option{ledger-post-amount-alignment-column}. @option{ledger-post-amount-alignment-column}.
@item ledger-post-amount-alignment-column @item ledger-post-amount-alignment-column
The column Ledger-mode uses to align amounts. The column Ledger-mode uses to align amounts.
@item ledger-default-acct-transaction-indent @item ledger-default-acct-transaction-indent
Default indentation for account transactions in an entry. Default indentation for account transactions in an entry.
@item ledger-post-use-completion-engine @item ledger-post-use-completion-engine
Which completion engine to use: @var{iswitchb}, @var{ido}, or built-in. Which completion engine to use: @var{iswitchb}, @var{ido}, or built-in.
@item ledger-post-use-ido @item ledger-post-use-ido
@end ftable @end ftable
@node Ledger Exec Customization Group, Ledger Test Customization Group, Ledger Post Customization Group, Customization Variables @node Ledger Exec Customization Group, Ledger Test Customization Group, Ledger Post Customization Group, Customization Variables
@ -864,10 +926,13 @@ Which completion engine to use: @var{iswitchb}, @var{ido}, or built-in.
Ledger Exec: Interface to the Ledger command-line accounting program. Ledger Exec: Interface to the Ledger command-line accounting program.
@ftable @option @ftable @option
@item ledger-binary-path @item ledger-binary-path
Path to the ledger executable. Path to the ledger executable.
@item ledger-init-file-name @item ledger-init-file-name
Location of the ledger initialization file. nil if you don't have one. Location of the ledger initialization file. nil if you don't have one.
@end ftable @end ftable
@node Ledger Test Customization Group, Ledger Texi Customization Group, Ledger Exec Customization Group, Customization Variables @node Ledger Test Customization Group, Ledger Texi Customization Group, Ledger Exec Customization Group, Customization Variables
@ -875,10 +940,13 @@ Location of the ledger initialization file. nil if you don't have one.
@cindex customization, test @cindex customization, test
@ftable @option @ftable @option
@item ledger-source-directory @item ledger-source-directory
Directory where the Ledger sources are located. Directory where the Ledger sources are located.
@item ledger-test-binary @item ledger-test-binary
Directory where the debug binary. Directory where the debug binary.
@end ftable @end ftable
@node Ledger Texi Customization Group, , Ledger Test Customization Group, Customization Variables @node Ledger Texi Customization Group, , Ledger Test Customization Group, Customization Variables
@ -886,12 +954,15 @@ Directory where the debug binary.
@cindex customization, texi @cindex customization, texi
@ftable @option @ftable @option
@item ledger-texi-sample-doc-path @item ledger-texi-sample-doc-path
Location for sample data to be used in texi tests, defaults to Location for sample data to be used in texi tests, defaults to
@file{~/ledger/doc/sample.dat}. @file{~/ledger/doc/sample.dat}.
@item ledger-texi-normalization-args @item ledger-texi-normalization-args
texi normalization for producing ledger output, defaults to texi normalization for producing ledger output, defaults to
@samp{--args-only --columns 80}. @samp{--args-only --columns 80}.
@end ftable @end ftable
@node Generating Ledger Regression Tests, Embedding Example results in Ledger Documentation, Customizing Ledger-mode, Top @node Generating Ledger Regression Tests, Embedding Example results in Ledger Documentation, Customizing Ledger-mode, Top

View file

@ -16,17 +16,21 @@ modification, are permitted provided that the following conditions are
met: met:
@itemize @itemize
@item @item
Redistributions of source code must retain the above copyright Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer. notice, this list of conditions and the following disclaimer.
@item @item
Redistributions in binary form must reproduce the above copyright Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
@item @item
Neither the name of New Artisans LLC nor the names of its Neither the name of New Artisans LLC nor the names of its
contributors may be used to endorse or promote products derived from contributors may be used to endorse or promote products derived from
this software without specific prior written permission. this software without specific prior written permission.
@end itemize @end itemize
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@ -1653,6 +1657,7 @@ scheme. As far as valuation goes, it's shorthand for writing
A valuation function receives three arguments: A valuation function receives three arguments:
@table @code @table @code
@item source @item source
A string identifying the commodity whose price is being asked for A string identifying the commodity whose price is being asked for
(example: @samp{EUR}) (example: @samp{EUR})
@ -1664,6 +1669,7 @@ The reference date the price should be relative.
A string identifying the ``target'' commodity, or the commodity the A string identifying the ``target'' commodity, or the commodity the
returned price should be in. This argument is null if @code{--market} returned price should be in. This argument is null if @code{--market}
was used instead of @code{--exchange @var{COMMODITY}}. was used instead of @code{--exchange @var{COMMODITY}}.
@end table @end table
The valuation function should return an amount. If you've written The valuation function should return an amount. If you've written
@ -1833,6 +1839,7 @@ The initial character of each line determines what the line means, and
how it should be interpreted. Allowable initial characters are: how it should be interpreted. Allowable initial characters are:
@table @code @table @code
@item NUMBER @item NUMBER
A line beginning with a number denotes a transaction. It may be A line beginning with a number denotes a transaction. It may be
followed by any number of lines, each beginning with white-space, to followed by any number of lines, each beginning with white-space, to
@ -1902,6 +1909,7 @@ If the semi colon is indented and occurs inside a transaction, it is
parsed as a persistent note for its preceding category. These notes or parsed as a persistent note for its preceding category. These notes or
tags can be used to augment the reporting and filtering capabilities of tags can be used to augment the reporting and filtering capabilities of
Ledger. Ledger.
@end table @end table
@node Command Directives, , Transaction and Comments, Journal Format @node Command Directives, , Transaction and Comments, Journal Format
@ -1910,6 +1918,7 @@ Ledger.
@findex --pedantic @findex --pedantic
@table @code @table @code
@item beginning of line @item beginning of line
Command directives must occur at the beginning of a line. Use of Command directives must occur at the beginning of a line. Use of
@samp{!} and @samp{@@} is deprecated. @samp{!} and @samp{@@} is deprecated.
@ -1997,7 +2006,6 @@ alias Checking=Assets:Credit Union:Joint Checking Account
2011/11/28 YummyPalace 2011/11/28 YummyPalace
Dining $10.00 Dining $10.00
Checking Checking
@end smallexample @end smallexample
The aliases are only in effect for transactions read in after the alias The aliases are only in effect for transactions read in after the alias
@ -2034,7 +2042,6 @@ bucket Assets:Checking
2011/12/01 Sale 2011/12/01 Sale
Assets:Checking:Business $ 30.00 Assets:Checking:Business $ 30.00
@end smallexample @end smallexample
@item capture @item capture
@ -2284,6 +2291,7 @@ The following single letter commands may be at the beginning of a line
alone, for backwards compatibility with older Ledger versions. alone, for backwards compatibility with older Ledger versions.
@table @code @table @code
@item A @item A
See @code{bucket} See @code{bucket}
@ -2328,6 +2336,7 @@ C 1.00 Kb = 1024 bytes
These four relate to timeclock support, which permits Ledger to read These four relate to timeclock support, which permits Ledger to read
timelog files. See the timeclock's documentation for more info on the timelog files. See the timeclock's documentation for more info on the
syntax of its timelog files. syntax of its timelog files.
@end table @end table
@node Converting from other formats, Archiving Previous Years, Journal Format, Keeping a Journal @node Converting from other formats, Archiving Previous Years, Journal Format, Keeping a Journal
@ -3243,26 +3252,25 @@ a function by using a lambda expression taking three arguments:
The arguments passed to these functions have the following meaning: The arguments passed to these functions have the following meaning:
@itemize @itemize
@item source @item source
The source commodity string, or an amount object. If it is The source commodity string, or an amount object. If it is a string,
a string, the return value must be an amount representing the the return value must be an amount representing the price of the
price of the commodity identified by that string (example: commodity identified by that string (example: @samp{$}). If it is an
@samp{$}). If it is an amount, return the value of that amount, return the value of that amount as a new amount (usually
amount as a new amount (usually calculated as commodity price calculated as commodity price times source amount).
times source amount).
@item date @item date
The date to use for determining the value. If null, it means The date to use for determining the value. If null, it means no date
no date was specified, which can mean whatever you want it to was specified, which can mean whatever you want it to mean.
mean.
@item target @item target
If not null, a string representing the desired target If not null, a string representing the desired target commodity that the
commodity that the commodity price, or repriced amount, should commodity price, or repriced amount, should be valued in. Note that
be valued in. Note that this string can be a comma-separated this string can be a comma-separated list, and that some or all of the
list, and that some or all of the commodities in that list may commodities in that list may be suffixed with an exclamation mark, to
be suffixed with an exclamation mark, to indicate what is indicate what is being desired.
being desired.
@end itemize @end itemize
In most cases, it is simplest to either use explicit amounts in your In most cases, it is simplest to either use explicit amounts in your
@ -3485,6 +3493,7 @@ Ledger you can control every aspect of the timing of a transaction.
Say you're in business. If you bill a customer, you can enter Say you're in business. If you bill a customer, you can enter
something like something like
@cindex effective date of invoice @cindex effective date of invoice
@smallexample @smallexample
@ -4327,19 +4336,20 @@ include Ledger entries within an org file. There are three ways (at
least) in which these can be included: least) in which these can be included:
@enumerate @enumerate
@item @item
place all Ledger entries within one source block and execute place all Ledger entries within one source block and execute this block
this block with different arguments to generate the with different arguments to generate the appropriate reports;
appropriate reports;
@item @item
place Ledger entries in more than one source block and use the place Ledger entries in more than one source block and use the noweb
noweb literary programming approach, supported by babel, to literary programming approach, supported by babel, to combine these into
combine these into one block elsewhere in the file for one block elsewhere in the file for processing by Ledger; and,
processing by Ledger; and,
@item @item
place Ledger entries in different source blocks and use place Ledger entries in different source blocks and use tangling to
tangling to generate a Ledger file which you can subsequently generate a Ledger file which you can subsequently process using Ledger
process using Ledger directly. directly.
@end enumerate @end enumerate
The first two are described in more detail in this short tutorial. The first two are described in more detail in this short tutorial.
@ -4707,15 +4717,20 @@ quantity. The commodity can have a set of flags that indicate how to
display it. The meaning of the flags (all of which are optional) are: display it. The meaning of the flags (all of which are optional) are:
@table @code @table @code
@item P @item P
The commodity is prefixed to the value. The commodity is prefixed to the value.
@item S @item S
The commodity is separated from the value by a space. The commodity is separated from the value by a space.
@item T @item T
Thousands markers are used to display the amount. Thousands markers are used to display the amount.
@item E @item E
The format of the amount is European, with period used as a thousands The format of the amount is European, with period used as a thousands
marker, and comma used as the decimal point. marker, and comma used as the decimal point.
@end table @end table
The actual quantity for an amount is an integer of arbitrary size. The actual quantity for an amount is an integer of arbitrary size.
@ -4972,35 +4987,47 @@ commands.
@subsection Reporting Commands @subsection Reporting Commands
@ftable @code @ftable @code
@item balance @item balance
@itemx bal @itemx bal
Show account balances Show account balances
@item register @item register
@itemx reg @itemx reg
Show all transactions with running total Show all transactions with running total
@item csv @item csv
Show transactions in csv format, for exporting to other programs Show transactions in csv format, for exporting to other programs
@item print @item print
Print transaction in a ledger readable format Print transaction in a ledger readable format
@item xml @item xml
Produce XML output of the register command Produce XML output of the register command
@item lisp @item lisp
@itemx emacs @itemx emacs
Produce Emacs lisp output Produce Emacs lisp output
@item equity @item equity
Print account balances as transactions Print account balances as transactions
@item prices @item prices
Print price history for matching commodities Print price history for matching commodities
@item pricedb @item pricedb
Print price history for matching commodities in ledger readable format Print price history for matching commodities in ledger readable format
@item xact @item xact
Generate transactions based on previous postings Generate transactions based on previous postings
@end ftable @end ftable
@node Basic Options Quick Reference, Report Filtering Quick Reference, Reporting Commands Quick Reference, Command Line Quick Reference @node Basic Options Quick Reference, Report Filtering Quick Reference, Reporting Commands Quick Reference, Command Line Quick Reference
@subsection Basic Options @subsection Basic Options
@ftable @code @ftable @code
@item --help @item --help
@itemx -h @itemx -h
Print summary of all options Print summary of all options
@ -5024,213 +5051,281 @@ Specify options file
@item --account @var{STR} @item --account @var{STR}
@itemx -a @var{STR} @itemx -a @var{STR}
Specify default account @var{STR} for QIF file postings Specify default account @var{STR} for QIF file postings
@end ftable @end ftable
@node Report Filtering Quick Reference, Error Checking and Calculation Options, Basic Options Quick Reference, Command Line Quick Reference @node Report Filtering Quick Reference, Error Checking and Calculation Options, Basic Options Quick Reference, Command Line Quick Reference
@subsection Report Filtering @subsection Report Filtering
@ftable @code @ftable @code
@item --current @item --current
@itemx -c @itemx -c
Display transaction on or before the current date Display transaction on or before the current date
@item --begin @var{DATE} @item --begin @var{DATE}
@itemx -b @var{DATE} @itemx -b @var{DATE}
Begin reports on or after @var{DATE} Begin reports on or after @var{DATE}
@item --end @var{DATE} @item --end @var{DATE}
@itemx -e @var{DATE} @itemx -e @var{DATE}
Limit end date of transactions for report Limit end date of transactions for report
@item --period @var{PERIOD_EXPRESSION} @item --period @var{PERIOD_EXPRESSION}
@itemx -p @var{PERIOD_EXPRESSION} @itemx -p @var{PERIOD_EXPRESSION}
Set report period to @var{PERIOD_EXPRESSION} Set report period to @var{PERIOD_EXPRESSION}
@item --period-sort @var{VEXPR} @item --period-sort @var{VEXPR}
Sort postings within each period Sort postings within each period
@item --cleared @item --cleared
@itemx -C @itemx -C
Display only cleared postings Display only cleared postings
@item --dc @item --dc
Display register or balance in debit/credit format Display register or balance in debit/credit format
@item --uncleared @item --uncleared
@itemx -U @itemx -U
Display only uncleared postings Display only uncleared postings
@item --real @item --real
@itemx -R @itemx -R
Display only real postings Display only real postings
@item --actual @item --actual
@itemx -L @itemx -L
Display only actual postings, not automated Display only actual postings, not automated
@item --related @item --related
@itemx -r @itemx -r
Display related postings Display related postings
@item --budget @item --budget
Display how close your postings meet your budget Display how close your postings meet your budget
@item --add-budget @item --add-budget
Show un-budgeted postings Show un-budgeted postings
@item --unbudgeted @item --unbudgeted
Show only un-budgeted postings Show only un-budgeted postings
@item --forecast @item --forecast
Project balances into the future Project balances into the future
@item --limit @var{EXPR} @item --limit @var{EXPR}
@itemx -l @var{EXPR} @itemx -l @var{EXPR}
Limit postings in calculations Limit postings in calculations
@item --amount @var{EXPR} @item --amount @var{EXPR}
@itemx -t @var{EXPR} @itemx -t @var{EXPR}
Change value expression reported in @command{register} report Change value expression reported in @command{register} report
@item --total @var{VEXPR} @item --total @var{VEXPR}
@itemx -T @var{VEXPR} @itemx -T @var{VEXPR}
Change the value expression used for ``totals'' column in Change the value expression used for ``totals'' column in
@command{register} and @command{balance} reports @command{register} and @command{balance} reports
@end ftable @end ftable
@node Error Checking and Calculation Options, Output Customization Quick Reference, Report Filtering Quick Reference, Command Line Quick Reference @node Error Checking and Calculation Options, Output Customization Quick Reference, Report Filtering Quick Reference, Command Line Quick Reference
@subsection Error Checking and Calculation Options @subsection Error Checking and Calculation Options
@ftable @code @ftable @code
@item --strict @item --strict
Accounts, tags or commodities not previously declared will cause Accounts, tags or commodities not previously declared will cause
warnings. warnings.
@item --pedantic @item --pedantic
Accounts, tags or commodities not previously declared will cause errors. Accounts, tags or commodities not previously declared will cause errors.
@item --check-payees @item --check-payees
Enable strict and pedantic checking for payees as well as accounts, Enable strict and pedantic checking for payees as well as accounts,
commodities and tags. commodities and tags.
@item --immediate @item --immediate
Instruct ledger to evaluate calculations immediately rather than lazily. Instruct ledger to evaluate calculations immediately rather than lazily.
@end ftable @end ftable
@node Output Customization Quick Reference, Grouping Options, Error Checking and Calculation Options, Command Line Quick Reference @node Output Customization Quick Reference, Grouping Options, Error Checking and Calculation Options, Command Line Quick Reference
@subsection Output Customization @subsection Output Customization
@ftable @code @ftable @code
@item --collapse @item --collapse
@itemx -n @itemx -n
Collapse transactions with multiple postings Collapse transactions with multiple postings
@item --subtotal @item --subtotal
@itemx -s @itemx -s
Report register as a single subtotal Report register as a single subtotal
@item --by-payee @item --by-payee
@itemx -P @itemx -P
Report subtotals by payee Report subtotals by payee
@item --empty @item --empty
@itemx -E @itemx -E
Include empty accounts in report Include empty accounts in report
@item --weekly @item --weekly
@itemx -W @itemx -W
Report posting totals by week Report posting totals by week
@item --yearly @item --yearly
@itemx -Y @itemx -Y
Report posting totals by year Report posting totals by year
@item --dow @item --dow
Report Posting totals by day of week Report Posting totals by day of week
@item --sort @var{VEXPR} @item --sort @var{VEXPR}
@itemx -S @var{VEXPR} @itemx -S @var{VEXPR}
Sort a report using @var{VEXPR} Sort a report using @var{VEXPR}
@item --wide @item --wide
@itemx -w @itemx -w
Assume 132 columns instead of 80 Assume 132 columns instead of 80
@item --head @var{INT} @item --head @var{INT}
Report the first @var{INT} postings Report the first @var{INT} postings
@item --tail @var{INT} @item --tail @var{INT}
Report the last @var{INT} postings Report the last @var{INT} postings
@item --pager @var{FILE} @item --pager @var{FILE}
Direct output to @var{FILE} pager program Direct output to @var{FILE} pager program
@item --average @item --average
@itemx -A @itemx -A
Report average posting value Report average posting value
@item --deviation @item --deviation
@itemx -D @itemx -D
Report each posting deviation from the average Report each posting deviation from the average
@item --percent @item --percent
@itemx -% @itemx -%
Show subtotals in the balance report as percentages Show subtotals in the balance report as percentages
@c @item --totals @c @item --totals
@c Include running total in the @code{xml} report @c Include running total in the @code{xml} report
@item --pivot @var{TAG} @item --pivot @var{TAG}
Produce a pivot table of the @var{TAG} type specified Produce a pivot table of the @var{TAG} type specified
@item --amount-data @item --amount-data
@itemx -j @itemx -j
Show only date and value column to format the output for plots Show only date and value column to format the output for plots
@item --plot-amount-format @var{FORMAT_STRING} @item --plot-amount-format @var{FORMAT_STRING}
Specify the format for the plot output Specify the format for the plot output
@item --total-data @item --total-data
@itemx -J @itemx -J
Show only dates and totals to format the output for plots Show only dates and totals to format the output for plots
@item --plot-total-format @var{FORMAT_STRING} @item --plot-total-format @var{FORMAT_STRING}
Specify the format for the plot output Specify the format for the plot output
@item --display @var{EXPR} @item --display @var{EXPR}
@itemx -d @var{EXPR} @itemx -d @var{EXPR}
Display only posting that meet the criterias in the @var{EXPR} Display only posting that meet the criterias in the @var{EXPR}
@item --date-format @var{DATE_FORMAT} @item --date-format @var{DATE_FORMAT}
@itemx -y @var{DATE_FORMAT} @itemx -y @var{DATE_FORMAT}
Change the basic date format used in reports Change the basic date format used in reports
@item --format @var{FORMAT_STRING} @item --format @var{FORMAT_STRING}
@itemx --balance-format @var{FORMAT_STRING} @itemx --balance-format @var{FORMAT_STRING}
@itemx --register-format @var{FORMAT_STRING} @itemx --register-format @var{FORMAT_STRING}
@itemx --prices-format @var{FORMAT_STRING} @itemx --prices-format @var{FORMAT_STRING}
@itemx -F @var{FORMAT_STRING} @itemx -F @var{FORMAT_STRING}
Set reporting format Set reporting format
@item --wide @item --wide
@itemx -w @itemx -w
Wide Wide
@item --anon @item --anon
Print the ledger register with anonymized accounts and payees, useful Print the ledger register with anonymized accounts and payees, useful
for filing bug reports. for filing bug reports.
@end ftable @end ftable
@node Grouping Options, Commodity Reporting Quick Reference, Output Customization Quick Reference, Command Line Quick Reference @node Grouping Options, Commodity Reporting Quick Reference, Output Customization Quick Reference, Command Line Quick Reference
@subsection Grouping Options @subsection Grouping Options
@ftable @code @ftable @code
@item --by-payee @item --by-payee
@itemx -P @itemx -P
Group postings by common payee names Group postings by common payee names
@item --daily @item --daily
@itemx -D @itemx -D
Group postings by day Group postings by day
@item --weekly @item --weekly
@itemx -W @itemx -W
Group postings by week Group postings by week
@item --monthly @item --monthly
@itemx -M @itemx -M
Group postings by month Group postings by month
@item --quarterly @item --quarterly
Group postings by quarter Group postings by quarter
@item --yearly @item --yearly
@itemx -Y @itemx -Y
Group postings by year Group postings by year
@item --dow @item --dow
Group by day of weeks Group by day of weeks
@item --subtotal @item --subtotal
@itemx -s @itemx -s
Group posting together, similar to balance report Group posting together, similar to balance report
@end ftable @end ftable
@node Commodity Reporting Quick Reference, , Grouping Options, Command Line Quick Reference @node Commodity Reporting Quick Reference, , Grouping Options, Command Line Quick Reference
@subsection Commodity Reporting @subsection Commodity Reporting
@ftable @code @ftable @code
@item --price-db @var{FILE} @item --price-db @var{FILE}
Use @file{FILE} for retrieving stored commodity prices. Use @file{FILE} for retrieving stored commodity prices.
@item --price-exp @var{INT} @item --price-exp @var{INT}
@itemx -L @var{INT} @itemx -L @var{INT}
Set expected freshness of prices in @var{INT} minutes. Set expected freshness of prices in @var{INT} minutes.
@item --download @item --download
@itemx -Q @itemx -Q
Download quotes using named @file{getquote}. Download quotes using named @file{getquote}.
@item --getquote @var{FILE} @item --getquote @var{FILE}
Sets path to a user defined script to download commodity prices. Sets path to a user defined script to download commodity prices.
@item --quantity @item --quantity
@itemx -O @itemx -O
Report commodity totals without conversion. Report commodity totals without conversion.
@item --basis @item --basis
@itemx -B @itemx -B
Report cost basis. Report cost basis.
@item --market @item --market
@itemx -V @itemx -V
Report last known market value. Report last known market value.
@item --gain @item --gain
@itemx -G @itemx -G
Report net gain loss for commodities that have a price history. Report net gain loss for commodities that have a price history.
@end ftable @end ftable
@node Detailed Options Description, Period Expressions, Command Line Quick Reference, Command-line Syntax @node Detailed Options Description, Period Expressions, Command Line Quick Reference, Command-line Syntax
@ -5258,6 +5353,7 @@ instance of Ledger running in the background and running multiple
sessions with multiple reports per session. sessions with multiple reports per session.
@ftable @code @ftable @code
@item --args-only @item --args-only
Ignore all environment and init-file settings and Ignore all environment and init-file settings and
use only command-line arguments to control Ledger. Useful for debugs use only command-line arguments to control Ledger. Useful for debugs
@ -5332,6 +5428,7 @@ FIX THIS ENTRY @c FIXME thdox
@item --version @item --version
FIX THIS ENTRY @c FIXME thdox FIX THIS ENTRY @c FIXME thdox
@end ftable @end ftable
@node Session Options, Report Options, Global Options, Detailed Options Description @node Session Options, Report Options, Global Options, Detailed Options Description
@ -5345,6 +5442,7 @@ instance of Ledger running in the background and running multiple
sessions with multiple reports per session. sessions with multiple reports per session.
@ftable @code @ftable @code
@item --cache @var{FIXME} @item --cache @var{FIXME}
FIX THIS ENTRY @c FIXME thdox FIX THIS ENTRY @c FIXME thdox
@ -5450,6 +5548,7 @@ with the --time-colon option they will be displayed as 2:15.
@item --value-expr @var{FIXME} @item --value-expr @var{FIXME}
FIX THIS ENTRY @c FIXME thdox FIX THIS ENTRY @c FIXME thdox
@end ftable @end ftable
@node Report Options, Basic options, Session Options, Detailed Options Description @node Report Options, Basic options, Session Options, Detailed Options Description
@ -5463,6 +5562,7 @@ instance of Ledger running in the background and running multiple
sessions with multiple reports per session. sessions with multiple reports per session.
@ftable @code @ftable @code
@item --abbrev-len @var{INT} @item --abbrev-len @var{INT}
Set the minimum length an account can be abbreviated to if it doesn't Set the minimum length an account can be abbreviated to if it doesn't
fit inside the @code{account-width}. If @var{INT} is zero, then the fit inside the @code{account-width}. If @var{INT} is zero, then the
@ -6130,6 +6230,7 @@ want to set them using environment variables (see @ref{Environment
Variables}), instead of using actual command-line options: Variables}), instead of using actual command-line options:
@ftable @code @ftable @code
@item --help @item --help
@itemx -h @itemx -h
Print a summary of all the options, and what they are used for. This Print a summary of all the options, and what they are used for. This
@ -6175,6 +6276,7 @@ precedence over settings in the init file.
@itemx -a @var{STR} @itemx -a @var{STR}
Specify the default account which QIF file postings are assumed to Specify the default account which QIF file postings are assumed to
relate to. relate to.
@end ftable @end ftable
@node Report Filtering, Output Customization, Basic options, Detailed Options Description @node Report Filtering, Output Customization, Basic options, Detailed Options Description
@ -6184,6 +6286,7 @@ These options change which postings affect the outcome of a
report, in ways other than just using regular expressions: report, in ways other than just using regular expressions:
@ftable @code @ftable @code
@item --current @item --current
@itemx -c @itemx -c
Display only transactions occurring on or before the current date. Display only transactions occurring on or before the current date.
@ -6293,6 +6396,7 @@ totals in the @command{balance} report, and the values printed in the
@itemx -T @var{VEXPR} @itemx -T @var{VEXPR}
Set the value expression used for the ``totals'' column in the Set the value expression used for the ``totals'' column in the
@command{register} and @command{balance} reports. @command{register} and @command{balance} reports.
@end ftable @end ftable
@c @node Search Terms, Output Customization, Report Filtering, Detailed Options Description @c @node Search Terms, Output Customization, Report Filtering, Detailed Options Description
@ -6346,6 +6450,7 @@ These options affect only the output, but not which postings are
used to create it: used to create it:
@ftable @code @ftable @code
@item --collapse @item --collapse
@itemx -n @itemx -n
Cause transactions in a @command{register} report with multiple Cause transactions in a @command{register} report with multiple
@ -6600,6 +6705,7 @@ Set the format for the @command{prices} report. The default is:
"%(date) %-8(display_account) %(justify(scrub(display_amount), 12, "%(date) %-8(display_account) %(justify(scrub(display_amount), 12,
2 + 9 + 8 + 12, true, color))\n" 2 + 9 + 8 + 12, true, color))\n"
@end smallexample @end smallexample
@end ftable @end ftable
@node Commodity Reporting, Environment Variables, Output Customization, Detailed Options Description @node Commodity Reporting, Environment Variables, Output Customization, Detailed Options Description
@ -6608,6 +6714,7 @@ Set the format for the @command{prices} report. The default is:
These options affect how commodity values are displayed: These options affect how commodity values are displayed:
@ftable @code @ftable @code
@item --price-db @var{FILE} @item --price-db @var{FILE}
Set the file that is used for recording downloaded commodity prices. Set the file that is used for recording downloaded commodity prices.
It is always read on startup, to determine historical prices. Other It is always read on startup, to determine historical prices. Other
@ -6646,6 +6753,7 @@ value understood by ledger. A sample implementation of a
distribution. Downloaded quote price are then appended to the price distribution. Downloaded quote price are then appended to the price
database, usually specified using the environment variable database, usually specified using the environment variable
@env{LEDGER_PRICE_DB}. @env{LEDGER_PRICE_DB}.
@end ftable @end ftable
There are several different ways that ledger can report the totals it There are several different ways that ledger can report the totals it
@ -6655,6 +6763,7 @@ there are also several ``default'' reports, which will satisfy most
users basic reporting needs: users basic reporting needs:
@ftable @code @ftable @code
@item --quantity @item --quantity
@itemx -O @itemx -O
Report commodity totals (this is the default) Report commodity totals (this is the default)
@ -6671,6 +6780,7 @@ Use the last known value for commodities to calculate final values.
@itemx -G @itemx -G
Report the net gain/loss for all commodities in the report that have Report the net gain/loss for all commodities in the report that have
a price history. a price history.
@end ftable @end ftable
Often you will be more interested in the value of your entire holdings, Often you will be more interested in the value of your entire holdings,
@ -6708,7 +6818,7 @@ One thing many people have wanted to do is to fixate the valuation of
old European currencies in terms of the Euro after a certain date: old European currencies in terms of the Euro after a certain date:
@smallexample @smallexample
= expr commodity == "DM" = expr commodity == "DM"
; VALUE:: date < [Jun 2008] ? market(amount, date, exchange) : 1.44 EUR ; VALUE:: date < [Jun 2008] ? market(amount, date, exchange) : 1.44 EUR
@end smallexample @end smallexample
@ -6790,6 +6900,7 @@ example, then it will balance against that specific price for AAPL.
Normally when you use @code{-X @var{COMMODITY}} to request that Normally when you use @code{-X @var{COMMODITY}} to request that
amounts be reported in a specific commodity, Ledger uses these values: amounts be reported in a specific commodity, Ledger uses these values:
@itemize @itemize
@item Register Report @item Register Report
@ -6799,6 +6910,7 @@ end of today's value is different from the value of the last posting.
@item Balance Report @item Balance Report
For the balance report, use the value of that commodity as of today. For the balance report, use the value of that commodity as of today.
@end itemize @end itemize
You can now specify @code{-H} to ask that all valuations for any You can now specify @code{-H} to ask that all valuations for any
@ -7048,15 +7160,20 @@ Ledger uses value expressions to make calculations for many different
purposes: purposes:
@enumerate @enumerate
@item @item
The values displayed in reports The values displayed in reports
@item @item
For predicates (where truth is anything non-zero), to determine which For predicates (where truth is anything non-zero), to determine which
postings are calculated (@code{-l}) or displayed (@code{-d}). postings are calculated (@code{-l}) or displayed (@code{-d}).
@item @item
For sorting criteria, to yield the sort key. For sorting criteria, to yield the sort key.
@item @item
In the matching criteria used by automated postings. In the matching criteria used by automated postings.
@end enumerate @end enumerate
Value expressions support most simple math and logic operators, in Value expressions support most simple math and logic operators, in
@ -7111,6 +7228,7 @@ accounts, often with a subtle difference in meaning. The use of each
variable for both is specified. variable for both is specified.
@table @code @table @code
@item t @item t
This maps to whatever the user specified with @code{-t}. In a This maps to whatever the user specified with @code{-t}. In a
register report, @code{-t} changes the value column; in a balance register report, @code{-t} changes the value column; in a balance
@ -7125,6 +7243,7 @@ not specified, the current report style's value expression is used.
@item m @item m
This is always the present moment/date. This is always the present moment/date.
@end table @end table
@menu @menu
@ -7136,6 +7255,7 @@ This is always the present moment/date.
@subsection Posting/account details @subsection Posting/account details
@table @code @table @code
@item d @item d
A posting's date, as the number of seconds past the epoch. This A posting's date, as the number of seconds past the epoch. This
is always ``today'' for an account. is always ``today'' for an account.
@ -7171,12 +7291,14 @@ account.
@item Z @item Z
@samp{1} if a posting is not automated, @samp{0} otherwise. @samp{1} if a posting is not automated, @samp{0} otherwise.
@end table @end table
@node Calculated totals, , Posting/account details, Variables @node Calculated totals, , Posting/account details, Variables
@subsection Calculated totals @subsection Calculated totals
@table @code @table @code
@item O @item O
The total of all postings seen so far, or the total of an account The total of all postings seen so far, or the total of an account
and all its children. and all its children.
@ -7197,6 +7319,7 @@ all its children.
The total net gain (market value minus cost basis), for a series of The total net gain (market value minus cost basis), for a series of
postings, or an account and its children. It is the same as postings, or an account and its children. It is the same as
@samp{V-B}. @samp{V-B}.
@end table @end table
@node Functions, Operators, Variables, Value Expressions @node Functions, Operators, Variables, Value Expressions
@ -7205,6 +7328,7 @@ postings, or an account and its children. It is the same as
The available one letter functions are: The available one letter functions are:
@table @code @table @code
@item - @item -
Negates the argument. Negates the argument.
@ -7222,6 +7346,7 @@ The arithmetic mean of the argument; @samp{Ax} is the same as
The present market value of the argument. The syntax @samp{P(x,d)} is The present market value of the argument. The syntax @samp{P(x,d)} is
supported, which yields the market value at time @samp{d}. If no date supported, which yields the market value at time @samp{d}. If no date
is given, then the current moment is used. is given, then the current moment is used.
@end table @end table
@node Operators, Complex Expressions, Functions, Value Expressions @node Operators, Complex Expressions, Functions, Value Expressions
@ -7277,6 +7402,7 @@ The binary and ternary operators, in order of precedence, are:
More complicated expressions are possible using: More complicated expressions are possible using:
@table @code @table @code
@item NUM @item NUM
A plain integer represents a commodity-less amount. A plain integer represents a commodity-less amount.
@ -7316,6 +7442,7 @@ precedence order of operators.
@item [DATE] @item [DATE]
Useful specifying a date in plain terms. For example, you could say Useful specifying a date in plain terms. For example, you could say
@code{[2004/06/01]}. @code{[2004/06/01]}.
@end table @end table
@menu @menu
@ -7447,12 +7574,16 @@ a maximum width is given, the substituted text will never be wider
than this, and will be truncated to fit. Here are some examples: than this, and will be truncated to fit. Here are some examples:
@table @code @table @code
@item %-20P @item %-20P
A transaction's payee, left justified and padded to 20 characters wide. A transaction's payee, left justified and padded to 20 characters wide.
@item %20P @item %20P
The same, right justified, at least 20 chars wide. The same, right justified, at least 20 chars wide.
@item %.20P @item %.20P
The same, no more than 20 chars wide. The same, no more than 20 chars wide.
@end table @end table
The expression following the format constraints can be a single letter, The expression following the format constraints can be a single letter,
@ -7464,6 +7595,7 @@ or an expression enclosed in parentheses or brackets.
The allowable expressions are: The allowable expressions are:
@table @code @table @code
@item % @item %
Inserts a percent sign. Inserts a percent sign.
@ -7560,6 +7692,7 @@ The @samp{%/} construct is special. It separates a format string
between what is printed for the first posting of a transaction, and between what is printed for the first posting of a transaction, and
what is printed for all subsequent postings. If not used, the what is printed for all subsequent postings. If not used, the
same format string is used for all postings. same format string is used for all postings.
@end table @end table
@node --balance-format, Formatting codes, Format Expressions, Format Strings @node --balance-format, Formatting codes, Format Expressions, Format Strings
@ -7654,21 +7787,29 @@ terminal character colors and font highlights in a normal TTY session.
The following functions allow you to manipulate and format dates. The following functions allow you to manipulate and format dates.
@table @code @table @code
@item date @item date
Return the date of the current transaction Return the date of the current transaction
@item format_date(date, "FORMAT_STRING") @item format_date(date, "FORMAT_STRING")
Format the date using the given format string. Format the date using the given format string.
@item now @item now
Return the current date and time. If the @code{--now @var{DATE}} Return the current date and time. If the @code{--now @var{DATE}}
option is defined it will return that value. option is defined it will return that value.
@item today @item today
Return the current date. If the @code{--now @var{DATE}} option is Return the current date. If the @code{--now @var{DATE}} option is
defined it will return that value. defined it will return that value.
@item to_datetime @item to_datetime
Convert a string to a date-time value Convert a string to a date-time value
@item to_date @item to_date
Convert a string to date value Convert a string to date value
@item value_date @item value_date
@end table @end table
@menu @menu
@ -7696,6 +7837,7 @@ Dates are formed from a combination of day, month and year codes, in
whatever order you prefer: whatever order you prefer:
@table @code @table @code
@item %Y @item %Y
Four digit year Four digit year
@ -7707,6 +7849,7 @@ Two digit month
@item %d @item %d
Two digit date Two digit date
@end table @end table
@noindent @noindent
@ -7720,31 +7863,41 @@ You can have additional weekday information in your date with @samp{%A}
as as
@table @code @table @code
@item %m-%d-%Y %A @item %m-%d-%Y %A
yields @code{02-10-2010 Wednesday} yields @code{02-10-2010 Wednesday}
@item %A %m-%d-%Y @item %A %m-%d-%Y
yields @code{Wednesday 02-10-2010} yields @code{Wednesday 02-10-2010}
@end table @end table
@noindent @noindent
These are options you can select for weekday These are options you can select for weekday
@table @code @table @code
@item %a @item %a
weekday, abbreviated Wed weekday, abbreviated Wed
@item %A @item %A
weekday, full Wednesday weekday, full Wednesday
@item %d @item %d
day of the month (dd), zero padded 10 day of the month (dd), zero padded 10
@item %e @item %e
day of the month (dd) 10 day of the month (dd) 10
@item %j @item %j
day of year, zero padded 000-366 day of year, zero padded 000-366
@item %u @item %u
day of week starting with Monday (1), i.e. @code{mtwtfss} 3 day of week starting with Monday (1), i.e. @code{mtwtfss} 3
@item %w @item %w
day of week starting with Sunday (0), i.e. @code{smtwtfs} 3 day of week starting with Sunday (0), i.e. @code{smtwtfs} 3
@end table @end table
@node Month, Miscellaneous Date Codes, Weekdays, Date and Time Format Codes @node Month, Miscellaneous Date Codes, Weekdays, Date and Time Format Codes
@ -7754,17 +7907,20 @@ You can have additional month information in your date with @samp{%B}
as as
@table @code @table @code
@item %m-%d-%Y %B @item %m-%d-%Y %B
yields @code{02-10-2010 February} yields @code{02-10-2010 February}
@item %B %m-%d-%Y @item %B %m-%d-%Y
yields @code{February 02-10-2010} yields @code{February 02-10-2010}
@end table @end table
@noindent @noindent
These are options you can select for month These are options you can select for month
@table @code @table @code
@item %m @item %m
@samp{mm} month as two digits @samp{mm} month as two digits
@ -7774,6 +7930,7 @@ as @samp{Feb}
@item %B @item %B
Locales full month, variable length February Locales full month, variable length February
@end table @end table
@node Miscellaneous Date Codes, , Month, Date and Time Format Codes @node Miscellaneous Date Codes, , Month, Date and Time Format Codes
@ -7782,20 +7939,28 @@ Locales full month, variable length February
Additional date format parameters which can be used: Additional date format parameters which can be used:
@table @code @table @code
@item %U @item %U
week number Sunday as first day of week 0153 week number Sunday as first day of week 0153
@item %W @item %W
week number Monday as first day of week 0153 week number Monday as first day of week 0153
@item %V @item %V
week of the year 0153 week of the year 0153
@item %C @item %C
@code{cc} century 0099 @code{cc} century 0099
@item %D @item %D
yields @code{mm/dd/yy 02/10/10} yields @code{mm/dd/yy 02/10/10}
@item %x @item %x
locales date representation @code{02/10/2010} for the U.S. locales date representation @code{02/10/2010} for the U.S.
@item %F @item %F
yields @code{%Y-%m-%d 2010-02-10} yields @code{%Y-%m-%d 2010-02-10}
@end table @end table
@menu @menu
@ -7810,6 +7975,7 @@ yields @code{%Y-%m-%d 2010-02-10}
The following format functions allow you limited formatting of text: The following format functions allow you limited formatting of text:
@table @code @table @code
@item ansify_if(value, color) @item ansify_if(value, color)
Surrounds the string representing value with ANSI codes to give it Surrounds the string representing value with ANSI codes to give it
@code{color} on an TTY display. Has no effect if directed to a file. @code{color} on an TTY display. Has no effect if directed to a file.
@ -7833,6 +7999,7 @@ Return @code{STR} surrounded by double quotes, @code{"STR"}.
@item strip(value) @item strip(value)
Values can have numerous annotations, such as effective dates and lot Values can have numerous annotations, such as effective dates and lot
prices. @code{strip} removes these annotations. prices. @code{strip} removes these annotations.
@end table @end table
@node Data File Parsing Information, , Text Formatting, Formatting codes @node Data File Parsing Information, , Text Formatting, Formatting codes
@ -7843,20 +8010,26 @@ regarding the coordinates of entries in the source data file(s) that
generated the posting. generated the posting.
@table @code @table @code
@item filename @item filename
name of ledger data file from whence posting came, abbreviated @samp{S} name of ledger data file from whence posting came, abbreviated @samp{S}
@item beg_pos @item beg_pos
character position in @code{filename} where entry for posting begins, character position in @code{filename} where entry for posting begins,
abbreviated @samp{B} abbreviated @samp{B}
@item end_pos @item end_pos
character position in @code{filename} where entry for posting ends, character position in @code{filename} where entry for posting ends,
abbreviated @samp{E} abbreviated @samp{E}
@item beg_line @item beg_line
line number in @code{filename} where entry for posting begins, line number in @code{filename} where entry for posting begins,
abbreviated @samp{b} abbreviated @samp{b}
@item end_line @item end_line
line number in @code{filename} where posting's entry for posting ends, line number in @code{filename} where posting's entry for posting ends,
abbreviated @samp{e} abbreviated @samp{e}
@end table @end table
@node Extending with Python, Ledger for Developers, Format Strings, Top @node Extending with Python, Ledger for Developers, Format Strings, Top
@ -8039,6 +8212,7 @@ modularity.
Those tiers are: Those tiers are:
@itemize @itemize
@item Utility code @item Utility code
There's lots of general utility in Ledger for doing time parsing, There's lots of general utility in Ledger for doing time parsing,
@ -8248,6 +8422,7 @@ Application object.
This creates the global scope object, performs error reporting, and This creates the global scope object, performs error reporting, and
handles command-line options which must precede even the creation of handles command-line options which must precede even the creation of
the global scope, such as @code{--debug}. the global scope, such as @code{--debug}.
@end itemize @end itemize
And that's Ledger in a nutshell. All the rest are details, such as And that's Ledger in a nutshell. All the rest are details, such as
@ -8565,6 +8740,7 @@ These options are primarily for Ledger developers, but may be of some
use to a user trying something new. use to a user trying something new.
@ftable @code @ftable @code
@item --args-only @item --args-only
Ignore init files and environment variables for the ledger run. Ignore init files and environment variables for the ledger run.
@ -8631,6 +8807,7 @@ FIX THIS ENTRY @c FIXME thdox
@item --version @item --version
Print version information and exit. Print version information and exit.
@end ftable @end ftable
@node Pre-commands, , Debug Options, Developer Commands @node Pre-commands, , Debug Options, Developer Commands
@ -8643,6 +8820,7 @@ is that pre-commands ignore the journal data file completely, nor is
the user's init file read. the user's init file read.
@ftable @code @ftable @code
@item eval @var{VEXPR} @item eval @var{VEXPR}
Evaluate the given value expression against the model transaction Evaluate the given value expression against the model transaction
@ -8728,6 +8906,7 @@ FIX THIS ENTRY @c FIXME thdox
@item template @item template
Shows the insertion template that a @code{draft} or @code{xact} Shows the insertion template that a @code{draft} or @code{xact}
sub-command generates. This is a debugging command. sub-command generates. This is a debugging command.
@end ftable @end ftable
@node Ledger Development Environment, , Developer Commands, Ledger for Developers @node Ledger Development Environment, , Developer Commands, Ledger for Developers
@ -8784,11 +8963,14 @@ for example, issue @code{ctest -V -R "5FB"}.
@chapter Major Changes from version 2.6 @chapter Major Changes from version 2.6
@itemize @itemize
@item @item
OFX support has been removed from Ledger 3.0 OFX support has been removed from Ledger 3.0
@item @item
Single character value expressions are deprecated and should be changed Single character value expressions are deprecated and should be changed
to the new value expressions available in 3.0 to the new value expressions available in 3.0
@end itemize @end itemize
@node Example Data File, Miscellaneous Notes, Major Changes from version 2.6, Top @node Example Data File, Miscellaneous Notes, Major Changes from version 2.6, Top