I need a module to act like a cron job, doing the following job:
run from all invoices IDs, check which are not paid, overdue and are from new services (still pending status)
if overdue is due 5 days, the module has to send first e-mail (template) to ask customer if he needs some help
if overdue is due 7 days, the module has to send an other e-mail template
if overdue is due 10 days, the module has to send an other e-mail template
if overdue is due 14 days, the module has to send an other e-mail template
if overdue is due 20 days or more, the module has to cancell the service (if still in pending status) and cancel the invoice.
and this module has to also:
everytime a service has status changed to Fraud or Cancelled or Terminated or Suspended, check if invoice is status Unpaid, if so, change the status to cancelled