r16805 - gnucash/trunk/src - Implement a Report GUID.

Andrew Sackville-West andrewsw at cvs.gnucash.org
Sat Jan 5 01:42:21 EST 2008


Author: andrewsw
Date: 2008-01-05 01:42:21 -0500 (Sat, 05 Jan 2008)
New Revision: 16805
Trac: http://svn.gnucash.org/trac/changeset/16805

Modified:
   gnucash/trunk/src/business/business-reports/easy-invoice.scm
   gnucash/trunk/src/business/business-reports/fancy-invoice.scm
   gnucash/trunk/src/business/business-reports/invoice.scm
   gnucash/trunk/src/business/business-reports/owner-report.scm
   gnucash/trunk/src/business/business-reports/payables.scm
   gnucash/trunk/src/business/business-reports/receivables.scm
   gnucash/trunk/src/report/locale-specific/us/taxtxf-de_DE.scm
   gnucash/trunk/src/report/locale-specific/us/taxtxf.scm
   gnucash/trunk/src/report/report-gnome/report-gnome.scm
   gnucash/trunk/src/report/report-system/report-system.scm
   gnucash/trunk/src/report/report-system/report.scm
   gnucash/trunk/src/report/standard-reports/account-piecharts.scm
   gnucash/trunk/src/report/standard-reports/account-summary.scm
   gnucash/trunk/src/report/standard-reports/advanced-portfolio.scm
   gnucash/trunk/src/report/standard-reports/average-balance.scm
   gnucash/trunk/src/report/standard-reports/balance-sheet.scm
   gnucash/trunk/src/report/standard-reports/budget.scm
   gnucash/trunk/src/report/standard-reports/cash-flow.scm
   gnucash/trunk/src/report/standard-reports/category-barchart.scm
   gnucash/trunk/src/report/standard-reports/daily-reports.scm
   gnucash/trunk/src/report/standard-reports/equity-statement.scm
   gnucash/trunk/src/report/standard-reports/general-journal.scm
   gnucash/trunk/src/report/standard-reports/general-ledger.scm
   gnucash/trunk/src/report/standard-reports/income-statement.scm
   gnucash/trunk/src/report/standard-reports/net-barchart.scm
   gnucash/trunk/src/report/standard-reports/portfolio.scm
   gnucash/trunk/src/report/standard-reports/price-scatter.scm
   gnucash/trunk/src/report/standard-reports/register.scm
   gnucash/trunk/src/report/standard-reports/transaction.scm
   gnucash/trunk/src/report/standard-reports/trial-balance.scm
   gnucash/trunk/src/report/utility-reports/hello-world.scm
   gnucash/trunk/src/report/utility-reports/test-graphing.scm
   gnucash/trunk/src/report/utility-reports/view-column.scm
   gnucash/trunk/src/report/utility-reports/welcome-to-gnucash.scm
Log:
Implement a Report GUID.

This is an internal representation of the report. It frees up the various name
fields for translation/changes without concern about it breaking reports*. Each
report is now assigned a GUID that refers to that specific report. All
reference to the report is now done with this GUID.

Support is included for using existing open or saved reports of the old
reference-by-name type. The user is warned of the existence of saved reports
without a GUID. Support is also provided to allow reports saved or left open
using the new report-guid reference to be accessed in 2.2.3(?) versions in case
user downgrades.

IMPORTANT: All saved or open reports created using these changes *will* *cause*
*application* *crashes* if accessed in versions prior to r16804. Earlier
versions have neither the new functions nor the report-record fields
implemented here. It is a one-way trip from pre-r16804 to here. I hope that is
clear enough ;)

* going forward only. name changes will still break non-report-guid saved or
open reports.


Modified: gnucash/trunk/src/business/business-reports/easy-invoice.scm
===================================================================
--- gnucash/trunk/src/business/business-reports/easy-invoice.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/business/business-reports/easy-invoice.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -854,6 +854,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Easy Invoice")
+ 'report-guid "67112f318bef4fc496bdc27d106bbda4"
  'menu-path (list gnc:menuname-business-reports)
  'options-generator options-generator
  'renderer reg-renderer

Modified: gnucash/trunk/src/business/business-reports/fancy-invoice.scm
===================================================================
--- gnucash/trunk/src/business/business-reports/fancy-invoice.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/business/business-reports/fancy-invoice.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -958,6 +958,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Fancy Invoice")
+ 'report-guid "3ce293441e894423a2425d7a22dd1ac6"
  'menu-path (list gnc:menuname-business-reports)
  'options-generator options-generator
  'renderer reg-renderer

