Under generally accepted accounting principals, revenue should be recognized when the company delivers or performs the task it will be paid for — not necessarily when the payment is received. This is known as the revenue recognition principle. However, exceptions do apply.
Xerox settled with the SEC in 2002 for accelerating revenue recognition of equipment sales by more than $3 billion, which increased pre-tax earnings by $1.5 billion. The company, which was supposed to record revenues both upfront and over a period of time (for servicing equipment over its usable life), moved those service revenues to the time of purchase.