What is the format of the Gift.VoucherNumber attribute?
The default format (#) corresponds to integer - this could be the reason why you always getting zero, since RANDOM returns a double value in the range 0 - 1. For example, 0.124342. So the result is then rounded to the nearest integer which is zero.
So you need to either set the format of the attribute to be double (for example, #.##) or multiply the result by some factor.