SKVReport

Generate CSV-formatted string from specified data to be able to create a Periodisk Sammanställningsrapport file for Skatteverket.

Installation

Add this line to your application's Gemfile:

gem 'skv_report'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install skv_report

Usage

Stripe

# charges - array of charges in json-format from stripe
# period - for which period of the year this report should be for
# year - corresponding year for the period
# company_information - needs to contain the following information:
# {
#   vat_number: String, # vat number of the selling company
#   name: String, # contact name on selling company
#   phone: String, # phone to contact on selling company
#   email: String, # optional email to contact on selling company
#   type_of_sales: String, # one of the following three
#                            ['wares', 'third_party', 'services']
# }
# rates - object containing exchange rates

SKVReport::Stripe.call(charges, period, year, company_information, rates)

Development

The main branch in this repository is called main.

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

To release a new version, update the version number in version.rb, and then make a release on GitHub which will automatically build the gem and upload to rubygems.

Exchange rates

Exchange rates needs to be passed. exchangerateapi gives us a JSON-object suited for this gem.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/standout/skv_report.

License

The gem is available as open source under the terms of the MIT License.