Include personal/address/emergency columns in financial export employees.csv
Validate / validate (push) Successful in 25s

Extends the employees.csv builder to include all 14 new fields
(DOB, gender, nationality, marital status, full Thai address,
emergency contact). Order matches the on-screen detail page so
auditors and accountants get the complete record.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-15 10:02:17 +07:00
parent f12c901a97
commit 51e8cfc536
+12 -1
View File
@@ -171,7 +171,14 @@ export async function buildFinancialExport(
[ [
'id', 'employeeCode', 'firstName', 'lastName', 'displayName', 'email', 'phone', 'id', 'employeeCode', 'firstName', 'lastName', 'displayName', 'email', 'phone',
'position', 'department', 'hireDate', 'terminationDate', 'nationalId', 'taxId', 'position', 'department', 'hireDate', 'terminationDate', 'nationalId', 'taxId',
'bankName', 'bankAccount', 'isActive', 'deletedAt', 'createdAt', 'updatedAt' 'bankName', 'bankAccount',
// Personal
'dateOfBirth', 'gender', 'nationality', 'maritalStatus',
// Address
'addressLine1', 'addressLine2', 'subdistrict', 'district', 'province', 'postalCode', 'country',
// Emergency contact
'emergencyContactName', 'emergencyContactPhone', 'emergencyContactRelationship',
'isActive', 'deletedAt', 'createdAt', 'updatedAt'
] ]
]; ];
for (const e of employeeRows) { for (const e of employeeRows) {
@@ -180,6 +187,10 @@ export async function buildFinancialExport(
e.email ?? '', e.phone ?? '', e.position ?? '', e.department ?? '', e.email ?? '', e.phone ?? '', e.position ?? '', e.department ?? '',
e.hireDate, e.terminationDate ?? '', e.nationalId ?? '', e.taxId ?? '', e.hireDate, e.terminationDate ?? '', e.nationalId ?? '', e.taxId ?? '',
e.bankName ?? '', e.bankAccount ?? '', e.bankName ?? '', e.bankAccount ?? '',
e.dateOfBirth ?? '', e.gender ?? '', e.nationality ?? '', e.maritalStatus ?? '',
e.addressLine1 ?? '', e.addressLine2 ?? '', e.subdistrict ?? '', e.district ?? '',
e.province ?? '', e.postalCode ?? '', e.country ?? '',
e.emergencyContactName ?? '', e.emergencyContactPhone ?? '', e.emergencyContactRelationship ?? '',
e.isActive, e.deletedAt ? e.deletedAt.toISOString() : '', e.isActive, e.deletedAt ? e.deletedAt.toISOString() : '',
e.createdAt.toISOString(), e.updatedAt.toISOString() e.createdAt.toISOString(), e.updatedAt.toISOString()
]); ]);