Hi

we would like to see all price INCLUDING VAT.

but we user the http://drupal.org/project/adminrole module which automatically activates this permission even after we deactivate it.

i think the settings should be changed to one of these possibilities:
- use permission but let the user on the user/*/edit page decide
- add the setting on: admin/store/settings/taxes/vat (maybe per role)

thanks

Comments

akaserer’s picture

i just saw the setting on admin/store/settings/taxes/vat

"Show prices excluding MwSt to the superuser."
By default, uid 1 has all permissions, which would include "show prices excluding VAT". This can be confusing so you can select here whether uid 1 should see prices inclusive or exclusive of MwSt.

that seems ok for user/1 but we have more users with admin rights and when using admin role they still see prices excl. VAT.

jonathan_hunt’s picture

I also ran into the undesirable interaction between UC VAT and Admin Role. I've wrapped the UC VAT permission in a Drupal variable to I can disable it:

/**
 * Implementation of hook_perm().
 */
function uc_vat_perm() {
  if (variable_get('uc_vat_exclude_vat_perm', 0)) {
    return array('show prices excluding VAT');
  }
}

and in uc_vat_exclude_vat():

/**
 * "Show prices excluding VAT" permission helper function.
 */
function uc_vat_exclude_vat() {
  global $user;
  return $user->uid == 1 ? variable_get('uc_vat_exclude_superuser', FALSE) : variable_get('uc_vat_exclude_vat_perm', 0) ? user_access('show prices excluding VAT') : 0;
}
didumir’s picture

We had trouble seeing the correct vat-values too, when using the admin-role module. We simply changed uc_vat_exclude_vat() to

/**
 * "Show prices excluding VAT" permission helper function.
 */
function uc_vat_exclude_vat() {
  global $user;
  return (in_array('administrator', array_values($user->roles)))  ? variable_get('uc_vat_exclude_superuser', FALSE) : user_access('show prices excluding VAT');
}

Bingo ;)