Commit graph

58 commits

Author SHA1 Message Date
Jonathan Wakely
bcaca24de4 Convert boost::optional objects to bool explicitly.
Fixes #417.
2015-07-27 20:37:16 +01:00
John Wiegley
a78e7358ec Revert "boost::none_t no longer convertible from literal 0 in 1.58"
This reverts commit 48aec0f093.
2015-05-17 17:50:45 -05:00
Johann Klähn
48aec0f093 boost::none_t no longer convertible from literal 0 in 1.58
Instead we use boost::none, which has been documented since boost 1.34.0.
2015-05-10 12:50:19 +02:00
Alexis Hildebrandt
d5e1308d07 [ledger] Remove --cache option
and all boost serialisation related code.
2015-02-18 21:50:34 +01:00
Alexis Hildebrandt
1dd9dcaab4 Bump copyright notice to 2015
The following script makes it a no-brainer:
% NEXT_YEAR=2015; ag -l 'Copyright.*Wiegley' \
  | xargs sed -i '' -e "s/\(Copyright.*\)-20[0-9]\{2\}/\1-${NEXT_YEAR}/"
2014-12-27 11:24:55 +01:00
Joe Gallo
d5592ea1e3 #if guards for boost 1.56 compatibility 2014-08-28 11:04:55 -04:00
John Wiegley
948f5fea28 Revert "fix "no viable conversion from ... to 'bool'""
This reverts commit df9ae3ab9b.
2014-08-27 11:56:14 -05:00
Joe Gallo
df9ae3ab9b fix "no viable conversion from ... to 'bool'" 2014-08-26 09:07:57 -04:00
Martin Michlmayr
b886342064 Preserve the given cost for print
Patch from John Wiegley
2014-07-14 21:05:54 -04:00
John Wiegley
8f8a94c28e Add the concept of "deferred postings"
This is pretty much exclusively for allowing one to use balance
assertions with replicated transactions across multiple files.
2014-04-13 23:26:14 -05:00
Alexis Hildebrandt
2b9208e850 Bump copyright information to 2014 2014-02-02 12:36:22 +01:00
John Wiegley
c70e959214 Add a missing % character 2013-05-19 02:41:46 -05:00
John Wiegley
0951bcebef Bump copyright information to 2013 2013-02-18 06:51:21 -06:00
John Wiegley
2ac996d916 Shorten debug comment 2012-11-23 16:54:03 -06:00
John Wiegley
4681e58d7f Converted the Ledger build system to use CMake 2012-05-20 04:48:05 -05:00
John Wiegley
a38ed141c1 Switched to Boost.PropertyTree for XML generation 2012-05-18 01:31:01 -06:00
John Wiegley
f4f3058b8c Switch to using Boost.Format 2012-05-14 21:44:00 -06:00
John Wiegley
fcabd64a89 Whitespace fix 2012-04-04 02:26:34 -05:00
John Wiegley
902ab72eb4 Forgot to copy two members in post_t's copy-ctor 2012-03-28 03:02:31 -05:00
John Wiegley
22505d9527 Always call TRACE_CTOR at the end of constructors 2012-03-20 02:10:40 -05:00
John Wiegley
cfe8142b2b Access to checkin/checkout of timelog entries 2012-03-13 03:41:00 -05:00
John Wiegley
59cbcf703c post_t's copy constructor wasn't copying xdata_ 2012-03-13 00:03:56 -05:00
John Wiegley
c9f7195936 Added the notion of "virtual costs" 2012-03-09 01:28:20 -06:00
John Wiegley
76f97a63da Added parsing support for the many value directives 2012-03-07 05:20:42 -06:00
John Wiegley
e2afc783db Increased file copyrights to 2012 2012-02-29 22:32:23 -06:00
John Wiegley
656e46e182 Renamed actual/effective dates to primary/auxiliary 2012-02-28 03:02:16 -06:00
John Wiegley
20f4ccde96 Added some debug code 2011-02-10 23:00:36 -05:00
John Wiegley
2f50e30b89 Scopes can now provide a description of themselves
This isn't being used yet, but it likely will to improve the information
presented to users if their value expressions fail to compile or
evaluate.
2010-06-24 19:53:59 -04:00
John Wiegley
b80be82b8d has_tag and get_tag now take an 'inherit' parameter 2010-06-18 02:19:39 -04:00
John Wiegley
31e8ed7587 Individual postings may each have their own payee
If a posting has the metadata field "Payee" set to a string, that will
be used as the payee name for that posting.  This affects the register
report, the payees report, and the --by-payee option.

This is useful because sometimes I send, say, 4 checks at a time to my
bank.  So on my bank statement, this is all just one amount:

   2010-06-17 Sample
     Assets:Bank        $400.00
     Income:Check1     $-100.00
     Income:Check2     $-100.00
     Income:Check3     $-100.00
     Income:Check4     $-100.00

Though it's important that the Assets:Bank posting be a single posting
of $400 value, I'd like for income reports to show whom each check came
from.  Now I can say:

   2010-06-17 Sample
     Assets:Bank        $400.00
     Income:Check1     $-100.00  ; Payee: Person One
     Income:Check2     $-100.00  ; Payee: Person Two
     Income:Check3     $-100.00  ; Payee: Person Three
     Income:Check4     $-100.00  ; Payee: Person Four

