[GNC-dev] Report with Fiscal Year

flywire flywire0 at gmail.com
Sun Sep 5 03:50:46 EDT 2021


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)))


More information about the gnucash-devel mailing list