Handle orphaned documents when a taxed AP/AR Open Item is cancelled

Handle orphaned documents when a taxed AP/AR Open Item is cancelled.  Clear database entry.
@gilmoskowitz I think you explained this elegantly before, I was thrown off again by this practice. The join condition is in the `WHERE` clause, and all the filtering conditions are in the `JOIN` clause. This appears almost perfectly backward. Why is this again?