only amount

ST smntov at gmail.com
Wed Mar 28 06:45:25 EDT 2012


> If you search the sources you will find that display-comm-coll-total
is
> defined in src/report/report-system/eguile-html-utilities.scm -- you
> would need to change this function similarly to pass a #f in when
> generating the print info object.
> 

1) I found this function and tried to play with it, but didn't manage to
make GnuCash's taxinvoice.eguile.scm to show only amounts without
currency.


(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?)))


following variables are passed to this function as arguments:

(inv-total (gnc:make-commodity-collector))
...
(rval      (gncEntryReturnValue entry #t)) 
(rtaxval   (gncEntryReturnTaxValue entry #t))
...
(inv-total 'add currency rval)
(inv-total 'add currency rtaxval)
...
<?scm (display-comm-coll-total inv-total #f) ?>

Derek, could you, please, tell me how to remove currency from those
lines?

2) is this function actually needed? Why not just use 

fmtmoneyNoCurrency rval


> >>  (define (fmtmoneyNoCurrency numeric)
> >>    (xaccPrintAmount numeric
> >>     (gnc-default-print-info #f)))


instead of

(display-comm-coll-total inv-total #f) ?

furthermore is this double definition (or whatever it is) in
taxinvoice.eguile.scm OK ?

               (inv-total 'add currency rval)
               (inv-total 'add currency rtaxval)


Thank you,
ST



> -derek
> 
> ST <smntov at gmail.com> writes:
> 
> > Thank you very much Derek!
> >
> > this one did work! There is only one thing that still remains with
> > currency:
> >
> >               (inv-total 'add currency rval)
> >               (inv-total 'add currency rtaxval)
> >               (tax-total 'add currency rtaxval)
> >               (sub-total 'add currency rval)
> >               (dsc-total 'add currency rdiscval)
> >
> > which are displayed like this:
> >
> > <strong><?scm (display-comm-coll-total inv-total #f) ?></strong>
> > etc.
> >
> > how do I get rid of currency here?
> >
> > thank you,
> > ST
> >
> >
> > On Mon, 2012-03-12 at 10:56 -0400, Derek Atkins wrote:
> >> Hi,
> >> 
> >> ST <smntov at gmail.com> writes:
> >> 
> >> > actually I get errors everywhere I try to use the new
fmtmoneyNoCurrency
> >> > instead of the original fmtmoney from taxinvoice.eguile.scm. How
should
> >> > such a function for gnc-numeric look like?
> >> 
> >> Maybe something like:
> >> 
> >>  (define (fmtmoneyNoCurrency numeric)
> >>    (xaccPrintAmount numeric
> >>     (gnc-default-print-info #f)))
> >> 
> >> > thank you again, Derek,
> >> > ST
> >> 
> >> -derek




More information about the gnucash-devel mailing list