|
Brett Smith
|
89378cbf90fc
|
5 years ago
|
|
hooks.ledger_entry: Clean up whitespace in strings.
The hook now ensures it does not output whitespace that could be significant to Ledger, either because it's a newline or an account-amount separator.
|
|
Brett Smith
|
cc2b3978011a
|
5 years ago
|
|
tests: Pass amount to Template.render as string.
render is required to convert the string to Decimal for historical design reasons. Passing the amount as a string verifies this behavior.
|
|
Brett Smith
|
13c316acf6e1
|
5 years ago
|
|
|
|
Brett Smith
|
8516134687e8
|
5 years ago
|
|
hooks.ledger_entry: Improve date handling.
Check that we have the date field used in the payee line, and not just 'date'. Allow other date fields to be None since they may not be used by the template.
|
|
Brett Smith
|
eb329e92a066
|
5 years ago
|
|
ledger_entry: Only try to balance entry amounts when necessary.
This gives template authors the ability to write entries that balance something other than the "main" amount.
|
|
Brett Smith
|
3e21157f205b
|
5 years ago
|
|
ledger_entry: Support string tests in amount expressions.
This is useful for setting amounts based on imported strings like country, Eventbrite ticket type, etc.
|
|
Brett Smith
|
4009c626d4cb
|
5 years ago
|
|
ledger_entry: Improve error reporting for amount expressions.
This is going to become more important as amount expressions become more capable.
|
|
Brett Smith
|
8755d6af6700
|
5 years ago
|
|
|
|
Brett Smith
|
db59d2fc8ceb
|
7 years ago
|
|
hooks.ledger_entry: Look up templates dynamically.
If there's a 'ledger entry' key in the entry data, use that value as the name of the template to load. Thanks to this, nbpy2017 could collapse multiple importers into one.
Otherwise, build a default template name based on the importer source, and try to use that.
All the configuration names now end with "ledger entry" instead of starting with "template". This makes it clearer what they're for, in case we support other kinds of output templates in the future.
I ended up changing the names of some of the importers so the default template name was nice, rather than specifying template names for all of them, to reduce the amount of name discrepancies across the codebase.
|
|
Brett Smith
|
cdec3d9aabf8
|
7 years ago
|
|
hooks.ledger_entry: Bring in all Ledger-specific code.
This includes the old "template" module, plus the associated template-loading code from config.
|