scheme to retrieve the customer associated with a transaction

Derek Atkins derek at ihtfp.com
Wed Mar 2 20:20:53 EST 2016


Hi,

On Wed, March 2, 2016 8:11 pm, Macho Philipovich wrote:
>    Hi GnuCashers,
>    Does anyone know offhand how Scheme code would find the customer and
>    job objects that are associated with a given transaction "split", if
>    any?
>    I'm customizing a report that I've adapted from transaction.scm. The
>    last bit of customization is to add two columns showing the customer
>    name and job name whenever the transaction is either is a payment
>    received toward a customer invoice, or whenever the transaction has an
>    associated chargeback (i.e. it the payment of an expense that will
>    ultimately be recouped from the customer on whose behalf it was made).
>    I'm in the add-split-row method and have variable called "split" to
>    work from.
>    All suggestions are appreciated, including API references, although a
>    couple of lines of code would truly make my day! Thanks.
>    Macho

Take a look at the aging.scm report.  You'll see:

    (let* ((transaction (xaccSplitGetParent split))
	   (temp-owner (gncOwnerNew))
	   (owner (gnc:owner-from-split split temp-owner)))

      (if (not (null? owner))
...


> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

-- 
       Derek Atkins                 617-623-3745
       derek at ihtfp.com             www.ihtfp.com
       Computer and Internet Security Consultant



More information about the gnucash-user mailing list