Skip to content

Commit

Permalink
[budget-barchart] use gnc-account-get-current-depth
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Jun 3, 2019
1 parent a323b25 commit 70eadba
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions gnucash/report/reports/standard/budget-barchart.scm
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,6 @@
(gnc:option-value
(gnc:lookup-option (gnc:report-options report-obj) section name)))

;; This is a helper function to find out the level of the account
;; with in the account tree
(define (get-account-level account level)
(let ((parent (gnc-account-get-parent account)))
(cond
((null? parent) level)
(else (get-account-level parent (1+ level))))))

(define (curr-period budget)
(let ((now (current-time))
(max-period (1- (gnc-budget-get-num-periods budget))))
Expand Down Expand Up @@ -353,10 +345,10 @@
(if (or (and (eq? depth-limit 'all)
(null? (gnc-account-get-descendants acct)))
(and (not (eq? depth-limit 'all))
(<= (get-account-level acct 0) depth-limit)
(<= (gnc-account-get-current-depth acct) depth-limit)
(null? (gnc-account-get-descendants acct)))
(and (not (eq? depth-limit 'all))
(= (get-account-level acct 0) depth-limit)))
(= (gnc-account-get-current-depth acct) depth-limit)))
(gnc:html-document-add-object!
document
(gnc:chart-create-budget-actual
Expand Down

0 comments on commit 70eadba

Please sign in to comment.