A lot of the internal API functions do assume sorted inputs throughout
(which is done by the parser, didn't really plan for a lot of API users
TBH).
Not sure about this one, I'd have to review the source.
You can call beancount.core.data.sorted(entries) to do the same Beancount
does internally.
Cheers,

On Tue, Dec 14, 2021 at 1:12 AM vijayvithal jahagirdar <
jahagirdar...@gmail.com> wrote:

> I have a script which does the following:
>
> .....
> entries.extend(calc_depreciation(entries))
> balance= balance_by_account(entries date=datetime.date(2018,4,1) )
> ...
> This results in a set of transactions like
> 2017 ....
> 2018 ....
> 2019 ...
> 2020 ...
> 2017 "depreciation For Asset class X"
> 2017 "depreciation For Asset class Y"
>
> 2018 "depreciation For Asset class X"
> 2018 "depreciation For Asset class Y"
> ...
>
> The balance_by account is not seeing the depreciation entries because the
> for loop has the following exit condition
>
> if date and entry.date >= date:
>
> break
> ...
>
> This assumes that the entries are sorted by date. Is the assumption
> correct? If yes what function should be called after
> entries.extend(calc_depreciation(entries)) to sort the entries?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beancount+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beancount/05964e81-bbd0-494f-abc9-177610be2238n%40googlegroups.com
> <https://groups.google.com/d/msgid/beancount/05964e81-bbd0-494f-abc9-177610be2238n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhM%2BTxr6iBViEdeygzOhb1VnEKKUZdgnf01_jTXyzVxx1A%40mail.gmail.com.

Reply via email to