Taxed

world.money.Taxed
See theTaxed companion object
final case class Taxed[C <: Currency & Singleton](net: Money[C], components: Vector[(String, Money[C])], withheld: Vector[(String, Money[C])])

A priced document: the net, the charged amount per component in declaration order, and any withheld amounts, with net + tax == gross by construction and the payable derived.

A reversal negates the amounts recorded here rather than recomputing them, so a credit note cancels the original rounding exactly. Instances via Taxed and 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 allocate(weights: Seq[Ratio]): Either[Unallocatable, Vector[Taxed[C]]]
Extension method from Taxed

Splits the recorded document by weights, for a partial refund or a credit note covering part of a line. Every recorded amount allocates independently, so the parts sum back to the whole per component. Recomputing tax on a partial amount could miss the recorded document by a rounding unit; this cannot.

Splits the recorded document by weights, for a partial refund or a credit note covering part of a line. Every recorded amount allocates independently, so the parts sum back to the whole per component. Recomputing tax on a partial amount could miss the recorded document by a rounding unit; this cannot.

Attributes

def apply(label: String): Option[Money[C]]
Extension method from Taxed
def gross: Money[C]
Extension method from Taxed
def payable: Money[C]
Extension method from Taxed

What the payer actually pays: gross minus every withheld amount.

What the payer actually pays: gross minus every withheld amount.

Attributes

def split(parts: Int): Either[Unallocatable, Vector[Taxed[C]]]
Extension method from Taxed

Equal parts of the recorded document; the two-way split of a half-returned line.

Equal parts of the recorded document; the two-way split of a half-returned line.

Attributes

def tax: Money[C]
Extension method from Taxed

The tax total across components.

The tax total across components.

Attributes

def unary_-: Taxed[C]
Extension method from Taxed

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