When I report this, it appears as:

10-Jun-17 Sample             Assets:Bank             $400.00     $400.00
          Person One         Income:Check1          $-100.00     $300.00
          Person Two         Income:Check2          $-100.00     $200.00
          Person Three       Income:Check3          $-100.00     $100.00
          Person Four        Income:Check4          $-100.00           0

This shows that they are all in the same transaction (which is why the
date is not repeated), but they have different payees.
2010-06-17 23:42:23 -04:00
John Wiegley
28c65cda51 Store metadata values as value_t instead of string 2010-06-12 14:55:18 -04:00
John Wiegley
dea2aed0b5 Untabified all source files 2010-06-11 17:02:25 -04:00
John Wiegley
685b12d8d3 Allow fixated costs, as well as prices
You can now establish a fixated price automatically by way of a fixated
cost.  The syntax for this is:

  2009/11/01 Sample
      Assets                1 apple @ =$0.10
      Equity
2010-06-10 12:29:58 -04:00
John Wiegley
fc09b69fb7 Fixed interaction with -V/X and grouped postings
With -s, -M/Y/D, -n, and a few other flags, postings get "grouped" into
meta-transactions that contain more postings than before.  In all these
cases, -V use the date of the *earliest* posting in that group, which
makes little sense and caused breakages with -J.  It now uses the latest
date.

Fixes #197 / 68EAF363-D0FE-4127-866E-A5AEBACB65D6
2010-06-09 02:22:50 -04:00
John Wiegley
63c7ba0322 Make --anon work with the print command
Fixes #226 / C1C1E731-D991-40ED-BE43-8ED55585386C
2010-06-05 02:46:22 -04:00
John Wiegley
47bfe58ab3 Added account_id and xact_id valexpr vars for posts
account_id is the "whicheth" number for that posting within its
account.  The xact_id is within its transaction.
2010-05-18 17:37:27 -04:00
John Wiegley
75b7294a6d Rewrite the "print" command as a custom function
There ended up being too many corner cases for the generalized formatter
to handle.
2010-03-08 01:11:48 -05:00
John Wiegley
ab416f759f Updated copyrights to 2003-2010 2010-03-05 22:14:10 -05:00
John Wiegley
69da18cd30 Some minor refactoring of the textual parser 2010-02-05 00:00:40 -05:00
John Wiegley
313c88a656 Added post_t::compare_by_date_and_sequence comparator 2010-02-05 00:00:40 -05:00
John Wiegley
9d61d3d621 Added actual_date() methods for items 2010-02-05 00:00:29 -05:00
John Wiegley
d12c7e08c6 Removed post_t::xdata_t::ptr, which is not used 2009-11-14 06:11:18 -05:00
John Wiegley
0068ac8fc0 Made ~post_t virtual 2009-11-12 05:08:43 -05:00
John Wiegley
e8ea2d4938 Automated postings defer amount expression calculation
This allows for value expressions to be used which reference the
incoming posting, for example:

  = Income:Clients:
    (Liabilities:Taxes:VAT1)  (floor(amount) * 1)
    (Liabilities:Taxes:VAT2)  0.19

  2009/07/27 * Invoice
    Assets:Bank:Checking                           $1,190.45
    Income:Clients:ACME_Inc

The automated posting for VAT1 will use the floored amount multiplied by
a factor, while the posting for VAT2 multiples the whole amount as
before.
2009-11-11 04:22:37 -05:00
John Wiegley
6cdb79e2a6 XML reporting now works via the "xml" command 2009-11-09 03:42:35 -05:00
John Wiegley
394c7bd8df Removed a bunch of empty comments 2009-11-08 14:59:11 -05:00
John Wiegley
78e6770c4c Segregated symbols into 5 separate namespaces
The different namespaces are:

  Function      Value expression functions, which receive a "context"
  Option        Command-line options
  Precommand    Commands which are invoked before reading the journal
  Command       Commands which are invoked after reading the journal
  Directive     Directives that occur at column 0 in a data file

This greatly eases the ability for Python uses to add intercept hooks to
change how the basic Ledger module functions.  An example of what should
be possible soon:

  import ledger

  def my_foo_handler(value):
      print "--foo received:", value

  ledger.add_handler(ledger.Option, "foo=", my_foo_handler)
2009-11-04 20:40:48 -05:00
John Wiegley
b14c814fec Whitespace fix 2009-11-04 20:40:42 -05:00
John Wiegley
3a0879aff0 Added "reported posts" into account xdata
This is necessary because sometimes, a post from one account will get
reported as though it were in another account (this happens with
--budget, to show child account postings within their parent account).
In that case, the account needs to remember which postings have been
reported as being within it, so that it can add these amounts to its own
total in the balance report.
2009-11-02 01:40:07 -05:00
John Wiegley
a757b19f51 Added serialization methods for most type
This allows journal_t objects to be completed serialized to disk and
deserialized.
2009-10-30 18:06:37 -04:00