mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge branch 'unstable-bugfix' of https://github.com/christopherlam/gnucash into unstable
This commit is contained in:
commit
30fb1dc479
@ -322,21 +322,15 @@ more than one currency. This report is not designed to cope with this possibilit
|
||||
|
||||
|
||||
;; set up the query to get the splits in the chosen account
|
||||
;; XXX: FIXME: begindate is a hack -- we currently only go back a year
|
||||
(define (setup-query query account date)
|
||||
(let ((begindate (gnc-mktime (make-zdate)))) ;Set begindate to the start of the Epoch
|
||||
; (gnc:debug "Account: " account)
|
||||
(gnc:debug "begindate" begindate)
|
||||
(gnc:debug "date" date)
|
||||
(qof-query-set-book query (gnc-get-current-book))
|
||||
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
|
||||
(xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
|
||||
(xaccQueryAddDateMatchTT query #t begindate #t date QOF-QUERY-AND)
|
||||
(qof-query-set-sort-order query
|
||||
(list SPLIT-TRANS TRANS-DATE-POSTED)
|
||||
'() '())
|
||||
(qof-query-set-sort-increasing query #t #t #t)))
|
||||
|
||||
(qof-query-set-book query (gnc-get-current-book))
|
||||
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
|
||||
(xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
|
||||
(xaccQueryAddDateMatchTT query #f 0 #t date QOF-QUERY-AND)
|
||||
(qof-query-set-sort-order query
|
||||
(list SPLIT-TRANS TRANS-DATE-POSTED)
|
||||
'() '())
|
||||
(qof-query-set-sort-increasing query #t #t #t))
|
||||
|
||||
(define (aging-options-generator options)
|
||||
(let* ((add-option
|
||||
|
@ -635,10 +635,10 @@
|
||||
(gnc:html-table-append-row!
|
||||
table
|
||||
(list
|
||||
(string-expand (gnc:owner-get-address-dep owner) #\newline "<br>")))
|
||||
(string-expand (gnc:owner-get-address-dep owner) #\newline "<br/>")))
|
||||
(gnc:html-table-append-row!
|
||||
table
|
||||
(list "<br>"))
|
||||
(list "<br/>"))
|
||||
(for-each
|
||||
(lambda (order)
|
||||
(let* ((reference (gncOrderGetReference order)))
|
||||
@ -722,7 +722,7 @@
|
||||
'attribute (list "align" "right")
|
||||
'attribute (list "width" "33%"))
|
||||
(gnc:html-table-append-row!
|
||||
table (list (string-expand (string-append (if addy addy "") (if id (string-append "\n" id) "")) #\newline "<br>")
|
||||
table (list (string-expand (string-append (if addy addy "") (if id (string-append "\n" id) "")) #\newline "<br/>")
|
||||
(string-expand
|
||||
(string-append (if phone
|
||||
(string-append (_ "Phone:") " " phone)
|
||||
@ -730,7 +730,7 @@
|
||||
(if fax (string-append (if phone "\n" "")
|
||||
(_ "Fax:") " " fax)
|
||||
""))
|
||||
#\newline "<br>" )
|
||||
#\newline "<br/>" )
|
||||
(if url (string-append (_ "Web:") " " url) "")))
|
||||
|
||||
;; oli-custom - I didn't want today's date on the invoice.
|
||||
@ -863,20 +863,20 @@
|
||||
(due-date (gncInvoiceGetDateDue invoice)))
|
||||
(set! date-table (make-date-table))
|
||||
(gnc:html-table-append-row!
|
||||
;; Translators: %s below is "Invoice" or "Bill" or even the
|
||||
;; Translators: ~a below is "Invoice" or "Bill" or even the
|
||||
;; custom title from the options. The next column contains
|
||||
;; the number of the document.
|
||||
date-table (list (format #f (_ "~s #") title) (gncInvoiceGetID invoice)))
|
||||
;; Translators: The first %s below is "Invoice" or
|
||||
date-table (list (format #f (_ "~a #") title) (gncInvoiceGetID invoice)))
|
||||
;; Translators: The first ~a below is "Invoice" or
|
||||
;; "Bill" or even the custom title from the
|
||||
;; options. This string sucks for i18n, but I don't
|
||||
;; have a better solution right now without breaking
|
||||
;; other people's invoices.
|
||||
(make-date-row! date-table (format #f (_ "~s Date") title) post-date date-format)
|
||||
(make-date-row! date-table (_ "Due Date") due-date date-format)
|
||||
(make-date-row! date-table (format #f (_ "~a Date") title) post-date date-format)
|
||||
(make-date-row! date-table (_ "Due Date") due-date date-format)
|
||||
date-table)
|
||||
(gnc:make-html-text
|
||||
(string-append title "<br>"
|
||||
(string-append title "<br/>"
|
||||
(_ "Invoice in progress...")))))
|
||||
|
||||
(gnc:html-table-append-row!
|
||||
@ -910,7 +910,7 @@
|
||||
(gnc:make-html-text
|
||||
(string-append
|
||||
(_ "Reference") ": "
|
||||
(string-expand billing-id #\newline "<br>"))))
|
||||
(string-expand billing-id #\newline "<br/>"))))
|
||||
(make-break! document)))))
|
||||
|
||||
(if (opt-val "Display" "Billing Terms")
|
||||
@ -922,7 +922,7 @@
|
||||
(gnc:make-html-text
|
||||
(string-append
|
||||
(_ "Terms") ": "
|
||||
(string-expand terms #\newline "<br>")))))))
|
||||
(string-expand terms #\newline "<br/>")))))))
|
||||
|
||||
(make-break! document)
|
||||
|
||||
@ -948,7 +948,7 @@
|
||||
document
|
||||
(gnc:make-html-text
|
||||
(string-append name-str ": "
|
||||
(string-expand name #\newline "<br>")))))))
|
||||
(string-expand name #\newline "<br/>")))))))
|
||||
|
||||
(make-break! document)
|
||||
|
||||
@ -960,13 +960,13 @@
|
||||
document
|
||||
(gnc:make-html-text
|
||||
(string-append contact-str ": "
|
||||
(string-expand contact #\newline "<br>")))))))
|
||||
(string-expand contact #\newline "<br/>")))))))
|
||||
|
||||
(gnc:html-document-add-object!
|
||||
document
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-br)
|
||||
(string-expand (opt-val "Display" "Extra Notes") #\newline "<br>")
|
||||
(string-expand (opt-val "Display" "Extra Notes") #\newline "<br/>")
|
||||
(gnc:html-markup-br))))
|
||||
|
||||
; else
|
||||
|
@ -478,10 +478,10 @@
|
||||
(gnc:html-table-append-row!
|
||||
table
|
||||
(list
|
||||
(string-expand (gnc:owner-get-name-and-address-dep owner) #\newline "<br>")))
|
||||
(string-expand (gnc:owner-get-name-and-address-dep owner) #\newline "<br/>")))
|
||||
(gnc:html-table-append-row!
|
||||
table
|
||||
(list "<br>"))
|
||||
(list "<br/>"))
|
||||
(set-last-row-style!
|
||||
table "td"
|
||||
'attribute (list "valign" "top"))
|
||||
@ -521,7 +521,7 @@
|
||||
(gnc:html-table-append-row! table (list (if name name "")))
|
||||
(gnc:html-table-append-row! table (list (string-expand
|
||||
(if addy addy "")
|
||||
#\newline "<br>")))
|
||||
#\newline "<br/>")))
|
||||
(gnc:html-table-append-row! table (list
|
||||
(strftime
|
||||
date-format
|
||||
|
@ -3176,21 +3176,17 @@
|
||||
"center"
|
||||
(gnc:html-markup/format
|
||||
(string-append (if (and (gnc-get-current-book-tax-name)
|
||||
(not (string=? ""
|
||||
(gnc-get-current-book-tax-name))))
|
||||
"Tax Name: %s<BR>"
|
||||
(not (string-null? (gnc-get-current-book-tax-name))))
|
||||
"Tax Name: ~a<br/>"
|
||||
"~a")
|
||||
"Period from ~a to ~s<BR>Tax Year ~a<BR>Tax Entity Type: %s<BR>All amounts in USD unless otherwise noted")
|
||||
"Period from ~a to ~a<br/>Tax Year ~a<br/>Tax Entity Type: ~a<br/>All amounts in USD unless otherwise noted")
|
||||
(gnc-get-current-book-tax-name)
|
||||
from-date
|
||||
to-date
|
||||
tax-year
|
||||
(if (gnc:txf-get-tax-entity-type-description
|
||||
(string->symbol tax-entity-type))
|
||||
(gnc:txf-get-tax-entity-type-description
|
||||
(string->symbol tax-entity-type))
|
||||
"None specified"
|
||||
)
|
||||
(or (gnc:txf-get-tax-entity-type-description
|
||||
(string->symbol tax-entity-type))
|
||||
"None specified")
|
||||
)))))
|
||||
|
||||
(if (not (null? txf-invalid-alist))
|
||||
@ -3199,7 +3195,7 @@
|
||||
doc (gnc:make-html-text
|
||||
(gnc:html-markup-p
|
||||
(gnc:html-markup/format
|
||||
"<BR>The following Account(s) have errors with their Income Tax code assignments (use 'Edit->Tax Report Options' to correct):"))))
|
||||
"<br/>The following Account(s) have errors with their Income Tax code assignments (use 'Edit->Tax Report Options' to correct):"))))
|
||||
(gnc:html-document-add-object! doc error-table)
|
||||
(gnc:html-table-append-row!
|
||||
error-table
|
||||
@ -3262,7 +3258,7 @@
|
||||
doc (gnc:make-html-text
|
||||
(gnc:html-markup-p
|
||||
(gnc:html-markup/format
|
||||
" <BR> "))))
|
||||
" <br/> "))))
|
||||
)
|
||||
)
|
||||
|
||||
@ -3453,29 +3449,29 @@
|
||||
(gnc:html-markup-p
|
||||
(gnc:html-markup/format
|
||||
(string-append
|
||||
"Selected Report Options:<BR>"
|
||||
"Selected Report Options:<br/>"
|
||||
;; selected accounts
|
||||
" ~a <BR>"
|
||||
" ~a <br/>"
|
||||
;; suppress 0.00 values
|
||||
" ~a <BR>"
|
||||
" ~a <br/>"
|
||||
;; full acct names
|
||||
" ~a <BR>"
|
||||
" ~a <br/>"
|
||||
;; transfer detail
|
||||
" ~a <BR>"
|
||||
" ~a <br/>"
|
||||
;; TXF detail
|
||||
" ~a <BR>"
|
||||
" ~a <br/>"
|
||||
;; action:memo detail
|
||||
" ~a <BR>"
|
||||
" ~a <br/>"
|
||||
;; transaction detail
|
||||
" ~a <BR>"
|
||||
" ~a <br/>"
|
||||
;; special dates
|
||||
" ~a <BR>"
|
||||
" ~a <br/>"
|
||||
;; currency conversion date
|
||||
" ~a <BR>"
|
||||
" ~a <br/>"
|
||||
;; alternate transaction shading
|
||||
(if (gnc-html-engine-supports-css)
|
||||
""
|
||||
" ~a <BR>"
|
||||
" ~a <br/>"
|
||||
))
|
||||
(if (not (null? user-sel-accnts))
|
||||
"Subset of accounts"
|
||||
|
@ -106,12 +106,20 @@
|
||||
value)))
|
||||
|
||||
(define (gnc:assign-colors num-colors)
|
||||
(define base-colors '("red" "orange" "yellow" "green"
|
||||
"cyan" "blue" "purple" "magenta"
|
||||
"orchid" "khaki" "gold" "orange"
|
||||
"red3" "orange3" "yellow3" "green3"
|
||||
"cyan3" "blue3" "purple3" "magenta3"
|
||||
"orchid3" "khaki3" "gold3" "orange3"))
|
||||
;; default CSS colours
|
||||
;; (define base-colors '("red" "orange" "yellow" "green"
|
||||
;; "cyan" "blue" "purple" "magenta"
|
||||
;; "orchid" "khaki" "gold" "orange"
|
||||
;; "red3" "orange3" "yellow3" "green3"
|
||||
;; "cyan3" "blue3" "purple3" "magenta3"
|
||||
;; "orchid3" "khaki3" "gold3" "orange3"))
|
||||
|
||||
;; new base-colors from http://clrs.cc/ and flatuicolors.com
|
||||
(define base-colors (list "#FF4136" "#FF851B" "#FFDC00" "#2ECC40"
|
||||
"#0074D9" "#001f3f" "#85144b" "#7FDBFF"
|
||||
"#F012BE" "#3D9970" "#39CCCC" "#f39c12"
|
||||
"#e74c3c" "#e67e22" "#9b59b6" "#8e44ad"
|
||||
"#16a085" "#d35400"))
|
||||
(define (assign-colors i)
|
||||
(if (<= num-colors i)
|
||||
'()
|
||||
|
@ -479,7 +479,7 @@
|
||||
(append col-labels
|
||||
(list (list-ref columns 2))))
|
||||
(set! col-colors
|
||||
(append col-colors (list "blue")))
|
||||
(append col-colors (list "#0074D9")))
|
||||
(set! all-zeros? #f)))))
|
||||
|
||||
|
||||
@ -495,7 +495,7 @@
|
||||
(append col-labels
|
||||
(list (list-ref columns 7))))
|
||||
(set! col-colors
|
||||
(append col-colors (list "green")))
|
||||
(append col-colors (list "#2ECC40")))
|
||||
(set! all-zeros? #f)))))
|
||||
|
||||
(if (memq 'GLPlot plot-type)
|
||||
@ -515,7 +515,7 @@
|
||||
(append col-labels
|
||||
(list (list-ref columns 5))))
|
||||
(set! col-colors
|
||||
(append col-colors (list "black")))
|
||||
(append col-colors (list "#111111")))
|
||||
|
||||
;; credit
|
||||
(gnc:html-barchart-append-column!
|
||||
@ -525,7 +525,7 @@
|
||||
(append col-labels
|
||||
(list (list-ref columns 6))))
|
||||
(set! col-colors
|
||||
(append col-colors (list "red")))
|
||||
(append col-colors (list "#FF4136")))
|
||||
(set! all-zeros? #f)))))
|
||||
|
||||
(if (not all-zeros?)
|
||||
|
@ -156,7 +156,7 @@
|
||||
(gnc:html-barchart-set-col-labels!
|
||||
chart (list (_ "Budget") (_ "Actual")))
|
||||
(gnc:html-barchart-set-col-colors!
|
||||
chart '("blue" "red"))
|
||||
chart '("#0074D9" "#FF4136"))
|
||||
)
|
||||
;; else
|
||||
(begin
|
||||
@ -169,7 +169,7 @@
|
||||
(gnc:html-linechart-set-col-labels!
|
||||
chart (list (_ "Budget") (_ "Actual")))
|
||||
(gnc:html-linechart-set-col-colors!
|
||||
chart '("blue" "red"))
|
||||
chart '("#0074D9" "#FF4136"))
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -334,9 +334,9 @@
|
||||
))
|
||||
(gnc:html-barchart-set-col-colors!
|
||||
chart (append
|
||||
(if show-in? '("blue") '())
|
||||
(if show-out? '("red") '())
|
||||
(if show-net? '("green") '())
|
||||
(if show-in? '("#0074D9") '())
|
||||
(if show-out? '("#FF4136") '())
|
||||
(if show-net? '("#2ECC40") '())
|
||||
))
|
||||
(gnc:report-percent-done 95)
|
||||
|
||||
|
@ -431,7 +431,7 @@
|
||||
(gnc:html-document-set-title!
|
||||
doc (format #f
|
||||
(string-append "~a ~a "
|
||||
(_ "For Period Covering %s to %s"))
|
||||
(_ "For Period Covering ~a to ~a"))
|
||||
company-name report-title
|
||||
(qof-print-date start-date-printable)
|
||||
(qof-print-date end-date)))
|
||||
|
@ -375,9 +375,9 @@
|
||||
(gnc:html-barchart-set-col-colors!
|
||||
chart (append
|
||||
(if show-sep?
|
||||
'("blue" "red") '())
|
||||
'("#0074D9" "#FF4136") '())
|
||||
(if show-net?
|
||||
'("green") '())))
|
||||
'("#2ECC40") '())))
|
||||
|
||||
;; URLs for income/expense or asset/liabilities bars.
|
||||
;; (if show-sep?
|
||||
|
@ -418,9 +418,9 @@
|
||||
(gnc:html-linechart-set-col-colors!
|
||||
chart (append
|
||||
(if show-sep?
|
||||
'("blue" "red") '())
|
||||
'("#0074D9" "#FF4136") '())
|
||||
(if show-net?
|
||||
'("green") '())))
|
||||
'("#2ECC40") '())))
|
||||
|
||||
;; Set the line width and markers
|
||||
(gnc:html-linechart-set-line-width!
|
||||
|
@ -221,8 +221,7 @@
|
||||
(export gnc:time64-ge-date)
|
||||
(export gnc:make-date-interval-list)
|
||||
(export gnc:make-date-list)
|
||||
(export make-zdate)
|
||||
(export SecDelta )
|
||||
(export SecDelta)
|
||||
(export DayDelta)
|
||||
(export WeekDelta )
|
||||
(export TwoWeekDelta)
|
||||
|
Loading…
Reference in New Issue
Block a user