mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix some reporting code.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2911 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
0647bf4bc9
commit
0ba828f12f
@ -554,7 +554,7 @@
|
|||||||
|
|
||||||
; Create a column entry
|
; Create a column entry
|
||||||
(define (html-table-col val)
|
(define (html-table-col val)
|
||||||
(html-table-col-align "right" val))
|
(html-table-col-align val "right"))
|
||||||
|
|
||||||
(define (string-html-table-col-align val align)
|
(define (string-html-table-col-align val align)
|
||||||
(string-append "<TD align=" align ">" (tostring val) "</TD>"))
|
(string-append "<TD align=" align ">" (tostring val) "</TD>"))
|
||||||
@ -623,7 +623,7 @@
|
|||||||
#f)
|
#f)
|
||||||
">"
|
">"
|
||||||
(tostring val)
|
(tostring val)
|
||||||
"</TH">))
|
"</TH>"))
|
||||||
|
|
||||||
(define (html-table-headcol val)
|
(define (html-table-headcol val)
|
||||||
(html-table-headcol-justified val "center"))
|
(html-table-headcol-justified val "center"))
|
||||||
|
@ -366,7 +366,9 @@
|
|||||||
;; FIXME - the '1' below is hard-coded and should
|
;; FIXME - the '1' below is hard-coded and should
|
||||||
;; be abstracted. Just a temp fix while
|
;; be abstracted. Just a temp fix while
|
||||||
;; the query api gets fully wrapped.
|
;; the query api gets fully wrapped.
|
||||||
(gnc:query-add-account gncq acct 1)) accounts)
|
(gnc:query-add-single-account-match gncq acct
|
||||||
|
(cons 'query-op 1)))
|
||||||
|
accounts)
|
||||||
|
|
||||||
(set! acctcurrency (gnc:account-get-currency (car accounts)))
|
(set! acctcurrency (gnc:account-get-currency (car accounts)))
|
||||||
|
|
||||||
|
@ -86,9 +86,9 @@
|
|||||||
gnc:*pnl-report-options*)
|
gnc:*pnl-report-options*)
|
||||||
|
|
||||||
(define (render-level-2-account level-2-account l2-value)
|
(define (render-level-2-account level-2-account l2-value)
|
||||||
(let ((account-name (list NBSP NBSP NBSP NBSP
|
(let ((account-name (string-append NBSP NBSP NBSP NBSP
|
||||||
(gnc:account-get-full-name
|
(gnc:account-get-full-name
|
||||||
level-2-account)))
|
level-2-account)))
|
||||||
(type-name (gnc:account-get-type-string
|
(type-name (gnc:account-get-type-string
|
||||||
(gnc:account-get-type level-2-account))))
|
(gnc:account-get-type level-2-account))))
|
||||||
(html-table-row-align
|
(html-table-row-align
|
||||||
@ -110,11 +110,10 @@
|
|||||||
|
|
||||||
(define (render-total l0-value)
|
(define (render-total l0-value)
|
||||||
(html-table-row-align
|
(html-table-row-align
|
||||||
(list (html-strong (string-db 'lookup 'net))
|
(list (string-html-strong (string-db 'lookup 'net))
|
||||||
NBSP NBSP
|
NBSP NBSP
|
||||||
(gnc:amount->formatted-string l0-value #f)
|
(gnc:amount->formatted-string l0-value #f)
|
||||||
NBSP NBSP
|
NBSP NBSP)
|
||||||
)
|
|
||||||
(list "left" "center" "right" "right" "right" "right")))
|
(list "left" "center" "right" "right" "right" "right")))
|
||||||
|
|
||||||
(define blank-line
|
(define blank-line
|
||||||
|
@ -535,7 +535,7 @@
|
|||||||
report (budget-subreport-get-maximum-expected subreport))))
|
report (budget-subreport-get-maximum-expected subreport))))
|
||||||
(budget-entry-get-subentries entry)
|
(budget-entry-get-subentries entry)
|
||||||
(budget-report-get-subreports report))))
|
(budget-report-get-subreports report))))
|
||||||
|
|
||||||
;; calculate the nominal value.
|
;; calculate the nominal value.
|
||||||
(define budget-report-set-nominal!
|
(define budget-report-set-nominal!
|
||||||
(record-modifier budget-report-structure 'nominal))
|
(record-modifier budget-report-structure 'nominal))
|
||||||
@ -662,16 +662,18 @@
|
|||||||
(gnc:group-map-accounts
|
(gnc:group-map-accounts
|
||||||
(lambda (account)
|
(lambda (account)
|
||||||
(let* ((line
|
(let* ((line
|
||||||
(budget-get-line-hash budget-hash (gnc:account-get-full-name account)))
|
(budget-get-line-hash budget-hash
|
||||||
|
(gnc:account-get-full-name account)))
|
||||||
(line2 (cond (line line)
|
(line2 (cond (line line)
|
||||||
(else
|
(else
|
||||||
(vector-ref others (gnc:account-get-type account)))))
|
(vector-ref others
|
||||||
|
(gnc:account-get-type account)))))
|
||||||
(acc 0)
|
(acc 0)
|
||||||
(filter-pred (budget-entry-get-filter-pred
|
(filter-pred (budget-entry-get-filter-pred
|
||||||
(budget-line-get-entry line2))))
|
(budget-line-get-entry line2))))
|
||||||
(budget-report-set-account-type! (budget-line-get-report line2)
|
(budget-report-set-account-type! (budget-line-get-report line2)
|
||||||
(gnc:account-get-type account))
|
(gnc:account-get-type account))
|
||||||
(cond
|
(cond
|
||||||
((budget-entry-get-action (budget-line-get-entry line2))
|
((budget-entry-get-action (budget-line-get-entry line2))
|
||||||
(set! acc 0)
|
(set! acc 0)
|
||||||
(gnc:for-each-split-in-account
|
(gnc:for-each-split-in-account
|
||||||
@ -803,8 +805,8 @@
|
|||||||
(case type
|
(case type
|
||||||
((gnc:budget-day) (+ 1
|
((gnc:budget-day) (+ 1
|
||||||
(remainder
|
(remainder
|
||||||
(inexact->exact (floor
|
(inexact->exact
|
||||||
(gnc:date-to-day-fraction caltime)))
|
(floor (gnc:date-to-day-fraction caltime)))
|
||||||
num-periods)))
|
num-periods)))
|
||||||
((gnc:budget-week) (+ (gnc:date-get-week-day lt)
|
((gnc:budget-week) (+ (gnc:date-get-week-day lt)
|
||||||
(* 7 (remainder
|
(* 7 (remainder
|
||||||
@ -812,10 +814,11 @@
|
|||||||
(floor (gnc:date-to-week-fraction caltime)))
|
(floor (gnc:date-to-week-fraction caltime)))
|
||||||
num-periods))))
|
num-periods))))
|
||||||
((gnc:budget-month) (+ (gnc:date-get-month-day lt)
|
((gnc:budget-month) (+ (gnc:date-get-month-day lt)
|
||||||
(let loop ((month
|
(let loop
|
||||||
(inexact->exact
|
((month
|
||||||
(floor
|
(inexact->exact
|
||||||
(gnc:date-to-month-fraction caltime)))))
|
(floor
|
||||||
|
(gnc:date-to-month-fraction caltime)))))
|
||||||
(if (= 0 (remainder month num-periods))
|
(if (= 0 (remainder month num-periods))
|
||||||
0
|
0
|
||||||
(+ (loop (- month 1))
|
(+ (loop (- month 1))
|
||||||
|
Loading…
Reference in New Issue
Block a user