During this discussion nobody could tell us from where you know which invoices the customer pay with his cheque. You must get any information from him, or do you clear basically the oldest invoices, or are do you have second sight skills.
Please inform. Depending on this information there are other possibilities for an automation