-
-
Notifications
You must be signed in to change notification settings - Fork 151
Taxes Object Model
Chris Travers edited this page Jul 3, 2017
·
2 revisions
The taxes module consists of two parts: A factory (LedgerSMB::Tax) and a set module classes which do the main calculations. The module classes all MUST implement the same methods and the factory checks to make sure that the interfaces are implemented before returning the object.
The Tax calculation module MUST accept a hashref in the constructor with the standard tax elements. It also MUST provide the following methods:
- additional_tax($orderdoc, $linenumber, $basis)
- included_tax($orderdoc, $linenumber, $total)
The factory is the only class which has database access. The calculation classes do not access the tax subsystem in the database.
The provided tax modules support compound taxes (where previous tax runs are taxable).
Manual/external tax calculation is beyond the scope of this module.