Yet another update...

Fixed mark all in search reference
Fixed redirect after deleting references
Changed for deletion only retrieves selected references that
total_available != total_stock AND for_deletion == 'F'

Unfixed markall for change_forDeletion