outgoing - A script to help with financial planning
outgoing [-hdvS] [-o out] [-c file] [-T time]
OutGoing is a hacked together perl script designed to aid in
financial planning. It is designed to take in a list of your regular monthly
outgoings and generate a lump of HTML which shows:
Supported options are:
outgoing.pl
within the current working directory.
MMDD
DD
[+-]{number}(d|w|y)
This can be used to specify a number of days (d), weeks (w)
or years (y) to go forward to backwards from the current date.
If the sign is not given then + is assumed.
This script is designed to be either run by hand or by cron in the
following manner:
outgoing -c config -o html
My current prefered way of working is for cron to run the script across
my configuration file at 3am every morning; it would perhaps make more sense
to run it on every monday morning since changes only happen week to week. Thus
the following crontab entry could be suitable:
# Work out outgoing money, 3am every monday morning 0 3 * * 1 /usr/local/bin/outgoing -c /home/user/outgoing.pl -o /home/user/outgoing.html
The configuration file for this script is actually a lump of perl
which is require()'ed into being within the script. As such it needs to
follow all of the normal perl syntax rules and since it is pulled in
using require() the file should have a 1; on its last line.
Currently there are three variables which should be defined:
undef to
disable this.
£ and for US dollars you'd just use
\$ - note the escape of the $ since the normal quoting rules of
perl apply.
name - The name given to the outgoing item. Blank values
will be ignored
stmt - What is shown on your bank statement. If this is not valid
for the entry (ie its cash) then use undef.
when - When the payment occurs. This can be one of two
things:
"m" - A monthly payment, requires a "date" key
"w" - A weekly payment
date - When in the month the payment occurs. This is
only valid for "when" values of "m". Use undef for any
other value of "when".
type - The type of payment. This can be one of:
"c" - Cash
"cc" - Credit card
"dd" - Direct debit
"so" - Standing order
"tr" - Money transfer
amt - The amount of money which is paid out
For example the following configuration file is for someone in the UK who gets paid on the 25th of every month.
$MonthStart = 25;
$CURR = "£";
@Out = (
{
name => "Water rates",
stmt => "The Water Co",
when => "m",
date => "7",
type => "dd",
amt => 20,
},
{
name => "Gas",
stmt => "The Gas Co",
when => "m",
date => "20",
type => "dd",
amt => 40,
},
{
name => "Council tax",
stmt => "Local City Cou",
when => "m",
date => "7",
type => "dd",
amt => 100,
},
{
name => "Food shopping",
stmt => undef,
when => "w",
date => undef,
type => "c",
amt => 60,
},
{
name => "Petrol",
stmt => undef,
when => "w",
date => undef,
type => "c",
amt => 30,
},
);
1;
It should be noted that entries with a blank ``name'' value will be
ignored.
This script is designed to help with week-by-week financial planning by showing you how much money needs to be paid out over the month on a week-by-week basis.
It takes a perl-based configuration file and outputs HTML to either its
standard output or a file. The features it currently supports are:
Aug Sep
S M Tu W Th F S S M Tu W Th F S
1 2 1 2 3 4 5 6
3 4 5 6 7 8 9 7 8 9 10 11 12 13
10 11 12 13 14 15 16 14 15 16 17 18 19 20
17 18 19 20 21 22 23 21 22 23 24 25 26 27
24 25 26 27 28 29 30 28 29 30
31
If you are paid on the 25th of each month then full weeks you have to worry about having money for start on:
o 25th August o 1st September o 8th September o 15th September o 22th September
In other words, a five week month.
``Date Shifting'' is the name I've given to the process whereby certain types of payments have their payment date shifted automatically.
In the UK standing orders and direct debits are generally not processed on a weekend so if the normal payment date for these types of transactions falls on a weekend then the payments for the week they should fall in and the week that they actually fall in will be incorrect.
When in date shifting mode the script will automatically move direct debit and standing order payments which fall on a weekend to the start of the next week.
It should be noted that if the next week happens to be within the next month then the payments will not be shown.
Payments which have been date shifted will have the text
[was DATE]`` placed under the date they are
predicted to go out, where DATE is the original date for the payment.
This funtionality can be disabled by calling this script with the -S
flag.
Simon Burr <simes@bpfh.net>
Copyright (c) 2003, Simon Burr <simes@bpfh.net> All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.