Skip to Content
avatar image
Former Member

How to absolutely enforce IDs for Voucher

Hello CCO Team!

I am in a bit of predicament. A cutsomer has very strict ID policies for their pre-printed vouchers. Yet even with the Option checked to ask for ID when selling - one could allways hit the "Cancel" button - generating an ID dependent on the Numeration Options of the client.
The customer gets his voucher with the pre-printed ID and cannot redeem the voucher.

Is there a way to enforce ID input? I tried via plugins, but the AddSalesItem Exit is not getting triggered if I use the "Cancel" button. (The ok Button does trigger it a second time)

So I am pretty out of ideas how to fulfill the customers request.

kind regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 14, 2017 at 07:34 AM

    Hi Marc,

    the "Cancel" button will only close the voucher-id input popup. This will not trigger an action in the backend java code. The only way to change this behavior with a plugin is to use JavaScript code. The JavaScript function in the sales UI, which is triggered for the voucher-id input, is called "showVoucherIdChangePopup(rowId)". You could wrap this method in your plugin and simply modify the dialog and hide the "Cancel" button. You could also provide your own dialog. To trigger the voucher-id input, you have to call the function "setNewVoucherId(voucherId, rowid)". This voucherId is the id of the voucher. The rowid is the id of the row in the sales item grid. This will be passed to the "showVoucherIdChangePopup" function as first argument.

    Best regards

    Marco Becker

    Add comment
    10|10000 characters needed characters exceeded