The answer to your question depends on how you run your reports in QuickBooks Online (QBO).
If you use the cash basis for reporting, QuickBooks generally reports or records income when you receive payments and expenses when you pay a bill. Outstanding invoices do not count toward your profit, nor can you deduct expenses when you incur them but only when you write the check.
If you use accrual basic for reporting, your report counts income when you provide a service or ship a product. Then, you count expenses when you obtain a purchase. The original transaction and the time money changes hands are separate events for accounting purposes.