only amount

Derek Atkins warlord at MIT.EDU
Mon Apr 2 09:52:25 EDT 2012


Hi,

ST <smntov at gmail.com> writes:

[snip]
> I found this function and tried to play with it, but didn't manage to
> make GnuCash working.
>
> (define-public (display-comm-coll-total comm-coll negative?)
>   ;; Display the total(s) of a commodity collector as HTML
>   (for-each
>     (lambda (pair)
>       (display (nbsp (gnc:monetary->string pair))))
>     (comm-coll 'format gnc:make-gnc-monetary negative?)))
>
> is this function actually needed? Why not just use 
>
> fmtmoneyNoCurrency rval
>
> instead of
>
> (display-comm-coll-total inv-total #f) ?

Because 'inv-total' may have multiple currencies.  The above function is
a way to print out each one.  You would just need to change the
gnc:monetary->string call to your own "print a gnc-monetary" function.

> furthermore is this double definition (or whatever it is) in
> taxinvoice.eguile.scm OK ?
>
>                (inv-total 'add currency rval)
>                (inv-total 'add currency rtaxval)

These are message-passing calls.  Think of them more like "object
methods".  What's going on here is that you are telling inv-total to
'add' rval and then rtaxval, both using the provided currency.

Do this isn't a double definition.

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list