diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am index 28354fe234..0ce1affb26 100644 --- a/src/backend/Makefile.am +++ b/src/backend/Makefile.am @@ -1,4 +1,4 @@ SUBDIRS=file ${SQL_DIR} ${RPC_DIR} - +DIST_SUBDIRS=file postgres rpc diff --git a/src/engine/Account.c b/src/engine/Account.c index 97b96176f0..25f1cd7fa4 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -502,6 +502,15 @@ xaccAccountGetGUID (Account *account) return &account->guid; } +GUID +xaccAccountReturnGUID (Account *account) +{ + if (!account) + return *xaccGUIDNULL(); + + return account->guid; +} + /********************************************************************\ \********************************************************************/ diff --git a/src/engine/Account.h b/src/engine/Account.h index 382c468b0c..20a2609393 100644 --- a/src/engine/Account.h +++ b/src/engine/Account.h @@ -140,12 +140,15 @@ void xaccAccountSetSlots_nc(Account *account, kvp_frame *frame); /* * The xaccAccountGetGUID() subroutine will return the * globally unique id associated with that account. + * xaccAccountReturnGUID() returns the same as a + * struct. * * The xaccAccountLookup() subroutine will return the * account associated with the given id, or NULL * if there is no such account. */ const GUID * xaccAccountGetGUID (Account *account); +GUID xaccAccountReturnGUID (Account *account); Account * xaccAccountLookup (const GUID *guid); /* diff --git a/src/engine/gw-engine-spec.scm b/src/engine/gw-engine-spec.scm index f68942f58a..94db2732e6 100644 --- a/src/engine/gw-engine-spec.scm +++ b/src/engine/gw-engine-spec.scm @@ -847,6 +847,14 @@ description of the nature of a particular account.") '(( a) ( tax-related)) "Set the tax-related flag of the account.") + (gw:wrap-function + mod + 'gnc:account-get-guid + ' + "xaccAccountReturnGUID" + '(( a)) + "Get the GUID of Account a.") + (gw:wrap-function mod 'gnc:account-get-type-string diff --git a/src/scm/report-utilities.scm b/src/scm/report-utilities.scm index 1de6d92705..c279b6ef54 100644 --- a/src/scm/report-utilities.scm +++ b/src/scm/report-utilities.scm @@ -19,16 +19,12 @@ (gnc:support "report-utilities.scm") -(define (gnc:amount->string amount info) - (d-gnc:amount->string-helper (exact->inexact amount) info)) - -(define (gnc:commodity-amount->string amount info) - (gnc:amount->string-helper amount info)) +(define gnc:amount->string gnc:amount->string-helper) ;; pair is a list of one gnc:commodity and one gnc:numeric ;; value. Deprecated -- use instead. (define (gnc:commodity-value->string pair) - (gnc:commodity-amount->string + (gnc:amount->string (cadr pair) (gnc:commodity-print-info (car pair) #t))) ;; Just for convenience. But in reports you should rather stick to the diff --git a/src/scm/report/account-summary.scm b/src/scm/report/account-summary.scm index 8c9d2f9c1a..c5eba1ea92 100644 --- a/src/scm/report/account-summary.scm +++ b/src/scm/report/account-summary.scm @@ -33,6 +33,9 @@ (use-modules (srfi srfi-1)) +(use-modules (gnucash gnc-module)) +(gnc:module-load "gnucash/engine" 0) + ;; account summary report ;; prints a table of account information with clickable ;; links to open the corresponding register window. diff --git a/src/scm/report/hello-world.scm b/src/scm/report/hello-world.scm index eb9a4567f3..552475c2fa 100644 --- a/src/scm/report/hello-world.scm +++ b/src/scm/report/hello-world.scm @@ -9,6 +9,9 @@ (define-module (gnucash report hello-world)) +(use-modules (gnucash gnc-module)) +(gnc:module-load "gnucash/engine" 0) + ;; This function will generate a set of options that GnuCash ;; will use to display a dialog where the user can select ;; values for your report's parameters. @@ -396,7 +399,9 @@ new, totally cool report, consult the mailing list %s.") (gnc:html-markup/format (_ "The number option formatted as currency is %s.") (gnc:html-markup-b - (gnc:amount->string num-val (gnc:default-print-info #f))))))) + (gnc:amount->string + (gnc:make-gnc-numeric (inexact->exact num-val) 1) + (gnc:default-print-info #f))))))) ;; you can add as many objects as you want. Here's another ;; one. We'll make a single-column table of the selected list diff --git a/src/scm/report/taxtxf.scm b/src/scm/report/taxtxf.scm index 2d1032d0f0..5d8eb2e026 100644 --- a/src/scm/report/taxtxf.scm +++ b/src/scm/report/taxtxf.scm @@ -36,6 +36,9 @@ (define-module (gnucash report taxtxf)) +(use-modules (gnucash gnc-module)) +(gnc:module-load "gnucash/engine" 0) + (use-modules (srfi srfi-1)) (use-modules (ice-9 slib)) (require 'printf)