Merge branch 'master' of github.com:simonmichael/hledger

This commit is contained in:
Simon Michael 2013-04-16 13:18:53 -07:00
commit 556a7a1a01
3 changed files with 29 additions and 24 deletions

View File

@ -881,14 +881,16 @@ the following:
- `REGEX` - match account names by this regular expression - `REGEX` - match account names by this regular expression
- `acct:REGEX` - same as above - `acct:REGEX` - same as above
- `amt:<N`, `amt:=N`, `amt:>N` - match postings with a single-commodity amount less than, greater than or equal to N. (Multi-commodity amounts are always matched.)
- `code:REGEX` - match by transaction code (eg check number) - `code:REGEX` - match by transaction code (eg check number)
- `desc:REGEX` - match transaction descriptions by regular expression - `desc:REGEX` - match transaction descriptions by regular expression
- `date:PERIODEXPR` - match dates within the specified [period](#period-expressions) - `date:PERIODEXPR` - match dates within the specified [period](#period-expressions)
- `edate:PERIODEXPR` - as above, but match secondary dates - `date2:PERIODEXPR` - as above, but match secondary dates
- `status:1` or `status:0` - match cleared/uncleared transactions
- `tag:NAME[=REGEX]` - match by (exact, case sensitive) [tag](#tags) name, and optionally match the tag value by regular expression - `tag:NAME[=REGEX]` - match by (exact, case sensitive) [tag](#tags) name, and optionally match the tag value by regular expression
- `depth:N` - match (or display, depending on command) accounts at or above this [depth](#depth-limiting) - `depth:N` - match (or display, depending on command) accounts at or above this [depth](#depth-limiting)
- `status:1` or `status:0` - match cleared/uncleared transactions
- `real:1` or `real:0` - match real/virtual-ness
- `empty:1` or `empty:0` - match if amount is/is not zero
- `amt:<N`, `amt:=N`, `amt:>N` - match postings with a single-commodity amount less than, greater than or equal to N. (Multi-commodity amounts are always matched.)
- `not:` before any of the above negates the match - `not:` before any of the above negates the match
<!-- <!--
@ -918,10 +920,12 @@ With the [print](#print) command, they select transactions which
> *have no postings matching any of the negative account terms AND* > *have no postings matching any of the negative account terms AND*
> *match all the other terms* > *match all the other terms*
Query expressions (mostly) work the same way on the command line and [web](#web) interfaces. Many of the query terms above have equivalent command-line flags which predate them.
Note that many query terms have equivalent (older) command-line flags. You can mix and match query arguments and flags, just note that a
You can mix and match query arguments and flags, but note that [period expression](#period-expressions) overrides any other date terms.
[period expressions](#period-expressions) override other date queries.
The same query syntax should work in both the command line and [web](#web) interfaces.
### Smart dates ### Smart dates

View File

@ -72,38 +72,39 @@ searchform :: ViewData -> HtmlUrl AppRoute
searchform VD{..} = [hamlet| searchform VD{..} = [hamlet|
<div#searchformdiv> <div#searchformdiv>
<form#searchform.form method=GET> <form#searchform.form method=GET>
<table> <table width="100%">
<tr> <tr>
<td> <td width="99%">
Search: <input name=q value=#{q} style="width:98%;">
\ # <td width="1%">
<td>
<input name=q size=70 value=#{q}>
<input type=submit value="Search"> <input type=submit value="Search">
<tr valign=top>
<td colspan=2 style="text-align:right;">
$if filtering $if filtering
\ # \ #
<span.showall> <span.showall>
<a href=@{here}>clear search <a href=@{here}>clear
\ # \ #
<a#search-help-link href="#" title="Toggle search help">help <a#search-help-link href="#" title="Toggle search help">help
<tr> <tr>
<td> <td colspan=2>
<td>
<div#search-help.help style="display:none;"> <div#search-help.help style="display:none;">
Leave blank to see journal (all transactions), or click account links to see transactions under that account. Leave blank to see journal (all transactions), or click account links to see transactions under that account.
<br> <br>
Transactions/postings may additionally be filtered by: Transactions/postings may additionally be filtered by
<br>
acct:REGEXP (target account), # acct:REGEXP (target account), #
code:REGEXP (transaction code), #
desc:REGEXP (description), # desc:REGEXP (description), #
date:PERIODEXP (date), # date:PERIODEXP (date), #
edate:PERIODEXP (secondary date), # date2:PERIODEXP (secondary date), #
<br> tag:TAG[=REGEX] (tag and optionally tag value), #
status:BOOL (cleared status), # depth:N (accounts at or above this depth), #
status:*, status:!, status: (cleared status), #
real:BOOL (real/virtual-ness), # real:BOOL (real/virtual-ness), #
empty:BOOL (posting amount = 0). empty:BOOL (is amount zero), #
amt:<N, amt:=N, amt:>N (test magnitude of single-commodity amount).
<br> <br>
not: to negate, enclose space-containing patterns in quotes, multiple filters are AND'ed. Prepend not: to negate, enclose multi-word patterns in quotes, multiple search terms are AND'ed.
|] |]
where where
filtering = not $ null q filtering = not $ null q

View File

@ -87,7 +87,7 @@ body { margin:0; }
.navlinkcurrent { font-weight:bold; } .navlinkcurrent { font-weight:bold; }
.form { margin:0em; } .form { margin:0em; }
#searchformdiv { margin:0 0 1em 0; white-space:nowrap; } #searchformdiv { margin:0 0 1em 0; }
#searchform { margin:0; } #searchform { margin:0; }
#searchform span { padding:4px; } #searchform span { padding:4px; }
#stopfilterlink { font-weight:bold; } #stopfilterlink { font-weight:bold; }