Hello guys,
On Micros 3700 there is a function with name GetMaxDiscount which expects as parameters the index of a check item and an object number of a discount and returns the max available amount discount.
There is also a command with name ItemDiscount which takes as parameters an object number of a discount, the number of items you want to append the discount, an array with theirs indexes and an array with the amounts.
My question is how can i do the same thing on Simphony 2?
On Micros 3700 there is a function with name GetMaxDiscount which expects as parameters the index of a check item and an object number of a discount and returns the max available amount discount.
There is also a command with name ItemDiscount which takes as parameters an object number of a discount, the number of items you want to append the discount, an array with theirs indexes and an array with the amounts.
My question is how can i do the same thing on Simphony 2?
Code:
VAR i : N3
VAR DiscIndex : N3
VAR DscAmountArray[64] : $5
VAR DtlIndexArray[64] : N3
FOR i = 1 TO @NUMDTLT
IF @DTL_TYPE[i] = "M" AND @DTL_IS_VOID[i] = 0
DiscIndex = DiscIndex + 1
DtlIndexArray[DiscIndex] = i
DscAmountArray[DiscIndex] = GetMaxDiscount(i,2)
ENDIF
ENDFOR
ItemDiscount 2, DiscIndex, DtlIndexArray, DscAmountArray