*** empty log message ***

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2166 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-04-07 21:06:23 +00:00
parent 77130e8dee
commit cf305fbddf
13 changed files with 3160 additions and 3148 deletions

View File

@ -1,3 +1,9 @@
2000-04-07 Dave Peticolas <peticola@cs.ucdavis.edu>
* Makefile.in: changed [ -e filename ] to [ -f filename ]
* src/scm/report.scm: Changed the report format to be a record.
2000-04-05 Dave Peticolas <peticola@cs.ucdavis.edu> 2000-04-05 Dave Peticolas <peticola@cs.ucdavis.edu>
* configure.in: removed check for eperl * configure.in: removed check for eperl

View File

@ -146,24 +146,24 @@ install:
# Put these in the opposite order of precedence. Final bin/gnucash link will # Put these in the opposite order of precedence. Final bin/gnucash link will
# point to the last one that exists... # point to the last one that exists...
-[ -e gnucash.qt.static ] && \ -[ -f gnucash.qt.static ] && \
${MAKE} FLAVOR=qt.static GNC_BINDIR=${GNC_BINDIR} install-bin ${MAKE} FLAVOR=qt.static GNC_BINDIR=${GNC_BINDIR} install-bin
-[ -e gnucash.qt ] && ${MAKE} FLAVOR=qt GNC_BINDIR=${GNC_BINDIR} install-bin -[ -f gnucash.qt ] && ${MAKE} FLAVOR=qt GNC_BINDIR=${GNC_BINDIR} install-bin
-[ -e gnucash.motif.static ] && \ -[ -f gnucash.motif.static ] && \
${MAKE} FLAVOR=motif.static GNC_BINDIR=${GNC_BINDIR} install-bin ${MAKE} FLAVOR=motif.static GNC_BINDIR=${GNC_BINDIR} install-bin
-[ -e gnucash.motif ] && ${MAKE} FLAVOR=motif GNC_BINDIR=${GNC_BINDIR} install-bin -[ -f gnucash.motif ] && ${MAKE} FLAVOR=motif GNC_BINDIR=${GNC_BINDIR} install-bin
-[ -e gnucash.gnome.static ] && \ -[ -f gnucash.gnome.static ] && \
${MAKE} FLAVOR=gnome.static GNC_BINDIR=${GNC_BINDIR} install-bin ${MAKE} FLAVOR=gnome.static GNC_BINDIR=${GNC_BINDIR} install-bin
-[ -e gnucash.gnome ] && ${MAKE} FLAVOR=gnome GNC_BINDIR=${GNC_BINDIR} install-bin -[ -f gnucash.gnome ] && ${MAKE} FLAVOR=gnome GNC_BINDIR=${GNC_BINDIR} install-bin
# Make sure at least one succeeded # Make sure at least one succeeded
[ \ [ \
-e ${GNC_BINDIR}/gnucash.motif -o \ -f ${GNC_BINDIR}/gnucash.motif -o \
-e ${GNC_BINDIR}/gnucash.motif.static -o \ -f ${GNC_BINDIR}/gnucash.motif.static -o \
-e ${GNC_BINDIR}/gnucash.gnome -o \ -f ${GNC_BINDIR}/gnucash.gnome -o \
-e ${GNC_BINDIR}/gnucash.gnome.static -o \ -f ${GNC_BINDIR}/gnucash.gnome.static -o \
-e ${GNC_BINDIR}/gnucash.qt -o \ -f ${GNC_BINDIR}/gnucash.qt -o \
-e ${GNC_BINDIR}/gnucash.qt.static \ -f ${GNC_BINDIR}/gnucash.qt.static \
] ]
$(INSTALL) src/quotes/gnc-prices ${GNC_BINDIR} $(INSTALL) src/quotes/gnc-prices ${GNC_BINDIR}

