/** * Calculates the late fine for a student fee based on payment delay. * * Rules: * - Returns 0 if the fee status is `CANCELLED` or `REFUNDED`. * - Returns the existing `fee.fine` value if it is set and greater than 0. * - Returns 0 if `perDateRate` ≤ 0 or `fee.amountDue` ≤ 0. * - When payment is in the same calendar month as the due date, fine days = payment day - dueDateLength. * - When payment crosses into a later month, fine days = days from the 1st of the due month to the last day of the month before payment. * - Fine amount = fineDays × perDateRate × (amountDue / amount), rounded to 2 decimal places. * * @param fee - The fee object containing amount, amountDue, dueDate, optional fine and paidAt, and status * @param dueDateLength - The day of the month after which a fine starts accruing (e.g. 10 means fine starts on the 11th) * @param perDateRate - The fine rate per day * @param asOf - Optional reference date used when paidAt is not provided (defaults to current date) * @returns The calculated fine amount rounded to 2 decimal places */ declare const calculateStudentFeeFine: (fee: { amount: number; amountDue: number; dueDate: Date; fine?: number | null; paidAt?: Date | null; status: string; }, dueDateLength: number, perDateRate: number, asOf?: Date) => number; export { calculateStudentFeeFine };