Modified: gnucash/trunk/src/business/business-reports/invoice.scm
===================================================================
--- gnucash/trunk/src/business/business-reports/invoice.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/business/business-reports/invoice.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -750,6 +750,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Printable Invoice")
+ 'report-guid "5123a759ceb9483abf2182d01c140e8d"
  'menu-path (list gnc:menuname-business-reports)
  'options-generator options-generator
  'renderer reg-renderer

Modified: gnucash/trunk/src/business/business-reports/owner-report.scm
===================================================================
--- gnucash/trunk/src/business/business-reports/owner-report.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/business/business-reports/owner-report.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -678,6 +678,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Customer Report")
+ 'report-guid "c146317be32e4948a561ec7fc89d15c1"
  'menu-path (list gnc:menuname-business-reports)
  'options-generator customer-options-generator
  'renderer reg-renderer
@@ -686,6 +687,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Vendor Report")
+ 'report-guid "d7d1e53505ee4b1b82efad9eacedaea0"
  'menu-path (list gnc:menuname-business-reports)
  'options-generator vendor-options-generator
  'renderer reg-renderer
@@ -694,6 +696,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Employee Report")
+ 'report-guid "08ae9c2e884b4f9787144f47eacd7f44"
  'menu-path (list gnc:menuname-business-reports)
  'options-generator employee-options-generator
  'renderer reg-renderer

Modified: gnucash/trunk/src/business/business-reports/payables.scm
===================================================================
--- gnucash/trunk/src/business/business-reports/payables.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/business/business-reports/payables.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -66,6 +66,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Payable Aging")
+ 'report-guid "e57770f2dbca46619d6dac4ac5469b50"
  'menu-path (list gnc:menuname-business-reports)
  'options-generator options-generator
  'renderer payables-renderer

Modified: gnucash/trunk/src/business/business-reports/receivables.scm
===================================================================
--- gnucash/trunk/src/business/business-reports/receivables.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/business/business-reports/receivables.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -67,6 +67,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Receivable Aging")
+ 'report-guid "9cf76bed17f14401b8e3e22d0079cb98"
  'menu-path (list gnc:menuname-business-reports)
  'options-generator options-generator
  'renderer receivables-renderer

Modified: gnucash/trunk/src/report/locale-specific/us/taxtxf-de_DE.scm
===================================================================
--- gnucash/trunk/src/report/locale-specific/us/taxtxf-de_DE.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/locale-specific/us/taxtxf-de_DE.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -857,6 +857,7 @@
 (gnc:define-report
  'version 1
  'name reportname
+ 'report-guid "758b125c05e54531a7dec5f1ef0ef9c8"
  'menu-name (N_ "Tax Report & XML Export")
  ;;'menu-path (list gnc:menuname-taxes)
  'menu-tip (N_ "Taxable Income / Deductible Expenses / Export to .XML file")

Modified: gnucash/trunk/src/report/locale-specific/us/taxtxf.scm
===================================================================
--- gnucash/trunk/src/report/locale-specific/us/taxtxf.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/locale-specific/us/taxtxf.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -821,6 +821,7 @@
 (gnc:define-report
  'version 1
  'name reportname
+ 'report-guid "f8921f4e5c284d7caca81e239f468a68"
  'menu-name (N_ "Tax Report & TXF Export")
  ;;'menu-path (list gnc:menuname-taxes)
  'menu-tip (N_ "Taxable Income / Deductible Expenses / Export to .TXF file")

Modified: gnucash/trunk/src/report/report-gnome/report-gnome.scm
===================================================================
--- gnucash/trunk/src/report/report-gnome/report-gnome.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/report-gnome/report-gnome.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -77,12 +77,13 @@
                  menu-path
                  (lambda (window)
                    (let ((report (gnc:make-report
-                                  (gnc:report-template-name template))))
+                                  (gnc:report-template-report-guid template))))
                      (gnc-main-window-open-report report window)))))
           (gnc-add-scm-extension item))))
 
-  (define (add-template name template)
-    (let ((menu-name (gnc:report-template-menu-name template)))
+  (define (add-template report-guid template)
+    (let ((name (gnc:report-template-name template))
+	  (menu-name (gnc:report-template-menu-name template)))
       (if menu-name (set! name menu-name))
       (set! *template-items* (cons (cons name template) *template-items*))))
 

Modified: gnucash/trunk/src/report/report-system/report-system.scm
===================================================================
--- gnucash/trunk/src/report/report-system/report-system.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/report-system/report-system.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -108,11 +108,14 @@
 (export gnc:report-template-new-options/name)
 (export gnc:report-template-new-options/report-guid)
 (export gnc:report-template-menu-name/name)
+(export gnc:report-template-menu-name/report-guid)
 (export gnc:report-template-renderer/name)
 (export gnc:report-template-renderer/report-guid)
 (export gnc:report-template-new-options)
 (export gnc:report-template-version)
 (export gnc:report-template-name)
+(export gnc:report-template-report-guid)
+(export gnc:report-template-set-report-guid!)
 (export gnc:report-template-options-generator)
 (export gnc:report-template-options-cleanup-cb)
 (export gnc:report-template-options-changed-cb)

Modified: gnucash/trunk/src/report/report-system/report.scm
===================================================================
--- gnucash/trunk/src/report/report-system/report.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/report-system/report.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -43,6 +43,10 @@
 (define gnc:pagename-display (N_ "Display"))
 (define gnc:optname-reportname (N_ "Report name"))
 
+;; we want to warn users if they've got an old-style, non-guid saved
+;; report, but only once
+(define gnc:old-style-report-warned #f)
+
 ;; A <report-template> represents one of the available report types.
 (define <report-template>
   (make-record-type "<report-template>"
@@ -93,24 +97,59 @@
 
   (let ((report-rec (args-to-defn #f args)))
     (if (and report-rec
-             (gnc:report-template-name report-rec))
-	(let* ((name (gnc:report-template-name report-rec))
-	       (tmpl (hash-ref *gnc:_report-templates_* name)))
+	     ;; only process reports that have a report-guid
+             (gnc:report-template-report-guid report-rec))
+	(let* ((report-guid (gnc:report-template-report-guid report-rec))
+	       (name (gnc:report-template-name report-rec))
+	       (tmpl (hash-ref *gnc:_report-templates_* report-guid)))
 	  (if (not tmpl)
 	      (hash-set! *gnc:_report-templates_*
-			 (gnc:report-template-name report-rec) report-rec)
+			 report-guid report-rec)
 	      (begin
 		;; FIXME: We should pass the top-level window
 		;; instead of the '() to gnc-error-dialog, but I
 		;; have no idea where to get it from.
-		(gnc-error-dialog '() (string-append (_ "A custom report with this name already exists. Either rename the report to store it with a different name, or edit your saved-reports file and delete the section with the following name: ") name ))
+		(gnc-error-dialog '() (string-append (_ "One of your reports has a report-guid that is a duplicate. Please check the report system, especially your saved reports, for a report with this report-guid: ") report-guid))
 		)))
-        (gnc:warn "gnc:define-report: bad report"))))
+	(begin
+	  (if (gnc:report-template-name report-rec)
+	      (begin
+		;; we've got an old style report with no report-id, give it an arbitrary one
+		(gnc:report-template-set-report-guid! report-rec (guid-new-return))
+		;; we also need to give it a parent-type, so that it will restore from the open state properly
+		;; we'll key that from the only known good way to tie back to the original report -- the renderer
+		(hash-for-each
+		 (lambda (id rec) 
+		   (if (and (equal? (gnc:report-template-renderer rec) 
+				    (gnc:report-template-renderer report-rec))
+			    (not (gnc:report-template-parent-type rec)))
+		       (begin
+			 (gnc:debug "gnc:define-report: setting parent-type of " (gnc:report-template-name report-rec) " to " (gnc:report-template-report-guid rec))
+			 (gnc:report-template-set-parent-type! report-rec (gnc:report-template-report-guid rec))
+			 (gnc:debug "done setting, is now " (gnc:report-template-parent-type report-rec))))) 
+		 *gnc:_report-templates_*)))
+	  
+	  (if (not gnc:old-style-report-warned)
+	      (begin
+		(set! gnc:old-style-report-warned #t)
+		(gnc-error-dialog '() (string-append (_ "Your report system includes one or more reports without a proper report-guid field. This report may break without warning in future versions of GnuCash. Please review your saved reports file and update those reports.")))))
+	  (hash-set! *gnc:_report-templates_*
+		     (gnc:report-template-report-guid report-rec) report-rec)
+	  (gnc:warn "gnc:define-report: old-style report. setting guid for " (gnc:report-template-name report-rec) " to " (gnc:report-template-report-guid report-rec)))
+	)))
 
 (define gnc:report-template-version
   (record-accessor <report-template> 'version))
+(define gnc:report-template-report-guid
+  (record-accessor <report-template> 'report-guid))
+(define gnc:report-template-set-report-guid!
+  (record-modifier <report-template> 'report-guid))
 (define gnc:report-template-name
   (record-accessor <report-template> 'name))
+(define gnc:report-template-parent-type
+  (record-accessor <report-template> 'parent-type))
+(define gnc:report-template-set-parent-type!
+  (record-modifier <report-template> 'parent-type))
 (define gnc:report-template-set-name
   (record-modifier <report-template> 'name))
 (define gnc:report-template-options-generator
@@ -134,25 +173,60 @@
 (define gnc:report-template-export-thunk
   (record-accessor <report-template> 'export-thunk))
 
-(define (gnc:report-template-new-options/name template-name)
-  (let ((templ (hash-ref *gnc:_report-templates_* template-name)))
+(define (gnc:report-template-name-to-id template-name)
+  (let ((template-id #f))
+    (hash-for-each
+     (lambda (id rec)
+       (if (equal? template-name (gnc:report-template-name rec))
+	   (set! template-id id))) *gnc:_report-templates_*)
+    template-id))
+
+(define (gnc:report-template-new-options/report-guid template-id template-name)
+  (let ((templ (hash-ref *gnc:_report-templates_* template-id)))
     (if templ
         (gnc:report-template-new-options templ)
         #f)))
 
-;; dummy function to enable backwards compatibility of newer reports
-(define (gnc:report-template-new-options/report-guid template-id template-name)
-  (gnc:report-template-new-options/name template-name))
+(define (gnc:report-template-new-options/name template-name)
+  (let ((templ #f))
+    (hash-for-each 
+     (lambda (id rec)
+       (if (equal? template-name (gnc:report-template-name rec))
+	   (set! templ (hash-ref *gnc:_report-templates_* id)))) *gnc:_report-templates_*)
+    (if templ
+	(gnc:report-template-new-options templ)
+	#f)))
 
+(define (gnc:report-template-menu-name/report-guid template-id)
+  (let ((templ (hash-ref *gnc:_report-templates_* template-id)))
+    (if templ
+	(or (gnc:report-template-menu-name templ)
+	    (gnc:report-template-name templ))
+        #f)))
+
 (define (gnc:report-template-menu-name/name template-name)
-  (let ((templ (hash-ref *gnc:_report-templates_* template-name)))
+  (let ((templ #f))
+    (hash-for-each
+     (lambda (id rec)
+       (if (equal? template-name (gnc:report-template-name rec))
+	   (set! templ (hash-ref *gnc:_report-templates_* id)))) *gnc:_report-templates_*)
     (if templ
 	(or (gnc:report-template-menu-name templ)
 	    (gnc:report-template-name templ))
         #f)))
 
+(define (gnc:report-template-renderer/report-guid template-id template-name)
+  (let ((templ (hash-ref *gnc:_report-templates_* template-id)))
+    (if templ
+	(gnc:report-template-renderer templ)
+        #f)))
+
 (define (gnc:report-template-renderer/name template-name)
-  (let ((templ (hash-ref *gnc:_report-templates_* template-name)))
+  (let ((templ #f))
+    (hash-for-each
+     (lambda (id rec)
+       (if (equal? template-name (gnc:report-template-name rec))
+	   (set! templ (hash-ref *gnc:_report-templates_* id)))) *gnc:_report-templates_*)
     (if templ
 	(gnc:report-template-renderer templ)
         #f)))
@@ -251,8 +325,12 @@
 ;; gnc:make-report instantiates a report from a report-template.
 ;; The actual report is stored away in a hash-table -- only the id is returned.
 (define (gnc:make-report template-name . rest)
-  (let ((r ((record-constructor <report>) 
-            template-name ;; type
+  (let* ((template-parent (gnc:report-template-parent-type (hash-ref *gnc:_report-templates_* template-name)))
+	 (report-type (if template-parent
+			  template-parent
+			  template-name))
+	 (r ((record-constructor <report>) 
+            report-type ;; type
             #f            ;; id
             #f            ;; options
             #t            ;; dirty
@@ -283,15 +361,16 @@
 ;; This is the function that is called when saved reports are evaluated.
 (define (gnc:restore-report id template-name options)
   (let ((r ((record-constructor <report>)
-            template-name id options #t #t #f #f)))
+            (gnc:report-template-name-to-id template-name) id options #t #t #f #f)))
     (gnc-report-add r))
   )
 
-;; dummy function to enable backwards compatibility with newer reports
 (define (gnc:restore-report-by-guid id template-id template-name options)
-  (gnc:restore-report id template-name options))
+  (let ((r ((record-constructor <report>)
+            template-id id options #t #t #f #f)))
+    (gnc-report-add r))
+  )
 
-
 (define (gnc:make-report-options template-name)
   (let ((template (hash-ref *gnc:_report-templates_* template-name)))
     (if template
@@ -373,12 +452,12 @@
    ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n"
    (simple-format #f ";; options for report ~S\n" (gnc:report-name report))
    (simple-format
-    #f "(let ((options (gnc:report-template-new-options/name ~S)))\n"
-    (gnc:report-type report))
+    #f "(let ((options (gnc:report-template-new-options/report-guid ~S ~S)))\n"
+    (gnc:report-type report) (gnc:report-template-name (hash-ref *gnc:_report-templates_* (gnc:report-type report))))
    (gnc:generate-restore-forms (gnc:report-options report) "options")
    (simple-format 
-    #f "  (gnc:restore-report ~S ~S options))\n"
-    (gnc:report-id report) (gnc:report-type report))))
+    #f "  (gnc:restore-report-by-guid ~S ~S ~S options))\n"
+    (gnc:report-id report) (gnc:report-type report) (gnc:report-template-name (hash-ref *gnc:_report-templates_* (gnc:report-type report))))))
 
 (define (gnc:report-generate-saved-forms report)
   ;; clean up the options if necessary.  this is only needed 
@@ -396,14 +475,17 @@
    (simple-format #f ";; Options for saved report ~S, based on template ~S\n"
 		  (gnc:report-name report) (gnc:report-type report))
    (simple-format
-    #f "(let ()\n (define (options-gen)\n  (let ((options (gnc:report-template-new-options/name ~S)))\n"
-    (gnc:report-type report))
+    #f "(let ()\n (define (options-gen)\n  (let ((options (gnc:report-template-new-options/report-guid ~S ~S)))\n"
+    (gnc:report-type report) (gnc:report-template-name (hash-ref *gnc:_report-templates_* (gnc:report-type report))))
    (gnc:generate-restore-forms (gnc:report-options report) "options")
    "  options))\n"
    (simple-format 
-    #f " (gnc:define-report \n  'version 1\n  'name ~S\n  'options-generator options-gen\n  'menu-path (list gnc:menuname-custom)\n  'renderer (gnc:report-template-renderer/name ~S)))\n\n"
+    #f " (gnc:define-report \n  'version 1\n  'name ~S\n  'report-guid ~S\n  'parent-type ~S\n  'options-generator options-gen\n  'menu-path (list gnc:menuname-custom)\n  'renderer (gnc:report-template-renderer/report-guid ~S ~S)))\n\n"
     (gnc:report-name report)
-    (gnc:report-type report))))
+    (guid-new-return) ;; when saving a report, we need to create a guid for it for later reloading
+    (gnc:report-type report) ;;a saved report also needs its type stored separately to reference the template
+    (gnc:report-type report)
+    (gnc:report-template-name (hash-ref *gnc:_report-templates_* (gnc:report-type report))))))
 
 (define gnc:current-saved-reports
   (gnc-build-dotgnucash-path "saved-reports-2.0"))
@@ -478,7 +560,7 @@
 
 ;; "thunk" should take the report-type and the report template record
 (define (gnc:report-templates-for-each thunk)
-  (hash-for-each (lambda (name template) (thunk name template))
+  (hash-for-each (lambda (report-id template) (thunk report-id template))
                  *gnc:_report-templates_*))
 
 ;; return the list of reports embedded in the specified report

Modified: gnucash/trunk/src/report/standard-reports/account-piecharts.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/account-piecharts.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/account-piecharts.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -463,6 +463,7 @@
      (gnc:define-report
       'version 1
       'name (car l)
+      'report-guid (car (reverse l))
       'menu-path (if (caddr l)
 		     (list gnc:menuname-income-expense)
 		     (list gnc:menuname-asset-liability)) 
@@ -479,15 +480,15 @@
  (list 
   ;; reportname, account-types, do-intervals?, 
   ;; menu-reportname, menu-tip
-  (list reportname-income (list ACCT-TYPE-INCOME) #t menuname-income menutip-income (lambda (x) #t))
-  (list reportname-expense (list ACCT-TYPE-EXPENSE) #t menuname-expense menutip-expense (lambda (x) #f))
+  (list reportname-income (list ACCT-TYPE-INCOME) #t menuname-income menutip-income (lambda (x) #t) "e1bd09b8a1dd49dd85760db9d82b045c")
+  (list reportname-expense (list ACCT-TYPE-EXPENSE) #t menuname-expense menutip-expense (lambda (x) #f) "9bf1892805cb4336be6320fe48ce5446")
   (list reportname-assets
         (list ACCT-TYPE-ASSET ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CHECKING
               ACCT-TYPE-SAVINGS ACCT-TYPE-MONEYMRKT
               ACCT-TYPE-RECEIVABLE ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL
               ACCT-TYPE-CURRENCY)
-        #f menuname-assets menutip-assets (lambda (x) #f))
+        #f menuname-assets menutip-assets (lambda (x) #f) "5c7fd8a1fe9a4cd38884ff54214aa88a")
   (list reportname-liabilities 
         (list ACCT-TYPE-LIABILITY ACCT-TYPE-PAYABLE ACCT-TYPE-CREDIT
               ACCT-TYPE-CREDITLINE)
-        #f menuname-liabilities menutip-liabilities (lambda (x) #t))))
+        #f menuname-liabilities menutip-liabilities (lambda (x) #t) "3fe6dce77da24c66bdc8f8efdea7f9ac")))

Modified: gnucash/trunk/src/report/standard-reports/account-summary.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/account-summary.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/account-summary.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -504,6 +504,7 @@
 (gnc:define-report 
  'version 1
  'name reportname
+ 'report-guid "3298541c236b494998b236dfad6ad752"
  'options-generator accsum-options-generator
  'renderer accsum-renderer)
 

Modified: gnucash/trunk/src/report/standard-reports/advanced-portfolio.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/advanced-portfolio.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/advanced-portfolio.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -941,6 +941,7 @@
 
 (gnc:define-report
  'version 1
+ 'report-guid "21d7cfc59fc74f22887596ebde7e462d"
  'name reportname
  'menu-path (list gnc:menuname-asset-liability)
  'options-generator options-generator

Modified: gnucash/trunk/src/report/standard-reports/average-balance.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/average-balance.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/average-balance.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -528,6 +528,7 @@
 (gnc:define-report
  'version 1
  'name reportname
+ 'report-guid "d5adcc61c62e4b8684dd8907448d7900"
  'menu-path (list gnc:menuname-asset-liability)
  'options-generator options-generator
  'renderer renderer)

Modified: gnucash/trunk/src/report/standard-reports/balance-sheet.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/balance-sheet.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/balance-sheet.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -729,6 +729,7 @@
 (gnc:define-report 
  'version 1
  'name reportname
+ 'report-guid "c4173ac99b2b448289bf4d11c731af13"
  'menu-path (list gnc:menuname-asset-liability)
  'options-generator balance-sheet-options-generator
  'renderer (lambda (report-obj)

Modified: gnucash/trunk/src/report/standard-reports/budget.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/budget.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/budget.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -360,6 +360,7 @@
 (gnc:define-report
  'version 1
  'name reportname
+ 'report-guid "810ed4b25ef0486ea43bbd3dddb32b11"
  'menu-path (list gnc:menuname-income-expense)
  'options-generator budget-report-options-generator
  'renderer budget-renderer)

Modified: gnucash/trunk/src/report/standard-reports/cash-flow.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/cash-flow.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/cash-flow.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -528,6 +528,7 @@
 (gnc:define-report 
  'version 1
  'name reportname
+ 'report-guid "f8748b813fab4220ba26e743aedf38da"
  'menu-path (list gnc:menuname-income-expense)
  'options-generator cash-flow-options-generator
  'renderer cash-flow-renderer)

Modified: gnucash/trunk/src/report/standard-reports/category-barchart.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/category-barchart.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/category-barchart.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -541,6 +541,7 @@
      (gnc:define-report
       'version 1
       'name (car l)
+      'report-guid (car (reverse l))
       'menu-path (if (caddr l)
 		     (list gnc:menuname-income-expense)
 		     (list gnc:menuname-asset-liability))
@@ -555,15 +556,15 @@
  (list 
   ;; reportname, account-types, do-intervals?, 
   ;; menu-reportname, menu-tip
-  (list reportname-income (list ACCT-TYPE-INCOME) #t menuname-income menutip-income (lambda (x) #t))
-  (list reportname-expense (list ACCT-TYPE-EXPENSE) #t menuname-expense menutip-expense (lambda (x) #f))
+  (list reportname-income (list ACCT-TYPE-INCOME) #t menuname-income menutip-income (lambda (x) #t) "44f81bee049b4b3ea908f8dac9a9474e")
+  (list reportname-expense (list ACCT-TYPE-EXPENSE) #t menuname-expense menutip-expense (lambda (x) #f) "b1f15b2052c149df93e698fe85a81ea6")
   (list reportname-assets 
         (list ACCT-TYPE-ASSET ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CHECKING
               ACCT-TYPE-SAVINGS ACCT-TYPE-MONEYMRKT
               ACCT-TYPE-RECEIVABLE ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL
               ACCT-TYPE-CURRENCY)
-        #f menuname-assets menutip-assets (lambda (x) #f))
+        #f menuname-assets menutip-assets (lambda (x) #f) "e9cf815f79db44bcb637d0295093ae3d")
   (list reportname-liabilities 
         (list ACCT-TYPE-LIABILITY ACCT-TYPE-PAYABLE ACCT-TYPE-CREDIT
               ACCT-TYPE-CREDITLINE)
-        #f menuname-liabilities menutip-liabilities (lambda (x) #t))))
+        #f menuname-liabilities menutip-liabilities (lambda (x) #t) "faf410e8f8da481fbc09e4763da40bcc")))

Modified: gnucash/trunk/src/report/standard-reports/daily-reports.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/daily-reports.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/daily-reports.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -520,6 +520,7 @@
    (gnc:define-report
     'version 1
     'name (car l)
+    'report-guid (car (reverse l))
     'menu-path (list gnc:menuname-income-expense)
     'menu-name (caddr l) 
     'menu-tip (car (cdddr l)) 
@@ -531,5 +532,5 @@
 
  (list 
   ;; reportname, account-types, menu-reportname, menu-tip
-  (list reportname-income (list ACCT-TYPE-INCOME) menuname-income menutip-income)
-  (list reportname-expense (list ACCT-TYPE-EXPENSE) menuname-expense menutip-expense)))
+  (list reportname-income (list ACCT-TYPE-INCOME) menuname-income menutip-income "5e2d129f28d14df881c3e47e3053f604")
+  (list reportname-expense (list ACCT-TYPE-EXPENSE) menuname-expense menutip-expense "dde49fed4ca940959ae7d01b72742530")))

Modified: gnucash/trunk/src/report/standard-reports/equity-statement.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/equity-statement.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/equity-statement.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -691,6 +691,7 @@
 (gnc:define-report 
  'version 1
  'name reportname
+ 'report-guid "c2a996c8970f43448654ca84f17dda24"
  'menu-path (list gnc:menuname-income-expense)
  'options-generator equity-statement-options-generator
  'renderer (lambda (report-obj)

Modified: gnucash/trunk/src/report/standard-reports/general-journal.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/general-journal.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/general-journal.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -128,6 +128,7 @@
 (gnc:define-report 
  'version 1
  'name reportname
+ 'report-guid "25455562bd234dd0b048ecc5a8af9e43"
  'menu-path (list gnc:menuname-asset-liability)
  'options-generator general-journal-options-generator
  'renderer general-journal-renderer

Modified: gnucash/trunk/src/report/standard-reports/general-ledger.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/general-ledger.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/general-ledger.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -129,6 +129,7 @@
 (gnc:define-report 
  'version 1
  'name reportname
+ 'report-guid "2e22929e5c5b4b769f615a815ef0c20f"
  'menu-path (list gnc:menuname-asset-liability)
  'options-generator general-ledger-options-generator
  'renderer general-ledger-renderer

Modified: gnucash/trunk/src/report/standard-reports/income-statement.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/income-statement.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/income-statement.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -684,6 +684,7 @@
 (gnc:define-report 
  'version 1
  'name is-reportname
+ 'report-guid "0b81a3bdfd504aff849ec2e8630524bc"
  'menu-path (list gnc:menuname-income-expense)
  'options-generator income-statement-options-generator
  'renderer income-statement-renderer
@@ -694,6 +695,7 @@
 (gnc:define-report 
  'version 1
  'name pnl-reportname
+ 'report-guid "8758ba23984c40dea5527f5f0ca2779e"
  'menu-path (list gnc:menuname-income-expense)
  'options-generator profit-and-loss-options-generator
  'renderer profit-and-loss-renderer

Modified: gnucash/trunk/src/report/standard-reports/net-barchart.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/net-barchart.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/net-barchart.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -375,6 +375,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Net Worth Barchart")
+ 'report-guid "cbba1696c8c24744848062c7f1cf4a72"
  'menu-path (list gnc:menuname-asset-liability)
  'options-generator (lambda () (options-generator #f))
  'renderer (lambda (report-obj) (net-renderer report-obj #f)))
@@ -382,6 +383,7 @@
 (gnc:define-report
  'version 1
  'name reportname
+ 'report-guid "80769921e87943adade887b9835a7685"
  'menu-name (N_ "Income & Expense Chart")
  'menu-path (list gnc:menuname-income-expense)
  'options-generator (lambda () (options-generator #t))

Modified: gnucash/trunk/src/report/standard-reports/portfolio.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/portfolio.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/portfolio.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -269,6 +269,7 @@
 (gnc:define-report
  'version 1
  'name reportname
+ 'report-guid "4a6b82e8678c4f3d9e85d9f09634ca89"
  'menu-path (list gnc:menuname-asset-liability)
  'options-generator options-generator
  'renderer portfolio-renderer)

Modified: gnucash/trunk/src/report/standard-reports/price-scatter.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/price-scatter.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/price-scatter.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -317,6 +317,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Price")
+ 'report-guid "1d241609fd4644caad765c95be20ff4c"
  'menu-path (list gnc:menuname-asset-liability)
  'menu-name (N_ "Price Scatterplot")
  'options-generator options-generator

Modified: gnucash/trunk/src/report/standard-reports/register.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/register.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/register.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -607,6 +607,7 @@
 (gnc:define-report
  'version 1
  'name (N_ "Register")
+ 'report-guid "22104e02654c4adba844ee75a3f8d173"
  'options-generator options-generator
  'renderer reg-renderer
  'in-menu? #f)

Modified: gnucash/trunk/src/report/standard-reports/transaction.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/transaction.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/transaction.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -1418,6 +1418,7 @@
  'version 1
  
  'name reportname
+ 'report-guid "2fe3b9833af044abb929a88d5a59620f"
  
  'options-generator trep-options-generator
  

Modified: gnucash/trunk/src/report/standard-reports/trial-balance.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/trial-balance.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/standard-reports/trial-balance.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -1137,6 +1137,7 @@
 (gnc:define-report 
  'version 1
  'name reportname
+ 'report-guid "216cd0cf6931453ebcce85415aba7082"
  'menu-path (list gnc:menuname-income-expense)
  'options-generator trial-balance-options-generator
  'renderer (lambda (report-obj)

Modified: gnucash/trunk/src/report/utility-reports/hello-world.scm
===================================================================
--- gnucash/trunk/src/report/utility-reports/hello-world.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/utility-reports/hello-world.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -467,6 +467,13 @@
  ;; untranslated value here!
  'name (N_ "Hello, World")
 
+ ;; The GUID for this report. This string should be unique, set once
+ ;; and left alone forever after that. In theory, you could use any
+ ;; unique string, even a meaningful one (!) but its probably best to
+ ;; use a true uuid. Get them from `uuidgen | sed -e s/-//g` and paste
+ ;; the results in here. You must make a new guid for each report!
+ 'report-guid "898d78ec92854402bf76e20a36d24ade"
+
  ;; The name in the menu
  ;; (only necessary if it differs from the name)
  'menu-name (N_ "Sample Report with Examples")

Modified: gnucash/trunk/src/report/utility-reports/test-graphing.scm
===================================================================
--- gnucash/trunk/src/report/utility-reports/test-graphing.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/utility-reports/test-graphing.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -127,6 +127,13 @@
  ;; untranslated value here!
  'name "Test Graphing"
 
+ ;; The GUID for this report. This string should be unique, set once
+ ;; and left alone forever after that. In theory, you could use any
+ ;; unique string, even a meaningful one (!) but its probably best to
+ ;; use a true uuid. Get them from `uuidgen | sed -e s/-//g` and paste
+ ;; the results in here. You must make a new guid for each report!
+ 'report-guid "2eff1729072e411ab124065b850dee6a"
+
  ;; The name in the menu
  ;; (only necessary if it differs from the name)
  'menu-name "Sample graphs."

Modified: gnucash/trunk/src/report/utility-reports/view-column.scm
===================================================================
--- gnucash/trunk/src/report/utility-reports/view-column.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/utility-reports/view-column.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -239,6 +239,7 @@
 (gnc:define-report 
  'version 1
  'name (N_ "Multicolumn View")
+ 'report-guid "d8ba4a2e89e8479ca9f6eccdeb164588"
  'menu-name (N_ "Custom Multicolumn Report")
  'menu-path (list gnc:menuname-utility)
  'renderer render-view

Modified: gnucash/trunk/src/report/utility-reports/welcome-to-gnucash.scm
===================================================================
--- gnucash/trunk/src/report/utility-reports/welcome-to-gnucash.scm	2008-01-05 06:10:31 UTC (rev 16804)
+++ gnucash/trunk/src/report/utility-reports/welcome-to-gnucash.scm	2008-01-05 06:42:21 UTC (rev 16805)
@@ -87,6 +87,7 @@
 (gnc:define-report 
  'name (N_ "Welcome to GnuCash")
  'version 1
+ 'report-guid "65135608f2014c6ca8412793a8cdf169"
  'in-menu? #f
  'menu-path (list gnc:menuname-utility)
  'options-generator options



More information about the gnucash-changes mailing list