In order to reset a document’s number to 1 every day, do the following:

In Settings –> Documents, at the corresponding document click on run SQL field (right to the list):

In the window that opens, copy and paste the following code: