Visit Jeremy's Blog.
Go Back > Blogs > trevorparsons
User Name


Rate this Entry

HMRC or hmrc? The sensitive case of the taxman

Posted 01-28-2014 at 10:05 PM by trevorparsons
Updated 02-20-2014 at 09:25 AM by trevorparsons (Corrections following response from HMRC)

I do book-keeping for a couple of small organisations, each of which have a few employees. This financial year I started using payroll software provided by Her Majesty's Revenue and Customs (HMRC, the United Kingdom's tax collectors). It's called Basic PAYE Tools (BPT), and I'm pleased to say that a version is made available for those running Linux-based operating systems.

[Aside: I feel to a tiny extent responsible for the UK government no longer restricting services to users of Microsoft, since as editor of LinuxUser magazine I helped create the first public fuss about the UK Government Gateway being Windows-only back in 2001. Anyway...]

BPT has been working fine for me, submitting the new 'real-time information' payroll submissions flawlessly, and preserving the data I input. Until I fired it up recently, that is.

The program hung on the splash screen, auto-updating itself. A few minutes on, BPT started, but all of my data was gone. No companies. No employees. No payments. No records at all.

Cold sweat. I quit the program, and started searching its install directory for data. No sign there. I realised I had no idea where in the filesystem my data was stored. Time for some panicky web searching.

The clue came from a 2011 post by saasmd about the unexpected (and, in Windows at least, arguably insecure) way in which BPT stores data in the local filesystem. The data in saasmd's Windows version of BPT was, he was surprised to find, stored in a folder called HMRC directly under the C: drive. I took the hint, looked under my home directory, and found a directory called HMRC. Disappointment. It was timestamped with today's date, and lacked any historic data. Then I noticed another directory, ~/hmrc, which contained an sqlite database and a bunch of zip files. Automated backups from the past few months. Phew.

So the fix was...

rm -rf HMRC && mv hmrc HMRC
[ie delete the newly-created directory, and rename the directory which actually contains the data to what BPT expects it to be called]

...after which I ran BPT and found it to be repopulated with my data.

Initially I assumed that the new version of BPT had mistakenly changed its data storage location from ~/hmrc to ~/HMRC. I consulted HMRC's online services helpdesk, and was told that BPT has always used ~/HMRC as the default location for data storage.

It seems I had accidentally changed the case of the existing ~/HMRC directory.

I have a script that I often use to rename files so that they don't have any upper-case letters or spaces. (UNIXy prejudice, I know.)

This is it:

for f in *; do
file=$(echo $f | tr A-Z a-z | tr ' ' _)
[ ! -f $file ] && mv "$f" $file
I must have accidentally run that script in my home directory recently. Oops.

Not a common scenario for BPT to encounter, I'll admit. Then again, one might expect BPT to know that it was upgrading itself, rather than doing a fresh installation, in which case it could be programmed to complain about not being able to find an existing ~/HMRC data directory.

For reference, it's possible to move (or rename) your data directory and then inform BPT of that via the program's configuration file, rti.cfg, which is to be found in the directory where you installed the software. There's no mention of this in the general documentation for BPT.

I wonder whether the developer of BPT for Linux might consider:
  • Making it clear during installation where the data is going to be stored by default, and asking the user if they'd like to specify an alternative location.
  • Not creating ~/HMRC if the data directory specified in rti.cfg doesn't exist, unless this is a fresh installation of BPT. An informative error could be displayed instead.
  • Including information about the location of data in the general documentation for BPT.
  • Asking her/his manager(s) to make the bug tracker publicly accessible. Communicating via the Online Services Helpdesk, delightful and helpful as the people who staff it are, is a cumbersome way of filing a bug.

Advice for myself:
  • Take care with scripts!
Posted in Uncategorized
Views 1792 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 01:19 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration