| name | ledger_analysis_projects |
| tier | 3 |
| task | T28 |
| description | This skill should be used when the task asks to analyze the ledger for expense changes between months and create projects/activities based on the analysis. Keywords include "analyze the ledger", "analyser hovedboken", "identifique las cuentas de gastos", "analysez le grand livre", "analysieren Sie das Hauptbuch", "identify expense accounts with the largest increase", "create an internal project for each account". |
Ledger Analysis + Project/Activity Creation
Analyze ledger, find top 3 expense increases, create projects with activities.
Turn 1: 3 parallel GETs (all free)
GET /ledger/posting?dateFrom=2026-01-01&dateTo=2026-03-01&fields=account(number,name),amount,date&count=200
GET /employee?fields=id,department(id)&count=1
GET /department?fields=id,name&count=5
The employee GET also fetches their department. The department GET finds available departments for the projects.
Analysis (no API call)
Filter expense accounts (4000-7999, positive amounts only).
Sum by account for January and February.
Calculate increase = Feb total - Jan total.
Pick top 3 largest increases.
Turn 2: Batch create 3 projects (1 write call)
Use the department from GET /department (first result, usually "Avdeling") or the employee's department.
POST /project/list
[
{
"name": "<account_name_1st>",
"number": "<account_number_1st>",
"externalAccountsNumber": "<account_number_1st>",
"projectManager": {"id": <employee_id>},
"department": {"id": <department_id>},
"startDate": "<today>",
"isInternal": true,
"projectActivities": [{"activity": {"name": "<account_name_1st>", "activityType": "PROJECT_GENERAL_ACTIVITY"}}]
},
{
"name": "<account_name_2nd>",
"number": "<account_number_2nd>",
"externalAccountsNumber": "<account_number_2nd>",
"projectManager": {"id": <employee_id>},
"department": {"id": <department_id>},
"startDate": "<today>",
"isInternal": true,
"projectActivities": [{"activity": {"name": "<account_name_2nd>", "activityType": "PROJECT_GENERAL_ACTIVITY"}}]
},
{
"name": "<account_name_3rd>",
"number": "<account_number_3rd>",
"externalAccountsNumber": "<account_number_3rd>",
"projectManager": {"id": <employee_id>},
"department": {"id": <department_id>},
"startDate": "<today>",
"isInternal": true,
"projectActivities": [{"activity": {"name": "<account_name_3rd>", "activityType": "PROJECT_GENERAL_ACTIVITY"}}]
}
]
Order: largest increase first.
Total: 3 GETs (free) + 1 POST (1 write). 0 errors.
CRITICAL RULES
- POST /project/list — batch create (1 write for all 3).
- Set
number, externalAccountsNumber to the account number string.
- Set
department from the GET /department result.
- Expense accounts are 4000-7999. Include salary (5000), operating (6000-7000).
- Only count POSITIVE amounts.
dateTo = 2026-03-01 (exclusive).
- Project name = activity name = exact account name from ledger.
isInternal: true on every project.
activityType: "PROJECT_GENERAL_ACTIVITY" on every activity.
- Use today's date for
startDate.
- Order: largest increase first.