Skip to main content

08 - Smart Expense Management: Beyond the Spreadsheet

Smart Expense Management: Beyond the Spreadsheet Anyone who has organized an event with other people knows the problem: "Who paid for what?" Discover advanced expense splitting algorithms, multi-currency support, and settlement optimization strategies.

What do you think about this article?

At a Glance

Smart Expense Management: Beyond the Spreadsheet Anyone who has organized an event with other people knows the problem: "Who paid for what?" Discover advanced expense splitting algorithms, multi-currency support, and settlement optimization strategies.

Rethinking Shared Expenses for Events

One of the most friction-prone aspects of organizing any group event is managing money. Who paid for what? How do you split costs fairly when not everyone participated in every activity? How do you handle multiple currencies during an international trip?

In Play The Event, the expense management module was designed from scratch to solve these problems with a flexible, intelligent system that adapts to any scenario.

What You Will Learn in This Article

  • The four smart splitting modes: Equal, Percentage, Fixed, and Custom
  • Multi-currency support and automatic conversion
  • Settlement tracking and balance resolution
  • Receipt tracking and document management
  • Excel export with Univerjs spreadsheet integration
  • The domain model behind the expense engine

Four Smart Splitting Modes

The core insight behind the expense system is that not all expenses are created equal. A dinner for the whole group should be split differently from a taxi ride shared by three people. Play The Event provides four distinct splitting strategies, each modeled as a first-class concept in the domain layer.

1. Equal Split

The simplest and most common mode. The total amount is divided equally among all selected participants. This is ideal for shared meals, venue rentals, or group transportation where everyone benefits equally.

Equal Split Example
EXPENSE: Restaurant dinner
TOTAL: EUR 180.00
PARTICIPANTS: 6 people
SPLIT MODE: EQUAL

RESULT:
├── Alice:   EUR 30.00
├── Bob:     EUR 30.00
├── Charlie: EUR 30.00
├── Diana:   EUR 30.00
├── Eve:     EUR 30.00
└── Frank:   EUR 30.00

PAID BY: Alice (EUR 180.00)
ALICE IS OWED: EUR 150.00 from the group

2. Percentage Split

When costs should be distributed proportionally rather than equally, the percentage mode allows organizers to assign a specific percentage to each participant. The system validates that all percentages sum to exactly 100%.

When to Use Percentage Split

  • Corporate events where departments contribute different shares
  • Group trips where some participants have higher budgets
  • Shared accommodation split by room size or occupancy

3. Fixed Amount Split

In this mode, each participant is assigned a specific fixed amount. The system validates that all fixed amounts sum to the total expense. This is useful when exact amounts are known in advance, such as pre-ordered items at different price points.

4. Custom Split

The most flexible option, the custom split allows complete freedom in assigning amounts. Organizers can mix and match, assigning different values to different participants based on consumption, preference, or any other criterion. The system handles rounding differences and ensures the total always balances.

Custom Split Example
EXPENSE: Group activity day
TOTAL: EUR 250.00
SPLIT MODE: CUSTOM

ASSIGNMENTS:
├── Alice:   EUR 80.00  (kayaking + lunch)
├── Bob:     EUR 45.00  (lunch only)
├── Charlie: EUR 80.00  (kayaking + lunch)
└── Diana:   EUR 45.00  (lunch only)

SUBTOTAL: EUR 250.00 (validated)
PAID BY: Charlie (EUR 250.00)

Multi-Currency Support

International events introduce the challenge of handling expenses in different currencies. A weekend trip across borders might involve payments in euros, pounds, and local currencies. Play The Event addresses this with a built-in multi-currency engine.

Each expense records the original currency of the transaction. The system maintains exchange rates and performs automatic conversions when calculating balances. Participants can view their totals in any supported currency, and the settlement algorithm always produces the minimum number of transfers needed to resolve all debts.

Design Decision: Currency at the Expense Level

Rather than forcing a single currency per event, each individual expense can have its own currency. This mirrors real-world behavior where travelers pay in local currencies at different stops. The Money value object in the domain layer encapsulates both the amount and the currency code, ensuring type safety throughout the system.

Settlement Tracking

After all expenses have been recorded, the settlement engine calculates the optimal set of transfers to resolve all debts. The algorithm minimizes the total number of transactions required, avoiding circular payments.

Settlement Algorithm Flow
SETTLEMENT CALCULATION

