Educating the world

Our blog has over 10,000 readers a month

How to pay Corporation Tax online

September 18th, 2014

Got a letter through the post from HMRC to say that my Corporation Tax direct debit had expired after a year and as a result my latest Corporation Tax payment had failed. HMRC had been plugging "pay by direct debit" for a while and last year I went to all the trouble of setting it up in order to pay it. Corporation Tax is an annual tax against the profits of your company so imagine my surprise when HMRC said they cancelled the direct debit after a year!

I phoned up HMRC and tried to ask them why they would cancel a direct debit on an annual payment after one year. They kept saying that the Corporation Tax value was different each year so I couldn't reuse an old direct debit again. I told then that my VAT payment was different each quarter and yet that still worked. This vexed them so they took my details and said someone would get back to me.

Due to the payment rejection (and being away) my deadline was upon me and I had to pay it today. Went to HMRC's website and started reading their documentation which takes you around and round in circles.

My confusion was caused by assuming that the Corporation Tax direct debit payments would be handled in the same way as VAT payments which are quarterly. Essentially, I work out what my VAT liability is each quarter then go to the HMRC web site and enter the values into the 8 magic boxes, and the site calculates what my total payment should be. Sometime later HMRC direct debits that amount from my account. Paying VAT is akin to paying my mobile phone bill each month.

I was reading the payment documentation with the assumption that paying Corporation Tax would be the same but it is subtly different.

When you enter the VAT details into the 8 magic boxes HMRC automatically creates a new direct debit instruction with the bank details you have assigned to paying VAT along with the payment amount it has calculated. This instruction is added to the system (on your behalf) and the money is debited from your account in due course.

Corporation Tax is handled differently because our accounts department has to fill in loads of forms which the finance director has to sign off as valid. Those forms maybe submitted online but the paperwork (with the signatures) still has to be posted. HMRC then creates a liability in the Corporation Tax section of the HMRC website. It is then up to me to create a new direct debit instruction with the amount we've declared and submit this to the system.

Each one of these direct debit instructions (VAT and Corporation Tax) can only be used once and then it expires from the system. My confusion had been cause by not realising that HMRC was automatically creating a new instruction for each VAT payment, and not doing that for Corporation Tax.

Now that we understand how it works it's still a bit of an arduous task to set it up. So here are some instructions to help:

  1. Goto and login.
  2. Click Services you can use from the left hand menu titled Main menu.
  3. Find the Corporation Tax (CT) section and click the Access Service.
  4. In the View account section the amount to pay will be shown as a link, click that.
  5. From the table click the date link you want to pay. This will take you to the Accounting period overview page.
  6. Find the line:

    When making a payment for this accounting period please quote the payment reference number 1234567890A00112A

    Cut and paste the long reference number and the amount to pay into a text file so you can use it later.
  7. Click the Your HMRC services in the top left corner of the screen above all the links for your Corporation Tax.
  8. Click Direct Debit payment from the Main menu navigation menu on the left.
  9. The table is a list of Direct Debit payment profiles. Click the Direct debit reference link of the bank profile you wish to use.
  10. Click Add payment plan.
  11. Select Corporation tax (CT) and click the Next button.
  12. Enter the 1234567890A00112A you recorded earlier, the amount and today's date (or The earliest date you can enter which is listed) then click Next.
  13. Check the details and click Next.
  14. There is now a useless Security check which asks you to enter your login credentials again, but if you have told your web browser to remember that information to help you (initially) login then your browser will just fill them in again for you. So click Submit.
  15. Make a note of the Direct Debit reference so you have something to give them, if there is a problem.

I'm not sure why paying Corporation Tax isn't as simple as paying VAT, but hopefully HMRC are working on it.

The rules I live by

August 25th, 2014

Peter Tatchell guiding motto is:

Don’t accept the world as it is, dream of what the world could be, and then help make it happen.

Featured on BBC Radio 4 Midweek on 25 January 2012.

Maybe it’s because I had Peter’s quote in my mind that I spotted this quote from Eleanor Roosevelt:

When you have decided what you believe, what you feel must be done, have the courage to stand alone and be counted.

IMDB cast faces popup

August 8th, 2014

The Internet Movie Database is the best resource on the Internet for information about Films and Television. For the most part, their web site is great but some of the pictures in the cast list are a bit small and difficult to see.

Most of the time the actors and actresses profile photo is a pretty clear head and shoulders press shot which has been shrunk down to 32x144. There are, however, many not so famous actresses (and actors) whose profile photos are just grainy black and white photographs of them on set or shots of them in a film. After they have been miniaturized they are unrecognisable.

I really missed the Facebook style pop ups you get when you hover over someone's face. So I wrote a Greasemonkey script to fix it. Install the script and go to IMDB, look at the details of a film and hover over the image next to the persons name. The face will be enlarged with more detail and overlayed in the centre of the screen.

The current version of imdb-cast-popup.user.js is 1.1.

Install it and let me know what you think. If anyone would like to send updates I'll be happy to incorporate them here.

28 Aug 20141.1e4660cddfb7b1128269949d75c13ccfe
8 Aug 20141.0c5d33b72a4d1fb8ba53968957a9004ff

Hiring a professional developer

August 5th, 2014

Just had another business meeting where I listened to the customer talking about the amateur to he hired to work on their office application. Same old story about them taking ages and getting bored after only completing half the site. It reminds me of the old adage:

If you think a professional developer is expensive, wait till you hire an amateur!

Conditionally replacing line contents

July 17th, 2014

I answer a lot of Unix shell scripting questions for friends (I know, sad isn't it) but as I haven't written a blog article for a while I thought I document my thoughts in case the rest of world needs something similar.


have a file of IP addresses, bit like this

basically if the line doesn't have a / in it, I want to add a /32 at
the end, can you do this in vi at all ?

I've been titting around with grep -v to do an inverse search, but
can't get sed to adjust the file in place etc. hence I think VI might
be better

There are many solutions to this kind of problem. Let's assume that the network addresses are contained in a file called file.txt.

If the order was not important then a really simple solution would be this:

$ grep -v "/" file.txt | sed 's>$>/32>' > out.txt
$ grep "/" file.txt >> out.txt

  • Filter file.txt and only give back the lines without a "/" in them. For each of those replace the end with "/32" and put the contents in the file out.txt.
  • Line 2 filters the file.txt, giving back the lines with a "/" in them and then append those lines to the file out.txt.

You will loses the order as doctored lines will appear at the top and undoctored lines will appear at the bottom. If the values were sorted you could just sort out.txt at the end and restore the order (eg sort out.txt > out.sorted.txt).

The trouble with editing the file "in place" is that there is a condition rule for each line. I'm not sure you could do it using vi or ed because you are not dealing with a range of lines in a buffer which is generally how those applications work.

I typically solve this kind of problem with a bit of awk. Awk was one of the precursors to Perl but I prefer it. Perl just became a monolithic mess of difficult to remember syntax for no real benefit over what awk already did.

$ awk '{ if ( $0 ~ /\// ) print $0; else print $0 "/32" }' < file.txt > out.txt

  • Take the file.txt as input, if the line contains a "/" print the line untouched else print the line with "/32" on the end. Do this for each line and put the output in out.txt.

The condition (in the if) is a regular expression match so that everything within the // is used in the match, in our case we are looking for a "/" so we must delimited it with a backslash \/.

There a little awk tutorial here that you might find useful: