[GNC] Inconsistent meanings of "AsOfDate"?
Christopher Lam
christopher.lck at gmail.com
Mon Jun 14 21:21:30 EDT 2021
Hi,
On Tue, 15 Jun 2021 at 00:09, Hong Xu <hong at topbug.net> wrote:
> I'm checking out the APIs of GnuCash. In
> xaccAccountGetReconciledBalanceAsOfDate, AsOfDate seems to mean ON OR
> BEFORE the date:
>
>
> https://github.com/Gnucash/gnucash/blob/7fe78e7017b3cb397e6a2f5a63c56e1933521a68/libgnucash/engine/Account.cpp#L3572
>
> In xaccAccountGetBalanceAsOfDate, AsOfDate seems to mean BEFORE the date:
>
>
> https://github.com/Gnucash/gnucash/blob/7fe78e7017b3cb397e6a2f5a63c56e1933521a68/libgnucash/engine/Account.cpp#L3535
>
> I'm wondering whether I misunderstood something, or this is an oversight,
> or this is completely intended and has always been so?
>
No, Likely yes, Likely no, Yes.
The first interpretation is likely the intended one. In theory, most
transaction dates are set to 10:59am, and report date thresholds for
comparison are gnc:time64-start-day-time (0:00) and gnc:time64-end-day-time
(23:59:59), so the comparisons should give similar results.
In practice, unintended edge cases will likely exist and may slightly
modify behaviour.
In the future, there may be work to eliminate times by using GDate or
std::chrono so only the dates are considered, therefore the comparisons
will need to be consistent. Jralls could offer a more detailed explanation.
>
> Thanks,
> Hong
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>
On Tue, 15 Jun 2021 at 00:09, Hong Xu <hong at topbug.net> wrote:
> I'm checking out the APIs of GnuCash. In
> xaccAccountGetReconciledBalanceAsOfDate, AsOfDate seems to mean ON OR
> BEFORE the date:
>
>
> https://github.com/Gnucash/gnucash/blob/7fe78e7017b3cb397e6a2f5a63c56e1933521a68/libgnucash/engine/Account.cpp#L3572
>
> In xaccAccountGetBalanceAsOfDate, AsOfDate seems to mean BEFORE the date:
>
>
> https://github.com/Gnucash/gnucash/blob/7fe78e7017b3cb397e6a2f5a63c56e1933521a68/libgnucash/engine/Account.cpp#L3535
>
> I'm wondering whether I misunderstood something, or this is an oversight,
> or this is completely intended and has always been so?
>
> Thanks,
> Hong
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>
More information about the gnucash-user
mailing list