From ca57f4790cc7fc4017ee1a217bd34380d4475d28 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Fri, 4 Jul 2025 14:08:11 +0700 Subject: [PATCH] refactor: update customer and quotation permissions to include additional roles --- src/stores/utils/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/stores/utils/index.ts b/src/stores/utils/index.ts index 0c137aa6..290aae02 100644 --- a/src/stores/utils/index.ts +++ b/src/stores/utils/index.ts @@ -267,13 +267,17 @@ const permissions = { view: allRoles.filter((r) => r !== 'branch_accountant'), }, customer: { - edit: allRoles.slice(0, 6), - view: allRoles.slice(0, 8), + edit: allRoles.slice(0, 9).filter((r) => r !== 'branch_accountant'), + view: allRoles.slice(0, 9), }, agencies: { edit: allRoles.slice(0, 7), view: allRoles, }, + quotation: { + edit: allRoles.slice(0, 9).filter((r) => r !== 'branch_accountant'), + view: allRoles.slice(0, 9), + }, related: { // ใช้กับหลายเมนู edit: allRoles.slice(0, 6), @@ -686,7 +690,7 @@ export function getEmployeeName( return { ['eng']: `${typeof employee.namePrefix === 'string' ? useOptionStore().mapOption(employee.namePrefix) : ''} ${employee.firstNameEN} ${employee.lastNameEN}`, - ['tha']: `${typeof employee.namePrefix === 'string' ? useOptionStore().mapOption(employee.namePrefix) : ''} ${employee.firstName} ${employee.lastName}`, + ['tha']: `${typeof employee.namePrefix === 'string' ? useOptionStore().mapOption(employee.namePrefix) : ''} ${employee.firstName || employee.firstNameEN} ${employee.lastName}`, }[opts?.locale || 'eng']; }