diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts
index 5919f12c..d019136b 100644
--- a/src/i18n/tha.ts
+++ b/src/i18n/tha.ts
@@ -746,7 +746,7 @@ export default {
title: 'ใบเสนอราคา',
caption: 'ใบเสนอราคาทั้งหมด',
customerName: 'ชื่อลูกค้า',
- actor: 'ผู้ที่ทำรายงาน',
+ actor: 'ผู้ที่ทำรายการ',
totalPrice: 'ยอดรวมสุทธิ',
totalPriceBaht: 'ยอดรวมสุทธิ (บาท)',
receipt: 'ใบเสร็จ/กำกับภาษี',
diff --git a/src/pages/08_request-list/RequestListView.vue b/src/pages/08_request-list/RequestListView.vue
index f2edf357..ae826245 100644
--- a/src/pages/08_request-list/RequestListView.vue
+++ b/src/pages/08_request-list/RequestListView.vue
@@ -15,7 +15,12 @@ import DutyExpansion from './DutyExpansion.vue';
import MessengerExpansion from './MessengerExpansion.vue';
// NOTE: Store
-import { baseUrl, dialog } from 'src/stores/utils';
+import {
+ baseUrl,
+ dialog,
+ getEmployeeName,
+ getCustomerName,
+} from 'src/stores/utils';
import { dateFormatJS } from 'src/utils/datetime';
import { useRequestList } from 'src/stores/request-list';
import {
@@ -79,47 +84,6 @@ async function fetchRequestWorkList(opts: { requestDataId: string }) {
}
}
-function getCustomerName(
- record: RequestData,
- opts?: {
- locale?: string;
- noCode?: boolean;
- },
-) {
- const customer = record.quotation.customerBranch;
-
- return (
- {
- ['CORP']: {
- [Lang.English]: customer.registerNameEN,
- [Lang.Thai]: customer.registerName,
- }[opts?.locale || 'eng'],
- ['PERS']:
- {
- [Lang.English]: `${optionStore.mapOption(customer.namePrefix)} ${customer.firstNameEN} ${customer.lastNameEN}`,
- [Lang.Thai]: `${optionStore.mapOption(customer.namePrefix)} ${customer.firstName} ${customer.lastName}`,
- }[opts?.locale || Lang.English] || '-',
- }[customer.customer.customerType] +
- (opts?.noCode ? '' : ' ' + `(${customer.code})`)
- );
-}
-
-function getEmployeeName(
- record: RequestData,
- opts?: {
- locale?: string;
- },
-) {
- const employee = record.employee;
-
- return (
- {
- [Lang.English]: `${optionStore.mapOption(employee.namePrefix)} ${employee.firstNameEN} ${employee.lastNameEN}`,
- [Lang.Thai]: `${optionStore.mapOption(employee.namePrefix)} ${employee.firstName} ${employee.lastName}`,
- }[opts?.locale || Lang.English] || '-'
- );
-}
-
async function getData() {
const current = route.params['requestListId'];
@@ -611,8 +575,10 @@ function goToQuotation(
icon="mdi-account-settings-outline"
:label="$t('customer.employer')"
:value="
- getCustomerName(data, { locale: locale, noCode: true }) ||
- '-'
+ getCustomerName(data.quotation.customerBranch, {
+ locale: locale,
+ noCode: true,
+ }) || '-'
"
/>