Skip to content
Learni
View all tutorials
Finance et Développement

How to Implement Revenue Recognition in 2026

Lire en français

Introduction

Revenue recognition is a key accounting principle that determines when a company can record revenue. In 2026, the IFRS 15 and ASC 606 standards remain essential for developers working on financial systems. This tutorial guides you step by step to implement these rules in a simple application.

Prerequisites

  • Node.js 18+
  • Basic knowledge of TypeScript
  • Elementary understanding of accounting

Initialize the project

terminal
npm init -y
npm install typescript @types/node
npx tsc --init

This command creates an empty TypeScript project ready to receive the revenue recognition logic.

Define the contract model

models/Contract.ts
export interface Contract {
  id: string;
  customerName: string;
  totalAmount: number;
  performanceObligations: number;
  startDate: Date;
  endDate: Date;
}

This type represents a customer contract according to IFRS 15 with its performance obligations.

Implement the five-step method

revenue/recognizeRevenue.ts
import { Contract } from '../models/Contract';

export function recognizeRevenue(contract: Contract): number {
  const dailyRevenue = contract.totalAmount / 
    ((contract.endDate.getTime() - contract.startDate.getTime()) / (1000 * 3600 * 24));
  const daysElapsed = (new Date().getTime() - contract.startDate.getTime()) / (1000 * 3600 * 24);
  return Math.min(Math.max(0, dailyRevenue * daysElapsed), contract.totalAmount);
}

This function calculates revenue recognized linearly over the contract duration, the basis of recognition under IFRS 15.

Create a sample contract

examples/sampleContract.ts
import { Contract } from '../models/Contract';
import { recognizeRevenue } from '../revenue/recognizeRevenue';

const contract: Contract = {
  id: 'C-2026-001',
  customerName: 'ACME Client',
  totalAmount: 12000,
  performanceObligations: 1,
  startDate: new Date('2026-01-01'),
  endDate: new Date('2026-12-31')
};
console.log(recognizeRevenue(contract));

Complete executable example that displays the amount of revenue recognized on the current date.

Add input validation

utils/validateContract.ts
import { Contract } from '../models/Contract';

export function validateContract(contract: Contract): boolean {
  if (contract.totalAmount <= 0) return false;
  if (contract.endDate <= contract.startDate) return false;
  return true;
}

Essential validation to avoid erroneous calculations on invalid contracts.

Best practices

  • Always validate contract data before calculation
  • Store dates in UTC to avoid offsets
  • Separate business logic from financial calculations
  • Document each performance obligation
  • Use unit tests for each scenario

Common errors

  • Forgetting to check that the end date is after the start date
  • Calculating revenue without considering multiple performance obligations
  • Ignoring contracts with advance or installment payments
  • Not rounding monetary amounts correctly

To go further

Deepen your knowledge of IFRS 15 and complex cases with our Learni training.

How to Implement Revenue Recognition with IFRS 15 in 2026 | Learni