Class Discount
- Namespace
- RetailForce.Fiscalisation.Model.Document
- Assembly
- RetailForce.Fiscalisation.Model.dll
Represents a discount of a position.
[Serializable]
public class Discount : DocumentValidationBase
- Inheritance
-
ValidationBase<DocumentValidationError>ValidationPropertyBase<DocumentValidationError>Discount
- Inherited Members
-
ValidationPropertyBase<DocumentValidationError>.Validate()
Properties
Caption
The name of the discount.
public string Caption { get; set; }
Property Value
DiscountOrder
The order of the discount.
public int DiscountOrder { get; set; }
Property Value
Remarks
This is the order of the disount calculation. First calculated discount is 0.
DiscountValue
The calculated value of the discount.
[Required]
public decimal DiscountValue { get; set; }
Property Value
Remarks
The calculated value means a discount if sign is positive. 2 means a discount of 2 and -2 means an extra charge of 2. The DiscountValue will be calculated at Discount with 4 decimal places.
DocumentLevel
The validation level for this element.
protected override DocumentLevel DocumentLevel { get; }
Property Value
Identifier
An additional identifier for the discount (can be used for instance for grouping of discounts to discount types).
public string Identifier { get; set; }
Property Value
PromotionKeys
List of according promotion id's if applicable.
public List<string> PromotionKeys { get; set; }
Property Value
Remarks
This list can be used to store one more according promotion id's to the discount.
This list is optional.
Type
The type of the discount.
[Required]
public DiscountType Type { get; set; }
Property Value
TypeValue
The type value of the discount.
public decimal TypeValue { get; set; }
Property Value
Remarks
The type value corresponds to the Type of the discount.
- Is the Type = Discount then a TypeValue of 10 has a meaning of 10 percent.
- Is the Type = Allowance then a TypeValue of 10 has a meaning of 10 eur (if eur is the currency). The type value is always seen as a discount if sign of type value is positive. This means that a type value of 10 represents a discount of 10 percent (if type is percentage) and a type value of -10 represents an extra charge of 10 percent.
Methods
Revert()
Reverts the discount (turns all values negative)
public void Revert()
ValidateElement()
Validates the element and returns a list of DocumentValidationError objects.
protected override List<DocumentValidationError> ValidateElement()
Returns
- List<DocumentValidationError>
A list of DocumentValidationError objects.