matt-helps

insight on all things techie

Google Adsense and VAT

A slight departure to the normal techie topics, but still related I think especially if you make your living from advertising on your websites!

If you happen to be UK VAT registered and make Google Adsense earnings you may be a bit confused as how one goes about reporting the numbers on your VAT return. Indeed, a cursory look around the internet shows advice from people who identify themselves as accountants and yet still get it wrong! There’s all this business about the EU reverse charge mechanism, it can all be a bit confusing. Actually, it is really quite simple! I had to have a rather long chat with HMRC’s VAT department to understand what I was doing wrong, so what follows comes straight from them. I, of course, take no responsibility if you choose to do as I have done.

The advice that I had been given from more than one accountant was that we should imagine VAT on top of the Adsense income and place that number into both boxes 2 and 4 (so as to declare it but cancel itself out). So if I earned £100 in Adsense earnings I would add £20 to box 2 and 4, and place £100 in box 6 (sales). This made box 4 too large (as box 7 (purchases) must be at least 5 times box 4) so I presumed I should add £100 to box 7 also. I think the HMRC VAT guy was impressed at how wrong I had managed to get it.

All you need do for Google Adsense is (assuming you have Google’s VAT number on your “statement of earnings” from them) is to put the earnings into box 6 (sales), and that is it. You don’t need to add 20% to box 2 and 4, and it isn’t a purchase so it has nothing to do with box 7. The reason we can do this is because Google Adsense earnings are a zero-vat sale. If you have Google’s VAT number you can zero-vat advertising revenue from them because the place of supply for advertising is based on the client (Google, so Ireland), so Google Ireland sort out the VAT at their end, not you.

In fact, what I had tried to do originally (20% into box 2 + 4) was actually what Google do when buying advertising from me! Or, if I purchase advertising from Google (Adwords) then I would need to do the box 2 and 4 malarkey (I have this to work out in my next VAT return, it should be 20% into box 2 & 4, and the whole amount in box 7 as it is a purchase, but I’ll call them up and ask HMRC as they are the people who will accept or reject the VAT return!). I hope that clears things up!

Search and Replace in Visual Studio

Today I’ve been parsing some text files in Visual Studio 2010 express in a semi-manual kind of way (lots of Find and Replace commands!). They were generally not too bad but I needed to clean them up to bring them into a tool I was writing. Here are some helpful things I worked out along the way:

To remove an empty line, bring up the Find and Replace dialog box (ctrl-h I think) and set the “find what” to
\n\nand put in the “replace with” box put
\n

That worked fine for my files though you may want to try something a little more robust if you have tabs and whitespace on the line. First click “use” and set the combo box to “regular expressions”. The set “Find what”:
^:b*$\nand leave “replace with” blank

I also needed to remove brackets along with their contents. Make sure Use Regular Expressions is set, “replace with” is blank and then set “Find words” to:
\(.*\)

Then I needed to remove any line that had an apostrophe in it (don’t ask why!), so as above, but set the “Find words” to:
.*'.*\nNaturally you can replace the apostrophe in the example above with another character, string, or regex substatement.

Need to get red of any lines that contain any non A-Z characters (ie, uppercase only)?
^.*[^A-Z]+.*$

I also cleared out all the numbers from the file. As above but:
[0-9]*

And finally removing all whitespace is done using the above settings and then in “Find What” goes:
:b

But that last one is in the shortcut list anyway. Regular Expressions (regex) are definitely something worth learning and not just if you’re into programming – I used to use this kind of stuff all the time when I did admin.

Hope you find this helpful. I’m going to try and post a few times a week. Expect some regular updates..!

Google Calendar: Last day of the month

I run different google calendars for different organisations, and many of them have regular repeating meetings in the calendar. It is relatively easy to set up repeating meetings in a google calendar but unfortunately the week (or day) that they repeat on is anchored to the start of the month, so if you want to say “lets meet on the last Thursday of the month” there’s no obvious way to do this with a google calendar.

Google could fix this with a little radio button option to set which end of the month to anchor repeating fixtures, but I guess they’re tad on the busy side (I’m quite the google fan actually!).

After a bit of trawling I found there is a workaround. If you want to insert a regular meeting on say the last Thursday of the month then you have to insert the repeating fixture on a month where it is the 5th occurrence of that day (day 29-31), and of course set it as a repeating event. If the 5th Thursday isn’t this next month then set up the meeting using a 5th Thursday in the past and then delete the individual instances of the meeting before today’s date (or do it in the future and set the interim meetings by hand).

Problem solved.

Google search auto-complete

Google recently introduced a new feature to their google.com search engine. As you type google will give suggestions to the question you might be asking. These suggestions are based on popular searches that other users have made. There are some highly amusing ones out there but I notice that the initial phrasing of the suggestion is important:

“When did” returns the suggestions: elvis die, michael jackson die, michael jackson turn white
“In what year did” returns the suggestions: did the US declare independence from Britain, England defeat France in the battle of Agincourt

“How does” returns: it work, skype work, twitter work, swine flu kill
“Under what conditions” returns: can potassium bromide conduct electricity, does a patience need to be on a drop of glucose, does matter create light.

So if you want intelligent suggestions you need to use intelligent phrasing! It seems the old adage is true: Ask a silly question, get a silly answer.

Edit: There’s now a website dedicated to it: http://autocompleteme.com

“Windows in the world” fail: ATM

Windows strikes fails again, this time on an ATM where I was planning on getting some cash out! Strictly speaking it is McAfee that failed with a pure virtual function call (C++, when you somehow manage to call a pure virtual method of an abstract class), and one has to ask: is an ATM really in need of anti-virus software? But it happens on a Microsoft box and that’s enough for me!

Microsoft Windows Fail - pure virtual function call on an ATM

Microsoft Windows Fail

Click the picture for large version.


Follow mattparkins on Twitter