Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ItemDiscount - Micros POS 3700

Status
Not open for further replies.

nvak

Programmer
May 25, 2015
60
GR
Can anyone give me an isl example how to use the ItemDiscount command because i cant do it to work?

Item Discount

Function
This command is used to apply a list of discount amounts to the corresponding list of detail index values. The GetMaxDiscount function will be used to help the ISL developer determine how much can actually be discounted for each menu item.

When this command is passed, the discount object number, array size, detail index array, discount amount array, and optionally, a discount reference string, will apply the discount amounts to the applicable menu items using the discount object number.
For more information see GetMaxDiscount Function.

Syntax:
ItemDiscount

Item Discount Example:
ItemDiscount obj_num, array_size, detail_array[], detail_array[], amount_array[]
ItemDiscount obj_num, array_size, detail _array[], amount_array[], ref_num
 
What SIM document are you looking at to see that ItemDiscount command? Its not in any of my SIM documents.

Do you want some custom SIM scripts developed. Contact me via my website
 
Ah i found it. Very useful!! Wish i knew about that before.

I would think it should be

Code:
var DtlIndexArray[2] : N4
    DtlIndexArray[1] = 2
    DtlIndexArray[2] = 5

var DscAmountArray[2] : N3
    DscAmountArray[1] = 50
    DscAmountArray[2] = 50

ItemDiscount 1, #2, DtlIndexArray[], DscAmountArray[], "DiscountRef"

This should discount detail indexes 2 & 5 using discount object number 1 (Open percentage discount) by 50% each.

Do you want some custom SIM scripts developed. Contact me via my website
 
Thank you for your answer!

Did you try this? It is not working.
Firstly of all the parser doesnt recognize the #2.
Secondly the arrays must be passed without the [].
And finally the DscAmountArray array has to be decimal (var DscAmountArray[2] : $5)

But still i can not make this work for me.
 
I did it. I changed the index because the fact that you can see only 3 items on your check doesnt mean that the first one is the index 1.

Code:
var DtlIndexArray[2] : N2
DtlIndexArray[1] = 16

var DscAmountArray[2] : $5
DscAmountArray[1] = 0.50

ItemDiscount 218, 1, DtlIndexArray, DscAmountArray, "discount"

And finally in my case i want to do 100% discount. So i have a discount 100 percentage and i use the method GetMaxDiscount to find the amount i want to remove (The whole amount in my case)

Code:
var DtlIndexArray[2] : N2
DtlIndexArray[1] = 16

var DscAmountArray[2] : $5
DscAmountArray[1] = GetMaxDiscount(16,218)

ItemDiscount 218, 1, DtlIndexArray, DscAmountArray, "disc" 
	
DetailsRow = DetailsRow + 1
DISPLAYMSINPUT DetailsRow, 2, Clear, "ENTER TO CONTINUE" 
WINDOWINPUT
ENDEVENT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top