GnuCash reports via eguile - probably not

Josh Sled jsled at asynchronous.org
Wed Jan 21 13:20:31 EST 2009


Chris Dennis <cgdennis at btinternet.com> writes:
> Josh Sled wrote:
>> Chris Dennis <cgdennis at btinternet.com> writes:
>>> What is really needed is some sort of wiki-like markup that can be 
>>> parsed by Guile code and includes references to GnuCash objects. 
>>> Something like this (I know the 'variable' names I've used are very 
>>> un-GnuCash-like), for which I've used TiddlyWiki-like markup:
>> 
>> I'd encourage "you" to not add another layer of formatting or
>> translation.  Just have the template iterate over objects, call
>> accessors and format data for rendering.
>> 
>
> Can you explain exactly what you mean by that last sentence please?

I meant specifically skip the idea of having any sort of wiki formatting
or anything else.  So the template would look more like (guessing at the
semantics of the TiddlyWiki-like markup, which I don't know):

  <h1>Invoice #<?scm:d (invoice-no-format invoice-no) ?></h1>
  <h2><?scm:d company-name ?></h2>
  <address>
    <?scm:d company-address ?>
  </address>
  <table class="invoice bordered">
    <thead>
      <tr>
        <th>Date</th>
        <th>Description</th>
        <th>Qty</th>
        <th>Cost</th>
        <th>Total</th>
      </tr>
    </thead>
    <tbody>
      <?scm (map (lambda (inv) ?>
        <tr>
          <td><?scm:d (format-date (gnc:invoice-get-date inv)) ?></td>
          <td><?scm:d (gnc:invoice-get-description inv) ?></td>
          <td><?scm:d (gnc:invoice-get-quantity inv) ?></td>
          <td><?scm:d (gnc:invoice-get-cost inv) ?></td>
          <td><?scm:d (gnc:invoice-get-total inv) ?></td>
        </tr>
      <?scm ) report-invoice-list) ?>
    </tbody>
  </table>
  <strong>Total:</strong> <?scm:d accumulated-total ?><br />


But more importantly, as you point out, binding all those symbols is
critical to getting any approach working.

-- 
...jsled
http://asynchronous.org/ - a=jsled; b=asynchronous.org; echo ${a}@${b}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090121/fbdd61fe/attachment.bin 


More information about the gnucash-devel mailing list