[GNC-dev] Report with Fiscal Year

john jralls at ceridwen.us
Sun Sep 5 11:18:05 EDT 2021



> On Sep 5, 2021, at 12:50 AM, flywire <flywire0 at gmail.com> wrote:
> 
> Any chance of a bit of a hand working through the add-option to get Fiscal
> Year working in the code? I've tested everything else and it works. It'd be
> a nice fix for Australians.
> 
> gnc:make-date-option needs an optional parameter for year-start-month -
> https://github.com/flywire/gnucash/blob/Fiscal-year/libgnucash/app-utils/options.scm#L683-L761
> 
> Typical code (
> https://github.com/flywire/gnucash/blob/Fiscal-year/libgnucash/app-utils/date-utilities.scm
> ):
> 
> (define* (gnc:get-end-cur-year #:key (start-month-fy 0))
>  (let ((now (gnc-localtime (current-time))))
>    (set-tm:sec now 59)
>    (set-tm:min now 59)
>    (set-tm:hour now 23)
>    (set-tm:mday now 31)
>    (set-tm:mon now 11)
>    (if (< (tm:mon now) start-month-fy)
>      (set-tm:year now (tm:year now))
>      (set-tm:year now (+ (tm:year now) 1)))
>    (set-tm:isdst now -1)
>    (gnc-mktime now)))

Let's back up a bit. What do you mean by "fiscal year" and what exactly are you trying to do?

Regards,
John Ralls




More information about the gnucash-devel mailing list