diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index 3b7d494a..51e53bf9 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -1344,10 +1344,7 @@ export default { Document: 'Document Status Report', Invoice: 'Payment Report', Product: 'Product and Service Report', - admin: { - Product: 'Product Movement Report', - Sale: 'Sales Summary Report', - }, + Sale: 'Sales Summary Report', }, document: { code: 'Code', diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index 8657680f..7d7b561f 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -1322,10 +1322,7 @@ export default { Document: 'รายงานสถานะเอกสาร', Invoice: 'รายงานการชำระเงิน', Product: 'รายงานสินค้าและบริการ', - admin: { - Product: 'รายงานการเคลื่อนไหวของสินค้า', - Sale: 'รายงานสรุปยอดขาย', - }, + Sale: 'รายงานสรุปยอดขาย', }, document: { code: 'รหัส', diff --git a/src/pages/14_report/MainPage.vue b/src/pages/14_report/MainPage.vue index b8464197..9c72fdee 100644 --- a/src/pages/14_report/MainPage.vue +++ b/src/pages/14_report/MainPage.vue @@ -62,24 +62,23 @@ onMounted(async () => { navigatorStore.current.path = [{ text: '' }]; }); -const isAdmin = computed(() => { +const isExecutive = computed(() => { const roles = userRoles.value; - - return roles.includes('head_of_admin') || roles.includes('head_of_account'); + return roles.includes('executive'); }); const filteredTabs = computed(() => { return pageTabs.filter((tab) => { - if (isAdmin.value) { - return !(tab.by.length === 1 && tab.by.includes('user')); - } else { - return !(tab.by.length === 1 && tab.by.includes('admin')); + if (!isExecutive.value) { + return !tab.by.includes('admin'); } + + return true; }); }); const pageState = reactive({ - currentTab: isAdmin.value ? ViewMode.Product : ViewMode.Document, + currentTab: isExecutive.value ? ViewMode.Product : ViewMode.Document, }); async function fetchReportTab() { @@ -152,7 +151,7 @@ watch([() => pageState.currentTab], async () => { : 'app-text-muted' " > - {{ $t(`report.view${isAdmin ? '.admin' : ''}.${tab.label}`) }} + {{ $t(`report.view.${tab.label}`) }} diff --git a/src/pages/14_report/constants.ts b/src/pages/14_report/constants.ts index fc2b9883..dd4af0e7 100644 --- a/src/pages/14_report/constants.ts +++ b/src/pages/14_report/constants.ts @@ -148,6 +148,6 @@ export const colReportBySale = [ export const pageTabs = [ { label: 'Document', value: ViewMode.Document, by: ['user'] }, { label: 'Invoice', value: ViewMode.Invoice, by: ['user'] }, - { label: 'Product', value: ViewMode.Product, by: ['user', 'admin'] }, + { label: 'Product', value: ViewMode.Product, by: ['user'] }, { label: 'Sale', value: ViewMode.Sale, by: ['admin'] }, ];