diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java
index 9e9da57149..368daaf713 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java
@@ -198,7 +198,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
conn = this.getConnection();
String sql = "SELECT DM_DEVICE.ID AS DEVICE_ID, DEVICE_IDENTIFICATION, DESCRIPTION, DM_DEVICE.NAME AS DEVICE_NAME, DM_DEVICE_TYPE.NAME AS DEVICE_TYPE,\n" +
"DM_ENROLMENT.ID AS ENROLMENT_ID, DATE_OF_ENROLMENT,OWNER, OWNERSHIP,IS_TRANSFERRED, STATUS, DATE_OF_LAST_UPDATE, LAST_BILLED_DATE,\n" +
- "TIMESTAMPDIFF('DAY', DATE_OF_ENROLMENT, CURDATE()) as DAYS_SINCE_ENROLLED FROM DM_DEVICE JOIN DM_ENROLMENT\n" +
+ "TIMESTAMPDIFF(DAY, DATE_OF_ENROLMENT, CURDATE()) as DAYS_SINCE_ENROLLED FROM DM_DEVICE JOIN DM_ENROLMENT\n" +
"ON (DM_DEVICE.ID = DM_ENROLMENT.DEVICE_ID) JOIN DM_DEVICE_TYPE ON (DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID) WHERE DM_ENROLMENT.TENANT_ID=?";
stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId);
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
index 87ee501c52..4bffc45a0b 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
@@ -26,9 +26,9 @@
10000
false
- false
+ true
false
- false
+ true
false
true
@@ -209,6 +209,8 @@
perm:windows:lock-reset
perm:windows:reboot
perm:windows:location
+ perm:admin:tenant:view
+ perm:admin:metadata:view
device-mgt
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2
index 8ec602013e..bc4b467236 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2
@@ -35,6 +35,39 @@
10000
{% endif %}
+
+ {% if mdm_ui_conf.hide_bill_generation_in_super_tenant is defined %}
+ {{mdm_ui_conf.hide_bill_generation_in_super_tenant}}
+ {% else %}
+ false
+ {% endif %}
+ {% if mdm_ui_conf.hide_bill_generation_in_sub_tenant is defined %}
+ {{mdm_ui_conf.hide_bill_generation_in_sub_tenant}}
+ {% else %}
+ true
+ {% endif %}
+ {% if mdm_ui_conf.hide_total_calculation_in_super_tenant is defined %}
+ {{mdm_ui_conf.hide_total_calculation_in_super_tenant}}
+ {% else %}
+ false
+ {% endif %}
+ {% if mdm_ui_conf.hide_total_calculation_in_sub_tenant is defined %}
+ {{mdm_ui_conf.hide_total_calculation_in_sub_tenant}}
+ {% else %}
+ true
+ {% endif %}
+ {% if mdm_ui_conf.hide_domain_selection_in_super_tenant is defined %}
+ {{mdm_ui_conf.hide_domain_selection_in_super_tenant}}
+ {% else %}
+ false
+ {% endif %}
+ {% if mdm_ui_conf.hide_domain_selection_in_sub_tenant is defined %}
+ {{mdm_ui_conf.hide_domain_selection_in_sub_tenant}}
+ {% else %}
+ true
+ {% endif %}
+
+
{% if mdm_ui_conf.app_registration.tags is defined %}
@@ -231,6 +264,8 @@
perm:windows:lock-reset
perm:windows:reboot
perm:windows:location
+ perm:admin:tenant:view
+ perm:admin:metadata:view
perm:android:authenticate-account
{% if mdm_ui_conf.scopes is defined %}
{%- for scope in mdm_ui_conf.scopes -%}