key_commit: Fixed a bug in teh invoice delete trigger