New docnumber functionality now works for general case.

Signed-off-by: unknown <astring@astring-pc.aved.local>