- All Implemented Interfaces:
OnixComposite
,OnixComposite.OnixDataComposite<JonixDiscount>
,OnixTag
,Serializable
Discount composite
An optional group of data elements which together define a discount either as a percentage or as an absolute amount. Repeatable in order to specify a more complex arrangement such as a progressive or tiered discount. Used only when an ONIX message is sent within the context of a specific trading relationship.
Reference name | <Discount> |
Short tag | <discount> |
Cardinality | 0…n |
- <
Price
>
Product
⯈ProductSupply
⯈SupplyDetail
⯈Price
⯈Discount
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tectonica.jonix.common.OnixComposite
OnixComposite.OnixDataComposite<V extends JonixStruct>, OnixComposite.OnixDataCompositeUncommon, OnixComposite.OnixDataCompositeWithKey<V extends JonixKeyedStruct<K>,
K extends Enum<K> & OnixCodelist>, OnixComposite.OnixSuperComposite -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This is an internal API.asStruct()
A discount expressed as an absolute amount per copy.A discount percentage applicable to the price carried in an occurrence of the <Price> composite.An ONIX code identifying a discount type or reason.boolean
exists()
indicates whether this tag exists in the ONIX recordFor advanced use-cases only.void
quantity()
A minimum order quantity required to qualify for a specified discount.A maximum order quantity eligible for a specified discount, used only in the case of ‘progressive’ discounts.
-
Field Details
-
refname
- See Also:
-
shortname
- See Also:
-
datestamp
(type: dt.DateOrDateTime) -
sourcename
(type: dt.NonEmptyString) -
sourcetype
-
EMPTY
-
-
Constructor Details
-
Discount
public Discount() -
Discount
-
-
Method Details
-
_initialize
public void _initialize()Description copied from interface:OnixComposite
This is an internal API. Since Jonix 8.0, composite objects are being populated lazily. This method initiates the population process, and is invoked internally by the accessor APIs of the composites- Specified by:
_initialize
in interfaceOnixComposite
-
exists
public boolean exists()Description copied from interface:OnixTag
indicates whether this tag exists in the ONIX record -
ifExists
-
getXmlElement
Description copied from interface:OnixComposite
For advanced use-cases only.- Specified by:
getXmlElement
in interfaceOnixComposite
- Returns:
- native representation of the XML element underlying to this tag
-
discountPercent
A discount percentage applicable to the price carried in an occurrence of the <Price> composite. Optional and non-repeating; but either <DiscountPercent> or <DiscountAmount> or both must be present in each occurrence of the <Discount> composite.
Jonix-Comment: this field is required -
discountType
An ONIX code identifying a discount type or reason. Optional, and non-repeating. When omitted, the default is a simple or rising discount (the discount is applied to all units in a qualifying order).
Jonix-Comment: this field is optional -
quantity
A minimum order quantity required to qualify for a specified discount. Optional, and non-repeating. Where omitted, the discount applies regardless of the order quantity (ie the minimum qualifying order quantity is 1).
Jonix-Comment: this field is optional -
toQuantity
A maximum order quantity eligible for a specified discount, used only in the case of ‘progressive’ discounts. Optional, but where used, must be preceded by a minimum qualifying order quantity (even if that minimum is 1). For the special case where there is no maximum (ie in the repeat of the <Discount> composite that specifies the highest progressive discount), use zero.
Jonix-Comment: this field is optional -
discountAmount
A discount expressed as an absolute amount per copy. Optional and non-repeating; but either <DiscountPercent> or <DiscountAmount> or both must be present in each occurrence of the <Discount> composite. Note that when both are present, they represent two different expressions of the same discount – the discounts are not cumulative.
Jonix-Comment: this field is optional -
asStruct
- Specified by:
asStruct
in interfaceOnixComposite.OnixDataComposite<JonixDiscount>
-