By default invoices / payslips are generated for all materialised events in the selected period that belong to the organisation you are running invoicing / payroll from and its child organisations. There are a number of ways you can limit this selection in the Generate Pay Advice or Generate Invoices dialogs, but there three controls that need some further explanation:

on the Advanced tab can be used for such things as only processing events that have been either check-in or checked-out of:
{"$or":[{"carers.actualStart.time":{"$exists":true}}, {"carers.actualStart.finish":{"$exists":true}}]}or events that have been checked-in and checked-out of:
{"$and":[{"carers.actualStart.time":{"$exists":true}}, {"carers.actualStart.finish":{"$exists":true}}]}
on the client and care worker tabs if you select Query from the radio button group then a text box appears which you can use for things like:
| Applies to | Effect | Query |
|---|---|---|
| Care workers and clients | Exclude one by surname | {"familyName":{"$ne":"Exclude-Me"}} |
| Care workers and clients | Exclude multiple by surname | {"familyName":{"$nin":["Exclude-Me", "Exclude-Also"]}} |