TaxRate
TaxRate
A TaxRate defines the rate of tax to apply to a ProductVariant based on three factors:
- the ProductVariant’s TaxCategory
- the applicable Zone (“applicable” being defined by the configured TaxZoneStrategy)
- the CustomerGroup of the current Customer
Signature
class TaxRate extends VendureEntity implements HasCustomFields {
constructor(input?: DeepPartial<TaxRate>)
@Column() @Column() name: string;
@Column() @Column() enabled: boolean;
@Column({ type: 'decimal', precision: 5, scale: 2, transformer: new DecimalTransformer() }) @Column({ type: 'decimal', precision: 5, scale: 2, transformer: new DecimalTransformer() }) value: number;
@Index() @ManyToOne(type => TaxCategory) @Index()
@ManyToOne(type => TaxCategory)
category: TaxCategory;
@Index() @ManyToOne(type => Zone) @Index()
@ManyToOne(type => Zone)
zone: Zone;
@Index() @ManyToOne(type => CustomerGroup, { nullable: true }) @Index()
@ManyToOne(type => CustomerGroup, { nullable: true })
customerGroup?: CustomerGroup;
@Column(type => CustomTaxRateFields) @Column(type => CustomTaxRateFields)
customFields: CustomTaxRateFields;
taxComponentOf(grossPrice: number) => number;
netPriceOf(grossPrice: number) => number;
taxPayableOn(netPrice: number) => number;
grossPriceOf(netPrice: number) => number;
apply(price: number) => TaxLine;
test(zone: Zone, taxCategory: TaxCategory) => boolean;
}
Extends
Implements
- HasCustomFields
Members
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
type:
CustomerGroup
customFields
property
type:
CustomTaxRateFields
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) => TaxLine
test
method
type:
(zone: Zone, taxCategory: TaxCategory) => boolean