Fix bug in access check code for invoice update