On a sale you typically have the "sale" where you receive cash or you will receive the cash within a specificed time period and corresponding you've sold and / or delivered your product or service. This is where you either debit cash or accounts receivable with the offsetting credit being sales revenue (DR = CR).
However depending on the terms of the sale the revenue may not be immediately recognized (remember when this SOP 101 was issued the semi equipment companies were up in arms as instead of shipping the equipment it had to be accepted prior to recognization).
In these instances a contra revenue account is set up with a corresponding liability on the balance sheet.