Repository is archived
No commit activity in last 3 years
No release in over 3 years
A Ruby library for generating a HMRC VAT MOSS return document
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

< 2.0, > 1.0
 Project Readme

HMRC VAT MOSS Return Generator

This library helps you generate a VAT MOSS Return from Ruby. In HMRC's infinate wisdom, they have decided that users must submit returns in a formatted ODS file. (unlike the EC Sales List, where they allow you submit CSV).

Usage

require 'hmrc_moss'

# Create a new return and provide the period which you are reporting for.
moss_return = HMRCMOSS::Return.new('Q1/2015')

# Add any sales which you made FROM the UK to other member states.
moss_return.supplies_from_uk do
  line 'AT', :rate_type => 'standard', :rate => 20, :total_sales => 2000, :vat_due => 10
  line 'DE', :rate_type => 'standard', :rate => 20, :total_sales => 2000, :vat_due => 10
  line 'FR', :rate_type => 'standard', :rate => 20, :total_sales => 2000, :vat_due => 10
  line 'NL', :rate_type => 'standard', :rate => 20, :total_sales => 2000, :vat_due => 10
end

# Add any sales made from fixed establishments in other member states.
moss_return.supplies_from_outside_uk do
  line '123123123', 'AT', :rate_type => 'standard', :rate => 20, :total_sales => 2000, :vat_due => 10
  line '123123123', 'DE', :rate_type => 'standard', :rate => 20, :total_sales => 2000, :vat_due => 10
  line '123123123', 'FR', :rate_type => 'standard', :rate => 20, :total_sales => 2000, :vat_due => 10
  line '123123123', 'NL', :rate_type => 'standard', :rate => 20, :total_sales => 2000, :vat_due => 10
end

# Save the restuling file
moss_return.ods_file.save('path/to/return.ods')

Output

The resulting ODS file is based on the template provided by HMRC.

Example

Important Notes

  • No validation is carried out on the data you provide. You should ensure it is all correct.
  • All numeric values provided will be output to two decimal places (as required by HMRC).
  • A file generated by this has not yet been submitted to HMRC however we have no reason to expect it to be rejected based on the method used to generate the file.
  • The author accepts not responsible whatsoever for any failures or mis-reporting. You are expected to fully review all output before submitting to HMRC.