diff --git a/client/src/components/trans-routes/RouteReportWithSignature.js b/client/src/components/trans-routes/RouteReportWithSignature.js index 0e3d871..590f276 100644 --- a/client/src/components/trans-routes/RouteReportWithSignature.js +++ b/client/src/components/trans-routes/RouteReportWithSignature.js @@ -167,6 +167,30 @@ const RouteReportWithSignature = () => { return `${baseName} (${qualifiers.join(', ')})`; }; + const getAttendanceDisplayByReportLogic = (...customerCandidates) => { + const hasEnterCenterTime = customerCandidates.some( + (item) => item?.customer_enter_center_time !== null && item?.customer_enter_center_time !== undefined + ); + if (hasEnterCenterTime) { + return { y: '✓', n: '' }; + } + const hasInCenterStatus = customerCandidates.some( + (item) => (item?.customer_route_status || '').toString() === PERSONAL_ROUTE_STATUS.IN_CENTER + ); + if (hasInCenterStatus) { + return { y: '✓', n: '' }; + } + return { y: '', n: '✗' }; + }; + + const getRouteNoteText = (...customerCandidates) => { + for (const item of customerCandidates) { + const noteText = (item?.customer_note || '').toString().trim(); + if (noteText) return noteText; + } + return ''; + }; + return ( <>