Transaction DeductVoucher
Authentication mode: Checked (known user, must have the privilege)
Database access mode: updating
Deducts an amount from a voucher - this can be used for items that are not in the MagicSmoke shop repository.
Fails if the voucher is not paid for yet.
Will not transfer anything if the voucher does not contain enough money.
Fails if the voucher is not valid anymore.
Inputs:
- voucherid: astring
ID of the voucher to be used
- amount: int
Amount to be deducted. Must be positive.
- comment: string
A comment noting why it was deducted.
Outputs:
- voucher: Voucher
The full voucher object after the transaction
- amount: int
The amount actually transferred. Can only be zero (not enough left on the voucher) or the same as above.