View File

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gnucash 1.3.X\n" "Project-Id-Version: gnucash 1.3.X\n"
"POT-Creation-Date: 2000-04-03 22:29-0700\n" "POT-Creation-Date: 2000-04-03 22:29-0700\n"
"PO-Revision-Date: 2000-04-02 18:35+0100\n" "PO-Revision-Date: 2000-04-07 22:05+0100\n"
"Last-Translator: Yannick LE NY <y-le-ny@ifrance.com>\n" "Last-Translator: Yannick LE NY <y-le-ny@ifrance.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -597,15 +597,13 @@ msgstr "Entrez la valeur totale des titres"
# messages-i18n.c:129 # messages-i18n.c:129
#: messages-i18n.c:86 #: messages-i18n.c:86
#, fuzzy
msgid "Enter the account to transfer from, or choose one from the list" msgid "Enter the account to transfer from, or choose one from the list"
msgstr "Entrez le compte à transférer, ou choisissez en un dans la liste." msgstr "Entrez le compte à transférer depuis, ou choisissez en un dans la liste."
# messages-i18n.c:129 # messages-i18n.c:129
#: messages-i18n.c:87 #: messages-i18n.c:87
#, fuzzy
msgid "Enter the account to transfer to, or choose one from the list" msgid "Enter the account to transfer to, or choose one from the list"
msgstr "Entrez le compte à transférer, ou choisissez en un dans la liste." msgstr "Entrez le compte à transférer vers, ou choisissez en un dans la liste."
# messages-i18n.c:132 # messages-i18n.c:132
#: messages-i18n.c:88 #: messages-i18n.c:88
@ -1386,7 +1384,7 @@ msgstr "Nettoyer"
#: messages-i18n.c:239 #: messages-i18n.c:239
msgid "Search Results" msgid "Search Results"
msgstr "" msgstr "Résultats de la recherche"
# messages-i18n.c:330 po/guile_strings.txt:161 # messages-i18n.c:330 po/guile_strings.txt:161
#: messages-i18n.c:240 po/guile_strings.txt:164 #: messages-i18n.c:240 po/guile_strings.txt:164
@ -2115,9 +2113,8 @@ msgstr "Calculer le bilan jusqu'
# messages-i18n.c:346 # messages-i18n.c:346
#: po/guile_strings.txt:133 #: po/guile_strings.txt:133
#, fuzzy
msgid "Transaction Report" msgid "Transaction Report"
msgstr "Transaction" msgstr "Rapport de transaction"
# po/guile_strings.txt:131 # po/guile_strings.txt:131
#: po/guile_strings.txt:134 #: po/guile_strings.txt:134

View File

