transaction.js: calculate only if one entry in table
Merge branch 'apply_user_permissions' into staging