Closed prdpspkt closed 5 months ago
@prdpspkt What part of code are you using? What command (or view) are you calling and what result do you expect?
{% for leg in transaction.legs.all %}
<div>{{leg.account.name}}: {{leg.balance.amount}}</div> //I need debit here
<div>{{leg.account.name}}: {{leg.balance.amount}}</div> //I need credit here
{% endfor %}]
but it comes randomly. some time debit first and sometime credit first.
You can do it for example like this:
{% for leg in transaction.legs.debits %}
<div>{{leg.account.name}}: {{leg.balance.amount}}</div>
{% endfor %}
{% for leg in transaction.legs.credits %}
<div>{{leg.account.name}}: {{leg.balance.amount}}</div>
{% endfor %}
Or by transaction.legs.order_by('amount')
in the view.
Also PRs are welcome. If you add method to LegManager
that returns legs ordered by amount
and add tests for that I will accept it.
Thank you. The project is abandoned for long time. Is there any method to generate Trial Balance, P/L and Balance sheet ?
The project is not abandoned. I have the rights to the repo and PyPI archive and I am maintaining the code. In fact I released new version just recently. Although I will not do any active development except fixing bugs, incompatibilities and improvements motivated by my own project. I will also accept quality PRs with meaningful new functions.
I don't know anything about those generators. Probably not, but search the documentation and code.
In transaction.legs.all debit and credit are not ordered. Sometimes debit comes first and sometimes credit comes first. How to get debit first and then credit.