Under cash accounting, income and expense is recognized when received or when paid respectively. The period in which the revenue was generated or when the cost was incurred is irrelevant.
Accruals is different since revenue is recognized in the period in which it was earned and in the same way, costs are recognized in the period in which they were incurred. The cash receipts or the cash payments under accruals are irrelevant.