casualsteps/spree_korean_surface_mail — pull request #3 by jamesmartinduffy (2014-05-16 04:17:10+00:00)
Title: Modified calculator to return total customs tax, not just seonpyeonyogeum

Hey Ken,

I really don't think this is going to work split into multiple calculators. Again, let me run through the calculation.

The price the user pays for their final order:
`Total price = Price + 관세 + 부가세` **The user does not actually pay 선편요금, it's only used to calculate 관세 and 부가세**

How 관세 and 부가세 are calculated:
`관세 = (Price + 선편요금) * gwansae_rate` **선편요금 is required for calculation**
`부가세 = (Price + 선편요금 + 관세) * bugasae_rate` **선편요금 is required for calculation**

If you just add on a flat 10% tax to the order, it won't include that 선편요금 charge, so it won't be accurate.

Since 션편요금 is required for both calculators, it would have to be a common module between the gwansae calculator and the bugasae calculator or we'd end up duplicating code. And since all of this is really just for one final tax (customs), I think it makes most sense to just put all the logic in one calculator instead of needing 3 separate extensions (선편요금, 관세, 부가세) to calculate one customs tax.

Take a look at my changes below and let me know what you think. Regardless, this is the correct logic to be used in the final calculator, if you want to split it into different modules instead of merging this PR. But I think this PR should just take care of the whole customs tax. Let me know your thoughts.