How to allocate partial credit to a sales invoice?

Okay thx lubos, I’m new to this and was following the suggested approach in Recording gifts and Gift Vouchers
Happy to go with your method but then how can I know how much liability I have as issued Gift Vouchers out there? How much is used and how much is left? (apart from manual written notes on the voucher itself)
Btw, these are kind of lottery give-away vouchers.