Lists one product in one e-commerce store, and carries the pricing and ordering that apply to it in that store only. The same product can be listed in several stores, each with its own row here. A row can override the store's GST rate, its internal margin, the cost of the product, and the position the product takes in the store's listing; where an override is left null the store's or the product's own value applies, which is what the effective accessors return. Removing a product from a store deletes this row and not the product itself.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| costOverride | BigDecimal | A fixed invoice cost excluding tax for this product in this store. When set it is used as is, so neither the supplier's base cost nor the margin has any effect on the price. |
| createdBy | Profile | The profile of the administrator who added this product to the store. |
| createdDate | Date | When this product was added to the store. |
| effectiveGst | BigDecimal | The tax rate actually applied to this product in this store, as a decimal. It is the override when one is set, otherwise the store's rate, and zero when the store has none. |
| effectiveMargin | BigDecimal | The internal margin actually applied to this product in this store, as a decimal. It is the override when one is set, otherwise the store's margin, and zero when the store has none. |
| effectivePosition | Integer | The position actually used when ordering this store's listing, which is the override when one is set and otherwise the product's own position. |
| gstRate | BigDecimal | Goods and services tax rate for this product in this store, as a decimal, so 15 percent is 0.15. It overrides the store's own rate, and null means the store rate applies. |
| id | long | Primary key of this store listing, assigned when it is first saved. |
| margin | BigDecimal | Internal margin for this product in this store, as a decimal, so a 5 percent margin is 0.05. It overrides the store's default margin, and null means the store margin applies. |
| position | Integer | Position of this product in the store's listing, lowest first. It overrides the position held on the product itself, and null means that one applies. |
| product | Product | The product being listed. It is shared with every other store that lists it, so changing the product changes it everywhere; per-store differences belong on this row. |
| store | ECommerceStore | The store the product is listed in. It supplies the defaults this row can override. |
Methods
getId() · getProduct() · setProduct(Product product) · getStore() · setStore(ECommerceStore store) · getGstRate() · setGstRate(BigDecimal gstRate) · getMargin() · setMargin(BigDecimal margin) · getCostOverride() · setCostOverride(BigDecimal costOverride) · getCreatedBy() · setCreatedBy(Profile createdBy) · getCreatedDate() · setCreatedDate(Date createdDate) · getPosition() · setPosition(Integer position) · getEffectivePosition() · getEffectiveGst() · getEffectiveMargin()
getId()
Returns: long
Primary key of this store listing, assigned when it is first saved.
getProduct()
Returns: Product
The product being listed. It is shared with every other store that lists it, so changing the product changes it everywhere; per-store differences belong on this row.
setProduct(Product product)
Returns: void
Sets the product being listed in the store.
| Parameter | Description |
|---|---|
product | the product to list |
getStore()
Returns: ECommerceStore
The store the product is listed in. It supplies the defaults this row can override.
setStore(ECommerceStore store)
Returns: void
Sets the store the product is listed in.
| Parameter | Description |
|---|---|
store | the store to list the product in |
getGstRate()
Returns: BigDecimal
Goods and services tax rate for this product in this store, as a decimal, so 15 percent is 0.15. It overrides the store's own rate, and null means the store rate applies.
setGstRate(BigDecimal gstRate)
Returns: void
Sets the tax rate override for this product in this store, as a decimal.
| Parameter | Description |
|---|---|
gstRate | the tax rate override, or null to use the store's rate |
getMargin()
Returns: BigDecimal
Internal margin for this product in this store, as a decimal, so a 5 percent margin is 0.05. It overrides the store's default margin, and null means the store margin applies.
setMargin(BigDecimal margin)
Returns: void
Sets the internal margin override for this product in this store, as a decimal.
| Parameter | Description |
|---|---|
margin | the margin override, or null to use the store's margin |
getCostOverride()
Returns: BigDecimal
A fixed invoice cost excluding tax for this product in this store. When set it is used as is, so neither the supplier's base cost nor the margin has any effect on the price.
setCostOverride(BigDecimal costOverride)
Returns: void
Sets a fixed invoice cost excluding tax, bypassing the base cost and margin calculation.
| Parameter | Description |
|---|---|
costOverride | the fixed invoice cost, or null to calculate it |
getCreatedBy()
Returns: Profile
The profile of the administrator who added this product to the store.
setCreatedBy(Profile createdBy)
Returns: void
Sets the profile of the administrator who added this product to the store.
| Parameter | Description |
|---|---|
createdBy | the creating profile |
getCreatedDate()
Returns: Date
When this product was added to the store.
setCreatedDate(Date createdDate)
Returns: void
Sets when this product was added to the store.
| Parameter | Description |
|---|---|
createdDate | the creation timestamp |
getPosition()
Returns: Integer
Position of this product in the store's listing, lowest first. It overrides the position held on the product itself, and null means that one applies.
setPosition(Integer position)
Returns: void
Sets the position of this product in the store's listing.
| Parameter | Description |
|---|---|
position | the position override, or null to use the product's own position |
getEffectivePosition()
Returns: Integer
The position actually used when ordering this store's listing, which is the override when one is set and otherwise the product's own position.
getEffectiveGst()
Returns: BigDecimal
The tax rate actually applied to this product in this store, as a decimal. It is the override when one is set, otherwise the store's rate, and zero when the store has none.
getEffectiveMargin()
Returns: BigDecimal
The internal margin actually applied to this product in this store, as a decimal. It is the override when one is set, otherwise the store's margin, and zero when the store has none.