*** 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>
* 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
# 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
-[ -e gnucash.qt ] && ${MAKE} FLAVOR=qt GNC_BINDIR=${GNC_BINDIR} install-bin
-[ -e gnucash.motif.static ] && \
-[ -f gnucash.qt ] && ${MAKE} FLAVOR=qt GNC_BINDIR=${GNC_BINDIR} install-bin
-[ -f gnucash.motif.static ] && \
${MAKE} FLAVOR=motif.static GNC_BINDIR=${GNC_BINDIR} install-bin
-[ -e gnucash.motif ] && ${MAKE} FLAVOR=motif GNC_BINDIR=${GNC_BINDIR} install-bin
-[ -e gnucash.gnome.static ] && \
-[ -f gnucash.motif ] && ${MAKE} FLAVOR=motif GNC_BINDIR=${GNC_BINDIR} install-bin
-[ -f gnucash.gnome.static ] && \
${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
[ \
-e ${GNC_BINDIR}/gnucash.motif -o \
-e ${GNC_BINDIR}/gnucash.motif.static -o \
-e ${GNC_BINDIR}/gnucash.gnome -o \
-e ${GNC_BINDIR}/gnucash.gnome.static -o \
-e ${GNC_BINDIR}/gnucash.qt -o \
-e ${GNC_BINDIR}/gnucash.qt.static \
-f ${GNC_BINDIR}/gnucash.motif -o \
-f ${GNC_BINDIR}/gnucash.motif.static -o \
-f ${GNC_BINDIR}/gnucash.gnome -o \
-f ${GNC_BINDIR}/gnucash.gnome.static -o \
-f ${GNC_BINDIR}/gnucash.qt -o \
-f ${GNC_BINDIR}/gnucash.qt.static \
]
$(INSTALL) src/quotes/gnc-prices ${GNC_BINDIR}

5941
po/fr.po

File diff suppressed because it is too large Load Diff

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 Quicken 5.0 (and others?).
*/
if (opening_balance) {
if (guess_name) {
if (opening_balance && guess_name) {
/* remove square brackets from name, remove carriage return ... */
qifline = &qifline[1];
if ('[' == qifline[0]) {
@ -868,7 +867,6 @@ xaccReadQIFTransaction (int fd, Account *acc, int guess_name,
tmp = strchr (qifline, '\n');
if (tmp) *tmp = 0x0;
xaccAccountSetName (acc, qifline);
}
} else {
/* locate the transfer account */
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:
* Session.h
@ -25,22 +45,6 @@
* 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__
#define __XACC_SESSION_H__
@ -52,7 +56,7 @@ typedef struct _session Session;
/** PROTOTYPES ******************************************************/
/*
* 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.
* Note that this routine does *not* free the account group!
*/

View File

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

View File

@ -13,8 +13,8 @@
;; to generate the reports menu whenever a new window opens and to
;; 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
;; rendering thunk.
;; The key is the string naming the report and the value is the report
;; structure.
(define (gnc:run-report report-name options)
;; Return a string consisting of the contents of the report.
@ -34,22 +34,22 @@
(lambda (item) (display-report-list-item item port))
lines))))
(define (call-report rendering-thunk options)
(let ((lines (rendering-thunk options)))
(define (call-report renderer options)
(let ((lines (renderer options)))
(report-output->string lines)))
(let ((report (hash-ref *gnc:_report-info_* report-name)))
(if (not report)
#f
(let ((rendering-thunk (gnc:report-rendering-thunk report)))
(call-report rendering-thunk options)))))
(let ((renderer (gnc:report-renderer report)))
(call-report renderer options)))))
(define (gnc:report-menu-setup win)
(define menu (gnc:make-menu "_Reports" (list "_Settings")))
(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")
(title (string-append (gnc:_ report-string) ": " (gnc:_ name)))
(item #f))
@ -77,14 +77,17 @@
(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
;; change behaviors without breaking older reports.
;;
;; FIXME: If we wanted to be uber-dynamic we might want to consider
;; re-generating the menus whenever this function is called.
;; The rendering-thunk should be a function that generates the report
;; The renderer should be a function that accepts one argument,
;; a set of options, and generates the report.
;;
;; 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
@ -106,17 +109,38 @@
;; ("<html>" "</html>")
;; ("<html>" " some 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)
(vector-ref report 0))
(define (gnc:report-name report)
(vector-ref report 1))
(define (gnc:report-options-generator report)
(vector-ref report 2))
(define (gnc:report-rendering-thunk report)
(vector-ref report 3))
(define (blank-report)
;; Number of #f's == Number of data members
((record-constructor report-record-structure) #f #f #f #f))
(define (args-to-defn in-report-rec args)
(let ((report-rec (if in-report-rec
in-report-rec
(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)
(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.")
(gnc:define-report
;; version
1
;; Name
"Account Balance Tracker"
;; Options
runavg-options-generator
;; renderer
average-balance-renderer))
'version 1
'name "Account Balance Tracker"
'options-generator 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.")
(gnc:define-report
;; version
1
;; Menu name
"Balance sheet"
;; Options Generator
balsht-options-generator
;; Code to generate the report
(lambda (options)
(generate-balance-sheet-or-pnl (string-db 'lookup 'bal-title)
(string-db 'lookup 'bal-desc)
options
#t)))
'version 1
'name "Balance sheet"
'options-generator balsht-options-generator
'renderer (lambda (options)
(generate-balance-sheet-or-pnl
(string-db 'lookup 'bal-title)
(string-db 'lookup 'bal-desc)
options
#t)))
(gnc:define-report
;; version
1
;; Menu name
"Profit and Loss"
;; Options
pnl-options-generator
;; Code to generate the report
(lambda (options)
(generate-balance-sheet-or-pnl
(string-db 'lookup 'pnl-title)
(string-db 'lookup 'pnl-desc)
options
#f))))
'version 1
'name "Profit and Loss"
'options-generator pnl-options-generator
'renderer (lambda (options)
(generate-balance-sheet-or-pnl
(string-db 'lookup 'pnl-title)
(string-db 'lookup 'pnl-desc)
options
#f))))

View File

@ -902,76 +902,79 @@
(make-report-spec
"Status" (budget-delta-html-proc) 'gnc:report-first budget-report-get-delta)))
(gnc:define-report
;; version
1
;; Name
"Budget"
;; 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))))
(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))
(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)
(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)
(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))))))
(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
'version 1
'name "Budget"
'options-generator budget-report-options-generator
'renderer gnc:budget-renderer)

View File

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

View File

@ -355,16 +355,16 @@
(gnc:define-report
;; The version of this report.
1
'version 1
;; 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
;; untranslated value here! It will be registered and translated
;; elsewhere.
"Hello, World"
'name "Hello, World"
;; The options generator function defined above.
options-generator
'options-generator options-generator
;; 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")
(gnc:define-report
;; version
1
;; Name
"Account Transactions"
;; Options
trep-options-generator
;; renderer
gnc:trep-renderer))
'version 1
'name "Account Transactions"
'options-generator trep-options-generator
'renderer gnc:trep-renderer))