[GNC] An automated depreciation calculator would be really helpful.

Stephen M. Butler Stephen.M.Butler51 at gmail.com
Thu Dec 9 13:13:14 EST 2021


Per https://www.excel-easy.com/examples/depreciation.html Excel has five 
(5) depreciation methods.

I suspect these could be implemented in a manner similar to the loan 
calculations inside the transaction scheduler (I am not talking about 
the loan wizard but about the resulting functions ipmt, ppmt, etc).

Per https://wiki.gnucash.org/wiki/Scheduled_Transactions

    "Any text string /followed by parens/, optionally with arguments,
    will have the string "gnc:" prepended to it and *evaluated in the
    scheme environment*.

        *Arguments* are separated with |:|. See fin.scm
        <https://github.com/Gnucash/gnucash/blob/master/libgnucash/app-utils/fin.scm>
        for examples of providing functions."

So, new functions could be added to fin.scm (located at libgnu 
cash/app-utils/fin.scm) to support depreciation.  Perhaps implement the 
five (5) functions found in Excel.
If needed, there appears to be supporting C code in 
ibgnucash/app-utils/calculation/fin.c

This wouldn't automate it to the level the OP wishes, but a few minutes 
setting up scheduled transactions using the new routines would provide 
the rudimentary items needed to implement whichever depreciation 
schedule desired.

I also noted that there is a local/private function in fin.scm for 
rounding.  For the individual who wanted to force rounding at a 
particular point (discussion over a year ago) within a scheduled 
transaction, all they need to do is expose (make public) that function.

Someone other than the current developers with Scheme/C expertise should 
be able to whip those changes together and make a contribution.  I can 
read the source but do not have sufficient exposure to either language 
to craft the new functions.

--Steve


On 12/8/21 19:18, davidcousens49 at gmail.com wrote:
> Dave,
>
> Depreciation rules are generally set by your taxation system and your accountant
> will likely be reflecting those rules that apply in your jurisdiction. If you
> are going to do the depreciation calculations then you will need to become
> acquainted with the rules in your jurisdiction. Rules may also be different for
> particular capital items and asset classes. If your taxation authority is nice
> they will have published the rules on line. From the little I have read
> depreciation is not an allowable business expense for tax purposes in the UK -
> check that with your accountant though.
>
> I personally used to maintain a spreadsheet for each major capital item I was
> depreciating and similarly for items which could be pooled under the
> depreciation rules and perform all the necessary calculations in the spreadsheet
> and just record the resulting figures as required in my accounting program (not
> GnuCash in the days when I was still running a business).
>
> I suspect depreciation rules vary considerably in detail from jurisdiction to
> jurisdiction making it difficult to define a general calculator which will work
> adequately across all jurisdictions. It is a bit like loan repayment
> calculations, they will likely come out pretty close but the methodology has to
> be exactly the same to get the same result.
>
> It should be possible to use the transaction file association to link the
> transactions to a depreciation spreadsheet data file, which since most OS's can
> initiate a program based on the file extension should allow the spreadsheet
> program to be launched from the file association - haven't tested this out for a
> spreadsheet but it does work for pdfs on Linux.
>
> David Cousens
>
>
> On Thu, 2021-12-09 at 00:34 +0000, Dr. David Kirkby wrote:
>> A friend of mine bought some Excel spreadsheets for his company accounts.
>> He has used them for many years and finds them good. He has suggested I use
>> them, but I'm not keen on that idea. At any point in time he can see
>> exactly what the depreciation of an item is, and so exactly when the value
>> has fallen to zero.
>>
>> I read about depreciation in GnuCash at
>>
>> https://cvs.gnucash.org/docs/C/gnucash-guide/chapter_dep.html
>>
>> but it seems rather limited. The last paragraph on this page
>>
>> https://cvs.gnucash.org/docs/C/gnucash-guide/dep_accounts1.html
>>
>> says
>>
>> "The actual input of the depreciation amounts is done by hand every
>> accounting period. There is no way in *GnuCash* (as of yet) to perform the
>> depreciation scheme calculations automatically, or to input the values
>> automatically into the appropriate accounts. However, since an accounting
>> period is typically one year, this really is not much work to do by hand."
>>
>> I don't think it's true to say it's not much work to do. I know my
>> accountant says one should start depreciating from the day something goes
>> into service, but he uses a different scheme, which is good enough. If an
>> item is purchased before the halfway through the month, he considers it
>> purchased on the 1st of that month, and if after 50% of the way though the
>> month, he considers it purchased the following next month. The errors in
>> this should be small.
>>
>> So each time an asset is purchased, one needs to start depreciating it from
>> then. It's not true to say this is just done once per year.
>>
>> Of course, I'm well aware that many people will have suggestions on how to
>> improve the software, and the developer's time is limited. But some
>> automated way of depreciating items would be very useful. As they say, if
>> you don't ask you will not get, so there's no harm in asking!
>>
>> Dave
>> _______________________________________________
>> gnucash-user mailing list
>> gnucash-user at gnucash.org
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> If you are using Nabble or Gmane, please see
>> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.


-- 
Stephen M Butler, PMP, PSM
Stephen.M.Butler51 at gmail.com
kg7je at arrl.net
253-350-0166
-------------------------------------------
GnuPG Fingerprint:  8A25 9726 D439 758D D846 E5D4 282A 5477 0385 81D8



More information about the gnucash-user mailing list