What is the meaning of Counterfoil?

the part of a cheque that is retained in the chequebook as a record; a stub

Source: wiktionary.org