谁知道我如何通过micros 3700
上的isl
代码从未开支票中选择一个项目?
我想选择它并对它进行折扣。
VAR CheckItemIndex : N2
VAR DetailsRow : N2
VAR CheckItems[64] : N10
VAR CheckItemsCount : N2
CheckItemsCount = 0
CheckItemIndex = 1
DetailsRow = 1
WINDOW 8, 75, "TEST WINDOW"
DISPLAY DetailsRow, 2, "CHECK ITEMS"
//dtl_type I Info, M Item, D Discount, S ServiceCharge, T Tender/Media, R ReferenceNumber, C CA Detail
FOR i = 1 TO @numdtlt
IF @DTL_TYPE[i] = "M" //AND BIT(@DTL_STATUS[i], 5) = 0
DetailsRow = DetailsRow + 1
DISPLAY DetailsRow, 2, @DTL_NAME[i], " ", @DTL_OBJNUM[i], " ", @DTL_TYPE[i], " ", @DTL_TYPEDEF[i], " S: ", @DTL_STATUS[i]
CheckItems[CheckItemIndex] = @DTL_OBJNUM[i]
CheckItemIndex = CheckItemIndex + 1
CheckItemsCount = CheckItemsCount + 1
ENDIF
ENDFOR
//I want to select an item here (for example the 2nd one) and perform a discount
LOADDBKYBDMACRO 545 // this is a predefined macro for 100% discount
我得出的结论是,当用户用手在支票中选择一个项目时,是不可能的。因此,我不能对check中的选定项目执行折扣。
我的问题的解决方案是计算折扣金额并使用预定义的宏执行开放金额折扣。
...
LOADKYBDMACRO key(5, 217)//a predefined discount macro open amount
LOADKYBDMACRO makekeys(DiscountPrice)
LOADKYBDMACRO @KEY_ENTER
...
据我所知,不可能从ISL中选择项目,但您可以使用ItemDiscount命令来折扣检查项目:
var dtl_arr[2]: N10 //dtl indexes array
var disc_val_arr[2]: $10 // discount value array
dtl_arr[1] = 1 //...index of item to discount...
disc_val_array[1] = 50 // eg. 50% discount on item
ItemDiscount 1000053, 1, dtl_arr, disc_val_arr //1000053 is the discount obj num, 1 is the number of items to discount