# Aged Balance is considering move lines only from open fiscal years

**URL:** <https://discuss.tryton.org/t/aged-balance-is-considering-move-lines-only-from-open-fiscal-years/7497>\
**Category:** User\
**Tags:** accounting\
**Created:** [July 26, 2024, 4:04am UTC](https://discuss.tryton.org/t/aged-balance-is-considering-move-lines-only-from-open-fiscal-years/7497 "2024-07-26T04:04:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frflores](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/f/ba8739/32.png) [@frflores](https://discuss.tryton.org/u/frflores)\
**Post date:** [July 26, 2024, 4:04am UTC](https://discuss.tryton.org/t/aged-balance-is-considering-move-lines-only-from-open-fiscal-years/7497/1 "2024-07-26T04:04:14Z")

</div>

Hi guys,  
I’m having problems with the aged balance report that is showing the balances considering only move lines from open fiscal years. I traced the issue to the method Line.query\_get, which specifically limits the query to “open” fiscal years. The question is: is this a bug in the system or a problem with my specific context?.. here the relevant lines of code (in Line.query\_get):

> Blockquote  
> …  
> if to\_date:  
> where &= move.date \<= to\_date  
> else:  
> where &= fiscalyear.state == ‘open’  
> where &= fiscalyear.company == company

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [July 26, 2024, 8:04am UTC](https://discuss.tryton.org/t/aged-balance-is-considering-move-lines-only-from-open-fiscal-years/7497/2 "2024-07-26T08:04:27Z")

</div>

Please fill a bug report: [https://bugs.tryton.org/](https://bugs.tryton.org/)

---

<div class="post-metadata">

**Author:** ![frflores](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/f/ba8739/32.png) [@frflores](https://discuss.tryton.org/u/frflores)\
**Post date:** [July 26, 2024, 3:47pm UTC](https://discuss.tryton.org/t/aged-balance-is-considering-move-lines-only-from-open-fiscal-years/7497/3 "2024-07-26T15:47:15Z")

</div>

Indeed, there is one open issue for this very same problem [Issue 12210](https://foss.heptapod.net/tryton/tryton/-/issues/12210)

I’d be happy to help close it. I see that the query\_get method is used five times in the account module and two times in the account\_deposit module; I’m not aware if the other calls require the current behavior or if it’s an issue with the method itself; Do you have any suggestions here?
