OrderLine
OrderLine
A single line on an Order which contains information about the ProductVariant and quantity ordered, as well as the price and tax information.
class OrderLine extends VendureEntity implements HasCustomFields {
constructor(input?: DeepPartial<OrderLine>)
@Index()
@ManyToOne(type => Channel, { nullable: true, onDelete: 'SET NULL' })
sellerChannel?: Channel;
@EntityId({ nullable: true })
sellerChannelId?: ID;
@Index()
@ManyToOne(type => ShippingLine, shippingLine => shippingLine.orderLines, {
nullable: true,
onDelete: 'SET NULL',
})
shippingLine?: ShippingLine;
@EntityId({ nullable: true })
shippingLineId?: ID;
@Index()
@ManyToOne(type => ProductVariant, productVariant => productVariant.lines, { onDelete: 'CASCADE' })
productVariant: ProductVariant;
@EntityId()
productVariantId: ID;
@Index()
@ManyToOne(type => TaxCategory)
taxCategory: TaxCategory;
@EntityId({ nullable: true })
taxCategoryId: ID;
@Index()
@ManyToOne(type => Asset, asset => asset.featuredInVariants, { onDelete: 'SET NULL' })
featuredAsset: Asset;
@Index()
@ManyToOne(type => Order, order => order.lines, { onDelete: 'CASCADE' })
order: Order;
@OneToMany(type => OrderLineReference, lineRef => lineRef.orderLine)
linesReferences: OrderLineReference[];
@OneToMany(type => Sale, sale => sale.orderLine)
sales: Sale[];
@Column()
quantity: number;
@Column({ default: 0 })
orderPlacedQuantity: number;
@Money({ nullable: true })
initialListPrice: number;
@Money()
listPrice: number;
@Column()
listPriceIncludesTax: boolean;
@Column('simple-json')
adjustments: Adjustment[];
@Column('simple-json')
taxLines: TaxLine[];
@OneToMany(type => Cancellation, cancellation => cancellation.orderLine)
cancellations: Cancellation[];
@OneToMany(type => Allocation, allocation => allocation.orderLine)
allocations: Allocation[];
@Column(type => CustomOrderLineFields)
customFields: CustomOrderLineFields;
unitPrice: number
unitPriceWithTax: number
unitPriceChangeSinceAdded: number
unitPriceWithTaxChangeSinceAdded: number
discountedUnitPrice: number
discountedUnitPriceWithTax: number
proratedUnitPrice: number
proratedUnitPriceWithTax: number
unitTax: number
proratedUnitTax: number
taxRate: number
linePrice: number
linePriceWithTax: number
discountedLinePrice: number
discountedLinePriceWithTax: number
discounts: Discount[]
lineTax: number
proratedLinePrice: number
proratedLinePriceWithTax: number
proratedLineTax: number
addAdjustment(adjustment: Adjustment) => ;
clearAdjustments(type?: AdjustmentType) => ;
}
-
Extends:
VendureEntity -
Implements:
HasCustomFields
constructor
(input?: DeepPartial<OrderLine>) => OrderLinesellerChannel
The Channel of the Seller for a multivendor setup.
sellerChannelId
shippingLine
The ShippingLine to which this line has been assigned. This is determined by the configured ShippingLineAssignmentStrategy.
shippingLineId
productVariant
The ProductVariant which is being ordered.
productVariantId
taxCategory
taxCategoryId
featuredAsset
order
linesReferences
sales
Sale[]quantity
numberorderPlacedQuantity
numberThe quantity of this OrderLine at the time the order was placed (as per the OrderPlacedStrategy).
initialListPrice
numberThe price as calculated when the OrderLine was first added to the Order. Usually will be identical to the
listPrice, except when the ProductVariant price has changed in the meantime and a re-calculation of
the Order has been performed.
listPrice
numberThis is the price as listed by the ProductVariant (and possibly modified by the OrderItemPriceCalculationStrategy), which, depending on the current Channel, may or may not include tax.
listPriceIncludesTax
booleanWhether the listPrice includes tax, which depends on the settings of the current Channel.
adjustments
Adjustment[]taxLines
TaxLine[]cancellations
allocations
customFields
CustomOrderLineFieldsunitPrice
numberThe price of a single unit, excluding tax and discounts.
unitPriceWithTax
numberThe price of a single unit, including tax but excluding discounts.
unitPriceChangeSinceAdded
numberNon-zero if the unitPrice has changed since it was initially added to Order.
unitPriceWithTaxChangeSinceAdded
numberNon-zero if the unitPriceWithTax has changed since it was initially added to Order.
discountedUnitPrice
numberThe price of a single unit including discounts, excluding tax.
If Order-level discounts have been applied, this will not be the
actual taxable unit price (see proratedUnitPrice), but is generally the
correct price to display to customers to avoid confusion
about the internal handling of distributed Order-level discounts.
discountedUnitPriceWithTax
numberThe price of a single unit including discounts and tax
proratedUnitPrice
numberThe actual unit price, taking into account both item discounts and prorated (proportionally-distributed) Order-level discounts. This value is the true economic value of a single unit in this OrderLine, and is used in tax and refund calculations.
proratedUnitPriceWithTax
numberThe proratedUnitPrice including tax.
unitTax
numberproratedUnitTax
numbertaxRate
numberlinePrice
numberThe total price of the line excluding tax and discounts.
linePriceWithTax
numberThe total price of the line including tax but excluding discounts.
discountedLinePrice
numberThe price of the line including discounts, excluding tax.
discountedLinePriceWithTax
numberThe price of the line including discounts and tax.
discounts
Discount[]lineTax
numberThe total tax on this line.
proratedLinePrice
numberThe actual line price, taking into account both item discounts and prorated (proportionally-distributed) Order-level discounts. This value is the true economic value of the OrderLine, and is used in tax and refund calculations.
proratedLinePriceWithTax
numberThe proratedLinePrice including tax.
proratedLineTax
numberaddAdjustment
(adjustment: Adjustment) => clearAdjustments
(type?: AdjustmentType) =>