If you tell it to.
It all depends on how you want this to work, and how all the data is stored.
If previous invoices are in separate files, then you can look them up, if you name the files in a meaningful way (i.e. have the date in the name).
Alternatively, you could use a single tracking file that logs each days invoice when the invoice is created.