AUDIT: r16803 - gnucash/trunk/src/report/standard-reports - Re-introduce the Profit & Loss report.

Derek Atkins warlord at cvs.gnucash.org
Fri Jan 4 22:48:10 EST 2008


Author: warlord
Date: 2008-01-04 22:48:09 -0500 (Fri, 04 Jan 2008)
New Revision: 16803
Trac: http://svn.gnucash.org/trac/changeset/16803

Modified:
   gnucash/trunk/src/report/standard-reports/income-statement.scm
Log:
Re-introduce the Profit & Loss report.
Just a renamed Income Statement, because the average person doesn't know better.
It's the exact same report, just relabeled.  Both reports are now available
in the menu.
This change does re-add the translatable string "Profit & Loss"
BP

Modified: gnucash/trunk/src/report/standard-reports/income-statement.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/income-statement.scm	2008-01-05 00:53:46 UTC (rev 16802)
+++ gnucash/trunk/src/report/standard-reports/income-statement.scm	2008-01-05 03:48:09 UTC (rev 16803)
@@ -48,8 +48,6 @@
 
 (gnc:module-load "gnucash/report/report-system" 0)
 
-(define reportname (N_ "Income Statement"))
-
 ;; define all option's names and help text so that they are properly
 ;; defined in *one* place.
 (define optname-report-title (N_ "Report Title"))
@@ -133,7 +131,7 @@
   (N_ "Causes the report to display in the standard order, placing income before expenses"))
 
 ;; options generator
-(define (income-statement-options-generator)
+(define (income-statement-options-generator-internal reportname)
   (let* ((options (gnc:new-options))
          (add-option 
           (lambda (new-option)
@@ -275,7 +273,7 @@
 ;; set up the document and add the table
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(define (income-statement-renderer report-obj)
+(define (income-statement-renderer-internal report-obj reportname)
   (define (get-option pagename optname)
     (gnc:option-value
      (gnc:lookup-option 
@@ -669,12 +667,36 @@
     )
   )
 
+(define is-reportname (N_ "Income Statement"))
+(define pnl-reportname (N_ "Profit & Loss"))
+
+(define (income-statement-options-generator)
+  (income-statement-options-generator-internal is-reportname))
+(define (income-statement-renderer report-obj)
+  (income-statement-renderer-internal report-obj is-reportname))
+
+(define (profit-and-loss-options-generator)
+  (income-statement-options-generator-internal pnl-reportname))
+(define (profit-and-loss-renderer report-obj)
+  (income-statement-renderer-internal report-obj is-reportname))
+
+
 (gnc:define-report 
  'version 1
- 'name reportname
+ 'name is-reportname
  'menu-path (list gnc:menuname-income-expense)
  'options-generator income-statement-options-generator
  'renderer income-statement-renderer
  )
 
+;; Also make a "Profit & Loss" report, even if it's the exact same one,
+;; just relabeled.
+(gnc:define-report 
+ 'version 1
+ 'name pnl-reportname
+ 'menu-path (list gnc:menuname-income-expense)
+ 'options-generator profit-and-loss-options-generator
+ 'renderer profit-and-loss-renderer
+ )
+
 ;; END



More information about the gnucash-changes mailing list