Commit graph

1839 commits

Author SHA1 Message Date
Craig Earls
0df1366168 Bug 634 Added roundto function, optimized floor and ceiling
Fixes Bug634 by adding roundto(amount, places).
2013-01-30 15:35:31 -07:00
Craig Earls
1903ff7c2e Fixed problem finding the default priced file.
Bug fix to detect badly specified priced files on the command line didn't handle the default correctly.
2013-01-29 14:10:08 -07:00
Craig Earls
1b3dfa1297 Fixes regression error introduced by tags command patch
Not sure how the changes to the options got into the repot.cc file, but this takes the changes out.
2013-01-29 11:26:43 -07:00
John Wiegley
1e709d1040 Merge pull request #132 from enderw88/bug514-sort-accounts-and-commodities
Fixes bug 514.  accounts and commodities output now sorts
2013-01-29 09:36:03 -08:00
John Wiegley
69001d927a Merge pull request #131 from enderw88/add-tags-command
Addes tags command and --values option
2013-01-29 09:35:02 -08:00
John Wiegley
ec7402fff8 Merge pull request #107 from afh/pull/time_colon
Add --time-colon option
2013-01-29 09:34:08 -08:00
Craig Earls
aba5c1aa46 Fixes bugs 705 and 862. Ledger now fails if init or pricedb files are specified on the command line but not found. 2013-01-29 10:30:18 -07:00
Craig Earls
f9da94c909 Fixes bug 514. accounts and commodities output now sorts
updated tests included.
2013-01-29 10:03:47 -07:00
Craig Earls
3e72a51dc3 Addes tags command and --values option
Tags command reports all metadat tags in use.  With the
values option it reports tags and their values.
2013-01-29 09:42:10 -07:00
Johann Klähn
b3b11bed3b Merge branch 'master' into next
Some commits were on the master branch but not yet on the next branch due to a
pull request to master after those two branches diverged. This merge
ensures that next ⊇ master.
2013-01-18 18:26:03 +01:00
Johann Klähn
3fe2ef5956 change handling of standard input
For `-f /dev/stdin`, the `pathname` of the parsing context will be empty
as for any other streamed input.

`instance_t::include_directive` did not work as expected for `-f /dev/stdin`
and relative file names. One would expect them to be relative to the current
directory rather than `/dev`.

This will lead to `While parsing file ""` messages. This could be
adjusted to read `While parsing standard input`, but maybe it's not
worth the special cases.

This commit also fixes bug 788: behaviour of source_context for '-f -'
2013-01-17 12:19:23 +01:00
John Wiegley
9252c5f1f3 Revert "Bug551 fixed, commodities and accounts now sort"
This reverts commit 67a598f6ff.
2013-01-16 18:14:34 -06:00
John Wiegley
d1c96190e9 Revert "fix bug 788: behaviour of source_context for '-f -'"
This reverts commit 0a1ff03542.
2013-01-16 18:10:30 -06:00
Johann Klähn
3ed53b7b3c whitespace cleanup 2013-01-16 23:11:45 +01:00
John Wiegley
6ff7dac73f Merge pull request #122 from enderw88/Lisp-fixes
Fix ledger-add-entry
2013-01-16 12:18:33 -08:00
Johann Klähn
d922f46595 fix bug 748: option aliases not recognized 2013-01-15 23:30:17 +01:00
Johann Klähn
0a1ff03542 fix bug 788: behaviour of source_context for '-f -'
`session_t::read_data` did not set context.pathname to `/dev/stdin`
for the special case `-f -`. I chose to adjust `source_context` too
as there is no sensible context if no file name is provided.
2013-01-15 23:03:39 +01:00
Johann Klähn
2b1cfd6706 remove superfluous 'break' 2013-01-15 21:17:03 +01:00
Johann Klähn
428490e917 fix for 'store absolute paths internally'
`parent_path` was called on unprocessed path
so neither `resolve_path` nor `filesystem::absolute` had any effect.
2013-01-15 21:16:15 +01:00
Craig Earls
856f4b673c Merge remote-tracking branch 'upstream/next' into next 2013-01-14 21:56:33 -08:00
John Wiegley
aba0a5ed2d Improvement to account alias expansion
Aliases are now expanded not only if they occur by themselves, but also
if they occur as the beginning of a multi-part account.  Given <alias
Food=Expenses:Food> the account <Food:Tomatos> should now be expanded to
<Expenses:Food:Tomatos>.
2013-01-11 07:08:51 -06:00
John Wiegley
82ac7ef313 Guard against a possible NULL 2013-01-11 00:10:30 -06:00
Craig Earls
67a598f6ff Bug551 fixed, commodities and accounts now sort
Added two compare structs for std::map to use.  I tried to override
the < operator got a clean compile but map wasn't picking it up, I
couldn't figure out why so I took the less elegant route.
2013-01-07 20:15:49 -07:00
John Wiegley
3445ddec09 Merge branch 'next' of github.com:ledger/ledger into next 2012-11-26 12:52:12 -06:00
John Wiegley
2ac996d916 Shorten debug comment 2012-11-23 16:54:03 -06:00
Alexis Hildebrandt
6a5d6a88cd Fix crash when accessing the transaction code via post.xact.code using python
ledger would abort with the following error message:
  TypeError: No Python class registered for C++ class boost::optional<std::string>

