Git Product home page Git Product logo

spree-vat-fix's Introduction

SpreeVatFix

Spree's VAT handling (out of the box) is lacking in the following ways

  • only one rate is taken, others are ignored
  • default tax rate is not used
  • there is no option to include shipment in the tax calculation
  • coupons (and consecutive tax reductions) are not handled
  • rate matching is done by billing, not shipping address

This extension tries to fix at least several if not all of these problems

It does this by :

  • providing a Calculator::VAT implementation and
  • overriding tax adjustment creation in Order
  • adding taxes to shipment if vat is not included in prices (ie :show_price_inc_vat == false)
  • giving you product price incl vat on the product screen (no more adjusing it automatically)

The admin also gets a checkbox on the product page to reverse the vat. Meaning you can put the price including vat into the field and it will be adjusted to the vat 0% price (using the tax category yu put or the default)

Contribute!

This is a work in progress and if you have any contributions, please mail or send diffs. At the moment used with 0.6 and in the process of upgrading with 0.7

Extras

This extension also adds an option to use running order numbers (as required in some countries). Set :running_order_numbers in Spree::Config

As an aside, I have added the description of the tax category as the Adjustments label. So these show up in the summary and printouts (spree-html-invoice ext.) So where it used to say Tax (or whatever, you must now set your descriptions and will possibly get several)

The unattainable Price

Due to the way spree works some prices (incl vat) are not achievable. This is because Product.price is stored with only 2 digits in the database.

So with any tax rate there are prices where the tax-in price jumps 2 cent for a one cent increase in price. Sometimes that means you just can't have 9.99 (or 9.95) or where-ever it hits you. Don't despair and just choose another price.

This could be fixed off course, but it's too big for me (ie it doesn't matter that much). Spree chooses to store pre-tax prices with 2 digits. So That's how it is: go to the list if you really feel you have to.

Status

  • several vat categories in an order WORKS
  • in fact (default) tax is applied to all non-tax adjustments
  • using default category WORKS
  • running Order numbers WORK
  • fixed some rounding issues
  • finally got the summary box to work for the vat_inc true (normal) case.
  • vat applied to shipping by default tax WORKS (if :show_price_inc_vat == false)

NO TESTS - This is strictly "works for me" software, use at own risk and/or contribute tests

Copyright (c) 2011 [Torsten Rüger], released under the New BSD License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.