2018-11-30

Making Tax Digital

The "challenge" continues.

Just a reminder - EVERY UK VAT REGISTERED COMPANY (that has to be registered) must be using the new "Making Tax Digital" API to submit VAT returns from April 2019. Do not forget!

We have s/w for this (Onion Accounts), tested, and approved, yay!

So we are trying to put the company (A&A) on the "pilot" so we can actually submit our own VAT return using the new system, before it is all mandatory. A final double check that all is working as it should.

We get to authorise it all, using OAUTH, and get an access token for the read:vat and write:vat access. But it does not work, we are told we are not authorised!

Checking the government gateway VAT pages it seems we have to "sign up" for the pilot. That may explain things, except if we are not signed up then why allow us to "authorise" the access? Surely the OAUTH process should be saying "You are not signed up for MTD VAT" rather than giving the access token and the failing when we try and get the VAT obligations? Crazy...

So, let's try and sign up.... Nope. We get "This service is only available to some limited companies, sole traders, partnerships and VAT groups." which is not that helpful.

We also get "You will be able to sign up for this service from April 2019."

Hang on?!?! This is "Sign up for the pilot". Why would I be able to sign up for a pilot in April 2019 when the pilot is surely over (as MTD VAT is mandatory from April 2019)? Surely they are not making people "sign up" for the mandatory process (they call it a "service" which I dislike).

A bit more digging and we find "You will not be able to take part in the pilot at the moment if you:" ... "currently trade with, or have traded with the EU".

Two issues with this...

Firstly, surely you want people on the pilot with the complex edge cases, not the "simple" cases. You want things to break (if they are going to break) in the pilot and not once the process goes live. So why exclude these edge cases?

Secondly, and this is where the mindset has got us brexit, what UK company does not trade with the EU? Hardly any, I bet. All of our customers and suppliers are in the EU! Yes, almost every single one is also in the UK, but the UK is part of the EU.

Is a Dutch company trading with a Dutch supplier, "trading with the EU"? If yes, then so is a UK company trading with a UK supplier. If no, then neither is a UK company trading with that Dutch supplier. Either the supplier (or customer) is in the EU, or they are not. They are not suddenly "not in the EU" if in the same country as the trading party. Next we'll say that trading with someone else in Bracknell is not trading with the UK, it is trading with Bracknell.

The ideas that there is the "UK", and there is this separate non-UK "EU", an idea perpetrated by HMRC in this case, is part of the problem, IMHO.

Update: Sounds like the "traded with EU" restriction goes away next week, so we may be able to make some progress!

Update: (4th Dec) We have "applied" for the trial.

Update: (5th Dec) We managed to file a VAT return, just in time.

2018-11-28

Granddaughters

I have grandsons, as you may know, but two of my daughters have been in a sort of race to produce our first granddaughter. Yes, I know it does not work like that, honest...

Alice

Alice was born on Saturday. Apart from being a few days earlier than expected, everything went exactly as planned, which is a huge relief. After what happened last time, we all knew the worst that could happen, and everyone was scared shitless that something would go wrong. I am so relieved, and pleased, to say everything went perfectly, and mother and baby are doing fine, back home, and starting the long journey ahead of them with a sweet innocent bundle of joy called Alice.

The hospital were great, and did everything right. Wales is a strange place - the hospital had plenty of parking, and it is free - we're still getting over the shock.

Alice

Odette

Odette was a little more drawn out in her arrival. At one point we thought she would be first, and at one point we thought they were both coming on the same day! My poor wife has been amazing, running back and forth between Wales and Bracknell to be with the girls when they need her. She has not slept for two days, but today (Wednesday) we welcome Odette in to the world.

Her big brother, Lewis, has been great. He clearly adores her already, and says she is cute.

So now I have two grand-daughters all of a sudden. Well done.

Odette

2018-11-19

Cal Mah

I nearly called this "Cal Meh" but I feel that is probably more a reflection of my expectation than the event itself. In case you missed it, Cal Mah was a Stargate fan event in Leicester this weekend. It was quite small (I felt), but that is probably to be expected for a UK event. It had some talks, and some of the actors, and a few stands with vendors. I went on the Saturday and felt it did not really justify two days, for me. I suspect that had the organiser not decided to unilaterally cancel my expensive ticket, then I may have had more fun with the extra evening events. Shame.

I am not one for dressing up, sorry, but I did go as far as a lab coat and an "Area 51 ID card". I even made a card for the organiser, and left at the desk when I left. No idea if he likes it, he has blocked me on twitter!

I seem to have been banished to a ship in a distant galaxy!

What was interesting was the number of people that did dress up, and some of them in quite impressive costumes. It seems like quite a community of fans, very friendly.


So, yes, a fun small event. If I can find someone to go with, I may consider one the the bigger events such as Gatecon in Vancouver, one day. I was surprised to see someone dressed as a full Star Trek captain though!

As for the event organisation, obviously I'm not impressed with my ticket being cancelled. It was three weeks after the "misunderstanding" on Facebook and with no warning. It was after I had spent money on a hotel room which he refused to cover. I still don't know who is actually running the event though - "FCD Events presents Cal Mah" does not explain the legal entity involved at all. I saw no terms and conditions as part of buying tickets, and the receipt from PayPal says it was paid to the organiser personally. It seems no data protection registration that I can find, and not complying with PECR (he emailed trying to sell more tickets using the email I used to buy the ticket, with no opt-in having been requested). No accessible privacy policy (just a generic contact link). I'm rather concerned that it is pitched as a charity, which has a whole set of rules of its own. Lots of rules (and laws) broken, or so it seems to me. In the end I decided to go, and not waste the hotel booking for which I would have no doubt had to sue to get my money from the organiser. It really was not the way to treat a fan (or a customer)! Had it gone better, not only would it have been a couple of expensive tickets but could have been a stand at the next event, etc. I am far happier being involved in events than just going to them. I could certainly have informally helped him with meeting some of the legislation! Oh well.

