2026-05-26 09:15:14 +08:00
|
|
|
import { isApplicationRequestLike } from './documentClassification.js'
|
|
|
|
|
|
2026-05-22 16:00:19 +08:00
|
|
|
export function isArchivedExpenseClaim(claim) {
|
|
|
|
|
const stage = String(claim?.approval_stage || claim?.approvalStage || '').trim()
|
|
|
|
|
const status = String(claim?.status || '').trim().toLowerCase()
|
|
|
|
|
|
|
|
|
|
if (stage === '归档入账' || stage === 'completed' || stage.includes('归档')) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!['approved', 'completed', 'paid'].includes(status)) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-26 09:15:14 +08:00
|
|
|
if (isApplicationRequestLike(claim) && ['审批完成', '申请归档'].includes(stage)) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-22 16:00:19 +08:00
|
|
|
return !stage || stage === '归档入账' || stage === 'completed'
|
|
|
|
|
}
|