From fff980c513433eb02121d2f6e081b801a481bd49 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 2 May 2025 11:00:50 +0700 Subject: [PATCH] fix dowload report kk1 error --- src/controllers/ProfileController.ts | 28 ++++++++++---------- src/controllers/ProfileEmployeeController.ts | 24 ++++++++--------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 103b8fb2..d487e220 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -1613,25 +1613,25 @@ export class ProfileController extends Controller { const fullCurrentAddress = profiles && profiles.currentAddress ? Extension.ToThaiNumber( profiles.currentAddress + - " ตำบล/แขวง " + - profiles.currentSubDistrict.name + - " อำเภอ/เขต " + - profiles.currentDistrict.name + - " จังหวัด " + - profiles.currentProvince.name + - profiles.currentZipCode, + (profiles.currentSubDistrict && profiles.currentSubDistrict.name + ? " ตำบล/แขวง " + profiles.currentSubDistrict.name : "") + + (profiles.currentDistrict && profiles.currentDistrict.name + ? " อำเภอ/เขต " + profiles.currentDistrict.name : "") + + (profiles.currentProvince && profiles.currentProvince.name + ? " จังหวัด " + profiles.currentProvince.name : "") + + profiles.currentZipCode, ) : ""; const fullRegistrationAddress = profiles && profiles.registrationAddress ? Extension.ToThaiNumber( profiles.registrationAddress + - " ตำบล/แขวง " + - profiles.registrationSubDistrict.name + - " อำเภอ/เขต " + - profiles.registrationDistrict.name + - " จังหวัด " + - profiles.registrationProvince.name + - profiles.registrationZipCode, + (profiles.registrationSubDistrict && profiles.registrationSubDistrict.name + ? " ตำบล/แขวง " + profiles.registrationSubDistrict.name : "") + + (profiles.registrationDistrict && profiles.registrationDistrict.name + ? " อำเภอ/เขต " + profiles.registrationDistrict.name : "") + + (profiles.registrationProvince && profiles.registrationProvince.name + ? " จังหวัด " + profiles.registrationProvince.name : "") + + profiles.registrationZipCode, ) : ""; const data = { diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index b57c7a33..2347207e 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -1613,12 +1613,12 @@ export class ProfileEmployeeController extends Controller { profiles && profiles.currentAddress ? Extension.ToThaiNumber( profiles.currentAddress + - " ตำบล/แขวง " + - profiles.currentSubDistrict.name + - " อำเภอ/เขต " + - profiles.currentDistrict.name + - " จังหวัด " + - profiles.currentProvince.name + + (profiles.currentSubDistrict && profiles.currentSubDistrict.name + ? " ตำบล/แขวง " + profiles.currentSubDistrict.name : "") + + (profiles.currentDistrict && profiles.currentDistrict.name + ? " อำเภอ/เขต " + profiles.currentDistrict.name : "") + + (profiles.currentProvince && profiles.currentProvince.name + ? " จังหวัด " + profiles.currentProvince.name : "") + profiles.currentZipCode, ) : ""; @@ -1626,12 +1626,12 @@ export class ProfileEmployeeController extends Controller { profiles && profiles.registrationAddress ? Extension.ToThaiNumber( profiles.registrationAddress + - " ตำบล/แขวง " + - profiles.registrationSubDistrict.name + - " อำเภอ/เขต " + - profiles.registrationDistrict.name + - " จังหวัด " + - profiles.registrationProvince.name + + (profiles.registrationSubDistrict && profiles.registrationSubDistrict.name + ? " ตำบล/แขวง " + profiles.registrationSubDistrict.name : "") + + (profiles.registrationDistrict && profiles.registrationDistrict.name + ? " อำเภอ/เขต " + profiles.registrationDistrict.name : "") + + (profiles.registrationProvince && profiles.registrationProvince.name + ? " จังหวัด " + profiles.registrationProvince.name : "") + profiles.registrationZipCode, ) : "";