@ -854,8 +854,7 @@ xaccReadQIFTransaction (int fd, Account *acc, int guess_name,
* for the very, very first transaction. This also seems to be the case * for the very, very first transaction. This also seems to be the case
* for Quicken 5.0 (and others?). * for Quicken 5.0 (and others?).
*/ */
if (opening_balance) { if (opening_balance && guess_name) {
if (guess_name) {
/* remove square brackets from name, remove carriage return ... */ /* remove square brackets from name, remove carriage return ... */
qifline = &qifline[1]; qifline = &qifline[1];
if ('[' == qifline[0]) { if ('[' == qifline[0]) {
@ -868,7 +867,6 @@ xaccReadQIFTransaction (int fd, Account *acc, int guess_name,
tmp = strchr (qifline, '\n'); tmp = strchr (qifline, '\n');
if (tmp) *tmp = 0x0; if (tmp) *tmp = 0x0;
xaccAccountSetName (acc, qifline); xaccAccountSetName (acc, qifline);
}
} else { } else {
/* locate the transfer account */ /* locate the transfer account */
xfer_acc = xaccGetXferQIFAccount (acc, qifline); xfer_acc = xaccGetXferQIFAccount (acc, qifline);

View File

@ -1,3 +1,23 @@
/********************************************************************\
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License*
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
* Boston, MA 02111-1307, USA gnu@gnu.org *
* *
\********************************************************************/
/* /*
* FILE: * FILE:
* Session.h * Session.h
@ -25,22 +45,6 @@
* Copyright (c) 1998, 1999 Linas Vepstas * Copyright (c) 1998, 1999 Linas Vepstas
*/ */
/********************************************************************\
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License*
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
\********************************************************************/
#ifndef __XACC_SESSION_H__ #ifndef __XACC_SESSION_H__
#define __XACC_SESSION_H__ #define __XACC_SESSION_H__
@ -52,7 +56,7 @@ typedef struct _session Session;
/** PROTOTYPES ******************************************************/ /** PROTOTYPES ******************************************************/
/* /*
* The xaccMallocSession() routine simply mallocs memory for a session object. * The xaccMallocSession() routine simply mallocs memory for a session object.
* The xaccInitSession() routine initializes memry for a session object. * The xaccInitSession() routine initializes memory for a session object.
* The xaccSessionDestroy() routine frees the associated memory. * The xaccSessionDestroy() routine frees the associated memory.
* Note that this routine does *not* free the account group! * Note that this routine does *not* free the account group!
*/ */

View File

@ -17,7 +17,7 @@
(define (gnc:date-get-month datevec) (define (gnc:date-get-month datevec)
(+ (vector-ref datevec 4) 1)) (+ (vector-ref datevec 4) 1))
(define (gnc:date-get-week-day datevec) (define (gnc:date-get-week-day datevec)
(vector-ref datevec 6)) (+ (vector-ref datevec 6) 1))
;; jan 1 == 1 ;; jan 1 == 1
(define (gnc:date-get-year-day datevec) (define (gnc:date-get-year-day datevec)
(+ (vector-ref datevec 7) 1)) (+ (vector-ref datevec 7) 1))

View File

@ -13,8 +13,8 @@
;; to generate the reports menu whenever a new window opens and to ;; to generate the reports menu whenever a new window opens and to
;; figure out what to do when a report needs to be generated. ;; figure out what to do when a report needs to be generated.
;; ;;
;; The key is the string naming the report and the value is the ;; The key is the string naming the report and the value is the report
;; rendering thunk. ;; structure.
(define (gnc:run-report report-name options) (define (gnc:run-report report-name options)
;; Return a string consisting of the contents of the report. ;; Return a string consisting of the contents of the report.
@ -34,22 +34,22 @@
(lambda (item) (display-report-list-item item port)) (lambda (item) (display-report-list-item item port))
lines)))) lines))))
(define (call-report rendering-thunk options) (define (call-report renderer options)
(let ((lines (rendering-thunk options))) (let ((lines (renderer options)))
(report-output->string lines))) (report-output->string lines)))
(let ((report (hash-ref *gnc:_report-info_* report-name))) (let ((report (hash-ref *gnc:_report-info_* report-name)))
(if (not report) (if (not report)
#f #f
(let ((rendering-thunk (gnc:report-rendering-thunk report))) (let ((renderer (gnc:report-renderer report)))
(call-report rendering-thunk options))))) (call-report renderer options)))))
(define (gnc:report-menu-setup win) (define (gnc:report-menu-setup win)
(define menu (gnc:make-menu "_Reports" (list "_Settings"))) (define menu (gnc:make-menu "_Reports" (list "_Settings")))
(define menu-namer (gnc:new-menu-namer)) (define menu-namer (gnc:new-menu-namer))
(define (add-report-menu-item name report)
(define (add-report-menu-item name report)
(let* ((report-string "Report") (let* ((report-string "Report")
(title (string-append (gnc:_ report-string) ": " (gnc:_ name))) (title (string-append (gnc:_ report-string) ": " (gnc:_ name)))
(item #f)) (item #f))
@ -77,14 +77,17 @@
(hash-for-each add-report-menu-item *gnc:_report-info_*)) (hash-for-each add-report-menu-item *gnc:_report-info_*))
(define (gnc:define-report version name option-generator rendering-thunk) (define report-record-structure
(make-record-type "report-record-structure"
; The data items in a report record
'(version name options-generator renderer)))
(define (gnc:define-report . args)
;; For now the version is ignored, but in the future it'll let us ;; For now the version is ignored, but in the future it'll let us
;; change behaviors without breaking older reports. ;; change behaviors without breaking older reports.
;; ;;
;; FIXME: If we wanted to be uber-dynamic we might want to consider ;; The renderer should be a function that accepts one argument,
;; re-generating the menus whenever this function is called. ;; a set of options, and generates the report.
;; The rendering-thunk should be a function that generates the report
;; ;;
;; This code must return as its final value a collection of strings in ;; This code must return as its final value a collection of strings in
;; the form of a list of elements where each element (recursively) is ;; the form of a list of elements where each element (recursively) is
@ -106,17 +109,38 @@
;; ("<html>" "</html>") ;; ("<html>" "</html>")
;; ("<html>" " some text " "</html>") ;; ("<html>" " some text " "</html>")
;; ("<html>" ("some" ("other" " text")) "</html>") ;; ("<html>" ("some" ("other" " text")) "</html>")
(let ((report (vector version name option-generator rendering-thunk)))
(hash-set! *gnc:_report-info_* name report)))
(define (gnc:report-version report) (define (blank-report)
(vector-ref report 0)) ;; Number of #f's == Number of data members
(define (gnc:report-name report) ((record-constructor report-record-structure) #f #f #f #f))
(vector-ref report 1))
(define (gnc:report-options-generator report) (define (args-to-defn in-report-rec args)
(vector-ref report 2)) (let ((report-rec (if in-report-rec
(define (gnc:report-rendering-thunk report) in-report-rec
(vector-ref report 3)) (blank-report))))
(if (null? args)
in-report-rec
(let ((id (car args))
(value (cadr args))
(remainder (cddr args)))
((record-modifier report-record-structure id) report-rec value)
(args-to-defn report-rec remainder)))))
(let ((report-rec (args-to-defn #f args)))
(if (and report-rec
(gnc:report-name report-rec))
(hash-set! *gnc:_report-info_*
(gnc:report-name report-rec) report-rec)
(gnc:warn "gnc:define-report: bad report"))))
(define gnc:report-version
(record-accessor report-record-structure 'version))
(define gnc:report-name
(record-accessor report-record-structure 'name))
(define gnc:report-options-generator
(record-accessor report-record-structure 'options-generator))
(define gnc:report-renderer
(record-accessor report-record-structure 'renderer))
(define (gnc:report-new-options report) (define (gnc:report-new-options report)
(let ((generator (gnc:report-options-generator report))) (let ((generator (gnc:report-options-generator report)))

View File

@ -410,11 +410,7 @@
(string-db 'store 'report-for-and "Report for %s and all subaccounts.") (string-db 'store 'report-for-and "Report for %s and all subaccounts.")
(gnc:define-report (gnc:define-report
;; version 'version 1
1 'name "Account Balance Tracker"
;; Name 'options-generator runavg-options-generator
"Account Balance Tracker" 'renderer average-balance-renderer))
;; Options
runavg-options-generator
;; renderer
average-balance-renderer))

View File

@ -240,30 +240,23 @@
(string-db 'store 'pnl-desc "This page shows your profits and losses.") (string-db 'store 'pnl-desc "This page shows your profits and losses.")
(gnc:define-report (gnc:define-report
;; version 'version 1
1 'name "Balance sheet"
;; Menu name 'options-generator balsht-options-generator
"Balance sheet" 'renderer (lambda (options)
;; Options Generator (generate-balance-sheet-or-pnl
balsht-options-generator (string-db 'lookup 'bal-title)
;; Code to generate the report (string-db 'lookup 'bal-desc)
(lambda (options) options
(generate-balance-sheet-or-pnl (string-db 'lookup 'bal-title) #t)))
(string-db 'lookup 'bal-desc)
options
#t)))
(gnc:define-report (gnc:define-report
;; version 'version 1
1 'name "Profit and Loss"
;; Menu name 'options-generator pnl-options-generator
"Profit and Loss" 'renderer (lambda (options)
;; Options (generate-balance-sheet-or-pnl
pnl-options-generator (string-db 'lookup 'pnl-title)
;; Code to generate the report (string-db 'lookup 'pnl-desc)
(lambda (options) options
(generate-balance-sheet-or-pnl #f))))
(string-db 'lookup 'pnl-title)
(string-db 'lookup 'pnl-desc)
options
#f))))

View File

@ -902,76 +902,79 @@
(make-report-spec (make-report-spec
"Status" (budget-delta-html-proc) 'gnc:report-first budget-report-get-delta))) "Status" (budget-delta-html-proc) 'gnc:report-first budget-report-get-delta)))
(define (gnc:budget-renderer options)
(let* ((begindate (gnc:lookup-option options "Report Options" "From"))
(enddate (gnc:lookup-option options "Report Options" "To"))
(begin-date-secs (car (gnc:timepair-canonical-day-time
(gnc:option-value begindate))))
(end-date-secs (car (gnc:timepair-canonical-day-time
(gnc:option-value enddate))))
(budget-hash (make-hash-table 313))
(budget-list '())
(update-hash (for-each
(lambda (entry)
(set! budget-list (cons
(make-budget-line
entry
(make-empty-budget-report entry))
budget-list))
(for-each
(lambda (account)
(make-budget-hash-entry
budget-hash account
(make-budget-line entry
(budget-line-get-report
(car budget-list)))))
(budget-entry-get-accounts entry)))
(cdr gnc:budget-entries))))
(set! budget-list (cons (make-budget-line (car gnc:budget-entries)
(make-empty-budget-report
(car gnc:budget-entries)))
budget-list))
(budget-calculate-actual! budget-hash
(car budget-list) begin-date-secs end-date-secs)
(for-each
(lambda (line)
(begin
(budget-calculate-nominal! line begin-date-secs end-date-secs)
(budget-calculate-expected! line begin-date-secs end-date-secs)
(budget-calculate-delta! line)))
budget-list)
(let ((report-specs
(case (gnc:option-value
(gnc:lookup-option options "Report Options" "View"))
((full) gnc:budget-full-report-specs)
((balancing) gnc:budget-balance-report-specs)
((status) gnc:budget-status-report-specs)
(else (gnc:debug (list "Invalid view option"
(gnc:option-value
(gnc:lookup-option options
"Report Options"
"View"))))))))
(list
(html-start-document)
"<p>This is a budget report. It is very preliminary, but you may find it useful. To actually change the budget, currently you have to edit budget-report.scm.</p>"
(html-start-table)
(html-table-row-manual
;;(map-in-order
(map
(lambda (spec)
(html-cell-header
(report-spec-get-header spec)))
report-specs))
;;(map-in-order
(budget-html budget-list report-specs)
(budget-totals-html (cdr budget-list) report-specs)
(html-end-table)
(html-end-document)))))
(gnc:define-report (gnc:define-report
;; version 'version 1
1 'name "Budget"
;; Name 'options-generator budget-report-options-generator
"Budget" 'renderer gnc:budget-renderer)
;; Options
budget-report-options-generator
;; renderer
(lambda (options)
(let* ((begindate (gnc:lookup-option options "Report Options" "From"))
(enddate (gnc:lookup-option options "Report Options" "To"))
(begin-date-secs (car (gnc:timepair-canonical-day-time
(gnc:option-value begindate))))
(end-date-secs (car (gnc:timepair-canonical-day-time
(gnc:option-value enddate))))
(budget-hash (make-hash-table 313))
(budget-list '())
(update-hash (for-each
(lambda (entry)
(set! budget-list (cons
(make-budget-line
entry
(make-empty-budget-report entry))
budget-list))
(for-each
(lambda (account)
(make-budget-hash-entry
budget-hash account
(make-budget-line entry (budget-line-get-report (car budget-list)))))
(budget-entry-get-accounts entry)))
(cdr gnc:budget-entries))))
(set! budget-list (cons (make-budget-line (car gnc:budget-entries)
(make-empty-budget-report
(car gnc:budget-entries)))
budget-list))
(budget-calculate-actual! budget-hash (car budget-list) begin-date-secs end-date-secs)
(for-each
(lambda (line)
(begin
(budget-calculate-nominal! line begin-date-secs end-date-secs)
(budget-calculate-expected! line begin-date-secs end-date-secs)
(budget-calculate-delta! line)))
budget-list)
(let ((report-specs
(case (gnc:option-value
(gnc:lookup-option options "Report Options" "View"))
((full) gnc:budget-full-report-specs)
((balancing) gnc:budget-balance-report-specs)
((status) gnc:budget-status-report-specs)
(else (gnc:debug (list "Invalid view option"
(gnc:option-value
(gnc:lookup-option options "Report Options" "View"))))))))
(list
(html-start-document)
"<p>This is a budget report. It is very preliminary, but you may find it useful. To actually change the budget, currently you have to edit budget-report.scm.</p>"
(html-start-table)
(html-table-row-manual
;;(map-in-order
(map
(lambda (spec)
(html-cell-header
(report-spec-get-header spec)))
report-specs))
;;(map-in-order
(budget-html budget-list report-specs)
(budget-totals-html (cdr budget-list) report-specs)
(html-end-table)
(html-end-document))))))

View File

@ -111,11 +111,6 @@
(string-db 'store 'net "Net") (string-db 'store 'net "Net")
(gnc:define-report (gnc:define-report
;; version 'version 1
1 'name "Stock Portfolio"
;; Menu name 'renderer folio-renderer))
"Stock Portfolio"
;; Options Generator
#f
;; Renderer
folio-renderer))

View File

@ -355,16 +355,16 @@
(gnc:define-report (gnc:define-report
;; The version of this report. ;; The version of this report.
1 'version 1
;; The name of this report. This will be used, among other things, ;; The name of this report. This will be used, among other things,
;; for making its menu item in the main menu. You need to use the ;; for making its menu item in the main menu. You need to use the
;; untranslated value here! It will be registered and translated ;; untranslated value here! It will be registered and translated
;; elsewhere. ;; elsewhere.
"Hello, World" 'name "Hello, World"
;; The options generator function defined above. ;; The options generator function defined above.
options-generator 'options-generator options-generator
;; The rendering function defined above. ;; The rendering function defined above.
hello-world-renderer)) 'renderer hello-world-renderer))

View File

@ -547,11 +547,7 @@
(string-db 'store 'net-inflow "Net Inflow") (string-db 'store 'net-inflow "Net Inflow")
(gnc:define-report (gnc:define-report
;; version 'version 1
1 'name "Account Transactions"
;; Name 'options-generator trep-options-generator
"Account Transactions" 'renderer gnc:trep-renderer))
;; Options
trep-options-generator
;; renderer
gnc:trep-renderer))