Tax

world.money.Tax
See theTax companion object
final case class Tax

A declared tax structure of named components, each levied on the net (Tax.on), on the net plus other components' charged amounts (Tax.over), or withheld from the payable (Tax.withheld).

The structure is the application's configuration: no jurisdiction's rates or bases are curated here. A component's base is referenced as a value, so naming an undeclared component cannot be written, and assembly validates the rest. Instances via Tax.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def exclusive[C <: Currency & Singleton](amount: Money[C], mode: Rounding)(using ValueOf[C]): Taxed[C]
Extension method from Tax

Prices tax-exclusively: amount is the net, and each component is computed forward from it and rounded at the currency's scale by mode. Named for the pricing direction, so that net and gross keep one reading each across the module.

Prices tax-exclusively: amount is the net, and each component is computed forward from it and rounded at the currency's scale by mode. Named for the pricing direction, so that net and gross keep one reading each across the module.

Attributes

def inclusive[C <: Currency & Singleton](amount: Money[C], mode: Rounding)(using c: ValueOf[C]): Either[Undefined, Taxed[C]]
Extension method from Tax

Prices tax-inclusively: amount is the gross, the shelf price. The combined factor is inverted, the components computed forward, and the net reconciled as gross minus their sum - so net + tax == gross holds by construction and the rounding remainder lands in the net deterministically. Withholding computes on the reconciled net. Undefined where a degenerate structure would divide by zero.

Prices tax-inclusively: amount is the gross, the shelf price. The combined factor is inverted, the components computed forward, and the net reconciled as gross minus their sum - so net + tax == gross holds by construction and the rounding remainder lands in the net deterministically. Withholding computes on the reconciled net. Undefined where a degenerate structure would divide by zero.

Attributes

def inclusive[C <: Currency & Singleton](amount: Money[C], scale: Int, mode: Rounding): Either[Undefined, Taxed[C]]
Extension method from Tax

The same extraction at an explicit scale - the controlled form for currencies that record no minor unit, completing the family's explicit-scale pair.

The same extraction at an explicit scale - the controlled form for currencies that record no minor unit, completing the family's explicit-scale pair.

Attributes

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product