Adv Port Report - Capitalization of Commissions

CDB-Man cdbman.online at gmail.com
Sun Jan 3 12:16:38 EST 2016


Hi Mike,

Thanks for taking a look!

I've actually asked my brother to take a look into this to see if anything
could be done (he's the programmer, I'm the accountant), and wanted to
share his findings.

He only made 2 changes, but it looks sufficient to get the treatment I'm
looking for (haven't fully tested if any other accruals break in the long
term yet):

*advanced-portfolio.scm*

Line 569, replace
((split-account-type? s ACCT-TYPE-EXPENSE)
with
((or (split-account-type? s ACCT-TYPE-EXPENSE) (string=?
(xaccSplitGetAction s) "Fee"))

Line 593, replace
(set! trans-income (gnc-numeric-sub trans-income split-value
                                    commod-currency-frac GNC-RND-ROUND))))
with
(if (eq? (xaccSplitGetAction s) "Fee")
(set! trans-income (gnc-numeric-sub trans-income split-value
                                    commod-currency-frac GNC-RND-ROUND)))))

Basically, if the "Fee" type is selection in split action, then treat that
split the same as how the entire report treats any split going to expenses,
aka treat any "Fee" split as brokerage fees.

It's an imperfect quick fix, and I say this because as we can see, the
check is only for a "Fee" flag, and does not check if it's also a split
coming specifically from the asset account.  But on a few tests, it does
seem to capitalize the purchase commissions properly as I'd like to see it.

If you have any thoughts on this quick solution, I'd love to hear it!

Regards,
CDB

P.S. for anyone just joining now, the rest of the thread's previous
comments can be found here:
http://lists.gnucash.org/pipermail/gnucash-user/2015-December/063205.html

*CDB-Man*
*Email:* cdbman.online at gmail.com

On Sat, Jan 2, 2016 at 7:35 PM, Mike Alexander <mta at umich.edu> wrote:

> --On December 27, 2015 at 12:03:20 AM -0500 CDB-Man <
> cdbman.online at gmail.com> wrote:
>
> I was talking to jralls over on IRC, and he suggested posing the
>> question to the group here, and more specifically to *Mike Alexander*
>> as well, the maintainer of the Adv. Portfolio Report if he's
>> listening.
>>
>
> I've read this thread and it looks like there are some good ideas in it.
> I won't be working on the Advanced Portfolio report anytime soon, so if
> someone else wants to look into implementing something, be my guest.
>
>            Mike
>
>


More information about the gnucash-user mailing list