TaxRate

TaxRate

TaxRate

A TaxRate defines the rate of tax to apply to a ProductVariant based on three factors:

  1. the ProductVariant’s TaxCategory
  2. the applicable Zone (“applicable” being defined by the configured TaxZoneStrategy)
  3. the CustomerGroup of the current Customer

Signature

class TaxRate extends AdjustmentSource {
  readonly readonly type = AdjustmentType.TAX;
  constructor(input?: DeepPartial<TaxRate>)
  @Column() name: string;
  @Column() enabled: boolean;
  @Column() value: number;
  @ManyToOne(type => TaxCategory)
    category: TaxCategory;
  @ManyToOne(type => Zone)
    zone: Zone;
  @ManyToOne(type => CustomerGroup, { nullable: true })
    customerGroup?: CustomerGroup;
  taxComponentOf(grossPrice: number) => number;
  netPriceOf(grossPrice: number) => number;
  taxPayableOn(netPrice: number) => number;
  grossPriceOf(netPrice: number) => number;
  apply(price: number) => Adjustment;
  test(zone: Zone, taxCategory: TaxCategory) => boolean;
}

Members

type

readonly property
type:

constructor

method
type:
(input?: DeepPartial<TaxRate>) => TaxRate

name

property
type:
string

enabled

property
type:
boolean

value

property
type:
number

category

property
type:
TaxCategory

zone

property
type:
Zone

customerGroup

property

taxComponentOf

method
type:
(grossPrice: number) => number

netPriceOf

method
type:
(grossPrice: number) => number

taxPayableOn

method
type:
(netPrice: number) => number

grossPriceOf

method
type:
(netPrice: number) => number

apply

method
type:
(price: number) => Adjustment

test

method
type:
(zone: Zone, taxCategory: TaxCategory) => boolean