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.
If you merged these changes in from somewhere, I'm not sure from what place would have code that isn't yet in `4_6_x` which is bleeding edge. Diffing your working copy with `4_6_x` locally might reveal what's going on.