document number generation script