| | |
| | | buildFinReimbursementListParams, |
| | | canDeleteReimbursementRow, |
| | | canEditReimbursementRow, |
| | | enrichReimbursementListRowsWithApprovalFlow, |
| | | filterRowsByReimbursementType, |
| | | FIN_REIMBURSEMENT_TYPE, |
| | | mapCostReimbursementRow, |
| | |
| | | }) |
| | | ); |
| | | const { records, total } = unwrapFinReimbursementPage(res); |
| | | allRows.value = filterRowsByReimbursementType( |
| | | const filtered = filterRowsByReimbursementType( |
| | | records, |
| | | FIN_REIMBURSEMENT_TYPE.COST |
| | | ).map(mapCostReimbursementRow); |
| | | page.total = total; |
| | | ); |
| | | let mapped = filtered.map(mapCostReimbursementRow); |
| | | mapped = await enrichReimbursementListRowsWithApprovalFlow( |
| | | mapped, |
| | | FIN_REIMBURSEMENT_TYPE.COST |
| | | ); |
| | | allRows.value = mapped; |
| | | const dropped = records.length - filtered.length; |
| | | page.total = |
| | | dropped > 0 ? Math.max(0, Number(total) - dropped) : Number(total); |
| | | } catch { |
| | | allRows.value = []; |
| | | page.total = 0; |