The changes pass a CallPolicy to make_getter when adding the transaction
code property for python, so that the correct to_python conversion is
made. For details see:
http://www.boost.org/doc/libs/1_52_0/libs/python/doc/v2/faq.html#topythonconversionfailed
2012-11-19 23:00:58 +01:00
John Wiegley
63712728e1 Properly handle metadata tags on auto-postings 2012-11-12 02:30:04 -06:00
John Wiegley
29359f3a87 Account names in auto-xacts can be format strings 2012-11-12 02:30:04 -06:00
Alexis Hildebrandt
36f87f49d8 Add --time-colon option
The --time-colon option will display the value for a seconds
based commodity as real hours and minutes.

For example 8100 seconds by default will be displayed as 2.25
whereas with the --time-colon option they will be displayed
as 2:15.
2012-11-10 12:02:00 +01:00
Christophe Rhodes
a6d40ada1f right-justify amount_expr text in print report where possible 2012-11-06 12:31:01 +00:00
Christophe Rhodes
8214a69e20 fix comment in display_filter_posts::output_rounding(post_t)
slightly more detail in the case of zero display_amount and --empty
not specified.
2012-11-06 12:31:01 +00:00
John Wiegley
ae5325f0a9 Guard against global_scope being NULL 2012-10-31 14:57:19 -05:00
John Wiegley
ab5dd39be4 Merge pull request #97 from enderw88/Bug726-727-draft-and-lisp-command
Added "draft" and "lisp" command synonyms
2012-10-31 12:03:22 -07:00
John Wiegley
3b9b2cf908 Corrected a typo 2012-10-31 00:14:47 -05:00
Craig Earls
5c5c6463c7 Added missing break; statement in report.cc 2012-10-26 15:46:10 -07:00
Craig Earls
10180f0fff Added "draft" and "lisp" command synonyms 2012-10-26 13:33:27 -07:00
John Wiegley
7cee6c559b Merge pull request #96 from enderw88/Bug634-floor-ceil-round
Bug 634 and 488, Corrected behavior of floor, and added ceiling
2012-10-26 08:31:57 -07:00
Craig Earls
b044a74bd3 Bug 634 and 488, Corrected behavior of floor, and added ceiling
This is only a partial fix for 634, since rounding is not fixed.
2012-10-25 22:28:26 -07:00
John Wiegley
34ca6b3991 Merge pull request #95 from enderw88/Bug695-init-file
Bug695 init file
2012-10-25 12:52:03 -07:00
Craig Earls
4b261f99bc Fixes Bug 695, ledger ignores --init-file
Handle --init-file as a special command option like the debug options.
That wway we can have the argument captured before teh global scope is
created.
2012-10-25 10:39:48 -07:00
Craig Earls
41cc9a7f3c Added filebase and filepath values
'filename' returns the complete path/filename of the file containg the current xact.
This is inconvenient for some displays.  filebase returns only the base name. For
completeness added filepath as well.
2012-10-23 14:10:19 -07:00
Craig Earls
14dcb27777 Implemented Bug551 Automatic Transactions are cleared base on parent 2012-10-23 13:07:39 -07:00
Johann Klähn
e824070b4a fix bucket directive (bug 765)
This was caused by both 'A' and 'bucket' using
default_account_directive. This function was still stripping the 'A'
directive, so the first character of the account name used with 'bucket'
was cut off. Maybe the code for the other directives should be changed
accordingly for consistency (put line + 1 in call instead of function).
2012-10-23 12:13:22 +02:00
Johann Klähn
49b02614a3 fix account mapping in csv conversion
By using payees_for_unknown_accounts instead of account_mappings in
csv.cc ledger will have the same behaviour as in `ledger -f - print`
in that it uses payee fields in account directives to rewrite the
account.
2012-10-18 13:45:40 -07:00
Johann Klähn
937c9c7bd1 ignore extra fields when converting csv files
This fixes bug #736.
2012-10-13 20:04:10 +02:00
Johann Klähn
1f2fe401f1 ignore (some) empty field when converting csv
This fixes bug #733 and bug #734.
2012-10-13 19:39:10 +02:00
Hyrum Wright
73aa585efa Fix compilation warning: ensure a destructor is properly defined to avoid
compiler confusion.
2012-08-14 01:23:32 -04:00
Hyrum Wright
6ccb5e9687 Fix compilation warning: be sure we call the base class copy constructor. 2012-08-14 01:23:04 -04:00
John Wiegley
97693b43b5 Resolve account.date to latest post in the account 2012-08-09 16:56:53 -05:00
John Wiegley
afc023406a Always store absolute paths internally 2012-08-02 16:13:58 -05:00