STEP 1: Calculate net balance for each participant
├── Alice:  paid EUR 180, owes EUR 110 → net +70
├── Bob:    paid EUR   0, owes EUR  95 → net -95
├── Charlie: paid EUR 250, owes EUR 155 → net +95
└── Diana:  paid EUR  50, owes EUR 120 → net -70

STEP 2: Generate minimum transfers
├── Bob → Alice:   EUR 70  (settles Alice)
├── Bob → Charlie: EUR 25  (partial settle)
└── Diana → Charlie: EUR 70 (settles both)

RESULT: 3 transfers instead of 6 individual reimbursements

Each settlement can be marked as pending, completed, or disputed. Participants confirm when they have sent or received a payment, providing a clear audit trail for the entire group.

Receipt Tracking and Document Management

Every expense in Play The Event can have one or more receipts attached. Participants snap a photo of the receipt, upload it directly through the mobile interface, and it is permanently linked to the expense record.

This feature is particularly valuable for corporate events where expense reports require documentation, and for group trips where disputes about who paid for what can be resolved instantly by consulting the attached receipt.

Receipt Management Features

  • Photo upload directly from mobile camera
  • Multiple receipts per expense
  • Automatic association with the expense record
  • Viewable by all event participants for transparency
  • Included in the Excel export for accounting purposes

Excel Export with Univerjs Integration

For organizers who need to share financial summaries outside the platform or integrate with accounting workflows, Play The Event offers a comprehensive Excel export. But the integration goes further: a Univerjs-powered spreadsheet is embedded directly within the application, allowing real-time editing and collaboration without leaving the platform.

The Univerjs spreadsheet component provides a familiar Excel-like interface where organizers can view, filter, and manipulate expense data. Formulas, sorting, and conditional formatting are all supported, giving power users the flexibility they need while keeping everything within a single ecosystem.

Export Structure
EXCEL EXPORT - SHEETS

Sheet 1: EXPENSE SUMMARY
├── Date | Description | Amount | Currency | Paid By | Split Mode
├── Totals per participant
└── Grand total

Sheet 2: BALANCES
├── Participant | Total Paid | Total Owed | Net Balance
└── Settlement status

Sheet 3: SETTLEMENTS
├── From | To | Amount | Currency | Status | Date
└── Overall settlement progress

Sheet 4: RECEIPTS
├── Expense | Receipt URL | Upload Date | Uploaded By
└── Document references

The Domain Model

Behind the user-facing features lies a carefully designed domain model. The expense system revolves around several key entities and value objects that enforce business rules at the domain level.

The Expense entity serves as the aggregate root, containing references to the split strategy, the payer, the list of participants with their shares, and any attached receipts. The split strategy is implemented using the Strategy pattern, allowing the system to swap between Equal, Percentage, Fixed, and Custom splitting without modifying the core expense logic.

Immutability and Audit Trail

Once an expense is finalized and settlements have begun, the expense record becomes immutable. Any corrections require creating an adjustment expense rather than modifying the original. This design ensures a complete audit trail and prevents disputes caused by retroactive changes.

Key Takeaways

Lessons from Building the Expense Module

  • Flexibility over simplicity: Four splitting modes cover virtually every real-world scenario without overcomplicating the UI
  • Currency is a first-class concept: Embedding currency in a value object prevents entire categories of bugs
  • Minimize settlements: The optimal transfer algorithm dramatically reduces friction in the repayment process
  • Receipts build trust: Attaching proof of payment eliminates the most common source of group expense disputes
  • Embedded spreadsheets: Univerjs integration bridges the gap between structured data and the flexibility users expect from Excel

In the next article, we will explore how Play The Event handles trip planning with multi-stop itineraries, external API integrations, and interactive maps.

Frequently asked questions

What are the four smart splitting modes provided by Play The Event for managing expenses?

The four distinct splitting strategies are Equal Split, Percentage Split, Fixed Amount Split, and Custom Split.

How does Play The Event handle multi-currency support during international events?

Each expense records the original currency of the transaction, and the system maintains exchange rates to perform automatic conversions when calculating balances.

What is the purpose of the settlement engine in Play The Event?

The settlement engine calculates the optimal set of transfers to resolve all debts, minimizing the total number of transactions required.

Can receipts be attached to expenses in Play The Event, and if so, what are their benefits?

Yes, every expense can have one or more receipts attached, which provides a clear audit trail for group events and helps resolve disputes about who paid for what.

Commenti

Caricamento commenti...

Sign in to comment

Discuss this article in the community

Join the Telegram group to discuss with other developers, ask questions and share your experiences.

Did you like this article?

Explore other content on the blog or discover my projects