A Ruby library to generate HMRC VAT MOSS Return files
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
Gemfile
Gemfile.lock
LICENSE
README.md
hmrc-moss-return.gemspec
template.ods

README.md

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.