Merge branch 'master' of https://github.com/ledger/ledger
This commit is contained in:
commit
8e6cdcc1d1
24 changed files with 167 additions and 104 deletions
28
.gitignore
vendored
28
.gitignore
vendored
|
|
@ -1,4 +1,6 @@
|
|||
*.[oa]
|
||||
*.so
|
||||
*.so.*
|
||||
*.backup
|
||||
*.elc
|
||||
*.gcov
|
||||
|
|
@ -11,12 +13,9 @@
|
|||
.deps/
|
||||
.libs/
|
||||
ABOUT-NLS
|
||||
BaselineTests
|
||||
Makefile
|
||||
Makefile.am
|
||||
Makefile.in
|
||||
PyUnitTests
|
||||
RegressionTests
|
||||
TAGS
|
||||
acconf.h.in
|
||||
aclocal.m4
|
||||
|
|
@ -31,12 +30,16 @@ config.status
|
|||
config.sub
|
||||
configure
|
||||
configure.ac
|
||||
data_tests
|
||||
depcomp
|
||||
doc/Doxyfile
|
||||
doc/*.aux
|
||||
doc/*.cp
|
||||
doc/*.cps
|
||||
doc/*.fn
|
||||
doc/*.fns
|
||||
doc/*.html
|
||||
doc/*.info
|
||||
doc/*.info-*
|
||||
doc/*.ky
|
||||
doc/*.log
|
||||
doc/*.pdf
|
||||
|
|
@ -47,12 +50,9 @@ doc/*.vr
|
|||
doc/.dirstamp
|
||||
doc/html/
|
||||
doc/latex/
|
||||
doc/ledger.info
|
||||
doc/ledger3.info
|
||||
doc/refman.pdf
|
||||
doc/report/
|
||||
elisp-comp
|
||||
expr_tests
|
||||
install-sh
|
||||
intl/
|
||||
ledger
|
||||
|
|
@ -60,20 +60,16 @@ libtool
|
|||
ltmain.sh
|
||||
m4/
|
||||
make.sh
|
||||
math_tests
|
||||
missing
|
||||
mkinstalldirs
|
||||
po/
|
||||
py-compile
|
||||
report_tests
|
||||
shave
|
||||
shave-libtool
|
||||
src/system.hh.gch
|
||||
stamp-h1
|
||||
texinfo.tex
|
||||
tmpcvs*/
|
||||
tmpwrk*/
|
||||
util_tests
|
||||
dist/win/vc9/Debug/
|
||||
dist/win/vc9/gen-mpir.exe
|
||||
dist/win/vc9/gen-mpir.ilk
|
||||
|
|
@ -82,10 +78,6 @@ dist/win/vc9/ledger.ncb
|
|||
dist/win/vc9/ledger.vcproj.*.user
|
||||
dist/win/vc9/ledger.suo
|
||||
dist/win/vc9/lib/Win32/Debug/
|
||||
dist/win/vc9/system.hh
|
||||
doc/ledger.1.html
|
||||
doc/ledger.html
|
||||
doc/ledger3.html
|
||||
src/TAGS
|
||||
CMakeCache.txt
|
||||
CPackConfig.cmake
|
||||
|
|
@ -107,14 +99,10 @@ contrib/non-profit-audit-reports/tests/general-ledger.txt
|
|||
contrib/non-profit-audit-reports/tests/MANIFEST
|
||||
contrib/non-profit-audit-reports/general-ledger.zip
|
||||
/wiki/
|
||||
doc/ledger-mode.info
|
||||
doc/ledger3.info-1
|
||||
doc/ledger3.info-2
|
||||
CTestTestfile.cmake
|
||||
.ninja_deps
|
||||
.ninja_log
|
||||
build.ninja
|
||||
rules.ninja
|
||||
Testing/Temporary
|
||||
test/Testing
|
||||
/MathTests
|
||||
/UtilTests
|
||||
|
|
|
|||
26
README.md
26
README.md
|
|
@ -101,11 +101,11 @@ And for building the current `maint` branch:
|
|||
If you build stuff using MacPorts on OS X, as I do, here is what you would
|
||||
run:
|
||||
|
||||
sudo port install -f cmake python26
|
||||
libiconv +universal zlib +universal gmp +universal
|
||||
mpfr +universal ncurses +universal ncursesw +universal
|
||||
gettext +universal libedit +universal boost-jam
|
||||
boost +st+python26+icu texlive doxygen graphviz
|
||||
sudo port install -f cmake python26 \
|
||||
libiconv +universal zlib +universal gmp +universal \
|
||||
mpfr +universal ncurses +universal ncursesw +universal \
|
||||
gettext +universal libedit +universal boost-jam \
|
||||
boost +st+python26+icu texlive doxygen graphviz \
|
||||
texinfo lcov sloccount
|
||||
|
||||
### Ubuntu
|
||||
|
|
@ -113,18 +113,18 @@ run:
|
|||
If you're going to build on Ubuntu, `sudo apt-get install ...` the
|
||||
following packages (current as of Ubuntu 14.04):
|
||||
|
||||
sudo apt-get install build-essential cmake doxygen
|
||||
libboost-system-dev libboost-dev python-dev gettext git
|
||||
libboost-date-time-dev libboost-filesystem-dev
|
||||
libboost-iostreams-dev libboost-python-dev libboost-regex-dev
|
||||
sudo apt-get install build-essential cmake doxygen \
|
||||
libboost-system-dev libboost-dev python-dev gettext git \
|
||||
libboost-date-time-dev libboost-filesystem-dev \
|
||||
libboost-iostreams-dev libboost-python-dev libboost-regex-dev \
|
||||
libboost-test-dev libedit-dev libgmp3-dev libmpfr-dev texinfo
|
||||
|
||||
Or, for Ubuntu 12.04:
|
||||
|
||||
sudo apt-get install build-essential cmake zlib1g-dev libbz2-dev
|
||||
python-dev gettext libgmp3-dev libmpfr-dev libboost-dev
|
||||
libboost-regex-dev libboost-date-time-dev
|
||||
libboost-filesystem-dev libboost-python-dev texinfo lcov
|
||||
sudo apt-get install build-essential cmake zlib1g-dev libbz2-dev \
|
||||
python-dev gettext libgmp3-dev libmpfr-dev libboost-dev \
|
||||
libboost-regex-dev libboost-date-time-dev \
|
||||
libboost-filesystem-dev libboost-python-dev texinfo lcov \
|
||||
sloccount libboost-iostreams-dev libboost-test-dev
|
||||
|
||||
### Debian
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ reconcile-finish will mark all pending posting cleared."
|
|||
:type 'string
|
||||
:group 'ledger-reconcile)
|
||||
|
||||
(defcustom ledger-reconcile-sort-key "(date)"
|
||||
"Default key for sorting reconcile buffer. For no sorting by default, use '(0)'."
|
||||
(defcustom ledger-reconcile-sort-key "(0)"
|
||||
"Default key for sorting reconcile buffer. Possible values are '(date)', '(amount)', '(payee)'. For no sorting, i.e. using ledger file order, use '(0)'."
|
||||
:type 'string
|
||||
:group 'ledger-reconcile)
|
||||
|
||||
|
|
|
|||
|
|
@ -1638,24 +1638,23 @@ post_t * instance_t::parse_post(char * line,
|
|||
"line " << context.linenum << ": " << "post amount = " << amt);
|
||||
|
||||
amount_t diff = amt;
|
||||
amount_t tot;
|
||||
|
||||
switch (account_total.type()) {
|
||||
case value_t::AMOUNT:
|
||||
tot = account_total.as_amount();
|
||||
diff -= account_total.as_amount();
|
||||
break;
|
||||
|
||||
case value_t::BALANCE:
|
||||
if (optional<amount_t> comm_bal =
|
||||
account_total.as_balance().commodity_amount(amt.commodity()))
|
||||
tot = *comm_bal;
|
||||
diff -= *comm_bal;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
diff -= tot;
|
||||
amount_t tot = amt - diff;
|
||||
|
||||
DEBUG("post.assign",
|
||||
"line " << context.linenum << ": " << "diff = " << diff);
|
||||
|
|
|
|||
|
|
@ -2,12 +2,21 @@ alias A=B:A
|
|||
alias B=C:B
|
||||
alias C=D:C
|
||||
|
||||
account Delta
|
||||
alias D
|
||||
|
||||
2001-01-01 Test
|
||||
A 10 EUR
|
||||
Foo
|
||||
|
||||
2001-01-01 Test
|
||||
D 20 EUR
|
||||
Foo
|
||||
|
||||
test reg
|
||||
01-Jan-01 Test B:A 10 EUR 10 EUR
|
||||
Foo -10 EUR 0
|
||||
01-Jan-01 Test Delta 20 EUR 20 EUR
|
||||
Foo -20 EUR 0
|
||||
end test
|
||||
|
||||
|
|
|
|||
18
test/baseline/feat-balance_assert-off.test
Normal file
18
test/baseline/feat-balance_assert-off.test
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
2014-05-01 * Opening balance
|
||||
Assets:Cash $100
|
||||
Equity:Opening balance
|
||||
|
||||
2014-05-10 * Spend money
|
||||
Expenses:Foo $10
|
||||
Assets:Cash -$10 = $80
|
||||
|
||||
test bal -> 1
|
||||
__ERROR__
|
||||
While parsing file "$FILE", line 8:
|
||||
While parsing posting:
|
||||
Assets:Cash -$10 = $80
|
||||
^^^
|
||||
Error: Balance assertion off by $-10 (expected to see $100)
|
||||
end test
|
||||
|
||||
20
test/baseline/opt-no-aliases.test
Normal file
20
test/baseline/opt-no-aliases.test
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
alias A=Foo
|
||||
|
||||
account Bar
|
||||
alias B
|
||||
|
||||
2001-01-01 * Test
|
||||
A 10 EUR
|
||||
B
|
||||
|
||||
test reg
|
||||
01-Jan-01 Test Foo 10 EUR 10 EUR
|
||||
Bar -10 EUR 0
|
||||
end test
|
||||
|
||||
test reg --no-aliases
|
||||
01-Jan-01 Test A 10 EUR 10 EUR
|
||||
B -10 EUR 0
|
||||
end test
|
||||
|
||||
19
test/regress/634AA589.test
Normal file
19
test/regress/634AA589.test
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
; The option --permissive quiets balance assertions
|
||||
|
||||
2014-05-01 * Opening balance
|
||||
Assets:Cash $100
|
||||
Equity:Opening balance
|
||||
|
||||
2014-05-10 * Spend money
|
||||
Expenses:Foo $10
|
||||
Assets:Cash -$10 = $80
|
||||
|
||||
test bal --permissive
|
||||
$90 Assets:Cash
|
||||
$-100 Equity:Opening balance
|
||||
$10 Expenses:Foo
|
||||
--------------------
|
||||
0
|
||||
end test
|
||||
|
||||
10
test/regress/AA2FF2B.test
Normal file
10
test/regress/AA2FF2B.test
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
2008/01/20 * La Poste
|
||||
Revenu:Invest:Exonéré
|
||||
Actif:Courant:LaPosteLivretA 25,24 € = 25,24 €
|
||||
|
||||
test --args-only --decimal-comma bal
|
||||
25,24 € Actif:Courant:LaPosteLivretA
|
||||
-25,24 € Revenu:Invest:Exonéré
|
||||
--------------------
|
||||
0
|
||||
end test
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
aspell check --mode=texinfo $(dirname $0)/../doc/ledger3.texi
|
||||
aspell --lang=en_US.UTF-8 check --mode=texinfo $(dirname $0)/../doc/ledger3.texi
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue