summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-14 07:20:23 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-14 07:20:23 -0400
commitc367dcab82c52283183008b27fe144a82e15ce90 (patch)
tree660a815387e86837361e7da0c3542f74d00ed60d
parentd11ff330744b7af8d5f9c378243f3f5c4fa715b8 (diff)
downloadfork-ledger-c367dcab82c52283183008b27fe144a82e15ce90.tar.gz
fork-ledger-c367dcab82c52283183008b27fe144a82e15ce90.tar.bz2
fork-ledger-c367dcab82c52283183008b27fe144a82e15ce90.zip
Improved algorithm for abbreviating account names
-rw-r--r--src/format.cc155
-rw-r--r--test/baseline/opt-abbrev-len.test4
-rw-r--r--test/baseline/opt-account.test4
-rw-r--r--test/baseline/opt-amount-width.test4
-rw-r--r--test/baseline/opt-amount.test4
-rw-r--r--test/baseline/opt-collapse-if-zero.test4
-rw-r--r--test/baseline/opt-columns.test4
-rw-r--r--test/baseline/opt-commodity-as-account.test4
-rw-r--r--test/baseline/opt-commodity-as-payee.test4
-rw-r--r--test/baseline/opt-date-format.test4
-rw-r--r--test/baseline/opt-date-width.test4
-rw-r--r--test/baseline/opt-empty.test4
-rw-r--r--test/baseline/opt-gain.test12
-rw-r--r--test/baseline/opt-input-date-format.test4
-rw-r--r--test/baseline/opt-invert.test4
-rw-r--r--test/baseline/opt-market.test14
-rw-r--r--test/baseline/opt-output.test4
-rw-r--r--test/baseline/opt-pager.test4
-rw-r--r--test/baseline/opt-payee-as-account.test10
-rw-r--r--test/baseline/opt-payee-width.test4
-rw-r--r--test/baseline/opt-payee.test4
-rw-r--r--test/baseline/opt-quantity.test4
-rw-r--r--test/baseline/opt-revalued.test14
-rw-r--r--test/baseline/opt-sort-all.test28
-rw-r--r--test/baseline/opt-sort-xacts.test76
-rw-r--r--test/baseline/opt-sort.test166
-rw-r--r--test/baseline/opt-subtotal.test4
-rw-r--r--test/baseline/opt-total-width.test4
-rw-r--r--test/baseline/opt-total.test4
-rw-r--r--test/regress/04C5E1CA.test4
-rw-r--r--test/regress/727B2DF8.test6
-rw-r--r--test/regress/86D2BDC4.test2
-rw-r--r--test/regress/D943AE0F.test2
-rw-r--r--test/regress/E4C9A8EA.test12
34 files changed, 354 insertions, 231 deletions
diff --git a/src/format.cc b/src/format.cc
index ae40e1c3..946dcf80 100644
--- a/src/format.cc
+++ b/src/format.cc
@@ -432,6 +432,23 @@ string format_t::truncate(const unistring& ustr,
case ABBREVIATE:
if (account_abbrev_length > 0) {
+ // The algorithm here is complex, but aims to preserve the most
+ // information in the most useful places.
+ //
+ // Consider: You have an account name like
+ // 'Assets:Banking:Check:Register'. This account name, which is
+ // 29 characters long, must be shortened to fit in 20. How would
+ // you shorten it?
+ //
+ // The approach taken below is to compute the difference, or 9
+ // characters, and then distribute this difference semi-evenly
+ // among first three segments of the account name, by taking
+ // characters until the difference is gone. Further, earlier
+ // segments will give up more of their share of letters than later
+ // segments, since the later segments usually contain more useful
+ // information.
+
+ // First, chop up the Unicode string into individual segments.
std::list<string> parts;
string::size_type beg = 0;
string strcopy(ustr.extract());
@@ -441,34 +458,140 @@ string format_t::truncate(const unistring& ustr,
parts.push_back(string(strcopy, beg, pos - beg));
parts.push_back(string(strcopy, beg));
- std::ostringstream result;
-
- std::size_t newlen = len;
+ DEBUG("format.abbrev", "Account name: " << strcopy);
+ DEBUG("format.abbrev",
+ "Must fit a " << len << " char string in " << width << " chars");
+
+ // Figure out the lengths of all the parts. The last part is
+ // always displayed in full, while the former parts are
+ // distributed, with the latter parts being longer than the
+ // former, but with none shorter than account_abbrev_length.
+ std::list<std::size_t> lens;
+#if defined(DEBUG_ON)
+ int index = 0;
+#endif
for (std::list<string>::iterator i = parts.begin();
i != parts.end();
i++) {
- // Don't contract the last element
+ std::size_t l = unistring(*i).length();
+ DEBUG("format.abbrev",
+ "Segment " << ++index << " is " << l << " chars wide");
+ lens.push_back(l);
+ }
+
+ // Determine the "overflow", or how many chars in excess we are.
+
+ std::size_t overflow = len - width;
+ DEBUG("format.abbrev",
+ "There are " << overflow << " chars of overflow");
+
+ // Walk through the first n-1 segments, and start subtracting
+ // letters to decrease the overflow. This is done in multiple
+ // passes until the overflow is gone, or we cannot reduce any
+ // further. The calculation to find the amount to remove is:
+ //
+ // overflow * (((len(segment) + counter) * iteration) /
+ // (len(string) - len(last_segment) - counter))
+ //
+ // Where:
+ // overflow - the amount that needs to be removed
+ // counter - starts at n-1 for the first segment, then
+ // decreases by one until it reaches 0 for the
+ // last segment (which is never shortened).
+ // This value is used to weight the shrinkage
+ // so that earlier segments shrink faster.
+ // iteration - starts at 1, increase by 1 for every
+ // iteration of the loop
+ //
+ // In the example above, we have this account name:
+ //
+ // Assets:Banking:Check:Register
+ //
+ // Therefore, the amount to be removed from Assets is calculated as:
+ //
+ // 9 * (((6 + 3) * 1) / (29 - 8 - 3)) = ceil(4.5) = 5
+ //
+ // However, since removing 5 chars would make the length of the
+ // segment shorter than the default minimum of 2, we can only
+ // remove 4 chars from Assets to reduce the overflow. And on it
+ // goes.
+ //
+ // The final result will be: As:Ban:Chec:Register
+
+ std::size_t iteration = 1;
+ std::size_t len_minus_last = len - lens.back();
+ while (overflow > 0) {
+ std::size_t overflow_at_start = overflow;
+ DEBUG("format.abbrev",
+ "Overflow starting at " << overflow << " chars");
+#if defined(DEBUG_ON)
+ index = 0;
+#endif
+ std::size_t counter = lens.size();
+ for (std::list<std::size_t>::iterator i = lens.begin();
+ i != lens.end();
+ i++) {
+ if (--counter == 0 || overflow == 0)
+ break;
+ DEBUG("format.abbrev", "Overflow is " << overflow << " chars");
+ std::size_t adjust;
+ if (overflow == 1)
+ adjust = 1;
+ else
+ adjust = std::size_t
+ (std::ceil(double(overflow) *
+ ((double(*i + counter) * double(iteration)) /
+ (double(len_minus_last) - double(counter)))));
+ DEBUG("format.abbrev", "Weight calc: (" << overflow
+ << " * (((" << *i << " + " << counter << ") * "
+ << iteration << ") / (" << len_minus_last
+ << " - " << counter << ")))");
+ if (adjust == 0)
+ adjust = 1;
+ else if (adjust > overflow)
+ adjust = overflow;
+ DEBUG("format.abbrev", "The weighted part is " << adjust << " chars");
+ std::size_t slack = *i - std::min(*i, account_abbrev_length);
+ if (adjust > slack)
+ adjust = slack;
+ if (adjust > 0) {
+ DEBUG("format.abbrev",
+ "Reducing segment " << ++index << " by " << adjust << " chars");
+ (*i) -= adjust;
+ DEBUG("format.abbrev",
+ "Segment " << index << " is now " << *i << " chars wide");
+ overflow -= adjust;
+ DEBUG("format.abbrev", "Overflow is now " << overflow << " chars");
+ }
+ }
+ DEBUG("format.abbrev",
+ "Overflow ending this time at " << overflow << " chars");
+ if (overflow == overflow_at_start)
+ break;
+ iteration++;
+ }
+
+ assert(parts.size() == lens.size());
+
+ std::list<string>::iterator i = parts.begin();
+ std::list<std::size_t>::iterator l = lens.begin();
+ std::ostringstream result;
+
+ for (; i != parts.end() && l != lens.end(); i++, l++) {
std::list<string>::iterator x = i;
if (++x == parts.end()) {
result << *i;
break;
}
- if (newlen > width) {
- unistring temp(*i);
- if (temp.length() > account_abbrev_length) {
- result << temp.extract(0, account_abbrev_length) << ":";
- newlen -= temp.length() - account_abbrev_length;
- } else {
- result << temp.extract() << ":";
- newlen -= temp.length();
- }
- } else {
+ unistring temp(*i);
+ if (temp.length() > *l)
+ result << temp.extract(0, *l) << ":";
+ else
result << *i << ":";
- }
}
- if (newlen > width) {
+ if (overflow > 0) {
// Even abbreviated its too big to show the last account, so
// abbreviate all but the last and truncate at the beginning.
unistring temp(result.str());
diff --git a/test/baseline/opt-abbrev-len.test b/test/baseline/opt-abbrev-len.test
index 40313b22..59164163 100644
--- a/test/baseline/opt-abbrev-len.test
+++ b/test/baseline/opt-abbrev-len.test
@@ -4,8 +4,8 @@ reg --abbrev-len=4
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX Asse:Inve:Vang:VMMXX 0.350 VMMXX 0.350 VMMXX
- Inco:Divi:Vang:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX Asse:Inve:Vangua:VMMXX 0.350 VMMXX 0.350 VMMXX
+ Inco:Divi:Vangua:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-account.test b/test/baseline/opt-account.test
index 10176fde..e577d72b 100644
--- a/test/baseline/opt-account.test
+++ b/test/baseline/opt-account.test
@@ -4,8 +4,8 @@ reg --account='payee + ":" + commodity'
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX RD:VM:As:In:Va:VMMXX 0.350 VMMXX 0.350 VMMXX
-07-Feb-02 RD VMMXX RD:$:In:Di:Va:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX RD:VM:As:In:Vang:VMMXX 0.350 VMMXX 0.350 VMMXX
+07-Feb-02 RD VMMXX RD:$:In:Di:Vangu:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-amount-width.test b/test/baseline/opt-amount-width.test
index 32282214..c79229dc 100644
--- a/test/baseline/opt-amount-width.test
+++ b/test/baseline/opt-amount-width.test
@@ -4,8 +4,8 @@ reg --amount-width=18
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX As:Investm:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+ In:Dividen:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-amount.test b/test/baseline/opt-amount.test
index 2ebbf055..36107fa8 100644
--- a/test/baseline/opt-amount.test
+++ b/test/baseline/opt-amount.test
@@ -4,7 +4,7 @@ reg --amount=10
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 10 10
- In:Di:Vanguard:VMMXX 10 20
+07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 10 10
+ In:Divid:Vanguar:VMMXX 10 20
>>>2
=== 0
diff --git a/test/baseline/opt-collapse-if-zero.test b/test/baseline/opt-collapse-if-zero.test
index fb4d33fd..ec3aa6d3 100644
--- a/test/baseline/opt-collapse-if-zero.test
+++ b/test/baseline/opt-collapse-if-zero.test
@@ -8,8 +8,8 @@ reg --collapse-if-zero
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+ In:Divid:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-columns.test b/test/baseline/opt-columns.test
index 4dc28d9b..ae8145b9 100644
--- a/test/baseline/opt-columns.test
+++ b/test/baseline/opt-columns.test
@@ -4,8 +4,8 @@ reg --columns=100
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:Investments:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Dividends:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX Asse:Investment:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
+ Incom:Dividends:Vanguard:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-commodity-as-account.test b/test/baseline/opt-commodity-as-account.test
index 2e723347..8fa813fd 100644
--- a/test/baseline/opt-commodity-as-account.test
+++ b/test/baseline/opt-commodity-as-account.test
@@ -4,8 +4,8 @@ reg --account=commodity
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX VM:As:In:Va:VMMXX 0.350 VMMXX 0.350 VMMXX
-07-Feb-02 RD VMMXX $:In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX VM:As:Inve:Vangu:VMMXX 0.350 VMMXX 0.350 VMMXX
+07-Feb-02 RD VMMXX $:In:Divi:Vangua:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-commodity-as-payee.test b/test/baseline/opt-commodity-as-payee.test
index 2f829b4a..dbc91b72 100644
--- a/test/baseline/opt-commodity-as-payee.test
+++ b/test/baseline/opt-commodity-as-payee.test
@@ -4,8 +4,8 @@ reg --payee=commodity
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
-07-Feb-02 $ In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+07-Feb-02 $ In:Divid:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-date-format.test b/test/baseline/opt-date-format.test
index b4e1a332..0d3ee6fa 100644
--- a/test/baseline/opt-date-format.test
+++ b/test/baseline/opt-date-format.test
@@ -4,8 +4,8 @@ reg --date-format='%Y'
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-2007 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Di:Vanguard:VMMXX $-0.35 $-0.35
+2007 RD VMMXX As:Investm:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+ In:Dividen:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-date-width.test b/test/baseline/opt-date-width.test
index 47652099..c7aa7731 100644
--- a/test/baseline/opt-date-width.test
+++ b/test/baseline/opt-date-width.test
@@ -4,8 +4,8 @@ reg --date-width=20
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX As:Investm:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+ In:Dividen:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-empty.test b/test/baseline/opt-empty.test
index 507767ed..7bf830a9 100644
--- a/test/baseline/opt-empty.test
+++ b/test/baseline/opt-empty.test
@@ -24,13 +24,13 @@ reg --empty
Assets:Cash $-10.00 0
08-Jan-01 January Expenses:One:Books $10.00 $10.00
Expenses:One:Two:Books $10.00 $20.00
- Ex:One:Two:Three:Books $10.00 $30.00
+ Expe:On:Tw:Three:Books $10.00 $30.00
Assets:Cash $-30.00 0
08-Jan-01 January Assets:Cash 0 0
Income:Books 0 0
08-Jan-01 January Assets:Cash $30.00 $30.00
Income:One:Books $-10.00 $20.00
Income:One:Two:Books $-10.00 $10.00
- In:One:Two:Three:Books $-10.00 0
+ Inc:On:Two:Three:Books $-10.00 0
>>>2
=== 0
diff --git a/test/baseline/opt-gain.test b/test/baseline/opt-gain.test
index 6d139c79..d2e9abfe 100644
--- a/test/baseline/opt-gain.test
+++ b/test/baseline/opt-gain.test
@@ -51,16 +51,16 @@ P 2010/04/01 00:00:00 S 16 P
>>>1
09-Jan-15 Commodities revalued <Revalued> 100 P 100 P
09-Feb-01 Commodities revalued <Revalued> 200 P 300 P
-09-Feb-01 Sample 2a As:Brokerage:Stocks 300 P 600 P
+09-Feb-01 Sample 2a Asset:Brokerage:Stocks 300 P 600 P
09-Mar-01 Commodities revalued <Revalued> 800 P 1400 P
-09-Mar-01 Sample 3a As:Brokerage:Stocks 700 P 2100 P
+09-Mar-01 Sample 3a Asset:Brokerage:Stocks 700 P 2100 P
09-Apr-01 Commodities revalued <Revalued> 2400 P 4500 P
-09-Apr-01 Sample 4a As:Brokerage:Stocks -1500 P 3000 P
+09-Apr-01 Sample 4a Asset:Brokerage:Stocks -1500 P 3000 P
10-Feb-01 Commodities revalued <Revalued> -2400 P 600 P
-10-Feb-01 Sample 2b As:Brokerage:Stocks 300 P 900 P
+10-Feb-01 Sample 2b Asset:Brokerage:Stocks 300 P 900 P
10-Mar-01 Commodities revalued <Revalued> 1200 P 2100 P
-10-Mar-01 Sample 3b As:Brokerage:Stocks 700 P 2800 P
+10-Mar-01 Sample 3b Asset:Brokerage:Stocks 700 P 2800 P
10-Apr-01 Commodities revalued <Revalued> 3200 P 6000 P
-10-Apr-01 Sample 4b As:Brokerage:Stocks -1500 P 4500 P
+10-Apr-01 Sample 4b Asset:Brokerage:Stocks -1500 P 4500 P
>>>2
=== 0
diff --git a/test/baseline/opt-input-date-format.test b/test/baseline/opt-input-date-format.test
index 0ab5e5c9..4e77bc28 100644
--- a/test/baseline/opt-input-date-format.test
+++ b/test/baseline/opt-input-date-format.test
@@ -4,8 +4,8 @@ reg --input-date-format='%m%%%d%%%Y'
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+ In:Divid:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-invert.test b/test/baseline/opt-invert.test
index 9a9f6d02..c010c264 100644
--- a/test/baseline/opt-invert.test
+++ b/test/baseline/opt-invert.test
@@ -4,8 +4,8 @@ reg --invert
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX -0.350 VMMXX -0.350 VMMXX
- In:Di:Vanguard:VMMXX $0.35 $0.35
+07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX -0.350 VMMXX -0.350 VMMXX
+ In:Divid:Vanguar:VMMXX $0.35 $0.35
-0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-market.test b/test/baseline/opt-market.test
index b6c0ed6d..8c5b168a 100644
--- a/test/baseline/opt-market.test
+++ b/test/baseline/opt-market.test
@@ -49,18 +49,18 @@ P 2010/03/01 00:00:00 S 8 P
P 2010/04/01 00:00:00 S 16 P
>>>1
-09-Jan-01 Sample 1a As:Brokerage:Stocks 200 P 200 P
+09-Jan-01 Sample 1a Asset:Brokerage:Stocks 200 P 200 P
09-Feb-01 Commodities revalued <Revalued> 200 P 400 P
-09-Feb-01 Sample 2a As:Brokerage:Stocks 400 P 800 P
+09-Feb-01 Sample 2a Asset:Brokerage:Stocks 400 P 800 P
09-Mar-01 Commodities revalued <Revalued> 800 P 1600 P
-09-Mar-01 Sample 3a As:Brokerage:Stocks 800 P 2400 P
+09-Mar-01 Sample 3a Asset:Brokerage:Stocks 800 P 2400 P
09-Apr-01 Commodities revalued <Revalued> 2400 P 4800 P
-09-Apr-01 Sample 4a As:Brokerage:Stocks -1600 P 3200 P
+09-Apr-01 Sample 4a Asset:Brokerage:Stocks -1600 P 3200 P
10-Feb-01 Commodities revalued <Revalued> -2400 P 800 P
-10-Feb-01 Sample 2b As:Brokerage:Stocks 400 P 1200 P
+10-Feb-01 Sample 2b Asset:Brokerage:Stocks 400 P 1200 P
10-Mar-01 Commodities revalued <Revalued> 1200 P 2400 P
-10-Mar-01 Sample 3b As:Brokerage:Stocks 800 P 3200 P
+10-Mar-01 Sample 3b Asset:Brokerage:Stocks 800 P 3200 P
10-Apr-01 Commodities revalued <Revalued> 3200 P 6400 P
-10-Apr-01 Sample 4b As:Brokerage:Stocks -1600 P 4800 P
+10-Apr-01 Sample 4b Asset:Brokerage:Stocks -1600 P 4800 P
>>>2
=== 0
diff --git a/test/baseline/opt-output.test b/test/baseline/opt-output.test
index 49881fb3..2339a3a1 100644
--- a/test/baseline/opt-output.test
+++ b/test/baseline/opt-output.test
@@ -5,7 +5,7 @@ reg --output=/dev/stderr
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
>>>2
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+ In:Divid:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
=== 0
diff --git a/test/baseline/opt-pager.test b/test/baseline/opt-pager.test
index 2a109ad7..060c4bb8 100644
--- a/test/baseline/opt-pager.test
+++ b/test/baseline/opt-pager.test
@@ -4,8 +4,8 @@ reg --pager=cat
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+ In:Divid:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-payee-as-account.test b/test/baseline/opt-payee-as-account.test
index 6aca0dab..561a6c3b 100644
--- a/test/baseline/opt-payee-as-account.test
+++ b/test/baseline/opt-payee-as-account.test
@@ -22,12 +22,12 @@ reg --account=payee
>>>1
08-Jan-01 January January:Expenses:Books $10.00 $10.00
08-Jan-01 January January:Assets:Cash $-10.00 0
-08-Jan-31 End of January En:Expenses:Books $10.00 $10.00
-08-Jan-31 End of January En:Assets:Cash $-10.00 0
-08-Feb-01 February Fe:Expenses:Books $20.00 $20.00
+08-Jan-31 End of January End of J:Expense:Books $10.00 $10.00
+08-Jan-31 End of January End of Jan:Assets:Cash $-10.00 0
+08-Feb-01 February Februar:Expenses:Books $20.00 $20.00
08-Feb-01 February February:Assets:Cash $-20.00 0
-08-Feb-28 End of February En:Expenses:Books $20.00 $20.00
-08-Feb-28 End of February En:Assets:Cash $-20.00 0
+08-Feb-28 End of February End of F:Expense:Books $20.00 $20.00
+08-Feb-28 End of February End of Feb:Assets:Cash $-20.00 0
08-Mar-01 March March:Expenses:Books $30.00 $30.00
08-Mar-01 March March:Assets:Cash $-30.00 0
>>>2
diff --git a/test/baseline/opt-payee-width.test b/test/baseline/opt-payee-width.test
index a5f61e87..d92dbe00 100644
--- a/test/baseline/opt-payee-width.test
+++ b/test/baseline/opt-payee-width.test
@@ -4,8 +4,8 @@ reg --payee-width=40
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX As:Investm:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+ In:Dividen:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-payee.test b/test/baseline/opt-payee.test
index 56ee0cde..a028bb91 100644
--- a/test/baseline/opt-payee.test
+++ b/test/baseline/opt-payee.test
@@ -4,8 +4,8 @@ reg --payee='account_base + ":" + commodity'
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 VMMXX:VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
-07-Feb-02 VMMXX:$ In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 VMMXX:VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+07-Feb-02 VMMXX:$ In:Divid:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-quantity.test b/test/baseline/opt-quantity.test
index 5de92e84..f8cd0e4c 100644
--- a/test/baseline/opt-quantity.test
+++ b/test/baseline/opt-quantity.test
@@ -4,8 +4,8 @@ reg --quantity
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+ In:Divid:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-revalued.test b/test/baseline/opt-revalued.test
index b68b256b..541a4e02 100644
--- a/test/baseline/opt-revalued.test
+++ b/test/baseline/opt-revalued.test
@@ -49,18 +49,18 @@ P 2010/03/01 00:00:00 S 8 P
P 2010/04/01 00:00:00 S 16 P
>>>1
-09-Jan-01 Sample 1a As:Brokerage:Stocks 200 P 200 P
+09-Jan-01 Sample 1a Asset:Brokerage:Stocks 200 P 200 P
09-Feb-01 Commodities revalued <Revalued> 200 P 400 P
-09-Feb-01 Sample 2a As:Brokerage:Stocks 400 P 800 P
+09-Feb-01 Sample 2a Asset:Brokerage:Stocks 400 P 800 P
09-Mar-01 Commodities revalued <Revalued> 800 P 1600 P
-09-Mar-01 Sample 3a As:Brokerage:Stocks 800 P 2400 P
+09-Mar-01 Sample 3a Asset:Brokerage:Stocks 800 P 2400 P
09-Apr-01 Commodities revalued <Revalued> 2400 P 4800 P
-09-Apr-01 Sample 4a As:Brokerage:Stocks -1600 P 3200 P
+09-Apr-01 Sample 4a Asset:Brokerage:Stocks -1600 P 3200 P
10-Feb-01 Commodities revalued <Revalued> -2400 P 800 P
-10-Feb-01 Sample 2b As:Brokerage:Stocks 400 P 1200 P
+10-Feb-01 Sample 2b Asset:Brokerage:Stocks 400 P 1200 P
10-Mar-01 Commodities revalued <Revalued> 1200 P 2400 P
-10-Mar-01 Sample 3b As:Brokerage:Stocks 800 P 3200 P
+10-Mar-01 Sample 3b Asset:Brokerage:Stocks 800 P 3200 P
10-Apr-01 Commodities revalued <Revalued> 3200 P 6400 P
-10-Apr-01 Sample 4b As:Brokerage:Stocks -1600 P 4800 P
+10-Apr-01 Sample 4b Asset:Brokerage:Stocks -1600 P 4800 P
>>>2
=== 0
diff --git a/test/baseline/opt-sort-all.test b/test/baseline/opt-sort-all.test
index b289f8e8..974f95c4 100644
--- a/test/baseline/opt-sort-all.test
+++ b/test/baseline/opt-sort-all.test
@@ -84,33 +84,33 @@ reg --monthly --sort=-amount
Expenses:Travel:Passport $127.00
Assets:Checking
>>>1
-08-Jan-01 - 08-Jan-31 Ex:Travel:Airfare $222.19 $222.19
+08-Jan-01 - 08-Jan-31 Expense:Travel:Airfare $222.19 $222.19
Liabilities:MasterCard $-222.19 0
-08-Feb-01 - 08-Feb-29 Ex:Travel:Airfare $477.60 $477.60
+08-Feb-01 - 08-Feb-29 Expense:Travel:Airfare $477.60 $477.60
Expenses:Travel:Auto $280.97 $758.57
Liabilities:MasterCard $-758.57 0
-08-Mar-01 - 08-Mar-31 Ex:Travel:Airfare $2,463.20 $2,463.20
+08-Mar-01 - 08-Mar-31 Expense:Travel:Airfare $2,463.20 $2,463.20
Liabilities:MasterCard $-2,463.20 0
-08-Apr-01 - 08-Apr-30 Ex:Travel:Airfare $1,186.14 $1,186.14
+08-Apr-01 - 08-Apr-30 Expense:Travel:Airfare $1,186.14 $1,186.14
Liabilities:MasterCard $-1,186.14 0
-08-Aug-01 - 08-Aug-31 Ex:Travel:Passport $170.00 $170.00
+08-Aug-01 - 08-Aug-31 Expens:Travel:Passport $170.00 $170.00
Liabilities:MasterCard $-170.00 0
-08-Sep-01 - 08-Sep-30 Ex:Travel:Airfare $3,925.94 $3,925.94
+08-Sep-01 - 08-Sep-30 Expense:Travel:Airfare $3,925.94 $3,925.94
Liabilities:MasterCard $-3,925.94 0
-08-Dec-01 - 08-Dec-31 Ex:Travel:Passport $254.00 $254.00
+08-Dec-01 - 08-Dec-31 Expens:Travel:Passport $254.00 $254.00
Assets:Checking $-254.00 0
>>>2
=== 0
reg --monthly --sort-all=-amount
>>>1
-08-Sep-01 - 08-Sep-30 Ex:Travel:Airfare $3,925.94 $3,925.94
-08-Mar-01 - 08-Mar-31 Ex:Travel:Airfare $2,463.20 $6,389.14
-08-Apr-01 - 08-Apr-30 Ex:Travel:Airfare $1,186.14 $7,575.28
-08-Feb-01 - 08-Feb-29 Ex:Travel:Airfare $477.60 $8,052.88
+08-Sep-01 - 08-Sep-30 Expense:Travel:Airfare $3,925.94 $3,925.94
+08-Mar-01 - 08-Mar-31 Expense:Travel:Airfare $2,463.20 $6,389.14
+08-Apr-01 - 08-Apr-30 Expense:Travel:Airfare $1,186.14 $7,575.28
+08-Feb-01 - 08-Feb-29 Expense:Travel:Airfare $477.60 $8,052.88
Expenses:Travel:Auto $280.97 $8,333.85
-08-Dec-01 - 08-Dec-31 Ex:Travel:Passport $254.00 $8,587.85
-08-Jan-01 - 08-Jan-31 Ex:Travel:Airfare $222.19 $8,810.04
-08-Aug-01 - 08-Aug-31 Ex:Travel:Passport $170.00 $8,980.04
+08-Dec-01 - 08-Dec-31 Expens:Travel:Passport $254.00 $8,587.85
+08-Jan-01 - 08-Jan-31 Expense:Travel:Airfare $222.19 $8,810.04
+08-Aug-01 - 08-Aug-31 Expens:Travel:Passport $170.00 $8,980.04
Liabilities:MasterCard $-170.00 $8,810.04
08-Jan-01 - 08-Jan-31 Liabilities:MasterCard $-222.19 $8,587.85
08-Dec-01 - 08-Dec-31 Assets:Checking $-254.00 $8,333.85
diff --git a/test/baseline/opt-sort-xacts.test b/test/baseline/opt-sort-xacts.test
index 4882e18f..5dee9775 100644
--- a/test/baseline/opt-sort-xacts.test
+++ b/test/baseline/opt-sort-xacts.test
@@ -86,27 +86,27 @@ reg --sort=account
>>>1
08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-127.00
08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-254.00
-08-Jan-11 LIAT Ex:Travel:Airfare $40.00 $-214.00
-08-Jan-14 cheaptickets.com Ex:Travel:Airfare $182.19 $-31.81
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $206.99
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $445.79
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $1,677.39
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $2,908.99
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $3,064.85
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $3,220.71
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $3,657.92
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $4,095.13
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $5,007.73
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $5,920.33
-08-Sep-22 AGNT FEE Ex:Travel:Airfare $70.00 $5,990.33
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $6,796.53
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $7,602.73
-08-Sep-22 LIAT 1974 LIMITED Ex:Travel:Airfare $418.34 $8,021.07
+08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $-214.00
+08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $-31.81
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $206.99
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $445.79
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $1,677.39
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $2,908.99
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $3,064.85
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $3,220.71
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $3,657.92
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $4,095.13
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $5,007.73
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $5,920.33
+08-Sep-22 AGNT FEE Expense:Travel:Airfare $70.00 $5,990.33
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $6,796.53
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $7,602.73
+08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $8,021.07
08-Feb-05 CTX Expenses:Travel:Auto $240.38 $8,261.45
08-Feb-22 BUDGET RENT-A-CAR Expenses:Travel:Auto $40.59 $8,302.04
-08-Aug-08 BCIS I-131 FILING F.. Ex:Travel:Passport $170.00 $8,472.04
-08-Dec-26 U.S. Department of .. Ex:Travel:Passport $127.00 $8,599.04
-08-Dec-26 U.S. Department of .. Ex:Travel:Passport $127.00 $8,726.04
+08-Aug-08 BCIS I-131 FILING F.. Expens:Travel:Passport $170.00 $8,472.04
+08-Dec-26 U.S. Department of .. Expens:Travel:Passport $127.00 $8,599.04
+08-Dec-26 U.S. Department of .. Expens:Travel:Passport $127.00 $8,726.04
08-Jan-11 LIAT Liabilities:MasterCard $-40.00 $8,686.04
08-Jan-14 cheaptickets.com Liabilities:MasterCard $-182.19 $8,503.85
08-Feb-05 CTX Liabilities:MasterCard $-240.38 $8,263.47
@@ -130,47 +130,47 @@ reg --sort=account
=== 0
reg --sort-xacts=account
>>>1
-08-Jan-11 LIAT Ex:Travel:Airfare $40.00 $40.00
+08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $40.00
Liabilities:MasterCard $-40.00 0
-08-Jan-14 cheaptickets.com Ex:Travel:Airfare $182.19 $182.19
+08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $182.19
Liabilities:MasterCard $-182.19 0
08-Feb-05 CTX Expenses:Travel:Auto $240.38 $240.38
Liabilities:MasterCard $-240.38 0
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $238.80
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $238.80
Liabilities:MasterCard $-238.80 0
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $238.80
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $238.80
Liabilities:MasterCard $-238.80 0
08-Feb-22 BUDGET RENT-A-CAR Expenses:Travel:Auto $40.59 $40.59
Liabilities:MasterCard $-40.59 0
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $1,231.60
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $1,231.60
Liabilities:MasterCard $-1,231.60 0
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $1,231.60
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $1,231.60
Liabilities:MasterCard $-1,231.60 0
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $155.86
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $155.86
Liabilities:MasterCard $-155.86 0
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $155.86
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $155.86
Liabilities:MasterCard $-155.86 0
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $437.21
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $437.21
Liabilities:MasterCard $-437.21 0
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $437.21
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $437.21
Liabilities:MasterCard $-437.21 0
-08-Aug-08 BCIS I-131 FILING F.. Ex:Travel:Passport $170.00 $170.00
+08-Aug-08 BCIS I-131 FILING F.. Expens:Travel:Passport $170.00 $170.00
Liabilities:MasterCard $-170.00 0
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $912.60
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $912.60
Liabilities:MasterCard $-912.60 0
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $912.60
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $912.60
Liabilities:MasterCard $-912.60 0
-08-Sep-22 AGNT FEE Ex:Travel:Airfare $70.00 $70.00
+08-Sep-22 AGNT FEE Expense:Travel:Airfare $70.00 $70.00
Liabilities:MasterCard $-70.00 0
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $806.20
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $806.20
Liabilities:MasterCard $-806.20 0
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $806.20
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $806.20
Liabilities:MasterCard $-806.20 0
-08-Sep-22 LIAT 1974 LIMITED Ex:Travel:Airfare $418.34 $418.34
+08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $418.34
Liabilities:MasterCard $-418.34 0
08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-127.00
- Ex:Travel:Passport $127.00 0
+ Expens:Travel:Passport $127.00 0
08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-127.00
- Ex:Travel:Passport $127.00 0
+ Expens:Travel:Passport $127.00 0
>>>2
=== 0
diff --git a/test/baseline/opt-sort.test b/test/baseline/opt-sort.test
index 27efe31b..6e9e5ddd 100644
--- a/test/baseline/opt-sort.test
+++ b/test/baseline/opt-sort.test
@@ -84,82 +84,82 @@ reg airfare --sort=date
Expenses:Travel:Passport $127.00
Assets:Checking
>>>1
-08-Jan-11 LIAT Ex:Travel:Airfare $40.00 $40.00
-08-Jan-14 cheaptickets.com Ex:Travel:Airfare $182.19 $222.19
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $460.99
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $699.79
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $1,931.39
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $3,162.99
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $3,318.85
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $3,474.71
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $3,911.92
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $4,349.13
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $5,261.73
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $6,174.33
-08-Sep-22 AGNT FEE Ex:Travel:Airfare $70.00 $6,244.33
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $7,050.53
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $7,856.73
-08-Sep-22 LIAT 1974 LIMITED Ex:Travel:Airfare $418.34 $8,275.07
+08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $40.00
+08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $222.19
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $460.99
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $699.79
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $1,931.39
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $3,162.99
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $3,318.85
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $3,474.71
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $3,911.92
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $4,349.13
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $5,261.73
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $6,174.33
+08-Sep-22 AGNT FEE Expense:Travel:Airfare $70.00 $6,244.33
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $7,050.53
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $7,856.73
+08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $8,275.07
>>>2
=== 0
reg airfare --sort=date,amount
>>>1
-08-Jan-11 LIAT Ex:Travel:Airfare $40.00 $40.00
-08-Jan-14 cheaptickets.com Ex:Travel:Airfare $182.19 $222.19
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $460.99
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $699.79
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $1,931.39
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $3,162.99
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $3,318.85
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $3,474.71
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $3,911.92
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $4,349.13
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $5,261.73
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $6,174.33
-08-Sep-22 AGNT FEE Ex:Travel:Airfare $70.00 $6,244.33
-08-Sep-22 LIAT 1974 LIMITED Ex:Travel:Airfare $418.34 $6,662.67
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $7,468.87
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $8,275.07
+08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $40.00
+08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $222.19
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $460.99
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $699.79
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $1,931.39
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $3,162.99
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $3,318.85
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $3,474.71
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $3,911.92
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $4,349.13
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $5,261.73
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $6,174.33
+08-Sep-22 AGNT FEE Expense:Travel:Airfare $70.00 $6,244.33
+08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $6,662.67
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $7,468.87
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $8,275.07
>>>2
=== 0
reg airfare --sort=date,-amount
>>>1
-08-Jan-11 LIAT Ex:Travel:Airfare $40.00 $40.00
-08-Jan-14 cheaptickets.com Ex:Travel:Airfare $182.19 $222.19
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $460.99
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $699.79
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $1,931.39
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $3,162.99
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $3,318.85
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $3,474.71
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $3,911.92
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $4,349.13
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $5,261.73
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $6,174.33
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $6,980.53
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $7,786.73
-08-Sep-22 LIAT 1974 LIMITED Ex:Travel:Airfare $418.34 $8,205.07
-08-Sep-22 AGNT FEE Ex:Travel:Airfare $70.00 $8,275.07
+08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $40.00
+08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $222.19
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $460.99
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $699.79
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $1,931.39
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $3,162.99
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $3,318.85
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $3,474.71
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $3,911.92
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $4,349.13
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $5,261.73
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $6,174.33
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $6,980.53
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $7,786.73
+08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $8,205.07
+08-Sep-22 AGNT FEE Expense:Travel:Airfare $70.00 $8,275.07
>>>2
=== 0
reg airfare --sort=-date,-amount
>>>1
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $806.20
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $1,612.40
-08-Sep-22 LIAT 1974 LIMITED Ex:Travel:Airfare $418.34 $2,030.74
-08-Sep-22 AGNT FEE Ex:Travel:Airfare $70.00 $2,100.74
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $3,013.34
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $3,925.94
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $4,363.15
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $4,800.36
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $4,956.22
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $5,112.08
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $6,343.68
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $7,575.28
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $7,814.08
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $8,052.88
-08-Jan-14 cheaptickets.com Ex:Travel:Airfare $182.19 $8,235.07
-08-Jan-11 LIAT Ex:Travel:Airfare $40.00 $8,275.07
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $806.20
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $1,612.40
+08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $2,030.74
+08-Sep-22 AGNT FEE Expense:Travel:Airfare $70.00 $2,100.74
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $3,013.34
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $3,925.94
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $4,363.15
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $4,800.36
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $4,956.22
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $5,112.08
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $6,343.68
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $7,575.28
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $7,814.08
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $8,052.88
+08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $8,235.07
+08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $8,275.07
>>>2
=== 0
bal --sort=total
@@ -202,27 +202,27 @@ reg --sort=account
>>>1
08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-127.00
08-Dec-26 U.S. Department of .. Assets:Checking $-127.00 $-254.00
-08-Jan-11 LIAT Ex:Travel:Airfare $40.00 $-214.00
-08-Jan-14 cheaptickets.com Ex:Travel:Airfare $182.19 $-31.81
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $206.99
-08-Feb-05 UNITED Ex:Travel:Airfare $238.80 $445.79
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $1,677.39
-08-Mar-16 IBERIA Ex:Travel:Airfare $1,231.60 $2,908.99
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $3,064.85
-08-Apr-03 AMERICAN Ex:Travel:Airfare $155.86 $3,220.71
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $3,657.92
-08-Apr-30 UNITED Ex:Travel:Airfare $437.21 $4,095.13
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $5,007.73
-08-Sep-06 AMERICAN Ex:Travel:Airfare $912.60 $5,920.33
-08-Sep-22 AGNT FEE Ex:Travel:Airfare $70.00 $5,990.33
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $6,796.53
-08-Sep-22 DELTA Ex:Travel:Airfare $806.20 $7,602.73
-08-Sep-22 LIAT 1974 LIMITED Ex:Travel:Airfare $418.34 $8,021.07
+08-Jan-11 LIAT Expense:Travel:Airfare $40.00 $-214.00
+08-Jan-14 cheaptickets.com Expense:Travel:Airfare $182.19 $-31.81
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $206.99
+08-Feb-05 UNITED Expense:Travel:Airfare $238.80 $445.79
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $1,677.39
+08-Mar-16 IBERIA Expense:Travel:Airfare $1,231.60 $2,908.99
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $3,064.85
+08-Apr-03 AMERICAN Expense:Travel:Airfare $155.86 $3,220.71
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $3,657.92
+08-Apr-30 UNITED Expense:Travel:Airfare $437.21 $4,095.13
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $5,007.73
+08-Sep-06 AMERICAN Expense:Travel:Airfare $912.60 $5,920.33
+08-Sep-22 AGNT FEE Expense:Travel:Airfare $70.00 $5,990.33
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $6,796.53
+08-Sep-22 DELTA Expense:Travel:Airfare $806.20 $7,602.73
+08-Sep-22 LIAT 1974 LIMITED Expense:Travel:Airfare $418.34 $8,021.07
08-Feb-05 CTX Expenses:Travel:Auto $240.38 $8,261.45
08-Feb-22 BUDGET RENT-A-CAR Expenses:Travel:Auto $40.59 $8,302.04
-08-Aug-08 BCIS I-131 FILING F.. Ex:Travel:Passport $170.00 $8,472.04
-08-Dec-26 U.S. Department of .. Ex:Travel:Passport $127.00 $8,599.04
-08-Dec-26 U.S. Department of .. Ex:Travel:Passport $127.00 $8,726.04
+08-Aug-08 BCIS I-131 FILING F.. Expens:Travel:Passport $170.00 $8,472.04
+08-Dec-26 U.S. Department of .. Expens:Travel:Passport $127.00 $8,599.04
+08-Dec-26 U.S. Department of .. Expens:Travel:Passport $127.00 $8,726.04
08-Jan-11 LIAT Liabilities:MasterCard $-40.00 $8,686.04
08-Jan-14 cheaptickets.com Liabilities:MasterCard $-182.19 $8,503.85
08-Feb-05 CTX Liabilities:MasterCard $-240.38 $8,263.47
diff --git a/test/baseline/opt-subtotal.test b/test/baseline/opt-subtotal.test
index 41defbc1..f2d9454f 100644
--- a/test/baseline/opt-subtotal.test
+++ b/test/baseline/opt-subtotal.test
@@ -85,9 +85,9 @@ reg --subtotal
Assets:Checking
>>>1
08-Jan-11 - 08-Dec-26 Assets:Checking $-254.00 $-254.00
- Ex:Travel:Airfare $8,275.07 $8,021.07
+ Expense:Travel:Airfare $8,275.07 $8,021.07
Expenses:Travel:Auto $280.97 $8,302.04
- Ex:Travel:Passport $424.00 $8,726.04
+ Expens:Travel:Passport $424.00 $8,726.04
Liabilities:MasterCard $-8,726.04 0
>>>2
=== 0
diff --git a/test/baseline/opt-total-width.test b/test/baseline/opt-total-width.test
index 1d7b8b94..bbcb549e 100644
--- a/test/baseline/opt-total-width.test
+++ b/test/baseline/opt-total-width.test
@@ -4,8 +4,8 @@ reg --total-width=25
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
- In:Di:Vanguard:VMMXX $-0.35 $-0.35
+07-Feb-02 RD VMMXX As:Investm:Vanguar:VMMXX 0.350 VMMXX 0.350 VMMXX
+ In:Dividen:Vanguar:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0
diff --git a/test/baseline/opt-total.test b/test/baseline/opt-total.test
index 8f4719d2..c73614c1 100644
--- a/test/baseline/opt-total.test
+++ b/test/baseline/opt-total.test
@@ -4,7 +4,7 @@ reg --total=10
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
-07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 10
- In:Di:Vanguard:VMMXX $-0.35 10
+07-Feb-02 RD VMMXX As:Inves:Vanguar:VMMXX 0.350 VMMXX 10
+ In:Divid:Vanguar:VMMXX $-0.35 10
>>>2
=== 0
diff --git a/test/regress/04C5E1CA.test b/test/regress/04C5E1CA.test
index 729ae6bf..9aca9b1f 100644
--- a/test/regress/04C5E1CA.test
+++ b/test/regress/04C5E1CA.test
@@ -8,10 +8,10 @@ reg
Expenses:School:CS Club:Home Depot:4" Brush (2 * $3.97)
Liabilities:Mastercard
>>>1
-09-Apr-04 CS Club Sign Ex:Sc:CS:Ho:4" Brush 2 2
+09-Apr-04 CS Club Sign Ex:Sc:CS:Home:4" Brush 2 2
Liabilities:Mastercard $-7.94 2
$-7.94
-09-Apr-04 CS Club Sign Ex:Sc:CS:Ho:4" Brush $7.94 2
+09-Apr-04 CS Club Sign Ex:Sc:CS:Home:4" Brush $7.94 2
Liabilities:Mastercard $-7.94 2
$-7.94
>>>2
diff --git a/test/regress/727B2DF8.test b/test/regress/727B2DF8.test
index a13e8292..fbe42e54 100644
--- a/test/regress/727B2DF8.test
+++ b/test/regress/727B2DF8.test
@@ -46,9 +46,9 @@ N $
; :AnotherTag:
>>>1
04-May-01 Checking balance Assets:Bank:Checking  $1,000.00 $1,000.00
- Eq:Opening Balances  $-1,000.00 0
+ Equit:Opening Balances $-1,000.00 0
04-May-03 Investment balance Assets:Brokerage  50 AAPL 50 AAPL
- Eq:Opening Balances  $-1,500.00 $-1,500.00
+ Equit:Opening Balances $-1,500.00 $-1,500.00
50 AAPL
04-May-14 Páy dày Assets:Bank:Checking  500.00€ $-1,500.00
50 AAPL
@@ -59,7 +59,7 @@ N $
50 AAPL
Income:Salary  $-500.00 $-1,500.00
50 AAPL
-04-May-14 Another dày in whic.. Ру:Ру:Ру:Русский язык  $1,000.00 $-500.00
+04-May-14 Another dày in whic.. Ру:Ру:Рус:Русский язык $1,000.00 $-500.00
50 AAPL
Income:Salary  $-1,000.00 $-1,500.00
50 AAPL
diff --git a/test/regress/86D2BDC4.test b/test/regress/86D2BDC4.test
index b6d4083c..1ea9fc41 100644
--- a/test/regress/86D2BDC4.test
+++ b/test/regress/86D2BDC4.test
@@ -5,7 +5,7 @@ reg -B
Expenses:Bank:Fees 2.73
Liabilities:Mastercard
>>>1
-09-Jun-03 Westjet Ex:Transportation:Air 676.017377 676.017377
+09-Jun-03 Westjet Expen:Transportati:Air 676.017377 676.017377
Expenses:Bank:Fees 2.73 678.747377
Liabilities:Mastercard -678.747377 0
>>>2
diff --git a/test/regress/D943AE0F.test b/test/regress/D943AE0F.test
index 7a2e14d8..8fd5f932 100644
--- a/test/regress/D943AE0F.test
+++ b/test/regress/D943AE0F.test
@@ -8,7 +8,7 @@ D 1000.00 EUR
P 2008/04/20 00:00:00 CAD 1.20 EUR
>>>1
-08-Apr-15 Paid expenses back .. Ex:Cie-Reimbursements 2200.00 EUR 2200.00 EUR
+08-Apr-15 Paid expenses back .. Exp:Cie-Reimbursements 2200.00 EUR 2200.00 EUR
Assets:Checking -2200.00 EUR 0
08-Apr-20 Commodities revalued <Revalued> 200.00 EUR 200.00 EUR
>>>2
diff --git a/test/regress/E4C9A8EA.test b/test/regress/E4C9A8EA.test
index fed47c82..108fb661 100644
--- a/test/regress/E4C9A8EA.test
+++ b/test/regress/E4C9A8EA.test
@@ -10,15 +10,15 @@ reg
Assets:Investments:RBC-Broker:Account-RSP 72.06 CAD
Expenses:Financial:Fees
>>>1
-07-Dec-31 Cost basis for: RED.. As:In:RB:Account-RSP 4.00 RHT 4.00 RHT
- Eq:Op:Cost -689.87 CAD -689.87 CAD
+07-Dec-31 Cost basis for: RED.. As:In:RBC-:Account-RSP 4.00 RHT 4.00 RHT
+ Equ:Opening-Balan:Cost -689.87 CAD -689.87 CAD
4.00 RHT
-08-Jan-03 Sell -- RHT -- RED .. As:In:RB:Account-RSP -4.00 RHT -689.87 CAD
- Ex:Fi:Commissions 9.95 USD -689.87 CAD
+08-Jan-03 Sell -- RHT -- RED .. As:In:RBC-:Account-RSP -4.00 RHT -689.87 CAD
+ Ex:Financi:Commissions 9.95 USD -689.87 CAD
9.95 USD
- As:In:RB:Account-RSP 72.06 CAD -617.81 CAD
+ As:In:RBC-:Account-RSP 72.06 CAD -617.81 CAD
9.95 USD
- Ex:Financial:Fees 2.89 CAD -614.92 CAD
+ Expense:Financial:Fees 2.89 CAD -614.92 CAD
9.95 USD
>>>2
=== 0