Let's start by building a simple Ledger product using our command line tool, Luca. This should help you to understand the basic logic and workflow of Ledger.
This guide will walk you through setting up a basic financial ledger using the Luca Command Line Tool. The goal is to establish a structured ledger to manage payroll payments, ensuring that funds flow correctly from a Revenue Account to a Salary Account, while also maintaining accurate balance updates.
After completing this guide, you will be able to:
Set up a Chart of Accounts for the main Financial Ledger.
Create an Employee Funds Group to manage salary accounts and wallets.
Set up wallets under these accounts for revenue collection and salary disbursement.
Initiate a fund transfer from the Funds Wallet to the Salary Wallet.
Verify transactions and balances in the ledger after movement.
🛠️ Pre-requisites
Before starting, ensure:
You have the Luca Command Line tool installed and initialized with verified credentials. (Refer to the setup guide if needed.)
You have a basic understanding of accounts, wallets, and financial transactions.
a) Setting up the Chart Structure
The Chart of Accounts defines the organization’s financial structure. It tracks income and transactions by categorizing accounts for different purposes.
Step 1: Create a Chart of Accounts for the Financial Ledger
This creates a Chart of Accounts named FIN_CHART, which will serve as the foundation for all financial transactions.
Step 2: Create a Revenue Account under the Financial Ledger
This creates a Revenue Account (REV_ACC) under FIN_CHART, which will store business income before allocation to expenses (e.g., salaries).
Step 3: Create a Funds Wallet under the Revenue Account
The Funds Wallet (FUNDS_WALLET) is created under REV_ACC.
Currency: EUR
Type: REVENUE (indicates income)
Decimal Places: 2 (ensures accurate fund tracking)
This wallet holds company revenue before it is allocated to employee payments.
Step 4: Open the Revenue Account
This activates the Revenue Account (REV_ACC) so it can start processing transactions.
b) Setting up the Group Structure
We now set up a Group Account for employees based in Europe. This group will manage payroll transactions, including salary disbursements.
Step 5: Create an Employee Group Account (Europe)
This creates an Employee Group (EMP_EU), which will manage payroll and operational costs for European employees.
Step 6: Create an Employee Payroll Account
This creates an Employee Payroll Account (EMP_A_ACCOUNT) under the EMP_EU group.
This account is responsible for salary disbursements.
Step 7: Create a Salary Wallet under the Payroll Account
The Salary Wallet (SALARY_WALLET_A) is created under EMP_A_ACCOUNT.
Currency: EUR
Type: EXPENSE (as salaries are an outgoing cost)
Decimal Places: 2
This wallet is where employee salaries will be credited before being paid out.
Step 8: Open the Employee Payroll Account
This activates the Employee Payroll Account, allowing funds to be received and distributed.
c) Record transactions and review balances
With the structure set up, we will record the fund transfer from the Funds Wallet (Revenue Account) to the Salary Wallet (Payroll Account) and verify the balances. To do this, you need to create and execute an instruction that updates the wallet balances.
In a real-world scenario, this action would be triggered by a fund movement, with the Ledger monitoring the event and recording it accordingly. For this example, we will assume that the transfer has already occurred.
Step 9: Create the Instruction for fund transfer recording from Revenue to Payroll
To record this transfer, we will create an instruction that specifies the movement of funds and finalizes the transaction. Define the fund movement activity by specifying the source and destination wallets:
To confirm that the payroll account balance is updated after the fund transfer, run:
This retrieves the latest balance of EMP_A_ACCOUNT, ensuring that the ledger correctly reflects the fund movement.
Check Transaction Postings
To verify that the salary funds have been recorded as committed, run:
This confirms that the ledger has recognized and finalized the postings, aligning with the external payment execution.
By performing these checks, we ensure that the ledger accurately reflects the completed fund transfer and maintains a reliable record for reconciliation and auditing.