NAME
privateloan.pl - Calculate repayments on a private loan under UK law
SYNOPSIS
privateloan.pl --conf some-configuration-file
DESCRIPTION
This script calculates the repayments and tax schedule for a private loan under UK law. The output of the script is a repayment table with a tax summary at the end of each finacial year.
At the time of writing, interest payments on a private loan (not from a bank or building society) must be have tax deducted from them by the borrower. The borrower is responsible for paying this tax to HMRC.
If the loan is for business purposes the borrower can then reclaim the whole amount of interest paid (net amount paid to the lender plus the tax paid) as a business expense.
The premium that is calculated by this module is not exact. It may over- or under-pay slightly and an adjustment will be necessary in the last few months. A configuration file enables you to set the tax rate, interest rate, period of loan and the amount. The tax rate and the amount lent may be subject to change during the period of the loan. Monthly interest is calculated as 1/12 of the nominal annual rate; this is not mathematically acccurate, but it is the usual convention in the financial world.
CONFIGURATION
The script uses Config::General. The format of a configuration files is the same as for Apache.
<taxrate> and <loan> blocks may be repeated any number of times. They do not have to be in date order, the program will sort them. In each block only the date is mandatory; if any other field is omitted it will remain at its previously set value.
Changes in amounts or rates that are made part way through a month are treated as happening at the start of the month. We make no attempt to calculate daily interest rates.
The loan period is used only for estimating the initial premium. The actual period of the loan will only approximate to this period. A premium that is defined in the configuration file overrides the calculated figure.
If there are advances on the loan during its period it is advisable to set the premium manually, otherwise there is a risk that the loan will never be paid off.
yearend is used to determine when to print summaries.
For a bank loan, where you pay gross interest, set the tax rate to 0.
All dates must be in the yyyy-mm-dd format.
SAMPLE CONNFIGURATION FILE
<taxrate>
date 2012-04-05
rate 20 # Correct rate at the time of writing
</taxrate>
# Initial loan amount
<loan>
date 2012-05-20
amount 20000
rate 3
premium 200
</loan>
# Part way through change the tax and interest rates, and advance some more cash
<loan>
date 2015-07-20
amount 500
rate 10
premium 250
</loan>
#Approximate loan period in years
period 10
# Start/end of the financial year, usually 5 April.
yearend 2012-04-05
AUTHOR
Raphael Mankin <rapmankin@cpan.org>