add function to check bill is cancelled
pass civicrm database connection