spree/spree — pull request #5337 by brchristian (2014-09-09 06:23:24+00:00)
Title: Handling Fees

As discussed by myself in https://github.com/spree/spree/issues/5210 (and commented on by @jhirbour and @labber), and discussed with @peterberkenbosch and @JDutil in the Spree Google group (and with @radar in the Spree IRC channel a couple months ago), I've put some thought into implementing Handling Fees as `Adjustments` applied from a `StockLocation` to a `Shipment`.

Here's the result of that work, for your consideration and discussion. I'm interested in any feedback, and of course in working towards a merge if things are looking good.

Note that for a reason I'm not fully understanding at the moment, I'm seeing `core/app/models/spree/stock_location.rb:3:in '': uninitialized constant Spree::Core::CalculatedAdjustments (NameError)` when I initialize the spec. If anyone has ideas, I assume it's an easy fix.

Note also that this involved a refactor of the shipping calculators' `compute_package` methods, which I think modularizes that code pretty nicely.

It seems to work quite well in the browser, and behaves as expected.

Cheers!