2018-11-11

SVG all the things!

I am quite amazed how many things in the business are postscript based, i.e. code or scripts generating postscript, or just hand crafted postscript files, which are then converted to PDF or printed.

I have been working all week on this, not just the plastic card printing, but now the invoices and statements and letters from the accounts system. Because of my new library for fonts I have also been updating systems that were already SVG based but coped badly with long names and strings.

But there is still a lot to do, so this is not going to happen over night.

The main change now for invoicing is the system generates SVG files. I originally planned on making simple multiple page SVG using inkscape style "layers" but actually inkscape is slow to load a multiple page SVG anyway even though it can pick out one page to convert to PDF. SVG does not (yet) have pages as a concept, but that may happen soon. Sadly I cannot seem to easily script loading once and then converting each page, so I ended up making multiple SVG files. But I have the option to make one SVG file, and I may make one that is interactive with page turn buttons, for use in a web page as well.

As has been a big topic on my blog, of late, fonts have been the challenge. I am getting the hang of it now. Latest annoyance if font family names - where some fonts have one family name and many weights and slants and so on, but others make each combination a different family name. I have ended up with code to "normalise" this (including, in one case, removing a trailing space from a family name which refused to work in the browser even in quotes!).

It also took me a while to realise that SVG font-style is *just* the slant (normal, italic, oblique), and also that SVG font-weight is 100-900 but free type uses a totally different scale. Oh, and it is normal, not "normal" when using in a style, but always "normal" when used as an XML attribute (obviously).

Anyway, finally we have a system which uses SVG masters as a letterhead and template for the content of invoices, statements and letters. This allows a lot of fine tuning (the accounts system is used by a lot of different companies). The old system using postscript allowed even more fine tuning but only if you could code postscript. This way you can edit a letterhead or layout in inkscape, which is a lot easier.

I have even set up a system to allow font control at various levels, even per account. This means we could set up an account for large print, for example. There are limits on what will fit with invoices and statements, but we can make text much larger in most cases, and text on letters even larger. We can also control font, such as using the Open Dyslexic font, if wanted. Whilst I doubt we would get many requests, especially as such documents are almost always emailed and so easily scaled on screen, we have the option now.

The other good thing is the new PDFs have much better copy/paste of content including good unicode support. I expect this would help screen readers extract text more easily.

Whilst mostly the plan was to make an equivalent system for invoices, statements, and letters, I have taken the chance to improve some things - such as a summary and totals on page 1 of invoices when they do not fit on one page.

Right now, some customers are on new format, so we can get some feedback, but we'll switch over completely soon. The "formal" invoice remains the PGP signed plain text that is emailed, but the PDF and print versions should be much nicer now.

Even so, much more to do - things like the call data records need changing and improving. This is a bit of a never ending task.

And finally, I have to say how excellent Google Fonts is. I have not loaded them all, but so far a reasonable selection can be seen on the card printing system, which I have managed to group by the base font family name. I'm happy to load any more free fonts if people have requests.


Thanks for the help from those that have been testing, especially Neil for his pedantry.

P.S. This seems odd in a way, laying out letters, as one of the very first projects I ever coded was a text editor and formatter for a TRS-80 written in Z80 code and printing to a daisy wheel printer over a Centronics interface. How time flies...

Non breaking spaces

Arrrg!

There is the normal space character (0x20), and there is the non breaking space character (0xA0).

I was not expecting to have to do anything with these specially in any way to be honest apart from spotting space characters for paragraph text wrapping logic...

However, I have run in to snags, and ended up having to add it as a special case in my code.

The first snag is simple - some fonts (and only a few) do not have the non-breaking space character encoded. So my new font system wants to know the size of every character to work out layout of text in SVG, and it "falls back" to Google NoTo fonts to find the character if missing.

This logic was originally for Emojis, but actually has the full Google NoTo set now, so does Egyptian hieroglyphics and so on. It works well (once you remove the Color[sic] Emoji font).

Thankfully most of the fonts I am using even have extended Latin, so things like Polish crossed "l" characters just work in the base font. Google's free fonts are pretty good!

The problem is that when the main selected font has no non breaking space I fall back, and I hit the Emoji font quite quickly which does, only it is about twice as wide as you expect!

So my text ends up with non breaking space encoded in the Emoji font, and being wide.

Well, this is not ideal, but why would I encounter non breaking spaces anyway? Well, because when I make the SVG output, extra spaces, and leading spaces, and trailing spaces, are all zapped. So any actual formatting with spaces (especially if using mono-spaced fonts) is totally lost. This is bad enough, but I have worked out the size with the spaces and so the result looks horridly stretch to fit the space it should take with all the spaces in place. This took me ages to find as one string I was testing with had a trailing space which I had not spotted. So now I convert all spaces to non breaking spaces for output to SVG.

This them hit the first snag that the non breaking spaces are not in the font, and so I ended up coding all spaces in Emoji (for some base fonts). Again, not spotted originally as the font I was using had non-breaking spaces encoded, but another font did not and just looks horrid spaced!

I have ended up:- (see P.S.)
  • Using only spaces for text wrapping (so non breaking spaces do in fact non-break)
  • Converting non breaking spaces to spaces for all width calculation
  • Converting all spaces to non-breaking spaces when making final SVG
It seems to finally work...

Fonts are fun!

P.S. xml:space="preserve" is your friend - it preserves spaces as they are.

Fun with... LED Strips

I am not late to the party here, honest. I have been playing with these for some time, and even design and make LED controllers. The ubiquit...