Fix typo/bug in cash calculations involving asset accounts
Typo resulted e.g. in transactions between cash assets and liabilities being discarded instead of being charged to Other Income
This commit is contained in:
parent
79305f8a8f
commit
fe600592d6
@ -113,7 +113,7 @@ def account_to_cash(account, currency):
|
|||||||
balancing_posting.transaction.postings.remove(balancing_posting)
|
balancing_posting.transaction.postings.remove(balancing_posting)
|
||||||
|
|
||||||
if amount_remaining != 0:
|
if amount_remaining != 0:
|
||||||
if account.is_asset:
|
if posting.account.is_asset:
|
||||||
# Cash - charge any unbalanced remainder to Other Income
|
# Cash - charge any unbalanced remainder to Other Income
|
||||||
posting.transaction.postings.append(Posting(posting.transaction, account.ledger.get_account(config['cash_other_income']), Amount(-amount_remaining, currency)))
|
posting.transaction.postings.append(Posting(posting.transaction, account.ledger.get_account(config['cash_other_income']), Amount(-amount_remaining, currency)))
|
||||||
else:
|
else:
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
{% block links %}
|
{% block links %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<a href="/transactions_commodity?{{ {'date': date.strftime('%Y-%m-%d'), 'pstart': pstart.strftime('%Y-%m-%d'), 'account': account.name, 'cash': 'on' if cash else ''}|urlencode }}">Show commodity detail</a>
|
{% if account %}<a href="/transactions_commodity?{{ {'date': date.strftime('%Y-%m-%d'), 'pstart': pstart.strftime('%Y-%m-%d'), 'account': account.name, 'cash': 'on' if cash else ''}|urlencode }}">Show commodity detail</a>{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block report %}
|
{% block report %}
|
||||||
|
Reference in New Issue
Block a user