{"generatedAt":"2026-11-13T12:06:55.059Z","commit":"4b8b59b7","server":{"name":"e-revisor","version":"1.0.0","transport":"streamable-http"},"instructions":"e-revisor turns a finished bookkeeping year into the Swedish year-end deliverables: bokslut (adjustments, tax calculation), årsredovisning (K2/K3, iXBRL), inkomstdeklaration (INK2/3/4), stämmoprotokoll, and avstämning per balance-sheet post. Most tools take client_id and fiscal_year_id; list_bolag and get_fiscal_years find them.\n\nRules that hold for every tool:\n- You prepare; the person decides and signs. Never file, sign or submit anything to Bolagsverket or Skatteverket, never book into the client's bookkeeping program, never accept terms, and never create a company unless the person asked.\n- K2 or K3 is the person's choice (it sets the price). Suggest, then ask.\n- Write only what the data or a source supports. What only the person can know (significant events, whether a loan has security, the stämma's date, who owns the shares) you ask about — never invent it.\n- Run dry_run first wherever a tool offers it, and show the person what would change before replacing anything they entered.\n- A step's status is the person's assertion, not a measurement: never mark steps done (set_bokslut_steg) on your own.\n- Avstämningar are the person's review. Leave them alone unless the person asks.\n- A booking already in the company's own books that the calculation books again (findings skatt_redan_bokford, loneskatt_redan_bokford, aretsresultat_redan_bokfort, periodiseringsfond_redan_bokford, overavskrivning_redan_bokford — their detalj.aterforing): reversing it is the person's choice (Kevin 2026-11-12). Explain the finding, show the rows, and only on their yes save exactly those rows with save_bokslut_justering, dry_run first. Turning the automatic booking off instead is also theirs to choose.\n- The revisionsberättelse is the revisor's opinion. A modified opinion, an anmärkning or advice against ansvarsfrihet is written only on the revisor's word — never because the books seem to point that way.\n- For how the program works or what a rule says, search the knowledge base (search_kunskap, get_kunskap) and point to the article; for what is new — in the program or from Skatteverket, Bolagsverket and accounting — search_kunskap with typ nyhet. Both are published by e-revisor's people; you read them. The company's own data comes first.\n- For a complete draft of a year-end, use the prompt upprata_bokslut; to finish one already begun, the same prompt (it continues where the year stands, or from a step). For help with one part — a step, a warning, an error message — the prompt hjalp_med.\n- A WARNING OR ERROR MESSAGE the person pastes is Swedish prose written for them; you work from its code. Find it: get_bokslut_kontroller lists every finding with message, kod, steg and ankare (match the text, or the step it belongs to); an error from saving something comes back as data.errors {field, code} — repeat the same change with dry_run to see it. Then say in plain Swedish what is wrong and why, fix what the data supports and the list below allows (dry_run first), and ask about the rest. Stay in that part: do not change other steps without asking.\n\nWhat you MAY do on your own when the data shows it (Kevin 2026-10-19) — always say in your answer what you did and why, so the person can undo it:\n- LAST YEAR'S RESULT NOT CARRIED FORWARD. When 2099 opens the year with last year's result, no dividend is booked against it and the books show nothing else decided, book a bokslutsjustering on the year's last day, category omklassificering: debit 2099, credit 2091 (the result balanced in ny räkning) — for other forms their own accounts for the year's result and the balanced result. It is what makes the equity table add up. Tell the person to book the same in the bookkeeping program. A dividend or another disposition visible in the books: ask instead.\n- AN ACCOUNT ON THE WRONG SIDE. When a balance-sheet account's balance shows it belongs on the counterpart line (a liability account in debit is a receivable — 2860 in debit is a fordran hos koncernföretag; the tax accounts 2510/2518 in net debit are a claim, in K2 under Övriga fordringar), reclassify it with save_bokslut_klassificering and let the INK2 field follow (sru_val, same statement). A line applies to BOTH columns, so check the comparison year: if the account stood on the right side there, it now lands wrong in that column. The comparison column is typed when the year setting ovrigt_autopy is off (the default) — a typed figure wins over the matrix — so type last year's correct figures for the lines the move touched with save_arsredovisning_varde (balans1), e.g. Skatteskulder last year and Övriga fordringar without the tax accounts. With ovrigt_autopy on, do not move it; report it instead. The move carries to next year as a decision; next year's wrong-side check catches it if the sign turns.\n- PERIODISERINGSFONDER WITHOUT ÅRGÅNG. Work out the årgångar from the data: an account named for its year (2120–2129: the last digit is the year), and the comparison year's movement on 8810/8811 (a provision last year is that year's årgång). When several årgångar sit on one account, the register takes one row per account: keep the oldest on the booked account and put each younger one on its BAS årgång account (2125 for 2025, …) with save_skatteberakning fonder, so that the register still adds up to the opening balance. What the data cannot tell, ask.\n- NOTES FROM THE BOOKKEEPING. Fill every chosen note as far as the books go: a movement note's comparison-year opening (balans2) from the balances when the account carries the same balance at the comparison year's opening, its end and this year's end and the file shows no movement on it; holdings from the account names and verifikat texts together with lookup_bolag (name, organisationsnummer, säte, carrying value). What the books do not hold — a capital share, a pledge — ask.\n- MEDELANTALET ANSTÄLLDA. Always include the note (ÅRL 5 kap. 20 §). With no salary costs (70xx–72xx) it is 0 for the year in question. With salaries, estimate full-time equivalents from the gross salaries (about 480 000 kr a year per full-time employee), in whole persons — the program stores whole numbers and rounds anything else (the answer's avrundade says so) — and say it is an estimate for the person to confirm.\n- UPPDRAGSTAGARE. Leave 'uppdragstagare har biträtt' as nej unless the person says otherwise.","guidance":{"errors":"a failed call answers with `data.errors`, a list of {field, code, message}. Reason about `code`, never about the Swedish wording of `message` — the message is for the person, the code is for you. Grouped by what to do about them:\n\n  FIX THE VALUE AND RETRY — invalid_date, invalid_enum, invalid_int, out_of_range,\n  too_long, invalid_email, invalid_personal_number, invalid_auth_method, invalid_account\n  (an account setting outside its range or not written as 6992, 6994-6999), account_in_both\n  (the same account among both 4.3c's costs and 4.5c's income — it belongs to one). The\n  field is named in `field`.\n\n  ASK THE PERSON — name_required, personal_number_required, auth_method_unavailable,\n  too_many, multiple_fastst, signing_extra_cost (the year's included signed documents are\n  used up, so the next one costs money — the person decides in the program; never retry),\n  licens_over_grans (a new company takes unpaid extras over the limit that stops finishing —\n  only in the person's own guide, an agent is not asked).\n  Something is missing or contradictory that you must not resolve on your own: which of\n  two people signs the fastställelseintyg is a decision, not a detail.\n\n  YOU ASKED FOR SOMETHING THAT DOES NOT EXIST — unknown_setting, unknown_role,\n  unknown_axis, unknown_person, unknown_scope, unknown_type, unknown_user, not_applicable. Do not\n  retry with a guess. Call get_bokslut_settings or list_bokslut_persons and use what\n  actually exists for this client and year.\n\n  YOUR REQUEST WAS MALFORMED — missing_fiscal_year, missing_input, no_settings,\n  no_persons, invalid_list. A required argument was absent or the wrong shape.\n\n  REFUSED, AND RETRYING WILL NOT HELP — year_locked (the fiscal year is locked: a person\n  locked it in Slutför when it was done, and only a person unlocks it, with a reason; say so\n  and stop), licence_denied (the plan does not cover it; that is for a human to change),\n  licens_saknas (the year is not paid, the trial is running, or the account has unpaid\n  charges: finishing — the final annual report, signing, filing with Bolagsverket or\n  Skatteverket, the paper form, the K10 file — waits until a person pays under Licens in\n  the program. The work itself goes on: say so in the message's words and stop; never pay),\n  email_in_use (another active account has the address; one active account per address),\n  invalid_password and tfa_off (the account's two-factor login — a person's own business,\n  never an agent's).\n\n  WAIT, THEN RETRY ONCE — rate_limited: too many calls this minute (heavy calls such as\n  PDF, iXBRL, import and export have a lower limit). `data.retry_after` gives the seconds;\n  wait that long before the next call, and do not retry in a tight loop.\n\n  REFUSED UNTIL NEXT MONTH — mcp_kvot_slut: the account's monthly allowance of calls\n  through a connected AI is used up. Say so with the message's date and stop; the\n  person can still do the work in the program itself.\n\n  OUR FAULT — internal_error. Report it and do not retry in a loop; the detail is in\n  our log, not in the response.\n\nNothing is written when any error is returned. The whole call is refused, not part of it.","dryRun":"pass dry_run=true to get exactly what would change and which errors would be raised, without writing anything. A dry run is never logged. Use it to show a person what you intend to do before you do it, especially when you are acting on data they have not seen.\n\nERRORS: a failed call answers with `data.errors`, a list of {field, code, message}. Reason about `code`, never about the Swedish wording of `message` — the message is for the person, the code is for you. Grouped by what to do about them:\n\n  FIX THE VALUE AND RETRY — invalid_date, invalid_enum, invalid_int, out_of_range,\n  too_long, invalid_email, invalid_personal_number, invalid_auth_method, invalid_account\n  (an account setting outside its range or not written as 6992, 6994-6999), account_in_both\n  (the same account among both 4.3c's costs and 4.5c's income — it belongs to one). The\n  field is named in `field`.\n\n  ASK THE PERSON — name_required, personal_number_required, auth_method_unavailable,\n  too_many, multiple_fastst, signing_extra_cost (the year's included signed documents are\n  used up, so the next one costs money — the person decides in the program; never retry),\n  licens_over_grans (a new company takes unpaid extras over the limit that stops finishing —\n  only in the person's own guide, an agent is not asked).\n  Something is missing or contradictory that you must not resolve on your own: which of\n  two people signs the fastställelseintyg is a decision, not a detail.\n\n  YOU ASKED FOR SOMETHING THAT DOES NOT EXIST — unknown_setting, unknown_role,\n  unknown_axis, unknown_person, unknown_scope, unknown_type, unknown_user, not_applicable. Do not\n  retry with a guess. Call get_bokslut_settings or list_bokslut_persons and use what\n  actually exists for this client and year.\n\n  YOUR REQUEST WAS MALFORMED — missing_fiscal_year, missing_input, no_settings,\n  no_persons, invalid_list. A required argument was absent or the wrong shape.\n\n  REFUSED, AND RETRYING WILL NOT HELP — year_locked (the fiscal year is locked: a person\n  locked it in Slutför when it was done, and only a person unlocks it, with a reason; say so\n  and stop), licence_denied (the plan does not cover it; that is for a human to change),\n  licens_saknas (the year is not paid, the trial is running, or the account has unpaid\n  charges: finishing — the final annual report, signing, filing with Bolagsverket or\n  Skatteverket, the paper form, the K10 file — waits until a person pays under Licens in\n  the program. The work itself goes on: say so in the message's words and stop; never pay),\n  email_in_use (another active account has the address; one active account per address),\n  invalid_password and tfa_off (the account's two-factor login — a person's own business,\n  never an agent's).\n\n  WAIT, THEN RETRY ONCE — rate_limited: too many calls this minute (heavy calls such as\n  PDF, iXBRL, import and export have a lower limit). `data.retry_after` gives the seconds;\n  wait that long before the next call, and do not retry in a tight loop.\n\n  REFUSED UNTIL NEXT MONTH — mcp_kvot_slut: the account's monthly allowance of calls\n  through a connected AI is used up. Say so with the message's date and stop; the\n  person can still do the work in the program itself.\n\n  OUR FAULT — internal_error. Report it and do not retry in a loop; the detail is in\n  our log, not in the response.\n\nNothing is written when any error is returned. The whole call is refused, not part of it."},"groups":[{"id":"bolag","sv":"Bolag, år och inställningar","en":"Companies, years and settings"},{"id":"import","sv":"Import och bokföringsprogram","en":"Import and bookkeeping programs"},{"id":"skatt","sv":"Skatt och deklaration","en":"Tax and returns"},{"id":"arsredovisning","sv":"Årsredovisning","en":"Annual report"},{"id":"bokslut","sv":"Saldon och bokslut","en":"Balances and year-end"},{"id":"avstamning","sv":"Avstämning","en":"Reconciliation"},{"id":"stamma","sv":"Stämma och signering","en":"Meeting and signing"},{"id":"k10","sv":"K10","en":"K10"},{"id":"revision","sv":"Revisionsberättelse","en":"Audit report"},{"id":"kunskap","sv":"Kunskapsbas","en":"Knowledge base"},{"id":"ovrigt","sv":"Dokument, uppgifter och notiser","en":"Documents, tasks and notifications"}],"prompts":[{"name":"upprata_bokslut","title":"Upprätta bokslut (utkast)","description":"A complete draft of a year-end in e-revisor — import, settings, tax, årsredovisning and stämma — except the avstämningar. Fills only what the data or a source supports and ends with a summary and the questions only the person can answer.","arguments":[{"name":"bolag","description":"The company: name or organisationsnummer","required":true},{"name":"ar","description":"The fiscal year, e.g. 2025 or 2025-12-31; default the latest that has ended","required":false},{"name":"underlag","description":"Material provided, e.g. 'SIE file attached', 'last year's annual report attached'","required":false},{"name":"steg","description":"Start further on, e.g. 'skatten' or 'årsredovisningen' — the earlier steps are done","required":false}]},{"name":"hjalp_med","title":"Hjälp med en del","description":"Help with one part of a year-end: a warning or error message, a step, or finishing something begun. Finds it by its code, explains it, fixes what the data supports and asks about the rest — without touching other parts.","arguments":[{"name":"bolag","description":"The company: name or organisationsnummer","required":true},{"name":"vad","description":"What to help with: the message as shown, a step ('noterna', 'skatten'), or a question","required":true},{"name":"ar","description":"The fiscal year; default the latest that has ended","required":false}]}],"tools":[{"name":"check_arsredovisning_testbank","group":"arsredovisning","klass":"lasa_ute","summary":"Run the year's annual report through Bolagsverket's TEST BENCH — the same validation as their web form at arsredovisning-accept2. It renders the file that would be filed (rensad iXBRL) itself; you do not pass a file. Nothing is filed and nothing is stored at Bolagsverket, but the document does leave us — say so before running it on a real company.","description":"Run the year's annual report through Bolagsverket's TEST BENCH — the same validation as their web form at arsredovisning-accept2. It renders the file that would be filed (rensad iXBRL) itself; you do not pass a file. Nothing is filed and nothing is stored at Bolagsverket, but the document does leave us — say so before running it on a real company.\n\nAnswer: `godkand` (no validation errors), `fel` (validation errors — the file would be refused) and `varningar` (Bolagsverket's warnings — filing is still possible; typical ones are a missing fastställelseintyg or revisionsberättelse, hidden tags, and calculation mismatches in the multi-year overview). Report errors first, then warnings, in the person's language. `forklaringar` [{varning, text}] marks warnings that are expected for this company — \"Revisionsberättelsen saknas.\" when no revisor is listed (the test bench says it of every report without one; it does not hold up filing) — say that rather than presenting it as a problem. With `hamta: true` the answer also carries Bolagsverket's own PDF and XBRL of the document, base64 — large; ask for them only when the person wants to see how Bolagsverket renders it.\n\nThe test bench only admits approved IP addresses (today: over a VPN). From anywhere else it answers testbank_unreachable — not a fault in the report; say so and stop. Only an aktiebolag files digitally, so for every other form it answers not_applicable with how that form files instead (on paper, or not at all) — say so; there is nothing to test. testbank_changed means Bolagsverket changed their form and our reader needs updating: report it, do not retry. A rendering failure (no_package, for instance) comes back exactly as from get_arsredovisning_ixbrl.\n\nBolagsverket's API check (`kontrollera`) is deliberately NOT a tool: it opens an eget utrymme for the company and requires a person to accept Bolagsverket's agreement in their own name. Its endpoint, bolagsverket/kontrollera, is for the app; it answers agreement_required (show the agreement text to the person, then they call again), invalid_document_type, invalid_personal_number, and provider_not_authorised when Bolagsverket accepts our certificate but not our access to the service. If a person asks for it, point them to the button in the app. Filing (`inlamning`) is not a tool either, for the same reason and because it is filing: a person uploads from Slutför in the app. Its codes, should you meet them: filing_disabled (filing to Bolagsverket's production is switched off on this server — say so and stop), invalid_token, missing_email and missing_document (the request was incomplete; the person corrects it in the app), signer_missing (nobody is marked to sign the fastställelseintyg — ask the person; who signs is a decision), check_failed (Bolagsverket's check found errors and nothing was uploaded).","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"kompletteras":{"type":"boolean","description":"true for 'Årsredovisning som ska kompletteras', false for a complete report. Left out: the type filing uses — kompletteras when the company has a revisor (the revisionsberättelse comes separately), otherwise komplett. The answer's `typ` says which was tested."},"hamta":{"type":"boolean","description":"Also return Bolagsverket's PDF and XBRL, base64"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"complete_todo","group":"ovrigt","klass":"skriva","summary":"Mark a todo as done. Idempotent — calling this on an already-done todo returns already_done: true rather than erroring. Notifies the original creator unless they're the one completing it.","description":"Mark a todo as done. Idempotent — calling this on an already-done todo returns already_done: true rather than erroring. Notifies the original creator unless they're the one completing it.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"todo_id":{"type":"integer","description":"Todo ID (from get_todos)"}},"required":["client_id","todo_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"connect_bokforingsprogram","group":"import","klass":"skriva_ute","summary":"Connect the client to its company in a bookkeeping program: Oqto, Bokföring Online or Accounted. Fortnox is connected only in the browser (connect_in_browser).","description":"Connect the client to its company in a bookkeeping program: Oqto, Bokföring Online or Accounted. Fortnox is connected only in the browser (connect_in_browser).\n\nOQTO: the usual way is the button Koppla Oqto in e-revisor's import step — the person logs in to Oqto in the browser, approves e-revisor, and comes back connected (ADR-0019 §6). That ends in the app, never through you; its outcome can be invalid_state (the approval was not started here or expired), access_denied (cancelled in Oqto), missing_code or invalid_code (an expired or used code) — the person starts over with the button. The fallback is this tool: the person activates e-revisor under Integrationer in Oqto, and Oqto then shows the company's company_id — a UUID. Pass it as external_id. You cannot get it any other way: ask the person for it, never guess one.\n\nBOKFÖRING ONLINE: the connection needs API credentials (client_id + client_secret) created in Bokföring Online. They are entered by the person in e-revisor's import step, never through you — do not ask for them or accept them in chat. Once stored, you can pick another company with them: get_bokforingsprogram_bolag lists the companies, and external_id is the chosen company's `id` (a number).\n\nACCOUNTED (ADR-0057): the same, with one API key (gnubok_sk_live_… or gnubok_sk_test_…) created under Inställningar → API in Accounted, entered by the person in the import step — never through you. With a stored key, get_bokforingsprogram_bolag (provider 'accounted') lists the companies, and external_id is the company's `id` (text, cmp_…).\n\nBJÖRN LUNDÉN (ADR-0058): connected only by the person in Dataimport — \"Koppla i Lundify\" (they approve e-revisor in Lundify and come back connected) or by pasting the company's key from Lundify. The key is a secret: never ask for it or accept it in chat. This tool answers connect_in_browser for it.\n\nThe connection is tested before it is saved — a token for the company and its organisationsnummer — so an id that does not work, or that belongs to another company, is never stored. Connecting again replaces the id and keeps the client's settings.\n\nErrors:\n  invalid_external_id — not a UUID; ask the person to copy it again from Oqto.\n  integration_not_activated — Oqto does not recognise the company for e-revisor: it has not activated e-revisor, or the id is wrong. A person must act in Oqto; do not retry.\n  orgnr_mismatch — the company in Oqto is a different company from this client.\n  provider_forbidden — e-revisor lacks a permission in Oqto (`permission` says which). The company must activate e-revisor again in Oqto for it to apply.\n  provider_not_configured — our Oqto keys are missing on the server; tell the person, it is ours to fix.\n  provider_unreachable, provider_rate_limited, provider_error — the program's side; worth one retry later, not a loop.\nBokföring Online and Accounted:\n  missing_credentials — no stored credentials; the person enters them in the import step.\n  invalid_credentials — Bokföring Online rejects the stored credentials (revoked, or the user deactivated). The person creates new ones there and connects again in the interface.\n  credentials_unreadable, encryption_not_configured — ours to fix on the server; the person may need to connect again.\n  company_not_found — the credentials do not reach that company.\n  company_no_license — the company has no active licence in Bokföring Online; without one the balances cannot be exported.\nFortnox:\n  connect_in_browser — Fortnox is connected only in the browser: the person clicks \"Koppla Fortnox\" in Dataimport and a system administrator approves in Fortnox. You cannot do it; tell the person.\n  missing_provider, unknown_provider, provider_not_available, missing_external_id, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"provider":{"type":"string","description":"The program key from get_bokforingsprogram, e.g. 'oqto'"},"external_id":{"type":"string","description":"The company's id in the program. Oqto: company_id (UUID). Bokföring Online: the company's id from get_bokforingsprogram_bolag"},"dry_run":{"type":"boolean","description":"Test the connection without saving it"}},"required":["client_id","provider","external_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"copy_avstamning","group":"avstamning","klass":"ersatta","summary":"Copy the avstämning from an earlier fiscal year (ADR-0033), all posts or one (rad_kod). Always: kommentar, row texts, account and calculation source, and ansvarig. Optional: belopp (last year's amounts — usually wrong for this year; only when the person asks) and bilagor (linked, not stored again). Never klar. A post that already has rows this year is skipped (har_rader), and one not in this year's balance sheet (finns_inte). dry_run first and show the person the plan.","description":"Copy the avstämning from an earlier fiscal year (ADR-0033), all posts or one (rad_kod). Always: kommentar, row texts, account and calculation source, and ansvarig. Optional: belopp (last year's amounts — usually wrong for this year; only when the person asks) and bilagor (linked, not stored again). Never klar. A post that already has rows this year is skipped (har_rader), and one not in this year's balance sheet (finns_inte). dry_run first and show the person the plan.\n\nErrors: missing_source_year, unknown_source_year (not one of the client's earlier years — see get_avstamning_tidigare_ar), quota_exceeded (linking attachments), year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year to copy TO"},"fran":{"type":"integer","description":"The fiscal year to copy FROM, from get_avstamning_tidigare_ar"},"rad_kod":{"type":"string","description":"Only this post"},"belopp":{"type":"boolean","description":"Copy the amounts too"},"bilagor":{"type":"boolean","description":"Link the attachments too"},"dry_run":{"type":"boolean","description":"Show the plan without copying"}},"required":["client_id","fiscal_year_id","fran"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"copy_bokslut_settings","group":"bolag","klass":"ersatta","summary":"REPLACE a fiscal year with an earlier one of the same client. Without from_fiscal_year_id the nearest preceding year is used.","description":"REPLACE a fiscal year with an earlier one of the same client. Without from_fiscal_year_id the nearest preceding year is used.\n\nTHIS IS DESTRUCTIVE AND IT IS NOT A MERGE. The target year is emptied of settings and people and given the source year's instead. Anything the target holds that the source does not is REMOVED — a setting somebody entered this year, a person in a role the source year has nobody in. The point is a year that looks like last year, rather than a blend of two years where nobody can tell afterwards what came from where.\n\nALWAYS dry_run first, show the human what `removed` and `persons_removed` contain, and get a yes before running it for real. Those two fields are the whole risk; `plan` alone reads like a harmless fill-in.\n\nGood for starting a new bokslut: säte, ort för underskrift and revisionsbolag rarely change, and the board is the longest thing there is to type in. All roles come along, the stämma's officers included.\n\nDates never copy — stämmodatum, fastställelsedatum, påskriftsdatum, the auditor's date and each person's sign_date. Last year's date is not a draft for this year, it is the wrong date in a document somebody signs. Since the copy is a replacement, a date already entered in the target year is cleared rather than kept.\n\nA copied person is marked source=manual even when last year's row was fetched: the register has not been asked about THIS year, and a row claiming otherwise would be a false provenance. Run fetch_bolagsverket_persons afterwards for the register's current answer.\n\nValues that no longer apply — a different regelverk, a retired setting, a role the new organisationsform does not have — are skipped and reported rather than resurrected.\n\nSettings and people are written separately and do not roll each other back: a name the target year's rules reject leaves the settings copied and reports persons_errors. Check that field — a success with persons_errors set means half the job.\n\nThe matrix comes along too, and it is DECISIONS that travel, never the resolved map: `samband_copied` counts the accounts somebody reclassified and `rubriker_copied` the lines somebody renamed. Everything nobody touched follows the target year's own package, so a mapping corrected in a newer taxonomy release reaches this client instead of being frozen.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year to REPLACE"},"from_fiscal_year_id":{"type":"integer","description":"Copy from this year instead of the nearest preceding one"},"dry_run":{"type":"boolean","description":"true returns the plan, including what would be removed, and writes nothing"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"copy_from_year","group":"bolag","klass":"ersatta","summary":"Copy chosen PARTS of another fiscal year into this one (ADR-0047) — from an earlier year of the same client, or from a year of another company or a template company (mallbolag). Find sources with list_kopiera_kallor.","description":"Copy chosen PARTS of another fiscal year into this one (ADR-0047) — from an earlier year of the same client, or from a year of another company or a template company (mallbolag). Find sources with list_kopiera_kallor.\n\nEACH CHOSEN PART IS REPLACED, NOT MERGED. What the target holds in that part and the source does not is REMOVED. Parts not chosen are not touched. ALWAYS dry_run first: `delar` gives, per part, how much is written (`skrivs`) and how much disappears (`forsvinner`); show the human both and get a yes. Copying is the person's decision — never copy on your own initiative.\n\nParts (`delar`, part => true or => {options}):\n  installningar    year settings and people\n  saldon           the balances and movements, as an import run (source 'kopia'); a later SIE\n                   import replaces them like any import\n  klassificering   account → line decisions, own lines, renamed lines\n  avstamningar     comments and reconciliation rows, NEVER files; {belopp}\n  arsredovisning   note choices, equity rows, page breaks, translations, texts;\n                   {texter (same client only), fb = förvaltningsberättelsens texts, belopp (another company only)}\n  stammoprotokoll  the stämma's details and paragraphs\n  justeringar      the manual bokslutsjusteringar, renumbered; the tax calculation's own one is not copied\n  skatteberakning  entered values, periodiseringsfond register, delägare, bilagor; never filing or SKV status\n\nTwo modes. From an earlier year of the SAME client (no fran_client_id): the year rules apply — dates do not copy, comparison years shift, annual-report amounts become comparison figures. From ANOTHER company: everything in a chosen part copies as it is, people and dates too — the template's content is the customer's responsibility. Another regelverk (K2/K3) or another organisationsform stops the copy (different_regelverk, different_form): K2 or K3 is the person's choice and sets the price. Adjustments in the target that are locked or posted to the bookkeeping program stop `justeringar` (adjustment_posted). Signing, filings, locks and step status never copy.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The client whose year is REPLACED"},"fiscal_year_id":{"type":"integer","description":"The fiscal year to copy INTO"},"fran_client_id":{"type":"integer","description":"The source company; omit for the same client"},"fran_fiscal_year_id":{"type":"integer","description":"The source year; for the same client, omit for the nearest preceding year"},"delar":{"type":"object","additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":{"type":"boolean"}}]},"description":"Parts to copy: { installningar: true, arsredovisning: { fb: true }, … }"},"dry_run":{"type":"boolean","description":"true returns the plan per part and writes nothing"}},"required":["client_id","fiscal_year_id","delar"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"create_bolag","group":"bolag","klass":"skriva","summary":"Create companies with their first fiscal year — what 'Nytt bolag' does at its end (ADR-0026), for one company or a list (at most 50 per call), e.g. a bureau putting its clients into the program.","description":"Create companies with their first fiscal year — what 'Nytt bolag' does at its end (ADR-0026), for one company or a list (at most 50 per call), e.g. a bureau putting its clients into the program.\n\nONLY WHEN THE PERSON HAS ASKED FOR IT. Each company is a client on the person's licence and the price follows the regelverk, so never create one on your own initiative or to test something.\n\nTHE TERMS ARE THE PERSON'S. You never accept terms. Creating requires that the person has accepted the terms and privacy policy themselves in the program (Konto och företag → AI, or the Nytt bolag guide); otherwise terms_not_accepted — tell them where, and stop (the endpoint that records the acceptance refuses an agent with human_only). The preview says whether they are accepted (villkor.godkant) and which version.\n\nTWO STEPS. Without bekrafta nothing is created: each row is looked up (lookup_bolag) for what you left out — name, organisationsform, the latest ended fiscal year — and checked, and the answer is a preview per row {bolag {orgnr, namn, organisationsform, start, slut, regelverk}, pris_plan, egna, villkor}. Show it to the person. With bekrafta: true the rows are created in order; the answer per row is {client_id, fiscal_year_id} or its errors — one failing row does not stop the others.\n\nregelverk (K2|K3) is REQUIRED per row and never defaulted: it is the person's choice and sets the price. lookup_bolag's regelverk_forslag is a suggestion to put to them, not an answer. A number that is already among the person's companies (`egna`) is refused with already_exists unless aven_om_det_finns is true — the same number may exist more than once, but only on purpose. Every company created here is logged as created via MCP. Afterwards: forbered_bolag (dry_run first) and the import.\n\nErrors per row: invalid_orgnr, required (name), invalid_enum (organisationsform or regelverk), invalid_date, terms_not_accepted, already_exists, not_authenticated, internal_error. Looking up many rows in a row may hit SCB's limit (provider_rate_limited) — then give name, form and dates yourself.","dryRun":false,"inputSchema":{"type":"object","properties":{"bolag":{"type":"array","items":{"type":"object","properties":{"orgnr":{"type":"string","description":"Organisationsnummer, with or without hyphen"},"regelverk":{"type":"string","enum":["K2","K3"],"description":"The person's choice; sets the price"},"namn":{"type":"string","description":"Left out: from the lookup"},"organisationsform":{"type":"string","description":"aktiebolag, ekonomisk_forening, ... Left out: from the lookup"},"start":{"type":"string","description":"First fiscal year's first day, YYYY-MM-DD. Left out: the latest ended year"},"slut":{"type":"string","description":"Its last day, YYYY-MM-DD"}},"required":["orgnr","regelverk"],"additionalProperties":false},"minItems":1,"maxItems":50,"description":"The companies, at most 50"},"bekrafta":{"type":"boolean","description":"true creates. Left out: a preview, nothing is created."},"aven_om_det_finns":{"type":"boolean","description":"Create even when the number is already among the person's companies"}},"required":["bolag"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"create_extrastamma","group":"stamma","klass":"skriva","summary":"Create an extra stämma for the year (ADR-0025 punkt 10): the form's template locked on it, the OWNERS copied from the year's people (the röstlängd), and optionally a first decision point.","description":"Create an extra stämma for the year (ADR-0025 punkt 10): the form's template locked on it, the OWNERS copied from the year's people (the röstlängd), and optionally a first decision point.\n\nOrdförande, protokollförare and justerare are NOT copied — they are chosen for this stämma with save_extrastamma_person, since they are often not the årsstämma's. Nothing is ever written back to the year's people.\n\n`arende` is required: what the stämma is about, shown in the list and the signing's title. `typ` fysisk (default) | digital | percapsulam — per capsulam all owners sign and there is no meeting. `beslut`: a `kod` from list_extrastammor `beslutspunkter`, 'tom' for an empty one, or leave it out.\n\nAnswers `stamma_id` and the list. Errors: required (arende), invalid_date, invalid_enum (typ, beslut), too_long, year_locked, not_applicable, package_missing.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"arende":{"type":"string","description":"What the stämma is about, max 255"},"datum":{"type":"string","description":"YYYY-MM-DD"},"ort":{"type":"string"},"typ":{"type":"string","enum":["fysisk","digital","percapsulam"]},"beslut":{"type":"string","description":"A beslutspunkt kod, or 'tom'"}},"required":["client_id","fiscal_year_id","arende"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"create_fiscal_year","group":"bolag","klass":"skriva","summary":"Create a new fiscal year (bokföringsår) for a client. Typically runs 12 months. A year overlapping an existing one is refused (overlap); a removed year does not count.","description":"Create a new fiscal year (bokföringsår) for a client. Typically runs 12 months. A year overlapping an existing one is refused (overlap); a removed year does not count.\n\nBy default the new year is LAST YEAR CARRIED FORWARD (ADR-0009 addendum, 2026-10-25), from the nearest preceding year in the app: the regelverk (K2/K3), the year settings and people (dates and signing choices not copied, comparison years shifted one step), the matrix decisions, the annual report's note choices, texts and translations with last year's figures as comparison figures and the multi-year overview shifted, last year's closing balances as this year's opening balances and comparison column (an import run with source 'fjolaret' — the first real import replaces it), and the reconciliations' comments and rows with their amounts (a row computed from a source recalculates). `hamtat.steg` says what each step did. Pass hamta_fjolaret: false for an empty year. The first year of a company has nothing to carry.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"start_date":{"type":"string","description":"Start date YYYY-MM-DD (e.g. 2025-01-01)"},"end_date":{"type":"string","description":"End date YYYY-MM-DD (e.g. 2025-12-31)"},"chart_of_accounts_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Chart of accounts ID. Leave blank to inherit from previous year."},"accounting_method_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Accounting method ID. Leave blank to inherit from previous year."},"hamta_fjolaret":{"type":"boolean","description":"false creates an empty year; default true carries last year forward"}},"required":["client_id","start_date","end_date"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"create_k10","group":"k10","klass":"skriva","summary":"Create a K10 for an income year (ADR-0056): one person (`pnr` with twelve digits, `namn`), or `alla: true` for every owner in the röstlängd with a personnummer who has none yet for the year (legal persons and owners without personnummer are skipped). Answers like get_k10's list, plus `skapade` [id]. Errors: year_not_supported, invalid_pnr, duplicate_k10, no_owners (nobody left to create from the röstlängd).","description":"Create a K10 for an income year (ADR-0056): one person (`pnr` with twelve digits, `namn`), or `alla: true` for every owner in the röstlängd with a personnummer who has none yet for the year (legal persons and owners without personnummer are skipped). Answers like get_k10's list, plus `skapade` [id]. Errors: year_not_supported, invalid_pnr, duplicate_k10, no_owners (nobody left to create from the röstlängd).","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"inkomstar":{"type":"integer","description":"Income year, 2026 or later"},"pnr":{"type":"string","description":"Personnummer ÅÅÅÅMMDD-NNNN, for one person"},"namn":{"type":"string","description":"The person's name"},"alla":{"type":"boolean","description":"Create for every owner in the röstlängd who lacks one"}},"required":["client_id","inkomstar"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"create_notification","group":"ovrigt","klass":"skriva","summary":"Create a notification, reminder or message for the selected client's users (scope client: the owner and the active invited users). Use for user reminders, AI-created reminders, client messages, and non-global alerts. Only the company's owner and editors may write; a message to all users, or to all agencies or all business owners, is for an administrator in the program and never for an agent (ADR-0037). display_mode toast is for the important: it stays until closed, once per user. The e-mail channel is prepared but switched off until the sender is verified — in_app is what reaches people today.","description":"Create a notification, reminder or message for the selected client's users (scope client: the owner and the active invited users). Use for user reminders, AI-created reminders, client messages, and non-global alerts. Only the company's owner and editors may write; a message to all users, or to all agencies or all business owners, is for an administrator in the program and never for an agent (ADR-0037). display_mode toast is for the important: it stays until closed, once per user. The e-mail channel is prepared but switched off until the sender is verified — in_app is what reaches people today.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"notification_key":{"type":"string","description":"Unique notification key. Reusing the same key updates the existing notification instead of creating a duplicate."},"title":{"type":"string","description":"Notification title"},"message":{"type":"string","description":"Notification message"},"type":{"type":"string","enum":["info","success","warning","danger"],"default":"info","description":"Notification type"},"display_mode":{"type":"string","enum":["dropdown","banner","toast"],"default":"dropdown","description":"Where to display the notification"},"starts_at":{"type":"string","description":"Optional start datetime YYYY-MM-DD HH:mm:ss"},"ends_at":{"type":"string","description":"Optional end datetime YYYY-MM-DD HH:mm:ss"},"delivery_channel":{"type":"string","enum":["in_app","email","push","all"],"default":"in_app","description":"Delivery channel. in_app = web app only, push = iOS push only, all = in-app and push."},"reset_dismissals":{"type":"boolean","default":false,"description":"If true, clears previous dismissals so users see the notification again. Use only when the underlying event has materially changed."}},"required":["client_id","notification_key","title","message"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"create_recurring_todo","group":"ovrigt","klass":"skriva","summary":"Create a recurring todo rule for the selected client (daily/weekly/monthly). Spawns instances automatically via a daily cron — a normal todo appears via get_todos whenever an occurrence is due, not immediately, UNLESS the rule's first occurrence is already due the moment it's created, in which case one instance is generated right away (see first_todo_id in the response). Use for standing checklist items like 'Stäm av kassan varje vecka' rather than one-off todos.","description":"Create a recurring todo rule for the selected client (daily/weekly/monthly). Spawns instances automatically via a daily cron — a normal todo appears via get_todos whenever an occurrence is due, not immediately, UNLESS the rule's first occurrence is already due the moment it's created, in which case one instance is generated right away (see first_todo_id in the response). Use for standing checklist items like 'Stäm av kassan varje vecka' rather than one-off todos.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"title":{"type":"string","description":"Title applied to every generated instance"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"],"default":"medium"},"assignee_id":{"type":"integer","description":"User ID applied to every generated instance. Must have access to this client. Use get_client_users to resolve a name to an id."},"frequency":{"type":"string","enum":["daily","weekly","monthly"],"description":"How often it recurs"},"interval_n":{"type":"integer","default":1,"description":"Every N days/weeks/months. E.g. frequency=monthly + interval_n=3 = quarterly (common for Swedish VAT). frequency=weekly + interval_n=2 = every other week."},"weekday":{"type":"integer","minimum":0,"maximum":6,"description":"Weekly only. 0=Sunday..6=Saturday. Defaults to start_date's weekday if omitted."},"day_of_month":{"type":"integer","minimum":1,"maximum":31,"description":"Monthly only. Clamped to each month's real length (e.g. 31 in a 30-day month becomes 30). Defaults to start_date's day if omitted."},"start_date":{"type":"string","description":"YYYY-MM-DD, first occurrence anchor. Defaults to today."},"action_url":{"type":"string"},"source_module":{"type":"string","default":"manual"}},"required":["client_id","title","frequency"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"create_todo","group":"ovrigt","klass":"skriva","summary":"Create a todo/task for the selected client. Can optionally be assigned to another user with access to the client and trigger a notification (in-app or push). Use todo_key only for recurring/system-style checks that should update the same todo instead of creating duplicates on repeat runs.","description":"Create a todo/task for the selected client. Can optionally be assigned to another user with access to the client and trigger a notification (in-app or push). Use todo_key only for recurring/system-style checks that should update the same todo instead of creating duplicates on repeat runs.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"title":{"type":"string","description":"Todo title"},"description":{"type":"string","description":"Longer free-text description"},"severity":{"type":"string","enum":["high","medium","low"],"default":"medium","description":"Priority"},"due_date":{"type":"string","description":"Due date YYYY-MM-DD"},"action_url":{"type":"string","description":"Optional deep link/anchor related to the todo"},"assignee_id":{"type":"integer","description":"User ID to assign the todo to. Must already have access to this client — the backend rejects assignees without access."},"notify":{"type":"boolean","default":false,"description":"Send an assignment notification to assignee_id. No-op if assignee_id is omitted or is the creator."},"notify_channel":{"type":"string","enum":["in_app","push","all"],"default":"in_app","description":"Delivery channel for the assignment notification"},"source_module":{"type":"string","default":"manual","description":"Origin tag, e.g. 'manual', 'vat'. Leave as 'manual' for ad-hoc/assistant-created todos."},"todo_key":{"type":"string","description":"Idempotency key for recurring system-style todos only. Reusing the same key updates the existing todo instead of creating a duplicate. Leave blank for normal one-off todos."}},"required":["client_id","title"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"delete_avstamning","group":"avstamning","klass":"ersatta","summary":"Delete a post's whole reconciliation: kommentar, rows, ansvarig and klar (ADR-0033). The post stays in the balance sheet, empty. Cannot be undone — ask the person first, and say what goes (get_avstamning shows it).","description":"Delete a post's whole reconciliation: kommentar, rows, ansvarig and klar (ADR-0033). The post stays in the balance sheet, empty. Cannot be undone — ask the person first, and say what goes (get_avstamning shows it).\n\nErrors: missing_post, unknown_post, year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"rad_kod":{"type":"string","description":"The post, from get_avstamning"}},"required":["client_id","fiscal_year_id","rad_kod"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"delete_avstamning_bilagor","group":"avstamning","klass":"ersatta","summary":"Delete attachments from the avstämning (ADR-0033), at one of four levels: one file (dokument_id + rad_id), a row's files (rad_id), a post's files (rad_kod) or the year's (hela_aret: true). A file nothing else points to is deleted from storage. Attachments are accounting records that must be kept for seven years — ask the person first, dry_run to show how many, and delete only what they confirm.","description":"Delete attachments from the avstämning (ADR-0033), at one of four levels: one file (dokument_id + rad_id), a row's files (rad_id), a post's files (rad_kod) or the year's (hela_aret: true). A file nothing else points to is deleted from storage. Attachments are accounting records that must be kept for seven years — ask the person first, dry_run to show how many, and delete only what they confirm.\n\nErrors: missing_scope, missing_row, unknown_row, unknown_post, unknown_document, year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dokument_id":{"type":"integer","description":"One file (with rad_id)"},"rad_id":{"type":"integer","description":"The row"},"rad_kod":{"type":"string","description":"All files on a post"},"hela_aret":{"type":"boolean","description":"All the year's reconciliation attachments"},"dry_run":{"type":"boolean","description":"Count without deleting"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"delete_bokslut_justering","group":"bokslut","klass":"ersatta","summary":"Remove a bokslutsjustering and its rows.","description":"Remove a bokslutsjustering and its rows.\n\n⚠ Permanent, and it moves the figures: ub_adjusted is recomputed without it at once. Ask the person first and name the entry — A3 and its description — rather than its id, which means nothing to them.\n\nThe number is not reused if the entry is in the middle of the series: deleting A2 of A1–A3 leaves a gap, because two different entries that were both once called A2 are worse than a gap. Deleting the last one does reuse its number.\n\nadjustment_posted: the entry has been booked in the client's bookkeeping program (Oqto …). Deleting it here leaves the voucher there and removes e-revisor's only link to it, so this tool cannot do it. Tell the person, who can confirm it in the interface — or, better, correct it in the program or with a counter-entry.\n\nErrors: missing_input, unknown_adjustment, adjustment_locked, adjustment_posted, year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"id":{"type":"integer","description":"The entry's id from list_bokslut_justeringar"}},"required":["client_id","fiscal_year_id","id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"delete_bokslut_person","group":"bolag","klass":"ersatta","summary":"Remove one person by id. Use this rather than save_bokslut_persons when you only want to remove somebody: it does not require sending the rest of the role, so it cannot take anyone else with it by accident.","description":"Remove one person by id. Use this rather than save_bokslut_persons when you only want to remove somebody: it does not require sending the rest of the role, so it cannot take anyone else with it by accident.\n\nConfirm with the person first. A funktionär is a stated fact about the company, and removing the wrong one is not visible in the document until somebody reads the signatures.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"id":{"type":"integer","description":"The person's id from list_bokslut_persons"}},"required":["client_id","fiscal_year_id","id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"delete_bolag","group":"bolag","klass":"ersatta","summary":"Remove a company, or one fiscal year, restore it, or (appadmin only) delete it for good (ADR-0028). ONLY when the user has explicitly asked for it in this conversation — never as cleanup on your own initiative. Always call with dry_run: true first and tell the user what would be removed (`antal`: rows per table, files), any `sparr` (a signed or filed year, or the company's only year, cannot be removed on its own) and `inlamnade_ar` (years already filed — the authorities keep their copies). `lage`: mjuk (default; hidden and closed, restorable for 90 days — `raderas` is the date it is purged), aterstall, or hard (appadmin, only for something already removed). `bekrafta` must be the company's name or the year's label (e.g. '2025/26') exactly as the user confirms it — ask them, never fill it in yourself. Owner or appadmin only. Errors: invalid_enum, unknown_client, unknown_fiscal_year, forbidden, already_deleted, not_deleted, client_deleted, blocked, confirmation_mismatch, conflict, overlap (restoring a year another year now covers).","description":"Remove a company, or one fiscal year, restore it, or (appadmin only) delete it for good (ADR-0028). ONLY when the user has explicitly asked for it in this conversation — never as cleanup on your own initiative. Always call with dry_run: true first and tell the user what would be removed (`antal`: rows per table, files), any `sparr` (a signed or filed year, or the company's only year, cannot be removed on its own) and `inlamnade_ar` (years already filed — the authorities keep their copies). `lage`: mjuk (default; hidden and closed, restorable for 90 days — `raderas` is the date it is purged), aterstall, or hard (appadmin, only for something already removed). `bekrafta` must be the company's name or the year's label (e.g. '2025/26') exactly as the user confirms it — ask them, never fill it in yourself. Owner or appadmin only. Errors: invalid_enum, unknown_client, unknown_fiscal_year, forbidden, already_deleted, not_deleted, client_deleted, blocked, confirmation_mismatch, conflict, overlap (restoring a year another year now covers).","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"Only this fiscal year; omit for the whole company"},"lage":{"type":"string","enum":["mjuk","aterstall","hard"]},"bekrafta":{"type":"string","description":"The name or year label, as the user typed it"},"dry_run":{"type":"boolean"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"delete_extrastamma","group":"stamma","klass":"ersatta","summary":"Delete an extra stämma with its paragraphs and its people. Cannot be undone — ask the person first. Refused when the protokoll is signed (already_signed: the signed document stays reachable from the stämma) or sent for signing (already_sent: it must be cancelled in the program first). Answers the list. Errors: unknown_stamma, already_signed, already_sent, year_locked.","description":"Delete an extra stämma with its paragraphs and its people. Cannot be undone — ask the person first. Refused when the protokoll is signed (already_signed: the signed document stays reachable from the stämma) or sent for signing (already_sent: it must be cancelled in the program first). Answers the list. Errors: unknown_stamma, already_signed, already_sent, year_locked.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"stamma_id":{"type":"integer"}},"required":["client_id","fiscal_year_id","stamma_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"delete_k10","group":"k10","klass":"ersatta","summary":"Delete a K10 (ADR-0056). Next year's K10 for the same person loses its suggested sparat utdelningsutrymme. Ask before deleting. Answers like get_k10's list for the income year. Errors: unknown_k10.","description":"Delete a K10 (ADR-0056). Next year's K10 for the same person loses its suggested sparat utdelningsutrymme. Ask before deleting. Answers like get_k10's list for the income year. Errors: unknown_k10.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"id":{"type":"integer","description":"The K10 id"}},"required":["client_id","id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"disconnect_bokforingsprogram","group":"import","klass":"ersatta","summary":"Remove the client's connection to a bookkeeping program.","description":"Remove the client's connection to a bookkeeping program.\n\nNothing already read in or booked is affected: the import history stays, and so do the balances. Access in the program itself ends only when e-revisor is deactivated there too — say so. Ask the person before disconnecting; reconnecting needs the id from the program again, and for Bokföring Online the stored API credentials are deleted with the connection. Fortnox: the approval stays in Fortnox until the company removes it under Integrationer there, and connecting again means a system administrator approving in the browser. Bokio: the connection is removed in Bokio too; if Bokio refuses, it is removed here anyway and `bokio_fel` says why — tell the person to remove e-revisor under Integrationer in Bokio.\n\nErrors: missing_provider, unknown_provider, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"provider":{"type":"string","description":"The program key, e.g. 'oqto'"}},"required":["client_id","provider"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"fetch_bolagsverket_periods","group":"bolag","klass":"lasa_ute","summary":"Ask Bolagsverket for the company's räkenskapsperioder, to fill the comparison years an årsredovisning needs. Writes nothing: the answer is a proposal you pass to save_bokslut_settings.","description":"Ask Bolagsverket for the company's räkenskapsperioder, to fill the comparison years an årsredovisning needs. Writes nothing: the answer is a proposal you pass to save_bokslut_settings.\n\nThe register returns three periods counted from TODAY, newest first, and the newest is the period currently running. That one is skipped on purpose: it is year 1, the year the settings belong to, and year 1 is never written as a setting — it is read from the fiscal year itself. To change it, change the fiscal year.\n\nSO A FETCH OFTEN FILLS FEWER YEARS THAN YOU EXPECT, and that is not a failure. Working in the most recent fiscal year fills year 2 and 3; working in an older one, the register's newer periods lie after the year you are in and are not comparison years at all, so only year 2 gets filled. The reach object says exactly how far it got — read it and tell the person, instead of letting a half-filled result look like something went wrong. Years the register cannot reach are entered by hand.\n\nEvery one of the three periods is accounted for: the ones that became fields are in plan, and the rest are in skipped with a reason — aktuellt_ar for the period that IS the fiscal year being worked on, efter_aktuellt_ar for one that lies after it. Report them, so a fetch that fills one year does not look like a fetch that lost two.\n\nThe plan lists every field the register can fill, including ones that already hold the right date; changed per field separates what moves from what stands still. The settings map is finished — pass it to save_bokslut_settings, which writes only what differs.\n\ncurrent_check compares the fiscal year in the program against the register. When matches is false somebody mistyped the dates when the year was created, or the company changed its räkenskapsår without it being recorded here. Say so — a wrong fiscal year is worth more attention than the comparison years, because everything else is built on it.\n\nrevision_aktuellt_ar is what the register says about revisionsplikt for the CURRENT period: true, false, or null for uppgift saknas. null means unknown and never 'no'. It is information, not a write — whether the report is audited follows from an auditor in the persons list (revisor/medrevisor), not from a setting.\n\nBolagsverket's own failures come back as provider_unreachable, provider_not_configured, not_found, provider_error, provider_bad_response and missing_orgnr, with the same meanings as in fetch_bolagsverket_persons.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"fetch_bolagsverket_persons","group":"bolag","klass":"lasa_ute","summary":"Ask Bolagsverket who represents the company, and get back a PROPOSAL. Writes nothing.","description":"Ask Bolagsverket who represents the company, and get back a PROPOSAL. Writes nothing.\n\nTwo scopes, because they are separate concerns: 'foretaget' covers the board, VD and likvidatorer; 'revisor' covers the auditors and additionally reads the revisionsbyrå into the revisor_bolag setting, a firm being a legal person and not somebody who signs.\n\nThe answer has two parts. `preview` is for the human: who is added, who stays, who falls away, and which functions were skipped because the register used a code we do not recognise. `replacement` is the finished list — pass it straight to save_bokslut_persons to apply it, and `settings` to save_bokslut_settings if it is not empty.\n\nSHOW THE PREVIEW AND ASK BEFORE APPLYING. A fetch REPLACES the roles in its scope, so somebody who has left the board disappears — which is the point, and exactly why it must not happen silently.\n\nEmail, legitimering, påskriftsdatum and the fastställelseintyg follow anyone matched on personnummer; Bolagsverket does not know them and they are not lost. Somebody recorded WITHOUT a personnummer who has changed surname comes back as a removal plus an addition, not as a change — without the number a rename cannot be told from a replacement. Say so when it happens instead of presenting it as two separate people.\n\nOnly aktiebolag are in the register. Stämmofunktionärer and ägare are not, and are never touched.\n\nAPPLYING: pass apply=true to fetch and write in one call, INSTEAD of passing `replacement` to save_bokslut_persons. Prefer it. The server fetches again and writes what the register says now, so nothing goes stale between your preview and the write, and the personnummer never travel through you. It goes through the same validation, the same fastställelse rule and the same history as an ordinary save — a fetch that would break one of them is refused, not written.\n\nCall it once WITHOUT apply, show the preview, get a yes, then call it again WITH apply. Never apply on the first call: a person who has left the board disappears, and that is not yours to decide.\n\nBOLAGSVERKET'S OWN FAILURES come back as codes only this tool can produce, and they differ in whether retrying is pointless:\n  provider_unreachable — the network or their service. Worth one retry in a little while.\n  provider_not_configured — our certificate is missing on the server. Retrying never helps; say the fetch is unavailable and let the person enter the board by hand.\n  provider_error — Bolagsverket refused, and `message` carries their own wording, which is usually specific. Pass it on rather than paraphrasing.\n  not_found — Bolagsverket has nothing on the number (their code 4005): a newly registered company or a test company. Nothing failed; the board is entered by hand.\n  provider_bad_response — they answered something we could not read. Report it; do not guess at a board.\n  missing_orgnr — the client has no valid organisationsnummer recorded, so there is nothing to look up. That is a gap in the client record, not in the request.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"scope":{"type":"string","enum":["foretaget","revisor"],"description":"foretaget = board, VD, likvidatorer. revisor = revisorer + revisionsbyrån"},"apply":{"type":"boolean","description":"true fetches again and writes. Only after showing the preview and being told yes"}},"required":["client_id","fiscal_year_id","scope"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"fetch_scb_sate","group":"bolag","klass":"lasa_ute","summary":"Propose styrelsens säte from SCB's business register (säteskommun) for one fiscal year. Never writes: the settings map is a finished proposal to pass to save_bokslut_settings.","description":"Propose styrelsens säte from SCB's business register (säteskommun) for one fiscal year. Never writes: the settings map is a finished proposal to pass to save_bokslut_settings.\n\nThe säteskommun is a SUGGESTION, not the answer. The bolagsordning states the seat, and it may be spelled differently ('Vellinge kommun', or a town within the municipality). changed is false when the stored value already matches, ignoring case. When nuvarande holds a value and changed is true, show the person both and let them choose — do not overwrite on your own.\n\nstatus.varning is set when SCB reports konkurs, likvidation, ackord or similar, or that the company is no longer active. Say it first — it matters more than the seat, and a company in likvidation signs its annual report differently.\n\nFailures: missing_orgnr (the client has no usable organisationsnummer), missing_fiscal_year, not_found (SCB has no such company), provider_rate_limited (the key is shared by every user and SCB blocks it for about ten minutes — do not retry before then), provider_unreachable (retry later; SCB is down 04:00–04:30 every night), provider_not_configured and provider_not_authorised (never retry), provider_error, invalid_input.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"fill_not","group":"arsredovisning","klass":"skriva","summary":"Fill a note in the annual report from the books — the same as the person's link \"Fyll i från bokföringen\" in the note. dry_run (the default) shows what would be filled (`rader`: nu against nytt, visa_* in the form's sign) and `info`; dry_run false writes it. Called without `not` it lists which of the year's chosen notes can be filled.","description":"Fill a note in the annual report from the books — the same as the person's link \"Fyll i från bokföringen\" in the note. dry_run (the default) shows what would be filled (`rader`: nu against nytt, visa_* in the form's sign) and `info`; dry_run false writes it. Called without `not` it lists which of the year's chosen notes can be filled.\n\nThe sources (notfyll.php): NotPersonal — salaries 7000–7299 and benefits 7380–7399 (board and CEO 7220–7229, 7240–7249 separately), pensions 7400–7499, social charges 7500–7599, and medelantalet anställda from the saved AGI receipts (individual statements per month, averaged — marked förslag); NotMedelantaletAnstallda (K2) the same average; NotErsattningRevisorer — 6420–6429 per engagement type, named after the audit firm; NotOperationellaLeasingavtalLeasetagare — the year's lease costs 5010–5019, 5200–5299, 5615; the fixed-asset notes — opening balance and the year's gross debit and credit per group (cost, depreciation, write-downs, revaluations by the account's last digit 9/8/7), from the SIE file's transactions; without them the net change is marked förslag and a re-import is suggested; NotSkattPeriodensResultat — as fill_skattenot. Comparison year from last year's figures in the program where they exist.\n\nnot = Kassaflodesanalys fills the cash flow statement (indirect method) from the annual report as it stands — the income statement and balance sheet including typed and changed amounts, the fixed-asset notes' purchases and the equity table — never from the accounts: adjustments (depreciation, K3 also the change in provisions), interest from the financial items when the starting value is operating profit, tax paid (tax cost and the change in the balance sheet's current tax liability and receivable; the tax account 1630 is left out), working capital from the balance-sheet lines, acquisitions from the notes' purchases and disposals as the sold carrying amount the balance sheet implies (net and förslag when no note has purchases), financial assets and loans net (förslag), dividend, share issue and contributions from the equity table (or the change in equity besides the year's result, förslag). The realisation result stays in the disposal until account lookups come in a later step. The comparison year comes from last year's annual report when it is in the program; without it only the year is filled — likvida medel at the year's start (balans1) is written directly and the comparison column is left to the person. What does not add up against the change in cash and bank goes on `rest_mal` (or nowhere with \"ingen\"), and `avstamning` gives per period the year's cash flow from the rows (summa), the change in cash and bank (likvida) and the remainder (rest) — a large remainder means something needs a look before writing.\n\nShow the person the preview and ask before writing: it replaces what they typed. Comments are never touched.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, no_package, unknown_note, not_applicable (the note has no source, or the source is missing — the message says which), invalid_value (val or rest_mal), internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"not":{"type":"string","description":"The note's code, e.g. NotPersonal, or Kassaflodesanalys. Omit to list what can be filled."},"rest_mal":{"type":"string","enum":["ForandringKassaflodeOvrigaKortfristigaSkulder","ForandringKassaflodeOvrigaKortfristigaFordringar","ForandringKassaflodeLeverantorsskulder","JusteringPosterSomInteIngarIKassaflodet","ingen"],"description":"Kassaflodesanalys only: the row the unallocated remainder goes on (default the first the package has), or \"ingen\" to leave it unallocated — the analysis' closing likvida medel then differs from cash and bank."},"dry_run":{"type":"boolean","description":"Default true: preview only. false writes."},"val":{"type":"array","items":{"type":"string"},"description":"With dry_run false: only these rows, by the preview's `nyckel` (a tuple's occurrence is one key: name, type and amount together). Omit to write all. The server recomputes the values; none are taken from the call."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"fill_skattenot","group":"arsredovisning","klass":"skriva","summary":"Fill the K3 note on tax (Skatt på årets resultat) from the year's SAVED tax calculation and the bookkeeping. dry_run (the default) shows what would be filled and what the note holds now; dry_run false writes it.","description":"Fill the K3 note on tax (Skatt på årets resultat) from the year's SAVED tax calculation and the bookkeeping. dry_run (the default) shows what would be filled and what the note holds now; dry_run false writes it.\n\nWhat is filled, per column: aktuell skatt (the calculated tax), justering avseende tidigare år (8920–8929) and förändring av uppskjuten skatt (8940–8949) from the books, gällande skattesats (from the tax parameters for the fiscal year's start — never a fixed 20,6), and one väsentlig post per adjustment in the return (INK2 4.3b–4.14c): the amount × the rate, in the tax's direction (plus raises the tax). A rest row (rounding of the taxable base, or a loss that gives no tax) makes the reconciliation add up. Resultat före skatt and skatt enligt gällande skattesats are computed in the document and not written. Existing väsentliga poster in a filled column are replaced; comments are never touched. The comparison column is filled the same way when last year's tax calculation is saved in the program.\n\nShow the person the preview and ask before writing: it replaces what they typed. `not_vald` false means the note is not chosen (set_arsredovisning_noter) and will not show until it is.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, no_package, not_applicable (not K3, no saved tax calculation, or a handelsbolag without income tax — the message says which), internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dry_run":{"type":"boolean","description":"Default true: preview only. false writes."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"forbered_bolag","group":"bolag","klass":"skriva_ute","summary":"Let the program do what it can on its own for a company and year (ADR-0026 punkt 3) — the same as the 'Fyll i automatiskt' wand in the app. It fills what is empty, and replaces something already filled ONLY for the steps you name in `ersatt`. Steps, in order: forra_aret (last year's settings, only into a completely empty year), perioder (the comparison periods from Bolagsverket — dates only, so that last year's figures show; a period that disagrees with a fiscal year in the program is not filled), personer and revisor (from Bolagsverket — aktiebolag only; other forms are filled in by hand), sate (from SCB; not for handels- and kommanditbolag, which have no such setting), orter (stämma and signing place = the säte), dekl_epost (the user's own e-mail for Skatteverket), dekl_adress (the declarant's address for Skatteverket = the company's postal address from SCB), funktionarer (stämma chair, minute-taker and adjuster from the board, only for forms that hold a stämma; per capsulam for an aktiebolag with a one-person board), skatt (the tax calculation — once saved it recalculates itself after imports. It is skipped, never guessed, when booking it would rest on a judgement nobody has made: the year's result already stands on 8999 (the company closed its own books — the person may choose ovrigt_noskatt), an ideell förening's or stiftelse's skattskyldighet or a brf's brf_beskattning is not chosen, or a handels- or kommanditbolag has no partners), noter (the notes the figures suggest), verksamhet ('om verksamheten' from SCB's industry and the säte), texter (the chosen notes' standard texts), avstamning (last year's avstämning with its amounts) and skatteavstamning (last year's skatteavstämning: its current column becomes this year's previous year, ADR-0036). The disposition is no step: 'balanseras i ny räkning' is a remainder the årsredovisning computes itself.","description":"Let the program do what it can on its own for a company and year (ADR-0026 punkt 3) — the same as the 'Fyll i automatiskt' wand in the app. It fills what is empty, and replaces something already filled ONLY for the steps you name in `ersatt`. Steps, in order: forra_aret (last year's settings, only into a completely empty year), perioder (the comparison periods from Bolagsverket — dates only, so that last year's figures show; a period that disagrees with a fiscal year in the program is not filled), personer and revisor (from Bolagsverket — aktiebolag only; other forms are filled in by hand), sate (from SCB; not for handels- and kommanditbolag, which have no such setting), orter (stämma and signing place = the säte), dekl_epost (the user's own e-mail for Skatteverket), dekl_adress (the declarant's address for Skatteverket = the company's postal address from SCB), funktionarer (stämma chair, minute-taker and adjuster from the board, only for forms that hold a stämma; per capsulam for an aktiebolag with a one-person board), skatt (the tax calculation — once saved it recalculates itself after imports. It is skipped, never guessed, when booking it would rest on a judgement nobody has made: the year's result already stands on 8999 (the company closed its own books — the person may choose ovrigt_noskatt), an ideell förening's or stiftelse's skattskyldighet or a brf's brf_beskattning is not chosen, or a handels- or kommanditbolag has no partners), noter (the notes the figures suggest), verksamhet ('om verksamheten' from SCB's industry and the säte), texter (the chosen notes' standard texts), avstamning (last year's avstämning with its amounts) and skatteavstamning (last year's skatteavstämning: its current column becomes this year's previous year, ADR-0036). The disposition is no step: 'balanseras i ny räkning' is a remainder the årsredovisning computes itself.\n\nALWAYS run `dry_run: true` first. Each step then has `lage`: skulle (would be filled), redan (already filled) or hoppat (nothing to fetch, or a judgement is needed first — `text` says which; ADR-0026 punkt 3 c). A step that does not apply to the company's form is left out. Förbered is a starting point: what it skips is yours or the person's to do, and `fel` means something actually failed. A `redan` step may carry `skillnad` {text, etikett, kan, fore, efter}: the filled value differs from the proposal. Show the person `fore` and `efter` and let them decide; only then pass that step in `ersatt`. Replacing keeps what a person entered where it can: personer keeps e-mail, personal number and signing method for those who remain; noter only adds, never removes. `signerad` lists signed documents — replacing then makes the signing outdated; say so. `steg` limits which empty steps are filled (default all). Answers `steg` [{kod, namn, lage: gjort|ersatt|hoppat|fel, text}] and `kvar` [{text, kort}] — what is left for a person; say it to them. Nothing is sent to any authority. Errors: missing_fiscal_year, year_locked, invalid_enum.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dry_run":{"type":"boolean"},"steg":{"type":"array","items":{"type":"string","enum":["forra_aret","perioder","personer","revisor","sate","orter","dekl_epost","dekl_adress","funktionarer","skatt","noter","verksamhet","texter"]},"description":"Only these empty steps are filled; omit for all"},"ersatt":{"type":"array","items":{"type":"string","enum":["perioder","personer","revisor","sate","orter","dekl_epost","dekl_adress","funktionarer","noter","verksamhet","texter"]},"description":"Replace these filled steps with the proposal — only after the person has seen fore/efter"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_arbetsgivardeklarationer","group":"skatt","klass":"lasa_ute","summary":"The fiscal year's employer declarations (arbetsgivardeklarationer, AGI) as Skatteverket has them, saved (ADR-0049 etapp 3). Answers perioder — one per receipt: nyckel (period-lopnr), period YYYYMM, lopnr (1 = the original; corrections follow), etikett, omfattar, gallande (the receipt that applies for the period), rattelse (the period has corrections), tidpunkt (signed), kvittens, underskriven_av (masked: birth date and XXXX), andrad/tidigare (the amounts changed since the previous fetch), rutor {faltkod: öre}, antal_iu, deklarationsdatum, betalningsdatum, fel — and rutor (the field codes with an amount: ruta = faltkod, namn, varden {nyckel: öre|null}, ar = the sum of the applicable receipt per period; e.g. 487 arbetsgivaravgifter, 497 skatteavdrag), hamtad, hamtad_av, manader, last.","description":"The fiscal year's employer declarations (arbetsgivardeklarationer, AGI) as Skatteverket has them, saved (ADR-0049 etapp 3). Answers perioder — one per receipt: nyckel (period-lopnr), period YYYYMM, lopnr (1 = the original; corrections follow), etikett, omfattar, gallande (the receipt that applies for the period), rattelse (the period has corrections), tidpunkt (signed), kvittens, underskriven_av (masked: birth date and XXXX), andrad/tidigare (the amounts changed since the previous fetch), rutor {faltkod: öre}, antal_iu, deklarationsdatum, betalningsdatum, fel — and rutor (the field codes with an amount: ruta = faltkod, namn, varden {nyckel: öre|null}, ar = the sum of the applicable receipt per period; e.g. 487 arbetsgivaravgifter, 497 skatteavdrag), hamtad, hamtad_av, manader, last.\n\nuppdatera: true fetches live from Skatteverket and saves, one call per month. It needs the agency's ombud authority for the company: without it unauthorized — the person can fetch in their own name with BankID in the app; you cannot. Not in a locked year (year_locked). Read only — nothing is filed or changed.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, invalid_enum, year_locked; with uppdatera also missing_org_number, unauthorized, rejected, not_configured, provider_unreachable, provider_error, bankid_required; internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"uppdatera":{"type":"boolean","description":"Fetch live from Skatteverket and save, instead of reading what is saved"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_arsredovisning_differenser","group":"arsredovisning","klass":"lasa","summary":"Whether the annual report adds up, as the gate before signing and filing sees it (ADR-0015 punkt 86). A difference is one of the report's checks that does not hold (the balance sheet, a sum against its parts, a note against its item) or an equity-table column that does not add up. While there are differences that no person has approved, signing the annual report or the stämmoprotokoll (signering/skicka) and uploading to Bolagsverket (bolagsverket/inlamning) are refused with ar_differenser, and every PDF of the report is a draft with the difference rows and an UTKAST watermark. The document itself — the iXBRL file and what is signed — never shows the differences.","description":"Whether the annual report adds up, as the gate before signing and filing sees it (ADR-0015 punkt 86). A difference is one of the report's checks that does not hold (the balance sheet, a sum against its parts, a note against its item) or an equity-table column that does not add up. While there are differences that no person has approved, signing the annual report or the stämmoprotokoll (signering/skicka) and uploading to Bolagsverket (bolagsverket/inlamning) are refused with ar_differenser, and every PDF of the report is a draft with the difference rows and an UTKAST watermark. The document itself — the iXBRL file and what is signed — never shows the differences.\n\nAnswers differenser [{id, text}], avtryck (a fingerprint of the differences), godkannande (who approved, when, and why) or null, giltigt (an approval exists for exactly these differences) and stoppar. Fix the cause where you can (get_bokslut_kontroller says where). APPROVING is for a person in Slutför only — the endpoint answers human_only to an agent; never ask the person for a motivation to pass on. Errors: missing_fiscal_year, invalid_enum; for a person also required, too_long, not_applicable (nothing to approve) and stale (the differences changed since they were shown).","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_arsredovisning_ixbrl","group":"arsredovisning","klass":"lasa","summary":"Render the year's annual report as an iXBRL document.","description":"Render the year's annual report as an iXBRL document.\n\nTHIS IS A DEBUGGING TOOL, NOT A FILING. Bolagsverket's completeness checks will reject it, which is expected. What it does prove is the XBRL validity and the FIGURES. Never tell anyone this file can be filed, and never offer to send it anywhere; nothing here submits.\n\nTWO AXES DECIDE WHAT YOU GET. `innehall` is WHAT is included: \"rensad\" (only concepts that have a value — this is what gets filed) or \"komplett\" (every concept in the package, xsi:nil where empty). `utdata` is HOW it is written: \"ixbrl\" or \"formular\" (the same tables with input fields instead of facts). All four combinations mean something; the defaults are rensad + ixbrl, so the plainest call gives the real document. The answer echoes `vy` so you know which you got.\n\nIn `formular` there is NO ix:header and no schemaRef — a saved form must never be mistakable for a filing. Field names are `rad_kod@kontext`, e.g. `MedelantaletAnstallda@period0`, never form-local ids, so they survive a taxonomy release and a concept that disappeared is detectable. Post them straight back to save_arsredovisning_varde as `falt`.\n\n⚠ ONLY WHAT SOMEBODY WRITES GETS A FIELD. The statements are computed from the accounts and the matrix owns them, so their cells render as TEXT with class `raknat` — unless the year is flagged manual_report. A cell without a field is not missing; it is not yours to change. Reclassify with save_bokslut_klassificering.\n\n`komplett` affects ROWS WITHIN a part, not whether a part exists. With no företrädare there is still no signature page: there is nothing to structure it around. And a row that is zero in both years is written as ZERO, not as xsi:nil — nil means the figure is absent, which is a different claim. Do not report a nil as a zero or the reverse.\n\n`delar` limits the document to the named parts (see the `delar` list in the answer for the ids). It filters PARTS, never element names: dropping one component while keeping its total would make the file lie quietly. Omitted or empty means all. Anything left out is listed in `delar_uteslutna`, which must be EMPTY for a document that is going to be filed — never file a filtered one, and never describe one as ready.\n\nA K2 annual report for an aktiebolag files against ONE entry point, se-k2-ab-risbs, which combines seven forms. `delar` lists them all with `med` (included) and `skal` (why not). Every part is built. Read `delar` before describing the document — a part that is missing is stated there, not merely absent from the file, and each `skal` means something different: \"inget att skriva\" is an empty part, \"bortvald i anropet\" is your own filter, and \"ingen kassaflödesanalys enligt inställningarna\" is a company that is not required to prepare one.\n\nKASSAFLÖDESANALYSEN: write the PARTS, the app computes the SUMS (ADR-0015 punkt 72). The taxonomy has no calculation linkbase for it, so the sums are read from the layout: före förändringar av rörelsekapital (K2: borrowed Rörelseresultat + justeringar + räntor + skatt), löpande, investerings- and finansieringsverksamheten, AretsKassaflode, and LikvidaMedel at year end (opening + AretsKassaflode + kursdifferens). In K3 also the subtotals inside the groups (rörelsefordringar, rörelseskulder, förvärv/försäljning of materiella and finansiella anläggningstillgångar).\n\nSIGNS (ADR-0015 punkt 74): 49 directed concepts must be zero or positive — Bolagsverket warns otherwise. Their name says the direction and the figure is the amount: an OUTFLOW (ErlagdRanta, BetaldSkatt, UtbetaldUtdelningKassaflode, förvärv/investeringar, lämnade tillskott/koncernbidrag/lån, AmorteringSkuld, AterkopEgnaAktier, Emissionsutgifter …) is written as a POSITIVE fact in `varden` and the app subtracts it, while the form shows it with a minus; an INFLOW (ErhallenRanta, försäljningar, UpptagnaLan, NyemissionKassaflode …) is positive too. Two-way rows — every \"Ökning/minskning\", the justeringar and the sums — carry their own sign. A negative directed figure raises the general warning kassaflode_tecken.\n\nA sum counts only when one of its parts has a value (`om_delar`): with no parts the sum IS a field and the written figure stands, so a user who only knows KassaflodeInvesteringsverksamheten can write just that. With parts, a written sum is stored but ignored. K3 offers three starting values for the löpande verksamhet — rörelseresultat (default), resultat efter finansiella poster, årets resultat — chosen with the advanced setting arsred_kassaflode_ingangsvarde; only the chosen borrowed row is shown and summed. K2 always starts from rörelseresultat. There is NO check of the analysis' likvida medel against the balance sheet — they may differ (short-term investments).\n\nWhether it is prepared at all follows from the settings — a larger company OR the voluntary checkbox arsred_kassaflodesanalys — and the answer carries `kassaflode` saying which. It is not a parameter of the call.\n\nIts likvida medel line appears TWICE, opening and closing, and the opening one sits one step back in the context series: balans1 and balans2 where the closing has balans0 and balans1. balans2 is the instant BEFORE the comparison period starts. The two rows share the balans1 cell, and only the first of them carries the input field; the second renders as text. That is not a missing field.\n\nMOVEMENT NOTES work the same way. A fixed-asset note is Ingående (bold), the changes, Utgående (bold) per group — anskaffningsvärden, avskrivningar, uppskrivningar, nedskrivningar — and Redovisat värde (bold) last, as in Bolagsverket's K2 example 1. Ingående sits on balans1/balans2, Utgående on balans0/balans1. The \"Förändringar av …\" heading is not drawn. THE BALANCES ARE COMPUTED: closing (balans1) = comparison-year opening (balans2) + changes (period1), and closing (balans0) = this year's opening (balans1, the same fact) + changes (period0). Write balans2 and the changes; a write to the balance at balans0 or balans1 is rejected with row_is_computed.\n\n⚠ SIGNS IN A GROUP AROUND A CREDIT BALANCE — accumulated depreciation and impairment — are SHOWN AND ENTERED NEGATIVE (−100 000), as Bolagsverket shows them, while the fact stays positive. In the form such cells carry data-tecken=\"vand\". Stored values and facts use the reported sign; see save_arsredovisning_varde.\n\n⚠ A MOVEMENT THAT DECREASES ITS BALANCE IS A POSITIVE FACT, SUBTRACTED: sales and disposals, reversed impairments, depreciation on revalued amounts, settled and written-off receivables, repayments, forfeited and exercised options — 134 concepts, Bolagsverket's rule (K3 warns on a negative). The form shows a sale −30 000 among the acquisition values and a reversal +20 000 among the (negative) accumulated depreciation; `varden` takes the positive fact. Reclassifications, translation differences, mergers and business combinations carry their own sign.\n\nK3 SHARES ELEVEN MOVEMENTS between notes: goodwill's depreciation and impairment of the year, and reversed impairments for nine asset types, live in the depreciation note AND in the asset's movement table. They count in the table's closing balance, are written in the asset's note, and show as a locked mirror in the depreciation note (a reversal is a negative fact, shown positive among the reversals). The number of share options is a movement table of counts, computed the same way.\n\nCOMPUTED NOTE SUMS (K3 has no calculation linkbase): a total right after its heading is computed from the lines under the heading — salaries, pensions, social costs incl. pensions, future lease payments, depreciation, impairments, reversed impairments, interest, current and deferred tax, group contributions (received − given), other appropriations. A custom line added under that heading joins the sum. The effective tax reconciliation computes tax at the statutory rate (profit before tax × rate; the rate is typed, 20.6 is only a placeholder), the reported tax (that + the material items, plus raises the tax) and its percentage. All of these are locked; writing one is row_is_computed.\n\nCHECKS (`kontroller`, and `regler` for the form's live recalculation — only for the chosen notes): besides the sums, each note ties to its statement item (not_<item>: the balance-sheet item; in K3 also the income-statement item for the result-from-holdings notes excl. and incl. impairments, interest expense, the tax-allocation reserve, the replacement fund and tax for the year; in a manual column the item is the typed value), skatt_effektiv (reported tax = tax for the year), styrelse_antal and ledande_antal (women + men = the count, only when both sides are filled), storlek_storre (the accounts exceed ÅRL 1:3 both years but the company is set as smaller), and K2 has nettoomsattning_varierar: net sales varying more than 30 percent between two of the overview's four years with an empty KommentarFlerarsoversikt (K2 5.5). A check with `vand: true` reads its difference with the opposite sign on screen. A failed check also appears in `varningar`. In `regler`, a sum with `sort: produkt|kvot` multiplies or divides its two terms; a term with `procent: true` is read as percent.\n\nLARGER AND SMALLER COMPANIES (K3): the setting arsred_storre_bolag decides. For a smaller company utdata=formular hides — with the `hidden` attribute, not removed — the EMPTY parts only larger companies must give: the payroll note beyond the average headcount, and eight directors' report headings (future development and risks, R&D, branches, financial instruments, sustainability, environmental permits, sustainability report, intangible key resources). Filled-in parts always show, and the filed document is unaffected. Which notes are larger-only: set_arsredovisning_noter, `storre`.\n\nIn formular mode the answer also carries `standardtexter` (field → suggestions) and `vagledning` (field → what the rules require), from the register for the package's family. A note's own free-text field is drawn only when the note has no other rows or the text is already filled (config not_egen_fritext).\n\nTHE NOTES ARE GATED. Only the notes chosen with set_arsredovisning_noter are rendered, in that order, numbered 1..N. No choice means no notes — not all 51. A chosen but unanswered note is left out of a rensad document and reported as not_utan_varden: an empty note in a filed document claims there is nothing to say.\n\nNote figures come from save_arsredovisning_varde, not from the accounts. The exception is a row that lives in a statement and is shown in a note as well — Goodwill is the balance sheet's line AND its movement note's total, 27 such rows in K2 — and those take their figure from where they live. Trying to type one is refused with row_is_computed, and that is the same rule seen from the other side.\n\nCustom note rows are allowed under BOTH regelverk and are rendered like any other row, tagged as an undefined concept from se-misc-base. Their field name is the ROW's `egen:` code, not the se-misc-base element: three custom rows share an element but are three rows.\n\nA COUNT has no standard XBRL unit and the taxonomy declares none, so it carries unitRef=\"antal-personer\" with the measure se-k3-type:AntalPersoner — what Bolagsverket's own examples use — and the namespace is declared on the document only when it is used. K3's unit is used under K2 as well because it is the general one: \"number of people\" covers a board's gender split, \"number of employees\" does not. Counts are written WITHOUT decimals even where the schema allows them: a mean headcount is 12, not 12,5.\n\nAMOUNTS ARE WHOLE KRONOR, ROUNDED ONCE AT THE ACCOUNTS (ADR-0029). Each account is rounded to whole kronor with the largest remainder, so the income statement adds up to the books' result rounded, the balance sheet to the books' total rounded, equity rolls forward from last year as it stands in the report, and every total is the sum of its parts as filed. A few accounts can therefore carry one krona other than plain rounding; the saldomatris marks them (Visa → Avrundning i handlingen), and get_bokslut_matris gives them as `avrundning` {nu, nu_vanlig, fore, fore_vanlig} on the account. When you fill in a note, take the amounts the report uses, not your own rounding of the exact balances. The rule is locked on the year when it is first sent for signing; a year signed before the rule existed keeps `cell` (each amount on its own). Only ratios (xbrli:pure) keep decimals — a solidity of 0,42 is 0 when rounded; amounts say decimals=\"0\".\n\nThe förvaltningsberättelse carries \"Allmänt om verksamheten\" from storage — write it with save_arsredovisning_varde, it is not an argument here. Its last line is \"Säte: <ort>\", tagged se-cd-base:ForetagetsSate, drawn from the setting styrelsens_sate (ÅRL 2:5, K2 5.2) — change the setting, never write the säte into the text.\n\nFLERÅRSÖVERSIKT shows up to seven columns, one context each: period0..period6 for durations, balans0..balans6 for instants, in the same table. The periods come from the arsred_jamfor_2..7 settings and the count from arsred_flerarsoversikt_ar. ⚠ The numbering is offset by one: arsred_jamfor_2 is LAST year, which is period1. A gap stops the table — the periods are numbered slots, not a list, and a time axis with a hole reads wrong. Column headings are plain years here, unlike the statements.\n\nFour rows are borrowed from the statements (Nettoomsattning, Rorelseresultat, ResultatEfterFinansiellaPoster, Tillgangar — the last labelled Balansomslutning here). For this year and last they are computed from the accounts; further back there are no accounts, so they are typed.\n\nKEY RATIOS have a mode each (ADR-0053), a year setting arsred_nyckeltal_<name> (soliditet, kassalikviditet, rorelsemarginal, avkastning_eget_kapital, avkastning_totalt_kapital, avkastning_sysselsatt_kapital): rakna — the program computes this year and last from the statements, never stored, and a typed value in a cell wins; egen — the person types it; dold — not in the report. Without a stored mode: a locked year or a row with any typed value is egen, otherwise soliditet is rakna and the rest dold. K2's soliditet (punkt 5.5 c) cannot be dold; avkastning_sysselsatt_kapital is never computed. The computed ratios' formulas are the default text of Nyckeltalsdefinitioner until the person writes their own. The mode is the person's choice — companies define ratios differently — so change it only when asked; never overwrite a typed ratio.\n\nFÖRÄNDRINGAR I EGET KAPITAL is a cross-table: columns are the equity items with a balance, rows every movement the taxonomy has (new issue, shareholder contributions, own shares, merger difference, correction of errors …), and every cell is its own concept (dimensions are forbidden). Opening and closing balances are the balance sheet's, typed comparative figures included. The movements are NOT in the books: a stämma's decision is only a different opening balance. They are written with save_arsredovisning_varde on the movement concept @period0 (corrections of the opening balance @balans1), e.g. ForandringEgetKapitalBalanseratResultatBalanserasNyRakning.\n\nA TRANSFER WITHIN EQUITY nets to zero (ADR-0015 punkt 75): fondemission, balansering i ny räkning, täckning av förlust, förändring av reservfond and kapitalandelsfond, upplösning of uppskrivningsfond and fond för utvecklingsutgifter, aktivering av utvecklingsutgifter, minskning av aktiekapital. Write BOTH sides, or Totalt — and in the group also the owners' share — is not zero and the answer warns (Bolagsverket warns too). Minskning av bunden överkursfond must not be negative in Totalt.\n\nUntil something is written the table PROPOSES last year's disposition: last year's ForslagDisposition* (utdelning, reservfond) from last year's annual report in the app, and the rest of last year's result carried forward — all of it when there is no such report. A proposal is not stored and does not claim the stämma followed the board; ask the user whether it matches the decision. Other rows — taxonomy rows and custom rows for what the taxonomy lacks — are added with set_arsredovisning_ek_rader. Every column is reconciled — opening + movements = closing — and a residual is reported in `varningar` naming the column and the amount. Report the residual; never adjust a figure to make the table close.\n\nCOMPARISON YEAR: with the advanced setting arsred_ekpy the same table shows both years — the comparison year's opening balance (@balans2), its movements (@period1), its closing balance (@balans1, which is also this year's opening), then this year. The @balans2 balances are proposed from last year's annual report in the app — its comparison column under last year's own settings, last year's accounts where nothing was typed — or written with save_arsredovisning_varde on the balance-sheet item @balans2. Its residuals are reported as 'Eget kapital, jämförelseåret, …'.\n\nSIGNS follow the taxonomy's standard label. A concept labelled 'Minskning av …' (a dividend, own shares acquired) is stored and reported POSITIVE and subtracted by the reader — a dividend of 1 099 000 is `1 099 000`, as in Bolagsverket's example 1. A concept labelled 'Ökning (minskning) av …' (carried forward, change in reserve fund) carries its sign: last year's loss carried forward is +13 411 in årets resultat and −13 411 in balanserat resultat. The form shows every movement as its effect on the column, and posting it as `falt` converts it back.\n\nRESULTATDISPOSITION has two halves with different origins. What stands at the stämma's disposal is CALCULATED from the balance sheet and is always written. The board's proposal is a DECISION and is NOT a parameter of this call: write it with save_arsredovisning_varde on ForslagDispositionUtdelning@balans0, …Fondemission@balans0, …AvsattningReservfond@balans0 and …BalanserasINyRakning@balans0. Vinstutdelningen may instead be split into ForslagDispositionUtdelningAnnanUtdelning and …AterbetalningVillkoratAktieagartillskott; then ForslagDispositionUtdelning is their sum and is computed (Bolagsverket's calculation says so). As a parameter it existed only for as long as somebody sent it, and the four rows had no field in the form.\n\nThe proposal must dispose of the whole free equity (ÅRL 6:2). In a rensad document the parts must sum to FrittEgetKapital or the proposal is not written at all and `varningar` says why; in komplett the rows stay so a half-typed proposal does not vanish mid-entry, and the warning says how far off it is. Fix the figures with the person; do not round one to make it fit. The SUM is calculated — never write ForslagDisposition itself.\n\nOrder is ÅRL 2:1 — förvaltningsberättelse, resultaträkning, balansräkning, noter, underskrifter. The INCOME STATEMENT COMES FIRST. Do not reorder it to match the matrix, which lists br before rr.\n\nWHY IT EXISTS: the matrix carries the bookkeeping's signs (revenue is a negative credit balance) and iXBRL carries the report's (the same revenue is reported positive). The conversion is one rule — flip every concept whose taxonomy `balance` is credit — and a rendered file is the only thing that proves it, because a machine other than ours can read it. So the figures here will legitimately differ in sign from get_bokslut_matris. That is not a discrepancy; explain it rather than reporting it as one.\n\nThe document is in `dokument` — NOT `ixbrl`, because in formular mode it is not iXBRL. `fakta` counts the facts written. `utelamnade` lists lines that produced none and why. `varningar` is empty in the normal case — an entry there is a structural problem in the package, not in the client's data, and is worth reporting verbatim.\n\n`jamforelsear` is null when the year has no predecessor. Comparison figures may still exist as `prev_ub`, but without a previous fiscal year there is no PERIOD to attach them to, so they are left out rather than given an invented one.\n\nLines that are zero in both years are omitted, as ÅRL 3:4 allows.\n\nIn `rensad` an empty cell is left EMPTY, not written as xsi:nil — nil says the figure is absent, which is a claim, and Bolagsverket's own example omits the fact instead. `komplett` is the debugging view and nils everything, which is the point there.\n\nA renamed line carries its new wording as a LogChangedLabel footnote on the fact. An ABSTRACT heading cannot: it may not be reported as a fact at all, so `fromRefs` has nothing to point at and the rename is invisible to any machine reading the file. That is open question 71 and is unresolved against Bolagsverket — say so if asked.\n\nA custom line is tagged as an odefinierat begrepp from se-misc-base, chosen by the line's `balans`. The entry point referenced for those is read from the taxonomy package's directory tree and has not been confirmed by Bolagsverket.\n\nSIGNATURES come from the year's persons (get_bokslut_personer). Each företrädare is a tuple of given name, surname and role, drawn two or three to a row with the role under the name. A legal person (juridisk_person) stands above the name, followed by 'genom'; in a handelsbolag/kommanditbolag it is tagged ForetraddJuridiskPersonAgareHandelsbolag in the tuple. Only those who sign are included — a styrelsesuppleant only when `signs_ar` is set, a kommanditdelägare only when arsred_kb_endast_komplementar is off, and with anknuten förvaltning the förvaltare instead of the board. The setting arsred_rollvisning decides which roles are shown: alla (default), ledning (chair, CEO, liquidator) or inga; a role that is not shown writes no role fact. Before the names: the day the content was decided (arsred_innehall_bestamt, tagged UndertecknandeArsredovisningDatum), a blank line, and the place of signing (arsred_ort_paskrift, optional) as plain untagged text — the concept is outside the K2 presentation. Each person's sign_date is tagged UndertecknandeDatum in the tuple, under the title. With digital_signering_alltid in config/arsredovisning.php (true for now) — or a Scrive signing of the annual report in draft/sent/completed, or digital_signering=true on the render — the line \"Den dag som framgår av min digitala signatur.\" (\"våra digitala signaturer\" for several signers) stands untagged on its own line before the names. The content date reads \"Årsredovisningens innehåll bestämdes <date>.\" With arsred_euro every amount carries iso4217:EUR and the reporting currency says euro; no figure is converted — the figures are the company's own. THOUSANDS: arsred_tusental shows and tags every monetary amount in thousands (scale=\"3\", decimals=\"-3\"; in euro HUNDREDS, scale 2, under both regelverk — K2 3.9), and arsred_tusental_flerar only the multi-year overview. Storage is always whole units — the form stays in whole kronor. Under the konto rule the thousands are distributed like the kronor (ADR-0029 punkt 6): the tops (the year's result, the balance total) are the books' amounts rounded to thousands, and every total in the package's calculation relations is the sum of its parts as filed; the multi-year overview carries the same thousands as the statements. The checks are in kronor. The resultatdisposition is always whole. The document opens with who issues it (\"Styrelsen och verkställande direktören avger …\"), the contents, and \"Om inte annat särskilt anges, redovisas alla belopp i …\" naming the currency and unit (K2 3.8–3.9). THE FASTSTÄLLELSEINTYG stands under the table of contents for an aktiebolag, by default and whether or not the stämma has been held — except with originalsignering=true, the document sent to Scrive for the board to sign before the stämma (that also turns on the digital line). It says the räkningar were adopted at the stämma (stamma_datum), the stämma's decision on the disposition (stamma_disposition_beslut: godkant by default, or ej_godkant with stamma_disposition_beslutstext — 'vinstdisposition', or 'behandling av ansamlad förlust' when the free equity is negative), the certification that the copies match the originals, and the person marked signs_fastst with today's date. With arsred_koncernredovisning it uses the koncern entry point and adds the koncern sentence. `faststallelseintyg` in the answer says whether it is in the document. The app's PDF (arsredovisning/pdf, not a tool) answers pdf_engine_missing when wkhtmltopdf is not installed on the server. THE AUDITOR'S PÅTECKNING follows the board's names whenever a revisor or medrevisor is listed — there is no separate 'is it audited' setting: \"Min/Vår revisionsberättelse har lämnats <revisor_datum_underskrift>.\" (one date for all auditors), the firm (revisor_bolag, ValtRevisionsbolagsnamn), the digital line, and each auditor with the title under the name (person field `title`, empty = Auktoriserad revisor). \"Vår\" with a firm or several auditors. The statement comes from the setting revisor_pateckning (ren by default; modifierad; eight avstyrkt/varken eller). That choice is the AUDITOR's — never set it to anything but what their revisionsberättelse says, and ask rather than guess. revisor_bolag is optional — an auditor may be elected as a person. `pateckning_utan_datum` says the date is missing.\n\nThis tool does NOT pin the year's package the way get_bokslut_matris does. Rendering a file is looking, not starting work in the year.\n\nFor whether the balance sheet balances, use get_bokslut_matris — `summor.br_diff` and `summor.alla_konton` are where it is computed. Do not recompute it from this document.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, no_package (organisationsform or regelverk is not chosen — say which, do not assume aktiebolag/K2), package_too_old (the year's matrix package predates the renderer and lacks namespaces, entry point or period type; it must be rebuilt with app/packages/build/build_matris.php — report it, there is no way around it), missing_corporate_id (the company has no organisationsnummer, which is the entity every fact in the file is about), invalid_amount (a disposition figure is not a number; the field name says which), unknown_content, unknown_output, unknown_part (the message lists the valid ids), invalid_enum (sprak), not_applicable (sprak other than sv with utdata=formular — the translation mode in the form is not built yet), internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"innehall":{"type":"string","enum":["rensad","komplett"],"description":"What is included. rensad (default) = only concepts with a value, which is what gets filed. komplett = every concept in the package."},"utdata":{"type":"string","enum":["ixbrl","formular"],"description":"How it is written. ixbrl (default) = facts. formular = the same tables with input fields, and no XBRL header."},"delar":{"type":"array","items":{"type":"string"},"description":"Limit to these parts, by id. Omitted or empty means all. A filtered document can never be filed — see delar_uteslutna."},"disposition_foregaende":{"type":"object","properties":{"utdelning":{"type":"number"},"fondemission":{"type":"number"},"reservfond":{"type":"number"},"balanseras":{"type":"number"}},"additionalProperties":false,"description":"DEPRECATED — write the movements with save_arsredovisning_varde instead, so that the form and every later rendering show them. LAST year's decided appropriation, for this call only: overrides both the stored movements and the proposal. Amounts are positive; dividend and reserve fund are taken from årets resultat."},"originalsignering":{"type":"boolean","description":"true for the document the board signs before the stämma: no fastställelseintyg, and the digital-signature line"},"intyg":{"type":"string","enum":["digitalt","papper","inget"],"description":"Which fastställelseintyg. digitalt (default for aktiebolag) = the tagged one that is filed digitally. papper = Bolagsverket's paper template under the table of contents, with the sentence certifying the copy and lines for place, date, signature and name — aktiebolag, ekonomisk förening and bostadsrättsförening. inget (default for other forms) = without. not_applicable when the form has no such certificate. `intyg` in the answer says which."},"sidindela":{"type":"boolean","description":"true to get the document PAGINATED as it is filed: div.ar-sida pages with a header (company name, orgnr, 'n (N)'), breaks measured with wkhtmltopdf — Bolagsverket's engine. The first call after a change takes seconds. `sidindelning` in the answer gives the page count, warnings about a page that overflows, and `avsnitt` — every section with its page and why it starts one (see set_arsredovisning_sidbrytning). ixbrl output only."},"sprak":{"type":"string","enum":["sv","en"],"description":"The document's language (ADR-0023). sv (default) is the original — the only one that is tagged and can be filed. en is a TRANSLATION: the same rendering with no iXBRL at all (no header, no facts — `fakta` is 0), lang=\"en\", and a note at the top that the Swedish original prevails. Never file or present it as the filed document. The program's own texts come from the English register and the line headings from the taxonomy's English labels (same label role as the Swedish). What has no translation stays in Swedish. The client's own translations (set_arsredovisning_oversattning) come first. `oversattning.antal` counts the visible texts (totalt, klara, saknas, inaktuella) and `oversattning.saknas` lists those printed in Swedish, as items of that tool's list. ixbrl output only."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_avstamning","group":"avstamning","klass":"lasa","summary":"The year's avstämning (reconciliation) per balance-sheet post (ADR-0033): for each BR post with a balance this year or last, its accounts, the person's kommentar and specification rows, and the Ospecificerat belopp = the post's balance minus the specified rows.","description":"The year's avstämning (reconciliation) per balance-sheet post (ADR-0033): for each BR post with a balance this year or last, its accounts, the person's kommentar and specification rows, and the Ospecificerat belopp = the post's balance minus the specified rows.\n\nAMOUNTS ARE IN ÖRE with the BOOKKEEPING sign, as in the saldomatris and the SIE file: debit plus, credit minus — a skuld of 45 000 kr is -4500000, and `kredit` marks posts whose normal side is credit (equity and liabilities). The balance is the ADJUSTED one, after bokslutsjusteringar, read from the saldomatris every time — never stored.\n\nPer post: konton[{konto, namn, saldo, fjol, specificerat, ospecificerat}], kommentar, rader[{id, text, belopp, konto, kalla, kalla_saknas, kalla_osparad, bilagor[{id, namn, mime, storlek, skapad, av}]}], specificerat, ospecificerat, ej_fordelat (rows without an account when the post has several), ansvarig/ansvarig_namn, klar{av, namn, at, andrat} (andrat: the balance changed after it was ticked).\n\nej_kopplad: true for a reconciliation whose post no longer exists in the matrix (emptied, or its accounts moved). It is kept, never deleted by a matrix change; move_avstamning moves it to a post. A row tied to an account follows the account when it moves between posts.\n\n`kallor` are the calculations a row can take its amount from: 'skatt' (income tax from the tax calculation), 'periodiseringsfond' (one fund — the row MUST carry the fund's account, without one it is 0) and 'skatteavstamning' (the tax reconciliation's total, the debt or claim per the balance sheet date — a row WITHOUT an account; kalla_osparad: the tax reconciliation is not saved and the amount comes from its suggestions); `anvandare` who can be ansvarig; `paborjad` whether the year has any reconciliation (the step is optional; the checks only warn once it has started).\n\nAttachments are listed per row (bilagor) but their contents are NOT readable by agents (open question 74); upload_avstamning_bilaga attaches one.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"rad_kod":{"type":"string","description":"Only this post (its rad_kod)"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_avstamning_arbetspapper","group":"avstamning","klass":"lasa","summary":"The avstämning's working papers as a PDF (ADR-0033): an overview of every balance-sheet post (balance, specified, unspecified, ansvarig, klar) and then each reconciled post — the account table, kommentar, the specification with the attachments' numbers (B3.2 = post 3, file 2) and the Ospecificerat belopp. rad_kod gives one post only. Returns filnamn and the PDF as base64.","description":"The avstämning's working papers as a PDF (ADR-0033): an overview of every balance-sheet post (balance, specified, unspecified, ansvarig, klar) and then each reconciled post — the account table, kommentar, the specification with the attachments' numbers (B3.2 = post 3, file 2) and the Ospecificerat belopp. rad_kod gives one post only. Returns filnamn and the PDF as base64.\n\nThe ZIP with the attachments themselves is for the person in the interface; agents do not read attachments (open question 74).\n\nErrors: unknown_post, pdf_engine_missing, missing_fiscal_year, unknown_fiscal_year, internal_error. (The interface's ZIP can also answer zip_failed — ours to fix.)","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"rad_kod":{"type":"string","description":"Only this post"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_avstamning_differens","group":"avstamning","klass":"lasa","summary":"The bokslutsjustering that would remove a post's Ospecificerat belopp (ADR-0033) — a PROPOSAL in save_bokslut_justering's form (booking_date = the year's last day, category ovrigt, description, rows). The difference is taken off the post's account(s); the motkonto gets the opposite amount. The person ALWAYS chooses the motkonto — never pick one yourself; ask. resultatkonto: true when the motkonto changes the year's result (and the tax is recalculated) — say so.","description":"The bokslutsjustering that would remove a post's Ospecificerat belopp (ADR-0033) — a PROPOSAL in save_bokslut_justering's form (booking_date = the year's last day, category ovrigt, description, rows). The difference is taken off the post's account(s); the motkonto gets the opposite amount. The person ALWAYS chooses the motkonto — never pick one yourself; ask. resultatkonto: true when the motkonto changes the year's result (and the tax is recalculated) — say so.\n\nThen book it with save_bokslut_justering (dry_run first), only after the person has said yes to exactly that entry. A difference is often a sign of something to find, not to book away.\n\nkonto: when some rows have no account, which account the difference is on (default: the one with the largest unspecified amount; konto_valbart says so).\n\nErrors: missing_post, unknown_post, nothing_to_book (already fully specified), unknown_account, invalid_account, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"rad_kod":{"type":"string","description":"The post, from get_avstamning"},"motkonto":{"type":"string","description":"The counter account the person chose (four digits)"},"konto":{"type":"string","description":"The post's account the difference is on, when ambiguous"}},"required":["client_id","fiscal_year_id","rad_kod"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_avstamning_filer","group":"avstamning","klass":"lasa","summary":"The client's avstämning attachments from all fiscal years (ADR-0033): for each file its name, type, size, the year it first belonged to (`ar`, balance date) and where it is used (anvands[{rad_id, rad, post, ar}]). Use it to link a file that already exists — last year's registreringsbevis, a contract — instead of uploading it again (link_avstamning_bilaga). Metadata only; agents do not read the contents.","description":"The client's avstämning attachments from all fiscal years (ADR-0033): for each file its name, type, size, the year it first belonged to (`ar`, balance date) and where it is used (anvands[{rad_id, rad, post, ar}]). Use it to link a file that already exists — last year's registreringsbevis, a contract — instead of uploading it again (link_avstamning_bilaga). Metadata only; agents do not read the contents.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID (any of the client's)"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_avstamning_forslag","group":"avstamning","klass":"lasa","summary":"Suggested specification rows for a balance-sheet post (ADR-0033): from the tax calculation (each periodiseringsfond on its account; the tax reconciliation's total as one row without an account when the post holds a tax account and the reconciliation is saved, otherwise the income tax on 2512) and last year's rows when the post's balance is unchanged and last year's reconciliation specified it fully (with their attachments). Nothing is saved. To use them, send them with save_avstamning — kalla and konto as given, and for a row from last year lanka_dokument with its attachments' ids — together with the post's existing rows.","description":"Suggested specification rows for a balance-sheet post (ADR-0033): from the tax calculation (each periodiseringsfond on its account; the tax reconciliation's total as one row without an account when the post holds a tax account and the reconciliation is saved, otherwise the income tax on 2512) and last year's rows when the post's balance is unchanged and last year's reconciliation specified it fully (with their attachments). Nothing is saved. To use them, send them with save_avstamning — kalla and konto as given, and for a row from last year lanka_dokument with its attachments' ids — together with the post's existing rows.\n\nErrors: missing_post, unknown_post, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"rad_kod":{"type":"string","description":"The post, from get_avstamning"}},"required":["client_id","fiscal_year_id","rad_kod"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_avstamning_tidigare_ar","group":"avstamning","klass":"lasa","summary":"The client's fiscal years before this one, latest first, to copy the avstämning from (ADR-0033): id, start, slut, foregaende (the year ending the day before — the default) and poster (how many posts have rows that year).","description":"The client's fiscal years before this one, latest first, to copy the avstämning from (ADR-0033): id, start, slut, foregaende (the year ending the day before — the default) and poster (how many posts have rows that year).\n\nErrors: missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year to copy TO"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokforingsorder","group":"import","klass":"lasa","summary":"The year's bokföringsorder: the bokslut journal entries, ready to be booked in the client's bookkeeping program (ADR-0019).","description":"The year's bokföringsorder: the bokslut journal entries, ready to be booked in the client's bookkeeping program (ADR-0019).\n\n`order.verifikat` are the PARTS — one per justering, in number order (A1 …). Rows are in öre (`belopp_ore`), debit positive and credit negative, as in SIE. Each part says whether it has been booked in a program (`posted_ref`) and whether the justering was changed afterwards (`andrad_efter`) — say so when it is true: the bookkeeping program no longer matches.\n\n`samlat` is how the order LEAVES the program: ONE voucher dated the last day of the year, rows kept separate (not netted per account), each row's text starting with its part's number (\"A1 Revision\"). That is what the SIE file holds and what a bookkeeping program receives.\n\nformat='sie' adds the SIE 4I file (PC8, base64, `filnamn` ending .si); series and voucher number are empty for the receiving program to assign. format='pdf' adds the PDF, with each part on its own and \"Upprättad av\". Neither books nor marks anything.\n\nA part's `posted_ref` is '<program>:<id>:<number>'. In Bokföring Online the order is sent as a DRAFT: the number is empty until the customer books it there. get_bokforingsorder_status reads whether a draft has been booked or deleted since.\n\nBOOKING IT IN THE CLIENT'S PROGRAM is deliberately not a tool: a person does it in the interface (Bokföringsorder card → Bokför i Oqto / Bokför i Fortnox / Skicka till Bokföring Online), because it changes the client's bookkeeping. Tell the person that is where it happens, and that a Bokföring Online draft can be taken back from there. Oqto and Fortnox book directly, with no draft. For reference, the interface's errors there: nothing_to_post (all parts already booked), provider_year_locked (the year is locked in the program), unknown_series, already_in_progress, outcome_unknown (no answer came back — reopening the dialog looks for the voucher in the program and marks the parts right), orgnr_mismatch, no_matching_year and the provider_ errors of connect_bokforingsprogram. Fortnox does not report a locked period beforehand: it rejects the voucher with provider_validation and its own message, and nothing is booked.\n\nErrors: no_adjustments (format sie/pdf on a year without justeringar), unbalanced, pdf_engine_missing, invalid_enum, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"format":{"type":"string","enum":["json","sie","pdf"],"description":"'sie' adds the SIE 4I file, 'pdf' the PDF"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokforingsorder_status","group":"import","klass":"lasa_ute","summary":"Follow up the bokföringsorder's drafts in the client's bookkeeping program (ADR-0020).","description":"Follow up the bokföringsorder's drafts in the client's bookkeeping program (ADR-0020).\n\nBokföring Online and Spiris take the order as a draft; for Oqto, Fortnox and Bokio the answer is empty and the program is not asked. For each draft e-revisor sent this year, the program is asked once:\n  utfall 'utkast' — still waiting to be booked there.\n  utfall 'bokford' — the customer booked it; `nummer` is its voucher number, now stored.\n  utfall 'raderat' — the customer deleted it; the parts are released and can be sent again.\n`andrat` is true when any part's status changed — read get_bokforingsorder again then.\n\nIt updates e-revisor's own marking of the parts to match the program; it never changes anything in the program.\n\nErrors: integration_not_connected, missing_credentials, invalid_credentials, credentials_unreadable, provider_forbidden, provider_unreachable, provider_rate_limited, provider_error — see connect_bokforingsprogram. missing_provider, unknown_provider, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"provider":{"type":"string","description":"The program key, e.g. 'bokforing_online'"}},"required":["client_id","fiscal_year_id","provider"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokforingsprogram","group":"import","klass":"lasa","summary":"The bookkeeping programs e-revisor can connect to, and this client's connections.","description":"The bookkeeping programs e-revisor can connect to, and this client's connections.\n\nEvery program in the register is listed, including those not built yet: `kan` is empty for them. `kan` holds import_sie (balances can be read in directly) and bokfor_order (the bokföringsorder can be booked back — by a person in the interface). `aktivering` says how a connection is made: company_id (Oqto), api_nycklar (Bokföring Online) or oauth (Fortnox: a system administrator approves e-revisor in Fortnox; Spiris and Bokio: a person logs in and approves — always in the browser, never through you; connect_bokforingsprogram answers connect_in_browser). An oauth connection carries the company's name and organisationsnummer in `settings` (bolag_namn, bolag_orgnr).\n\n`koppling.har_uppgifter` is true when API credentials are stored for the connection. The credentials themselves are never returned — not to you, not to the interface.\n\n`koppling` is null when the client is not connected. When it is, `status` is 'aktiv' or 'fel', and on 'fel' `last_error` says why the last call failed — read it before trying again; it usually needs a person to act in the bookkeeping program.\n\nErrors: internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokforingsprogram_bolag","group":"import","klass":"lasa_ute","summary":"The companies the client's stored Bokföring Online credentials reach — to pick the one to connect (connect_bokforingsprogram with its `id` as external_id).","description":"The companies the client's stored Bokföring Online credentials reach — to pick the one to connect (connect_bokforingsprogram with its `id` as external_id).\n\nOnly programs connected with API credentials (`aktivering` api_nycklar), today Bokföring Online. Uses the STORED credentials only: new ones are entered by the person in the interface, never through you. Fortnox has no list: one approval is for exactly one company, and which one is in the connection (get_bokforingsprogram) — provider_not_available.\n\nThe company with the client's organisationsnummer comes first; `forvalt` is its id when there is exactly one. `valbar` is false for a company without an active licence or with another organisationsnummer than the client, and `skal` says why. Only offer valbar companies. Nothing is saved.\n\nErrors: missing_credentials, invalid_credentials, credentials_unreadable, encryption_not_configured, provider_forbidden, provider_unreachable, provider_rate_limited, provider_error — see connect_bokforingsprogram. missing_provider, unknown_provider, provider_not_available, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"provider":{"type":"string","description":"The program key: 'bokforing_online' or 'accounted'"}},"required":["client_id","provider"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokslut_importer","group":"import","klass":"lasa","summary":"The import history for a fiscal year: whether the bookkeeping has been read in at all, from what, and when.","description":"The import history for a fiscal year: whether the bookkeeping has been read in at all, from what, and when.\n\nCheck this first when figures look wrong or missing. An empty list means nothing has been imported and every balance question is unanswerable — say that instead of reporting zeros.\n\nFailed runs stay in the list with `message` giving the reason: a file for the wrong company, an unbalanced file, something that would not parse. `latest_ok` is the run the current balances came from.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"limit":{"type":"integer","description":"How many runs, newest first (default 20)"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokslut_kontoplan","group":"bokslut","klass":"lasa","summary":"The chart of accounts for a fiscal year: the BAS plan, the client's own accounts, and the accounts that actually carry a balance.","description":"The chart of accounts for a fiscal year: the BAS plan, the client's own accounts, and the accounts that actually carry a balance.\n\nCall this before proposing an account number for a bokslut journal entry. Never invent one — a plausible-looking account that does not exist in this year produces an entry nobody can trace.\n\n`source` says where each came from: saldo (it has a balance in this year), custom (the client's own) or bas. `has_balance` is the useful one — an adjustment almost always touches an account already in the year, and one that does not is worth mentioning, because it will not appear in the saldomatris.\n\nThe BAS year follows the fiscal year's START date, and when no plan exists for it the nearest is used.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokslut_kontroller","group":"bokslut","klass":"lasa","summary":"Run the logical checks for one client and fiscal year and return the findings: what looks WRONG, as opposed to what is merely not filled in yet.","description":"Run the logical checks for one client and fiscal year and return the findings: what looks WRONG, as opposed to what is merely not filled in yet.\n\nEach finding carries kod, niva, steg, ankare, message, kalla and detalj. Reason about `kod` and `detalj`; `message` is Swedish prose written for a person.\n\nTHREE LEVELS, AND THEY MEAN DIFFERENT THINGS:\n  error   — cannot be right. The deliverable is not ready to file. It never blocks a save, and you must not refuse to write a value because of one.\n  warning — may well be right; worth a look. A late stämma is unlawful but it is also a fact, and a year closed after the deadline still has to be possible to produce.\n  info    — not filled in yet. This is the normal state for most of the year and is the same count as `readiness` in get_bokslut_settings, seen per step instead of per deliverable. Do not add the two together.\n\nWHERE THEY COME FROM (one list, the same as the left menu's marks): the year's settings, the saldomatris and import (bokslut.filimport), the tax calculation together with the return file (bokslut.berakning — only once the calculation has been saved for the year), and the annual report's own checks (arsredovisning.kontrollera — only once something is saved in it).\n\nTHE CODES ARE A CLOSED SET:\n  ar_kontroll_stammer_inte — step arsredovisning.kontrollera. One of the annual report's checks does not add up (a note against its item, a sum against its parts, a movement table); detalj.kontroll, detalj.differens per context, detalj.text. The same checks as get_arsredovisning_ixbrl's kontroller. detalj.tom true: a selected note with nothing filled in — the difference is the whole item. The program never fills note amounts; ask the person, or fill them from the accounts with save_arsredovisning_varde if they ask you to. Three kinds are warnings only and never hold up signing or upload: kassaflode_tecken (a cash-flow amount with the wrong sign — Bolagsverket accepts it and it can be right, e.g. a tax refund larger than the tax paid), a required note not chosen (personalkostnader_utan_not and the church's note checks), and K2's net sales varying over 30 % without a comment (nettoomsattning_varierar). Everything else that does not add up holds them up.\n  ar_gar_inte_ihop — step arsredovisning.kontrollera. The annual report's rendering found something that does not add up; the text is in message.\n  ar_verksamhet_saknas — warning, step arsredovisning.kontrollera. The förvaltningsberättelse has no overview of the business (ÅRL 6 kap. 1 §): the text detalj.rad_kod (AllmantVerksamheten in K2, VerksamhetenArtInriktning in K3) is empty. Ask the person what the company does, or write a draft for them to read, and save it with save_arsredovisning_varde on period0. Not a difference; it does not hold up signing.\n  ar_noter_ordning — info, step arsredovisning.kontrollera. The chosen notes are not in the order of the items they belong to (ÅRL 5 kap. 3 §; K3 8.2, K2 18.2: principles, estimates, notes to items in the order of the statements, other notes). Information, not an error. set_arsredovisning_noter with ordna: true reorders them — ask the person first, it renumbers the notes.\n  ar_nyckeltal_avviker — info, step arsredovisning.kontrollera. A key ratio typed in the multi-year overview (detalj.rad_kod) differs by more than one percentage point from the program's computation for the same year (detalj.avvikelser: ar, eget, raknat, in percent). Often a typo; the company may also define the ratio its own way, and then the definition belongs in Nyckeltalsdefinitioner. Ask the person; never overwrite their figure.\n  ar_not_tom — warning, step arsredovisning.kontrollera. A chosen note with nothing filled in (detalj.not) and no item to check it against — medelantalet anställda (ÅRL 5 kap. 20 §; NotPersonal in K3), ställda säkerheter, a text note. Read its rows with get_bokslut_matris not: '<kod>', fill what the books support (the server instructions say how), or ask the person whether the note should go. A note with an item is reported as ar_kontroll_stammer_inte with detalj.tom instead.\n  datumordning — two dates in the annual report's chain are in the wrong order. The chain is: fiscal year end, then arsred_innehall_bestamt, then the board's signatures (sign_date per person), then the auditor's report, then the stämma, then the fastställelseintyg. Every comparison allows the same day — everything signed in one sitting is the normal case in a small company, not an error. detalj.regel names the rule and detalj.vanster/hoger give the two dates compared.\n  datumfrist — a statutory deadline counted from the year end is exceeded. Always warning. detalj.hoger carries the last permitted day.\n  jamforelsear_avviker — a comparison year's period differs from a fiscal year the program holds with the same end date. Advisory: the typed period may be the right one and the program's wrong. Do not silently correct it.\n  omvant_saldo — a balance-sheet post on the wrong side (asset in credit, liability in debit; eget kapital exempt). detalj gives rad and belopp. Usually a misclassification — point it out. Move it only as the server instructions allow — and when the comparison year was right, type its figures (balans1) so the move does not put them wrong.\n  fjol_matris_avviker — last year's 'efter justering' in the program differs from this year's comparative figures for the same accounts. detalj gives rad, konton and differens. Usually last year's adjustments were never booked.\n  utdelning_skattefri_kontrollera — step bokslut.berakning. Dividends booked on 8010/8012 and 8110–8113 (and 8210/8212, other companies) differ from INK2 4.5b (dividend not taxable). detalj gives koncern_intresse_kr, andra_kr and falt_kr. The field is never filled automatically: dividends on näringsbetingade shares are tax-free, but shares in foreign companies may not be. Ask the person; never write 4.5b yourself without their decision.\n  skatt_att_overvaga — info, step bokslut.berakning. The books have a posting where the tax result often differs from the booked one: dividends, sale, write-down or reversal on financial assets or property, sale of other fixed assets (3970–3973) or a revaluation (2085). One finding per group: detalj.grupp, rubrik, belopp, riktning (vinst/forlust or null), konton and falt (the year's fields, key → punkt). Information only, never an error: the program does not know whether the tax treatment is right. Mention it to the person; never fill the fields yourself on its strength.\n  matris_alla_konton — error, step bokslut.filimport. The sum of every account after adjustments is not zero (detalj.summa): the import is incomplete or an adjustment does not balance.\n  matris_balanserar_inte — error, step bokslut.filimport. The balance sheet does not balance after adjustments, and unclassified accounts do not explain it (detalj.differens, resultatrakning, bokat_resultat). With the result booked on 8999 it is usually booked TWICE — the company's own booking and the tax calculation's; the fix is the reversal in aretsresultat_redan_bokfort, saved by the person with the button in Beräkning. Do not save it yourself.\n  matris_fjol_alla_konton — warning, step bokslut.filimport. The file's comparative figures (prev_ub) do not sum to zero: they are incomplete. detalj.summa.\n  matris_fjol_balanserar_inte — warning, step bokslut.filimport. Last year's balance sheet in the file does not balance (detalj.differens, resultatrakning, bokat_resultat): last year was probably not closed correctly in the books. It can be fine when the bookkeeping program closes the year in a later period and this year's figures balance — ask, do not adjust. Neither is raised when fjol_resultat_obokat or fjol_matris_avviker already is.\n  fjol_resultat_obokat — last year's result is not transferred to equity (no 8999/2099) in the file's comparative balances, so the comparison balance sheet is off by exactly that result. detalj.resultat is the amount. The program does not adjust: tell the person to close last year in the bookkeeping and re-import, or type in the comparative figures.\n  avstamning_ospecificerat — warning, step bokslut.avstamning. One or more balance-sheet posts have an Ospecificerat belopp (balance minus specification ≠ 0). Only given once the year has a reconciliation started — the step is optional. detalj.poster lists rad_kod, etikett and ospecificerat_ore; get_avstamning shows the posts.\n  uppgift_saknas — a required field or person is missing. detalj.handlingar says which deliverables it holds up. Also when signers of the annual report have no påskriftsdatum (ankare.persons sign_date; detalj.utan_datum of detalj.undertecknare): Bolagsverket needs the dates for digital filing, and signing in the program fills them in when it completes — never invent one.\n  samband_foraldralost — an account is classified to a line or a declaration field that the package no longer has, usually after a new taxonomy edition renamed it. detalj.sort is 'rad' or 'falt'. The package default applies until someone chooses again, so the report still adds up — what was lost is a decision somebody once made. That is why it is a warning and not an error.\n  konto_oklassificerat — an account carries a balance but belongs to no line in the annual report, so the report would not add up. detalj gives konto, belopp_ore, sektion (br/rr), and typ when the package left the account without a line on purpose: ej_tillamplig (does not apply to this company form or regelverk), or kraver_val (the account spans two lines and only the person closing the books can choose). An account whose amount is already the sum of other lines, such as 8999, is silently excluded and never reported. Suggest a line; do not pick one on the person's behalf.\n  skatt_overford_ej_borttagen — step bokslut.berakning. ovrigt_noskatt turns the automatic booking off, which removes the tax calculation's system adjustment — but this one was already transferred to the bookkeeping program (detalj.posted_ref), so it stays until it is removed there. Tell the person; do not try to remove it.\n  revision_nej_trots_revisor — step bokslut.berakning. The return says the annual report was NOT audited (arsredovisning_reviderad = false) although the year's persons list has a revisor or medrevisor (detalj.revisorer). With an auditor listed the field is suggested as ja; someone overrode it. Ask the person which is right; do not change it yourself.\n  skatt_skiljer_fran_bokford — step bokslut.berakning. ovrigt_noskatt is set: the company books its year-end itself and the calculation only checks. The calculated tax differs from the tax booked on 8900–8989 (detalj.beraknad_kr, bokford_kr). The booked tax is what the return uses (4.3a); the goal is that they are equal — tell the person to correct the calculation or the bookkeeping.\n  loneskatt_skiljer_fran_bokford — step bokslut.berakning. ovrigt_noskatt is set, and the calculated särskild löneskatt differs from the booked (7530/7532/7533) by more than the tolerance (detalj.beraknad_ore, bokford_ore, tolerans_kr). The booked one is what stands in 4.1 — correct the basis (1.4, 1.5) or the books.\n  periodiseringsfond_skiljer_fran_bokford — step bokslut.berakning. ovrigt_noskatt is set, and the funds entered in the calculation (avsättning minus återföring, detalj.angivet_ore) do not match the net booked on 8810–8819 (detalj.bokfort_ore). Compared as a net because companies often book net. The entered funds drive the schablonintäkt and next year's funds, so they should be entered as booked.\n  (With ovrigt_noskatt set, skatt_redan_bokford, aretsresultat_redan_bokfort, loneskatt_redan_bokford loneskatt_ej_bokford, periodiseringsfond_redan_bokford, skatt_ej_bokford, aretsresultat_ej_bokfort and periodiseringsfond_ej_bokford are not raised: the company booking itself is the point.)\n  skatt_redan_bokford — step bokslut.berakning. Account 8910 already carried a DIFFERENT amount than the calculated tax, and the calculated tax is booked IN FULL on top of it (skatt_bokforing 'auto' or 'alltid'), by design: the program never nets the two. When the SAME amount (within a krona) is already booked, 'auto' books nothing and this finding is not raised. The tax therefore stands twice until the earlier booking is reversed — or choose 'aldrig'. detalj.bokford_ore and detalj.beraknad_ore give both amounts. detalj.aterforing (also on loneskatt_redan_bokford and aretsresultat_redan_bokfort) is the reversal against the calculation's own counter account (2510, 2514, the form's result account) that the person's button 'Återför bolagets bokning' saves: {datum, kategori, beskrivning, rader [{konto, debet_ore, kredit_ore}]}. Reversing is the person's choice (Kevin 2026-11-12): explain the finding, show the rows and ask; only on their yes save exactly those with save_bokslut_justering — booking_date datum, category kategori, description beskrivning, each row account_no konto with debit/credit the öre / 100 — dry_run first. Never on your own; turning the automatic booking off ('aldrig') instead is also theirs to choose.\n  aretsresultat_redan_bokfort — the same for 8999 Årets resultat (aretsresultat_bokforing): the company closed the year in its own books with a different result, and the calculated result is booked on top. The same result already booked is left alone. detalj.bokfort_ore and detalj.beraknat_ore.\n  skatt_ej_bokford, aretsresultat_ej_bokfort, periodiseringsfond_ej_bokford — the choice is 'aldrig' (Bokför inte) and what is booked is not what is calculated. For the result this means the income statement does not close to zero and the balance sheet does not balance.\n  aretsresultat_fel_konto — an account in 8990–8998 carries a balance. BAS books the year's result on 8999 in every form; elsewhere it counts as an ordinary result item and the calculated result is wrong (often zero). Ask the person to move it to 8999. detalj.konton_ore.\n  aretsresultat_motkonto_avviker — 8999 is already booked and not booked again, but the closing balance on the form's counter account (2099; 2069 for ideell förening and stiftelse; 2019–2049 split by the partners' shares) is not the counter amount: wrong account, another split, or last year's result not carried forward. A prompt to check, nothing is booked. detalj.konton.\n  loneskatt_redan_bokford — step bokslut.berakning. Särskild löneskatt already stood on 7530/7532/7533 and the calculated löneskatt was booked in full on top of it: the choice loneskatt_bokforing is 'alltid', or 'auto' and the booked amount is further from the calculated than the tolerance. detalj.bokford_ore, beraknad_ore, bokfors_ore. Tell the person; they either reverse the earlier booking or choose 'aldrig'.\n  loneskatt_ej_bokford — löneskatt is chosen not to be booked ('aldrig') and none is booked either, so the year's result and the income tax are computed without the cost.\n  periodiseringsfond_arsgang_saknas — a fund stands on 2110 (no year in the account) and no årgång is given, so the sixth-year återföring and the uppräkning cannot be computed. Ask which year it was set aside; save it as fonder[{konto, arsgang}].\n  periodiseringsfond_aterforing_ordning — a younger fund is reversed while an older one remains; the oldest go first (IL 30 kap. 7 §).\n  periodiseringsfond_over_tak — a SAVED avsättning now exceeds 25 % of the taxable result before it, because the result fell afterwards (an import, an adjustment); the cap is booked. Writing an amount over the cap is refused outright (out_of_range). detalj.vald, detalj.max.\n  periodiseringsfond_ib_avviker — the fund register (last year's calculation plus what was typed) does not add up to this year's opening balance on 2110–2139. detalj.register_kr, ib_kr.\n  overavskrivning_for_mycket — the tax value after the year falls below the lowest allowed (IL 18:13, 17): berakning.overavskrivning gives utrymme and detalj.for_mycket the excess. Check the purchases in the Överavskrivningar tab, then reverse the excess if the person agrees. A warning, never a block: ersättningsfond and a lower verkligt värde are worked out outside the program.\n  overavskrivning_redan_bokford — the company booked a different change on 2150–2159 or 8850–8859 and the calculation books its amount on top. detalj.aterforing is the reversal; save it with save_bokslut_justering if the person agrees.\n  overavskrivning_ej_bokford — an amount is chosen with bokforing 'aldrig', and the books show something else. The person books it in their program, or changes the choice.\n  overavskrivning_skiljer_fran_bokford — with ovrigt_noskatt set, the amount in the tab differs from the books. Nothing is booked from here; the person decides which is right.\n  periodiseringsfond_redan_bokford — the company has booked fund movements itself during the year (2110–2139 against the opening balance, or 8810–8819) that are not the calculation's. The calculation books reversals and provisions itself, so they count twice until the person reverses the company's booking (ADR-0016 addendum 2026-10-24: the program handles the dispositions — what the company booked is reversed, then the calculation books its own). A part (reversal or provision) already booked with the same amounts on the same accounts is not booked again and does not count here (periodiseringsfond_bokforing 'auto'). detalj.konton_ore. detalj.aterforing {beskrivning, datum, kategori, rader [{konto, debet_ore, kredit_ore}]} is the reversal the person's button 'Återför bolagets bokning' in the tax step saves as an adjustment — null when the booking does not balance. Tell them; do not save it yourself.\n  delagare_saknas — error. A handelsbolag (INK4) with no partners in the calculation: the result is split between them and their details go in the declaration. Ask the person for each partner's name, personnummer or organisationsnummer and share; save with save_skatteberakning delagare.\n  delagare_andel_summa — error. The partners' shares do not add up to 100 %. detalj.summa_andel.\n  pdf_mall_saknas — error. Skatteverket's form (SKV 2002/2003/2004) for the year's declaration period (P1 Jan–Apr, P2 May–Jun, P3 Jul–Aug, P4 Sep–Dec, by the month the fiscal year ends) is not in the program, so no PDF is made. detalj.period, e.g. 2025P4. With detalj.bilaga (n4, n8, n9, n3b) it is the appendix's form (SKV 2154, SKV 2155, SKV 2158, SKV 2167) for that period that is missing — it is also issued per period, with the period code and barcode printed. The program's maintainers add the form; the person cannot.\n  pdf_datum_overtryckta — info. The form has the period's usual fiscal year preprinted and this year is another, so the year's own dates are printed over them. Not a problem.\n  pdf_delar — info. The PDF holds only the parts filed for the year (INK3: the main form and, by the choices, INK3SUF, INK3SUS, INK3R and INK3S, or INK3K). detalj.delar, detalj.sidor.\n  ink_deklarationsplikt_saknas — info. By the computation no return needs filing: the income is under the limit in SFL 30 kap. 4 § (a public-benefit association: the 15 000 kr basic deduction; a foundation: 200 kr) and no base for property tax or fee, yield tax or special payroll tax is set. Skatteverket may still require one (SFL 37 kap. 4 §).\n  medlemsavgifter_ej_61 — warning. An income account named for medlemsavgifter is not linked to INK3R 6.1 (detalj.konton: konto, namn, belopp, falt). BAS has no such account, so the fees land in 6.4 net sales, in the taxable column, and SUF 4.1 — the same fact as 6.1 — is zero. Suggest linking the account to 6.1 (sru_falt 8650 with save_bokslut_klassificering); the program never does it from the name. SUF 4.1 itself cannot be written (read_only): it mirrors 6.1.\n  ink_val_saknas — error. A choice that must be made is not made: a bostadsrättsförening must be set as privatbostadsföretag (äkta), privatbostadsföretag with näringsverksamhet, or oäkta (val brf_beskattning), and an ideell förening or stiftelse as allmännyttig (inskränkt) or not (val skattskyldighet). Until then the year is computed with general rules and the return cannot be filed. Ask the user; do not guess.\n  n9_kan_behovas — warning. N9 is not chosen, but the accounts' negative räntenetto is over förenklingsregeln's 5 000 000 kr; ask whether N9 should be prepared (n9_upprattas 'ja'). detalj.rantenetto.\n  n9_koncernutjamning — error. N9 C.2 is larger than C.1, or C.5 larger than C.4.\n  n9_avdrag_for_stort — error. N9 E.2 or E.3 exceeds what the rule allows: the negative räntenetto, D.11 or 5 000 000.\n  n9_kvarstaende_forenkling — error. E.3 (carried-forward räntenetto) with förenklingsregeln; only the EBITDA rule allows it.\n  n3b_ink3_manuellt — warning. N3B on INK3's näringsverksamhet path: the partnerships' result is not carried over (INK3 has the point only for capital income, INK3K 2.1); enter it in the tax adjustments and do not count the booked share twice. detalj.belopp.\n  n9_kvarstaende_forfaller — info. A remaining negative net interest from six years back is not deducted this year and lapses (IL 24 kap. 26 §).\n  n9_ink3_manuellt — warning. N9 with INK3: nothing is carried to INK3 automatically. The reversal (C.5, E.4, E.6) lowers deductible interest in 6.15, right column; the deduction (C.2, E.5) goes to 7.4.\n  n4_avslagen — warning. Last year's N4 left remaining deferrals, but N4 is set to 'nej' this year; they will not carry on to next year. detalj.mangd (kronor).\n  n8_avslagen — warning. Last year's N8 has properties in its register, but N8 is 'nej' this year; the deduction room and the deductions made will not carry on. detalj.mangd (number of properties).\n  n8_handskrivet — warning. 4.11 or 4.12 (INK4 4.4a/4.6a, INK3 7.7/7.8) has an amount typed by hand on top of N8's locked row. 4.12 also takes reversed depreciation on buildings — then it is right; otherwise remove it.\n  n8_ink3_manuellt — warning. N8 on INK3's kapital path: 7.7/7.8 exist only on the näringsverksamhet path.\n  n8_okand_fastighet — warning. A property with a deduction or reversal is not in the register (tabell fastigheter, or an A.3 row this year); ask the person for its room and deductions made.\n  n8_over_utrymme — error. A deduction exceeds what is left of the property's room (IL 21 kap. 7 §).\n  n8_over_skogsintakt — error. A.1 exceeds 50 % of the avdragsgrundande skogsintäkt (IL 21 kap. 7 §).\n  n8_skogsintakt_saknas — warning. A.1 without the skogsintäkt; ask for it.\n  n8_belopp_grans — warning. The forest deduction is under 15 000 kr or not whole hundreds, and does not take all the remaining room (IL 21 kap. 11 §).\n  n8_aterfort_over_gjorda — warning. More is reversed for a property than was deducted on it.\n  n8_ej_redovisad — info. The room changed in a year without N8; it is kept and reported the next time N8 is filed.\n  n4_handskrivet — warning. 4.7c or 4.7d (INK3 2.7/2.8) has an amount typed by hand on top of N4's locked row; the same deferral counts twice unless it is something else. detalj.falt, detalj.belopp.\n  n4_ink3_manuellt — warning. N4 on INK3's näringsverksamhet path: nothing is carried; the deferral goes in 7.4 and the reversal in 7.5d.\n  n4_okant_uppskov — warning. A deferral is reversed (A.3, A.4, B.1) whose beteckning is not among the remaining deferrals at the start of the year (tabell ingaende); ask the person for it.\n  n4_aterfort_for_stort — error. More is reversed for a beteckning than remained at the start of the year.\n  n4_begart_over_vinst — warning. A.2 requests more than A.1's gain minus cash and A.3's earlier deferral plus gain.\n  n9_intressegemenskap — error. Section F: a community's requested deductions exceed 5 000 000, or section F is filled with the EBITDA rule.\n  pdf_bilaga_rader — warning. An appendix has more repeated rows than its paper form fits; the rest goes in a separate letter, the XBRL file has them all.\n  brf_konton_saknas — error. A privatbostadsföretag with näringsverksamhet has marked no accounts in val brf_skattepliktiga_konton (comma-separated account numbers). INK2R, 4.1 and the suggestions read only those accounts plus 8900–8989; the balance part holds only the taxable activity's assets and does not balance by design. Ask the user which accounts carry the taxable income and deductible costs.\n  ink_val_galler_inte — warning. A saved choice does not hold with the year's other choices (INK3: \"only the special information\" when not public-benefit); the default is used. detalj.sparat, detalj.galler.\n  statslaneranta_saknas — error. The rate the schablonintäkt needs is not cached; call get_statslaneranta with uppdatera, then recompute.\n\n`kalla` is the legal citation, and it may be null. Null means the rule follows from the others rather than from a paragraph of its own — it does not mean the finding is weaker. The citations that are present have not yet been confirmed by a specialist; quote them as the program's reference, not as your own legal advice.\n\n`ankare` says where in the step the finding sits: {field} for a setting, {persons} when it concerns the people's own dates and there is no field to point at, and `group` is the tab. `summary` counts findings per step and in total.\n\n`failed_sources` lists producers that threw. It is normally empty; a name in it means that part of the checks did not run, so say so rather than reporting the year as clean.\n\nNothing here is a gate against the person. Readiness and findings are advisory, and filing always requires a human (ADR-0010).\n\nErrors: missing_fiscal_year, unknown_step, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"step":{"type":"string","description":"Limit the findings to one workflow step, e.g. forbered.installningar. Omit for the whole year."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokslut_matris","group":"bokslut","klass":"lasa","summary":"The saldomatris: the year's accounts grouped onto the lines of the annual report.","description":"The saldomatris: the year's accounts grouped onto the lines of the annual report.\n\nget_bokslut_saldon gives the accounts as the file delivered them. This gives the same figures arranged the way they will be presented, which is what you need to answer anything about the annual report rather than about the ledger.\n\nTWO CHECKS on the lines: `omvant: true` marks a balance-sheet post on the wrong side — an asset with a credit balance (bank overdrawn: a checkräkningskredit?) or a liability with a debit balance (skatteskulder in plus: a receivable?); eget kapital is exempt. `fjol` (on lines and accounts) is 'efter justering' in the previous year's matris in the program, present only when that year ends the day before this one starts (`fjol_ar`); `fjol_avviker: true` where it differs from this year's `prev_ub`, usually last year's adjustments not booked. `omvant` and `fjol_avviker` at the top count them. Point these out. Reclassify only as the server instructions allow (an account on the wrong side, with the comparison column typed where the move would put it wrong); otherwise suggest.\n\nROUNDING (ADR-0029): `avrundning` at the top is {regel: konto | cell, last (locked on the year at signing), antal}. With konto, an account whose amount in the report is not plain rounding carries `avrundning` {nu, nu_vanlig, fore, fore_vanlig} (whole kronor, the books' sign), and so does its line with the line's amount in the report. The matrix itself stays exact öre.\n\n`paket` names the template the lines come from — organisationsform, regelverk, taxonomy version and BAS year. An organisationsform ending in 'funk' (abfunk, ekforfunk, hbfunk, ideellfunk, stiftelsefunk and the other stiftelse variants) is an aktiebolag, ekonomisk förening, handels-/kommanditbolag, ideell förening or stiftelse under K3 with a FUNCTIONAL income statement (ÅRL bilaga 3), chosen by the year setting arsred_funktionsindelad: its income statement lines are nettoomsättning, kostnad för sålda varor, försäljnings-, administrations- and FoU-kostnader; the accounts have a default mapping the person adjusts by moving whole accounts, and the declaration fields (INK2R, INK3, INK4R) stay as with kostnadsslag. For ideella föreningar and stiftelser there is no bruttoresultat: medlemsavgifter, gåvor and bidrag stand beside nettoomsättning, and lämnade bidrag leads the functions. **`paket` is null when the matrix cannot be built**, and `saknas` says why: organisationsform (not stated for the company), regelverk (K2/K3 not chosen for the year), regelverk_k3 (the form requires K3 — a bostadsrättsförening — but the year is set to another regelverk; tell the user to switch the year to K3), paket (no template exists for that combination yet), or pinnat_paket (the year is pinned to a template file that is no longer on disk — report it, do not work around it). Do not fall back on aktiebolag/K2; say what is missing.\n\n`paket.pinnad` says whether the year holds this choice itself. The first call on an open year pins it, so a later taxonomy release cannot move a year that has already been worked in. False means the choice is simply the newest template on disk, which is what a closed year gets — those are never pinned.\n\nEach line carries `etikett` (what will be shown), `niva` for indentation, `konton` with the accounts on it, and two totals that are NOT the same thing:\n  konton_summa — the accounts on this line and every line below it in the presentation\n  summa        — for a total line, the taxonomy's own calculation where it has one\nA line is a total when `ar_summa: true`, NOT when `summerar` is non-empty, and NOT when `summa` is truthy — `summa` is the amounts object above and is always present. The two differ under K3, which ships no calculation linkbase at all: there `summerar` is empty on every line while 23 of them are still totals, and their figure falls back to konton_summa. Reading totality out of `summerar` would make a K3 total look like an ordinary post.\nA heading such as \"Tillgångar\" and the line \"Summa tillgångar\" are SIBLINGS, not parent and child, and they are computed differently on purpose. Equal figures are a check that passed.\n\nA line somebody has renamed also carries `etikett_taxonomi`, the taxonomy's own wording, `etikett_andrad`, the two compared, and `etikett_loggas`, whether that difference becomes a LogChangedLabel footnote. Use the taxonomy's wording when you need to be sure which line is meant — the shown one is whatever this client decided to call it. `egna_rubriker` counts how many lines the year has renamed; see save_bokslut_rubrik.\n\nTHE NOTES ARE A THIRD SECTION, and they behave differently from the two statements. Their lines can be renamed and can take custom rows, but they take NO ACCOUNTS: the note concepts carry no BAS references, and the resolution chain is one account to one line, so an account placed in a note would leave the balance sheet. `paket.sektioner` carries `tar_konton` per section — read it rather than assuming. Many of their monetary lines also carry NO balance direction at all (327 of 412 in K2): those are movement concepts, reported as amounts in the direction the label implies, and a missing `balans` there is the taxonomy's answer, not a gap.\n\nSIGNS ARE THE BOOKKEEPING'S, NOT THE REPORT'S. Equity and liabilities are negative and stay negative all the way up, so \"Summa eget kapital och skulder\" is a negative number here and a positive one in the filed annual report. Do not describe that as an error.\n\n`oklassificerade` are accounts with a balance that belong to no line. `typ` says why: kraver_val (the account spans two lines, only the person closing the books can choose), ej_tillamplig (does not apply to this company form or regelverk — the amount is probably on the wrong account), or harlett (the amount is already the sum of other lines, such as 8999 Årets resultat; this one is normal and is not a problem). Anything else is an account the chart does not know.\n\n`summor.balance_diff` (BR + RR + `bokat_resultat`) should be zero. `bokat_resultat` is the year's result already booked (8999 against 2099, as in a closed ledger or a consolidated trial balance) — it is already inside the balance sheet, so it is counted and is not a problem. When the difference is not zero, compare it with `summor.oklassificerade_belopp` (unclassified accounts other than 8999) — when the two cancel out, the unclassified accounts are the whole explanation. Two more checks: `summor.alla_konton` is the sum of every account, unclassified and 8999 included — not zero means the import is incomplete or an adjustment does not balance. `summor.br_diff` checks the balance sheet against the year's result: with the result booked on 8999 (`bokat_resultat` not zero) the balance sheet must balance on its own, so br_diff is BR; otherwise BR + RR. Not zero with no unclassified accounts usually means the result is booked TWICE — the company's own booking and the tax calculation's (finding aretsresultat_redan_bokfort, whose detalj.aterforing is the fix the person saves with the button in Beräkning, or you save on their yes — see get_skatteberakning). balance_diff cannot see that: it is zero whenever every booking balances. `summor_fore` holds the same sums for the file's comparative figures (prev_ub, last year as it was closed in the books) — warnings matris_fjol_alla_konton and matris_fjol_balanserar_inte.\n\nEach account's `kalla` says where its line came from: \"paket\" is the template's own mapping, \"klient\" means somebody moved it with save_bokslut_klassificering. Say so when it matters; a figure that sits where a person put it is a different kind of fact from one the template placed.\n\nTHE DECLARATION FIELD RIDES ALONG. Each account and each line carries `sru`: `falt` is the INK2 field code, `villkorat` is a pair when the sign of the amount decides which field applies (8810 is a reversal at plus and a provision at minus), and `kandidater` means BAS places the account under two fields and nobody has chosen. `skal: \"via_rad\"` says the annual report's line broke that tie. `sru_poster` gives each field's INK2 row number and wording, so you can say \"3.6 Handelsvaror\" rather than \"7512\". `sru_val` lists every INK2R field an account can be given ({falt, rad, benamning, sektion: br for 2.x, rr for 3.x}); `skal: \"klient\"` on an account means its field was chosen for this client rather than taken from the table.\n\nThe two mappings are computed separately on purpose. Never derive one from the other, and never describe a reclassification in the annual report as changing the tax return.\n\nSuggest a line for an unclassified account; never pick one on the person's behalf.\n\nSIZE (Kevin 2026-10-19). The full matrix is large — a small company's balance sheet alone is some 180 000 characters, the notes 900 000. So by default (`form: 'kompakt'`) the answer carries only the lines that have an amount in either year, each as {kod, etikett, niva, summa (a total), nu, fore, sru, omvant?, fjol?, fjol_avviker?, avrundning?, konton: [{konto, namn, nu, fore, kalla?, sru?}]} — nu is the year's figure after adjustments, fore the comparison year's AS THE MATRIX HAS IT — with ovrigt_autopy off (the default) the annual report shows a figure typed for the comparison year instead (save_arsredovisning_varde, balans1/period1), so a line moved for this year's sake can look wrong here and still be right in the report; kalla and an account's sru only when they differ from the template or the line — plus the top-level checks and `sru_val` for the section. Ask for `form: 'full'` only when you need what the compact form leaves out (headings, lines without amounts, the template details). With `section: 'noter'` and no `not`, the answer lists the notes (kod, etikett). `not: '<kod>'` (e.g. NotAndelarKoncernforetag) gives that one note's rows to fill: {kod, skriv (the rad_kod for save_arsredovisning_varde — 'Tuple/Concept' inside a tuple), etikett, niva, datatyp, kontext (balans | period), rubrik?, summa?, tupel?, varde?} — `varde` is what is already saved, {kontext: amount or text}, with '#n' after the kontext for instans n of a tuple; `ifylld` at the top says whether anything is. Read it before writing, and never overwrite what a person entered without showing them. A movement table's Utgående line is computed: write the comparison year's opening (balans2) and the movements.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, unknown_section, unknown_note (`not` is not a note of the package), internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"form":{"type":"string","enum":["kompakt","full"],"description":"kompakt (default): only lines with an amount, short fields. full: the whole matrix."},"not":{"type":"string","description":"One note's rows to fill, by its kod (e.g. NotAndelarKoncernforetag). Implies section noter."},"section":{"type":"string","enum":["br","rr","noter"],"description":"Limit to balansräkning, resultaträkning or noter. Omit for all three. The notes are large — 657 lines in K2, 1391 in K3 — so ask for the section you need rather than the whole matrix."},"enhet":{"type":"string","enum":["jur","kon"],"description":"Whose matrix: jur = the company itself (default), kon = the group (koncern, ADR-0022). The group's lines have the same concept names as the parent's, so a renamed line or own line belongs to one of them. kon requires arsred_koncernredovisning (aktiebolag under K3) and is refused with no_koncern otherwise; an unknown value is unknown_entity."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokslut_saldon","group":"bokslut","klass":"lasa","summary":"The year's account balances: what the bookkeeping actually says.","description":"The year's account balances: what the bookkeeping actually says.\n\nCall this before reasoning about any figure. Without it you are guessing at numbers that exist.\n\nPer account: ib (opening), ub (closing, as imported), ub_adjusted (after bokslut adjustments, null when the account has none) and prev_ub (the comparative year). is_result separates the resultaträkning from the balansräkning — for a result account `ub` is the year's movement, not a balance.\n\nALWAYS USE ub_adjusted WHEN IT IS NOT NULL. It is the figure the annual report is built from; `ub` is what the file said before anyone worked on it.\n\n`totals.balance_diff` is br_ub + rr_ub and should be zero: the year's result has not been transferred to equity, so the two halves cancel. A non-zero figure means the import was incomplete — say so rather than working around it.\n\nE-revisor stores BALANCES, not transactions. There are no verifikat to fetch; the movement figures the notes need are extracted at import time and returned under `movements`, with debit and credit kept apart because a note showing the year's increase and decrease cannot recover them from a net figure.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, unknown_section, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"section":{"type":"string","enum":["br","rr"],"description":"Limit to balansräkning or resultaträkning. Omit for both."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokslut_settings","group":"bolag","klass":"lasa","summary":"Get the year-end settings for one client and fiscal year: the values, the definitions that apply, and what each deliverable is still missing.","description":"Get the year-end settings for one client and fiscal year: the values, the definitions that apply, and what each deliverable is still missing.\n\nCall this FIRST, before any other bokslut tool. It is the only way to know which settings exist for this company — they are filtered by organisationsform, by regelverk (K2/K3) and by the year's end date, so the set differs between clients and between years of the same client. Never assume a setting exists because it existed elsewhere.\n\n`readiness` is the useful part for planning: per deliverable — årsredovisning, revisionsberättelse, stämmoprotokoll, deklaration, and the two filings — whether it is ready and what is missing, covering both settings and people. It is ADVISORY. It never blocks anything, and a person who knows a field is irrelevant to their case may proceed without it. Report it; do not treat it as a gate.\n\n`axes` carries regelverk, which is not a setting: it decides which settings exist at all. `orphans` are stored values that no longer apply — usually harmless, worth mentioning if the user asks why something vanished.\n\nWHAT YOU MAY DECIDE: every definition carries `source`.\n  bolagsverket, derived, sie — you may propose a value from data you have\n  agency — the firm's own standing details; reuse what other years or clients of the same agency use, do not invent\n  user_choice — a judgement. Ask the person. Do not guess, and do not infer it from a similar company.\nRead `description` before setting anything: it says what the setting actually affects, which the label does not.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"group":{"type":"string","description":"Limit the definitions to one tab: foretaget, stamma, arsredovisning, revisor, deklaration, ovrigt. Readiness is always computed over all of them."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bokslut_steg","group":"bokslut","klass":"lasa","summary":"Where the year-end work stands: the six activity groups and every step in them, with who signed each one off and when (ADR-0006, ADR-0007).","description":"Where the year-end work stands: the six activity groups and every step in them, with who signed each one off and when (ADR-0006, ADR-0007).\n\nSTATUS IS A PERSON'S ASSERTION, NOT A MEASUREMENT. `status` is todo, in_progress or done, and it says what somebody decided, not what the data shows. The two are separate axes on purpose — get_bokslut_kontroller is the other one — and a step can be done with warnings standing. Never report a step as finished because the checks are quiet, or as unfinished because they are not.\n\n`is_stale` is the one place the two axes meet: true means the step's own data changed AFTER it was signed off, so the assertion describes a version that no longer exists. That is worth raising. null means no data source is wired to that step yet — it is not a quiet false.\n\nStored rows are sparse: a step nobody has touched is absent from the table and comes back as todo. `done` and `total` count the steps, and which steps exist at all depends on the company's organisationsform.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_bolagsverket_arendestatus","group":"stamma","klass":"lasa_ute","summary":"Ask Bolagsverket where the company's annual report case stands — the answer to \"has the annual report been filed / registered?\". Reads only: nothing is filed and no eget utrymme is created. Aktiebolag only (not_applicable otherwise).","description":"Ask Bolagsverket where the company's annual report case stands — the answer to \"has the annual report been filed / registered?\". Reads only: nothing is filed and no eget utrymme is created. Aktiebolag only (not_applicable otherwise).\n\nUPLOADED IS NOT FILED. An upload from the app puts the document in the company's eget utrymme; it has come in to Bolagsverket only when a representative has signed the fastställelseintyg there. This tool reports Bolagsverket's side.\n\nAnswer: `aktuell` — Bolagsverket's answer now: `status` (arsred_saknas: none filed for the period; arsred_inkommen: received, being processed; arsred_forelaggande_skickat: Bolagsverket has sent an injunction — something must be done; arsred_komplettering_inkommen: a new report received; arsred_registrerad: registered; arsred_avslutad_ej_registrerad: closed without registration), `text` in Swedish, `arendenummer` (may be shown to the person), `tidpunkt`, and the period. ⚠ The answer concerns the COMPANY's latest case, not necessarily this year: `galler_aret` false means the period is another year's — say so rather than reporting it as this year's status. `andrad` is true when the status changed since last fetched; `historik` is this year's stored changes, newest first. `miljo` is prod or acceptans (Bolagsverket's test environment). Errors: provider_unreachable (worth a retry later), provider_not_authorised, provider_not_configured, missing_orgnr. Rows with kalla 'handelse' came from Bolagsverket's push events, which are built but switched off on this server until it has a public address (events_disabled — not an error to report, just why no event rows exist yet).","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_client_users","group":"bolag","klass":"lasa","summary":"List users with access to the selected client — the owner, extra users (viewer/editor/auditor roles), and pending invitations. Use this to resolve a name to a user_id before assigning a todo with create_todo/update_todo.","description":"List users with access to the selected client — the owner, extra users (viewer/editor/auditor roles), and pending invitations. Use this to resolve a name to a user_id before assigning a todo with create_todo/update_todo.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_clients","group":"bolag","klass":"lasa","summary":"List all companies (clients) the user has access to. Always call this first to find the client_id needed by every other tool.","description":"List all companies (clients) the user has access to. Always call this first to find the client_id needed by every other tool.","dryRun":false,"inputSchema":{"type":"object","properties":{},"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_document","group":"ovrigt","klass":"lasa","summary":"Fetch a single uploaded document so it can be read and classified (e.g. decide utlägg vs leverantörsfaktura and extract amount/VAT/date/supplier). Resolves a short-lived pre-signed URL via documents/view, then returns the file inline: Images are returned inline and can be read by the model. PDFs and other non-image files are not read by the model yet; they are returned only as metadata and a temporary signed URL. If a PDF is encountered, tell the user it must be handled manually or later by PDF extraction. Always returns mime_type, original_file_name, document_type and source — use document_type/source for routing before even opening the file.","description":"Fetch a single uploaded document so it can be read and classified (e.g. decide utlägg vs leverantörsfaktura and extract amount/VAT/date/supplier). Resolves a short-lived pre-signed URL via documents/view, then returns the file inline: Images are returned inline and can be read by the model. PDFs and other non-image files are not read by the model yet; they are returned only as metadata and a temporary signed URL. If a PDF is encountered, tell the user it must be handled manually or later by PDF extraction. Always returns mime_type, original_file_name, document_type and source — use document_type/source for routing before even opening the file.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"document_id":{"type":"integer","description":"Document ID (from list_documents)"},"expires":{"type":"integer","description":"Seconds until the pre-signed URL expires (default 600, max 86400)."}},"required":["client_id","document_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_driftstatus","group":"ovrigt","klass":"lasa_ute","summary":"Are the services e-revisor depends on up: Scrive (signing), BankID, Bolagsverket and Skatteverket? Use it when a filing or signing fails, to tell the person whether the fault is likely theirs. Without `tjanst`: all four. Each has `lage`: ok, underhall, storning, nere or okand (we do not know — never say it is up then), `text` in Swedish, `lank`, `kontrollerad` and `meddelanden` [{typ, titel, datum, lank, text}]. Skatteverket has no status page: its `lage` comes from its published operational messages, so ok means no disturbance announced — read `meddelanden`. Bolagsverket is our own check: it says whether they answer us. Cached one minute. Errors: invalid_enum, not_authenticated.","description":"Are the services e-revisor depends on up: Scrive (signing), BankID, Bolagsverket and Skatteverket? Use it when a filing or signing fails, to tell the person whether the fault is likely theirs. Without `tjanst`: all four. Each has `lage`: ok, underhall, storning, nere or okand (we do not know — never say it is up then), `text` in Swedish, `lank`, `kontrollerad` and `meddelanden` [{typ, titel, datum, lank, text}]. Skatteverket has no status page: its `lage` comes from its published operational messages, so ok means no disturbance announced — read `meddelanden`. Bolagsverket is our own check: it says whether they answer us. Cached one minute. Errors: invalid_enum, not_authenticated.","dryRun":false,"inputSchema":{"type":"object","properties":{"tjanst":{"type":"string","enum":["scrive","bankid","bolagsverket","skatteverket"],"description":"One service; default all"}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_fiscal_years","group":"bolag","klass":"lasa","summary":"Get fiscal years (bokföringsår) for a client. Returns dates, chart of accounts, accounting method, and lock status. Use this to find valid fiscal_year_id / loadfiscalyear_id values needed by other tools.","description":"Get fiscal years (bokföringsår) for a client. Returns dates, chart of accounts, accounting method, and lock status. Use this to find valid fiscal_year_id / loadfiscalyear_id values needed by other tools.\n\nis_locked = 1 is a year a person locked when it was done (krav C9), with las_av and las_datum saying who and when. Every tool that changes the year refuses it with year_locked; reading, downloading, signing, filing and the bokföringsorder to the bookkeeping program still work. Only a person locks and unlocks, in Slutför — tell them, do not look for a way round it.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"Optional: specific fiscal year ID. Omit to get all."}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_frister","group":"bolag","klass":"lasa","summary":"Deadlines for a fiscal year, computed from the law and Skatteverket's published tables — no lookup at any authority (ADR-0027). Areas (`omrade`): stamma, arsredovisning (filing with Bolagsverket or länsstyrelsen), deklaration (INK2/INK3/INK4), moms, arbetsgivare (AGI); default all. Two ways: with client_id and fiscal_year_id (form and dates from the company, stamma_datum from its settings, and `klar` per deadline from the status milestones), or without a company: organisationsform, slut, optional start, stamma_datum, moms {period: manad|kvartal|helar, over_40_mkr, eu_handel} and arbetsgivare {over_40_mkr}. Each deadline has `lage`: datum, saknas (cannot be computed — `skal` says why; never guess a date then) or ej_tillamplig. `villkor` means it only applies under a condition the program cannot know — say so. `lagstadgat` is the date before Skatteverket's move to the next weekday; Bolagsverket and stämma dates are never moved. Moms and arbetsgivare have no settings yet, so for a company they are `saknas`. Errors: invalid_enum, invalid_date, unknown_client, unknown_fiscal_year, missing_form, not_authenticated.","description":"Deadlines for a fiscal year, computed from the law and Skatteverket's published tables — no lookup at any authority (ADR-0027). Areas (`omrade`): stamma, arsredovisning (filing with Bolagsverket or länsstyrelsen), deklaration (INK2/INK3/INK4), moms, arbetsgivare (AGI); default all. Two ways: with client_id and fiscal_year_id (form and dates from the company, stamma_datum from its settings, and `klar` per deadline from the status milestones), or without a company: organisationsform, slut, optional start, stamma_datum, moms {period: manad|kvartal|helar, over_40_mkr, eu_handel} and arbetsgivare {over_40_mkr}. Each deadline has `lage`: datum, saknas (cannot be computed — `skal` says why; never guess a date then) or ej_tillamplig. `villkor` means it only applies under a condition the program cannot know — say so. `lagstadgat` is the date before Skatteverket's move to the next weekday; Bolagsverket and stämma dates are never moved. Moms and arbetsgivare have no settings yet, so for a company they are `saknas`. Errors: invalid_enum, invalid_date, unknown_client, unknown_fiscal_year, missing_form, not_authenticated.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID — omit for a pure calculation"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID, with client_id"},"omrade":{"type":"array","items":{"type":"string","enum":["alla","stamma","arsredovisning","deklaration","moms","arbetsgivare"]}},"organisationsform":{"type":"string","enum":["aktiebolag","ekonomisk_forening","bostadsrattsforening","ideell_forening","stiftelse","handelsbolag","kommanditbolag","svenska_kyrkan"]},"start":{"type":"string","description":"YYYY-MM-DD, without client_id"},"slut":{"type":"string","description":"YYYY-MM-DD, without client_id"},"stamma_datum":{"type":"string","description":"YYYY-MM-DD, without client_id"},"moms":{"type":"object","properties":{"period":{"type":"string","enum":["manad","kvartal","helar"]},"over_40_mkr":{"type":"boolean"},"eu_handel":{"type":"boolean"}},"required":["period"],"additionalProperties":false},"arbetsgivare":{"type":"object","properties":{"over_40_mkr":{"type":"boolean"}},"required":["over_40_mkr"],"additionalProperties":false}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_k10","group":"k10","klass":"lasa","summary":"K10 for qualifying shares in a fåmansföretag (ADR-0056), under Verktyg — the 3:12 rules from income year 2026 ONLY. One K10 per company, shareholder (personnummer) and INCOME year (not fiscal year). Without `id`: the list for `inkomstar` — rader [{id, namn, pnr, numrering, gransbelopp, utdelning, sparat_ut, for_hand, varningar}], agare_utan_k10 (owners in the röstlängd without a K10; `skal` when one cannot get one — no personnummer or a legal person), ar (the years the tool can compute), belopp. With `id`: that K10 in full. A K10 answer: `rad` (what is ENTERED; null in a field means the suggestion applies), `forslag` {field: {varde, kalla}} (aktier/aktier_totalt from the röstlängd of the fiscal year ending just before the income year, loneunderlag 4.1 from the AGI receipts of the year before, sparat_in 1.4 from last year's K10), `varden` (what is computed on: entered, else suggested), `belopp` (the year's amounts: grundbelopp, loneavdrag, tak_utdelning, tak_vinst, ranta %), and `berakning` {punkter {\"1.1\": kr, …} named as on K10 edition 39 — A 1.1–1.6, B 2.1–2.10, C 3.1–3.13, D 4.1–4.12; a point that does not apply is absent — gransbelopp, sparat_ut (to next year), varningar [{kod, text}], for_hand [keys]} or null with `fel` when the year cannot be computed. A non-empty `for_hand` means the case is outside what the tool computes (shares bought the year before, spouses, gift/inheritance, several sales): say so and do not present the figures as the K10.","description":"K10 for qualifying shares in a fåmansföretag (ADR-0056), under Verktyg — the 3:12 rules from income year 2026 ONLY. One K10 per company, shareholder (personnummer) and INCOME year (not fiscal year). Without `id`: the list for `inkomstar` — rader [{id, namn, pnr, numrering, gransbelopp, utdelning, sparat_ut, for_hand, varningar}], agare_utan_k10 (owners in the röstlängd without a K10; `skal` when one cannot get one — no personnummer or a legal person), ar (the years the tool can compute), belopp. With `id`: that K10 in full. A K10 answer: `rad` (what is ENTERED; null in a field means the suggestion applies), `forslag` {field: {varde, kalla}} (aktier/aktier_totalt from the röstlängd of the fiscal year ending just before the income year, loneunderlag 4.1 from the AGI receipts of the year before, sparat_in 1.4 from last year's K10), `varden` (what is computed on: entered, else suggested), `belopp` (the year's amounts: grundbelopp, loneavdrag, tak_utdelning, tak_vinst, ranta %), and `berakning` {punkter {\"1.1\": kr, …} named as on K10 edition 39 — A 1.1–1.6, B 2.1–2.10, C 3.1–3.13, D 4.1–4.12; a point that does not apply is absent — gransbelopp, sparat_ut (to next year), varningar [{kod, text}], for_hand [keys]} or null with `fel` when the year cannot be computed. A non-empty `for_hand` means the case is outside what the tool computes (shares bought the year before, spouses, gift/inheritance, several sales): say so and do not present the figures as the K10.\n\nThe tool assumes the shares ARE qualifying, held directly (not via a holding company), and that shares in other fåmansföretag are entered (andel_andra_procent) — otherwise the grundbelopp is too high. Ask the person about these; never assume. The K10 is the shareholder's own return: you prepare, the person files. The filled-in form (Skatteverket's own K10, edition 39 for 2026) is a button in the card, not a tool; it answers k10_for_hand (something in \"räknas inte här\" is ticked), k10_aktier_saknas (no shares entered) and template_missing (the form for the income year is not loaded yet — Skatteverket publishes it in the autumn). The SRU file for Skatteverket's file transfer is a button too; it answers no_complete_k10 (none of the K10 can become a file) and medielev_missing (who submits the file — number, name, postal code and town — is missing in the year's declaration settings dekl_uppgiftslamnare_* / dekl_kontakt_*). Errors: year_not_supported, unknown_k10.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"inkomstar":{"type":"integer","description":"Income year, 2026 or later — for the list"},"id":{"type":"integer","description":"A K10 id — for one K10 in full"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_kunskap","group":"kunskap","klass":"lasa","summary":"One article or news item from the knowledge base, by slug or id (from search_kunskap; `typ` says which, a news item has `publicerad_at` — ours — and its source's own date in `kallor[].datum`): `sammanfattning` is the short answer; `innehall` in Markdown, where `## Heading {steg}` is a section of steps in the program and `> **Obs:**` / `**Tips:**` / `**Exempel:**` are notes — `kallor` [{text, url?}] (lagrum, Skatteverket, BFN), `giltig_fran`/`giltig_tom` (the fiscal years it applies to, by the year's start), `uppdaterad`, `synlighet` (publik | kunder | intern — never quote an intern article to a customer) and `flyttad` when the slug was an old one. `html` is the same text rendered; use `innehall`. Errors: required, not_found (no such article, or not one the person may see).","description":"One article or news item from the knowledge base, by slug or id (from search_kunskap; `typ` says which, a news item has `publicerad_at` — ours — and its source's own date in `kallor[].datum`): `sammanfattning` is the short answer; `innehall` in Markdown, where `## Heading {steg}` is a section of steps in the program and `> **Obs:**` / `**Tips:**` / `**Exempel:**` are notes — `kallor` [{text, url?}] (lagrum, Skatteverket, BFN), `giltig_fran`/`giltig_tom` (the fiscal years it applies to, by the year's start), `uppdaterad`, `synlighet` (publik | kunder | intern — never quote an intern article to a customer) and `flyttad` when the slug was an old one. `html` is the same text rendered; use `innehall`. Errors: required, not_found (no such article, or not one the person may see).","dryRun":false,"inputSchema":{"type":"object","properties":{"slug":{"type":"string","description":"The article's slug"},"id":{"type":"integer","description":"The article's id, instead of slug"}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_licens","group":"bolag","klass":"lasa","summary":"The licence for a fiscal year: is it paid, may it be finished, and what it costs. `orsak` is null (paid, nothing in the way), provperiod (the account's trial — everything works except finishing), obetald (not paid, the trial is over) or obetalda_tillagg (paid, but extra charges are overdue). `sparrad` is whether the server actually stops finishing now — never while `lage` is beta. `text` says it in Swedish for the person. Finishing means the final annual report (otherwise a draft with a watermark), signing, filing with Bolagsverket or Skatteverket, the paper form and the K10 file; everything else is free in the trial. Amounts (`pris`, `moms`, `tillagg.belopp`) are in öre, ex moms. You never pay or start a payment: tell the person to pay under Licens in the program. Errors: missing_fiscal_year, unknown_fiscal_year. The payment itself is the person's (licens/kop, licens/kvittera: human_only to an agent); in the program it can answer owner_only (only the account's owner pays), byra_licens (an agency pays for the whole account, not per year), not_byra (the account is not an agency), licens_betald (already paid, or the agency's next year cannot be bought yet), inga_tillagg (no unpaid charges), unknown_payment, payment_pending, amount_mismatch, provider_not_configured (card payment is not set up on this server) and provider_unreachable. `poster` lists the account's extra charges (status obetald | betald | struken) and `tillagg_obetalt` what is left to pay; for an agency `byra` has the paid period and what next year costs today, line by line.","description":"The licence for a fiscal year: is it paid, may it be finished, and what it costs. `orsak` is null (paid, nothing in the way), provperiod (the account's trial — everything works except finishing), obetald (not paid, the trial is over) or obetalda_tillagg (paid, but extra charges are overdue). `sparrad` is whether the server actually stops finishing now — never while `lage` is beta. `text` says it in Swedish for the person. Finishing means the final annual report (otherwise a draft with a watermark), signing, filing with Bolagsverket or Skatteverket, the paper form and the K10 file; everything else is free in the trial. Amounts (`pris`, `moms`, `tillagg.belopp`) are in öre, ex moms. You never pay or start a payment: tell the person to pay under Licens in the program. Errors: missing_fiscal_year, unknown_fiscal_year. The payment itself is the person's (licens/kop, licens/kvittera: human_only to an agent); in the program it can answer owner_only (only the account's owner pays), byra_licens (an agency pays for the whole account, not per year), not_byra (the account is not an agency), licens_betald (already paid, or the agency's next year cannot be bought yet), inga_tillagg (no unpaid charges), unknown_payment, payment_pending, amount_mismatch, provider_not_configured (card payment is not set up on this server) and provider_unreachable. `poster` lists the account's extra charges (status obetald | betald | struken) and `tillagg_obetalt` what is left to pay; for an agency `byra` has the paid period and what next year costs today, line by line.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_momsdeklarationer","group":"skatt","klass":"lasa_ute","summary":"The fiscal year's VAT returns (momsdeklarationer) as Skatteverket has them, saved (ADR-0049). Answers perioder (one per declared period: period YYYYMM, etikett, omfattar — the months it covers, status beslutad | inlamnad, tidpunkt, beslutad and inlamnad (dates), kvittens, underskriven_av (who submitted, masked), andrad — set when the boxes changed since the previous fetch, e.g. after a reassessment, with tidigare {status, rutor, hamtad} — and rutor {ruta: öre}), rutor (the boxes with an amount in any period: ruta, namn, varden {period: öre|null}, ar = the year's sum), hamtad, hamtad_av, manader (the year's month-ends) and last (the year is locked). Amounts in öre. Box 49 is VAT to pay (+) or get back (−). Monthly, quarterly and yearly filers all show: a period is its last month.","description":"The fiscal year's VAT returns (momsdeklarationer) as Skatteverket has them, saved (ADR-0049). Answers perioder (one per declared period: period YYYYMM, etikett, omfattar — the months it covers, status beslutad | inlamnad, tidpunkt, beslutad and inlamnad (dates), kvittens, underskriven_av (who submitted, masked), andrad — set when the boxes changed since the previous fetch, e.g. after a reassessment, with tidigare {status, rutor, hamtad} — and rutor {ruta: öre}), rutor (the boxes with an amount in any period: ruta, namn, varden {period: öre|null}, ar = the year's sum), hamtad, hamtad_av, manader (the year's month-ends) and last (the year is locked). Amounts in öre. Box 49 is VAT to pay (+) or get back (−). Monthly, quarterly and yearly filers all show: a period is its last month.\n\nuppdatera: true fetches live from Skatteverket and saves — decided and submitted returns for every period, three periods per call (Skatteverket's limit): the decision gives the boxes, the submission the receipt. It needs the agency's ombud authority for the company: without it unauthorized — the person can fetch in their own name with BankID in the app; you cannot. Not in a locked year (year_locked): what is saved is what was declared at closing. Read only — nothing is filed or changed at Skatteverket.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, invalid_enum, year_locked; with uppdatera also missing_org_number, unauthorized, period_too_old, rejected, not_configured, provider_unreachable, provider_error, bankid_required; internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"uppdatera":{"type":"boolean","description":"Fetch live from Skatteverket and save, instead of reading what is saved"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_notification_counts_by_client","group":"ovrigt","klass":"lasa","summary":"Get unread client-scope notification counts grouped by client_id for all companies the logged-in user has access to. Global notifications are excluded.","description":"Get unread client-scope notification counts grouped by client_id for all companies the logged-in user has access to. Global notifications are excluded.","dryRun":false,"inputSchema":{"type":"object","properties":{},"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_notifications","group":"ovrigt","klass":"lasa","summary":"Get active unread notifications for the selected client. Includes reminders, bank alerts, document alerts, system messages and other notifications requiring attention.","description":"Get active unread notifications for the selected client. Includes reminders, bank alerts, document alerts, system messages and other notifications requiring attention.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_revisionsberattelse","group":"revision","klass":"lasa","summary":"The audit report (revisionsberättelse) for a company and year (ADR-0072), the tool card under Verktyg — aktiebolag, ekonomisk förening, bostadsrättsförening, handelsbolag, kommanditbolag, ideell förening and stiftelse, from FAR's normal text (RevR 700 examples 1, 18, 19, 10, 11, 12–15). Read it before changing anything. An audit report answer: `finns` (saved yet), `ren` (standardformulering: the texts follow the settings; any own text turns it off), `uppgifter` (the settings in force — namn, orgnr, start, slut, form, regelverk k2|k3, vd, ledamoter, resultat vinst|forlust, utdelning, kassaflode, koncern (the parent company prepares koncernredovisning: the texts speak of årsredovisningen och koncernredovisningen, FAR RevR 700 exempel 2), ansvar_kort, revisionsbolag, revisorer [{fornamn, efternamn, titel, huvudansvarig}], ort, datum, mottagare, anmarkning_skatter, anmarkning_sen, and the appearance: stil standard or the id of a style profile the audit firm's account has (an e-revisor administrator makes and assigns them; its defaults apply where neither the report nor the account chose), typsnitt opensans|profil, storlek standard (as the annual report)|8|8.5|9|9.5|10|10.5|11|11.5|12 (pt), spalter 1|2 (two columns: the title over both, the text in two columns per page), sidhuvud logo_vanster|logo_hoger (the logo left and the page number right, or the reverse; the header has no company name), logotyp — the audit firm's logo, uploaded by a person under Konto och företag — logotyp_hojd 8|12|16|20 (mm) and logotyp_sidor alla|forsta (every page, or only the first); the base style, margins, page header and page numbers are the annual report's), `kalla` per setting (bokslut: read from the year-end; har: changed here; grund: not in the year-end, entered here; konto: the audit firm's account default; profil: the style profile's default; standard: the program's default), `stilar` [{id, namn}] (the account's style profiles; empty: no stil to choose), `block` [{kod, sektion ar|ak, rubrik, text, egen, plural, har_plural, begrepp, tillhor, forslag [names], kontrollera}] in document order (`ar` = the report on the annual report, `ak` = on other requirements), `kontrollera` [kod] (own texts written before a setting changed — read them against the new settings, then acknowledge with save_revisionsberattelse kvittera), and `paket` {form ab|ef|brf|hb|ideell|stiftelse (hb also for kommanditbolag), version, kalla, namn, koncern (the package has group texts — only aktiebolag), taggad (tagged iXBRL that Bolagsverket takes digitally — only aktiebolag; the others are a plain document the revisor signs as PDF)}. The form follows the company's organisationsform in the year-end; svenska_kyrkan answers unsupported_form. `paket.uppgifter` lists settings only that form has — for stiftelse: revideras arsredovisning|arsbokslut|sammanstallning (what the revisor audited; it renames the report and what the opinion tests against — ask, never guess), forvaltare (true: managed by a förvaltare, from the year-end's persons) and tryggandelagen (a pension or staff foundation, RevR 700 example 12). `paket.vd` and `paket.disposition` false: the form has no VD or no disposition statement, and those settings change nothing. The blocks have the same kod in every form; the package names them (hb and ideell: 'Uttalande' in the singular, no fastställelse, hb's Företagsledningens ansvar) and leaves out what does not apply. A block with empty text is left out of the document; `tillhor` means it has no heading of its own and is appended to that block's text (ak_forteckning_lan after ak_uttalanden). `kontroller` [{kod, niva fel|varning|info, text, block?}] are the program's checks before Bolagsverket's: fel holds up filing — rb_revisor_saknas, rb_ort_saknas, rb_datum_saknas, rb_uttalanden_saknas, rb_ansvarsfrihet_saknas, rb_datum_fore_styrelsen (dated before the board signed); varning does not — rb_datum_efter_stamman, rb_ansvar_bada / rb_ansvar_inget (styrelsens or likvidatorns ansvar: one, not both and not neither), rb_grund_utan_beskrivning (a modified opinion whose Grund för uttalanden is only the standard text), rb_hakparentes (a [placeholder] left from a suggestion), rb_kontrollera; info: rb_otaggat (inkomstskatterapporten and the anmärkning flags stay untagged until Bolagsverket accepts the 2026-09-09 concepts; the text is still in the document). A fel about the date, ort or revisor is a question for the person — never fill in a date or a place yourself.","description":"The audit report (revisionsberättelse) for a company and year (ADR-0072), the tool card under Verktyg — aktiebolag, ekonomisk förening, bostadsrättsförening, handelsbolag, kommanditbolag, ideell förening and stiftelse, from FAR's normal text (RevR 700 examples 1, 18, 19, 10, 11, 12–15). Read it before changing anything. An audit report answer: `finns` (saved yet), `ren` (standardformulering: the texts follow the settings; any own text turns it off), `uppgifter` (the settings in force — namn, orgnr, start, slut, form, regelverk k2|k3, vd, ledamoter, resultat vinst|forlust, utdelning, kassaflode, koncern (the parent company prepares koncernredovisning: the texts speak of årsredovisningen och koncernredovisningen, FAR RevR 700 exempel 2), ansvar_kort, revisionsbolag, revisorer [{fornamn, efternamn, titel, huvudansvarig}], ort, datum, mottagare, anmarkning_skatter, anmarkning_sen, and the appearance: stil standard or the id of a style profile the audit firm's account has (an e-revisor administrator makes and assigns them; its defaults apply where neither the report nor the account chose), typsnitt opensans|profil, storlek standard (as the annual report)|8|8.5|9|9.5|10|10.5|11|11.5|12 (pt), spalter 1|2 (two columns: the title over both, the text in two columns per page), sidhuvud logo_vanster|logo_hoger (the logo left and the page number right, or the reverse; the header has no company name), logotyp — the audit firm's logo, uploaded by a person under Konto och företag — logotyp_hojd 8|12|16|20 (mm) and logotyp_sidor alla|forsta (every page, or only the first); the base style, margins, page header and page numbers are the annual report's), `kalla` per setting (bokslut: read from the year-end; har: changed here; grund: not in the year-end, entered here; konto: the audit firm's account default; profil: the style profile's default; standard: the program's default), `stilar` [{id, namn}] (the account's style profiles; empty: no stil to choose), `block` [{kod, sektion ar|ak, rubrik, text, egen, plural, har_plural, begrepp, tillhor, forslag [names], kontrollera}] in document order (`ar` = the report on the annual report, `ak` = on other requirements), `kontrollera` [kod] (own texts written before a setting changed — read them against the new settings, then acknowledge with save_revisionsberattelse kvittera), and `paket` {form ab|ef|brf|hb|ideell|stiftelse (hb also for kommanditbolag), version, kalla, namn, koncern (the package has group texts — only aktiebolag), taggad (tagged iXBRL that Bolagsverket takes digitally — only aktiebolag; the others are a plain document the revisor signs as PDF)}. The form follows the company's organisationsform in the year-end; svenska_kyrkan answers unsupported_form. `paket.uppgifter` lists settings only that form has — for stiftelse: revideras arsredovisning|arsbokslut|sammanstallning (what the revisor audited; it renames the report and what the opinion tests against — ask, never guess), forvaltare (true: managed by a förvaltare, from the year-end's persons) and tryggandelagen (a pension or staff foundation, RevR 700 example 12). `paket.vd` and `paket.disposition` false: the form has no VD or no disposition statement, and those settings change nothing. The blocks have the same kod in every form; the package names them (hb and ideell: 'Uttalande' in the singular, no fastställelse, hb's Företagsledningens ansvar) and leaves out what does not apply. A block with empty text is left out of the document; `tillhor` means it has no heading of its own and is appended to that block's text (ak_forteckning_lan after ak_uttalanden). `kontroller` [{kod, niva fel|varning|info, text, block?}] are the program's checks before Bolagsverket's: fel holds up filing — rb_revisor_saknas, rb_ort_saknas, rb_datum_saknas, rb_uttalanden_saknas, rb_ansvarsfrihet_saknas, rb_datum_fore_styrelsen (dated before the board signed); varning does not — rb_datum_efter_stamman, rb_ansvar_bada / rb_ansvar_inget (styrelsens or likvidatorns ansvar: one, not both and not neither), rb_grund_utan_beskrivning (a modified opinion whose Grund för uttalanden is only the standard text), rb_hakparentes (a [placeholder] left from a suggestion), rb_kontrollera; info: rb_otaggat (inkomstskatterapporten and the anmärkning flags stay untagged until Bolagsverket accepts the 2026-09-09 concepts; the text is still in the document). A fel about the date, ort or revisor is a question for the person — never fill in a date or a place yourself.\n\n`forslag` {block, namn} also returns that block's suggested text filled in with the settings (the names are in each block's `forslag`; null when there is none), and `forslag_ovrigt` {rubrik?, plural?, uppgifter?} — what the suggestion changes besides the text: a modified opinion's heading (Uttalanden med reservation …), FAR's plural heading, or a setting such as anmarkning_sen. Apply them together with save_revisionsberattelse (block {kod: {text, rubrik, plural}}, uppgifter), and only when the revisor wants that suggestion. The suggestions come from FAR's examples (RevR 700, 701, 705, 21 and the exempelsamling: kontrollbalansräkning, missing cash flow statement, stämma documents not available, dividend in breach of ABL 17 kap., no written representations (no opinion), opening balances, an inventory count not observed …); only those that fit the form and its settings are listed. Some situations span blocks — a modified opinion and its Grund för uttalanden, an anmärkning and an Övrig upplysning — so offer the matching pair. In a brf, a joint report by an auktoriserad/godkänd and a förtroendevald revisor (exempelsamling 5.2) is not a suggestion but the setting gemensam (paket.uppgifter; preset when the year-end has a qualified and another revisor): it switches the standard texts, adds lekman_ansvar, and keeps the standard wording. What the revisor must write in stands in square brackets — [belopp], [not X], [ÅÅÅÅ], [Styrelsen/Verkställande direktören] — and you never fill those in from guesswork: ask, or leave them for the revisor. For the document itself, use get_revisionsberattelse_ixbrl.\n\nTHE REPORT IS THE REVISOR'S OPINION, not the company's document. The standard wording is FAR's normal text for a clean report (RevR 700). Whether the opinion is modified, whether there is an anmärkning, whether ansvarsfrihet is recommended, and what goes under Övrig upplysning or Särskilt betydelsefulla områden is the revisor's judgement: write them only from what the revisor tells you, and never choose them because the books seem to point that way — say what you see and ask. Settings that come from the year-end (VD, utdelning, kassaflöde, K2/K3, the revisor) you may read; change them here only when the person says the report should differ. A company in liquidation has no setting: empty styrelsens_ansvar (and ak_styrelsens_ansvar) and write likvidatorns_ansvar instead. Filing the report to Bolagsverket is not a tool — the revisor or the company submits it from the card in the app (revisionsberattelse/forbered and /inlamning), as a digital copy tied to the annual report by the org.nr and the same signer. Its codes, should you meet them: rb_check_failed (the program's own checks found a fel — nothing went to Bolagsverket; read `kontroller`), check_failed (Bolagsverket's check found errors), agreement_required, signer_missing (nobody marked to sign in the year-end settings and no one chosen), invalid_personal_number, missing_email, filing_disabled. Errors: missing_fiscal_year, unsupported_form.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"forslag":{"type":"object","properties":{"block":{"type":"string","description":"The block's kod"},"namn":{"type":"string","description":"The suggestion's name, from the block's `forslag`"}},"required":["block","namn"],"additionalProperties":false,"description":"Return one suggested text, filled in"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_revisionsberattelse_ixbrl","group":"revision","klass":"lasa","summary":"The audit report as Bolagsverket's iXBRL document (ADR-0072): the 2026-08-31 taxonomy, entry point se-ar-rar, as the app would file it (for every form but aktiebolag the same document untagged — plain XHTML, since Bolagsverket does not take theirs digitally yet): split into A4 pages with the annual report's page header and numbers. Answer: `filnamn` (a name to save it under), `ixbrl` (the XHTML), `sidindelning` {sidor, avsnitt [{nyckel, rubrik, sida, brytning forsta|standard|manuell|automatisk|null, borttagen}], varningar}, `ren`, `kontrollera` (own texts not yet checked against changed settings — say so before calling the document ready). Saving the file is for the person; nothing here files or signs. It is unsigned: the revisor signs the original. A missing ort, datum or revisor leaves that part out — read get_revisionsberattelse first and ask for what is missing rather than describing the document as complete. Errors: missing_fiscal_year.","description":"The audit report as Bolagsverket's iXBRL document (ADR-0072): the 2026-08-31 taxonomy, entry point se-ar-rar, as the app would file it (for every form but aktiebolag the same document untagged — plain XHTML, since Bolagsverket does not take theirs digitally yet): split into A4 pages with the annual report's page header and numbers. Answer: `filnamn` (a name to save it under), `ixbrl` (the XHTML), `sidindelning` {sidor, avsnitt [{nyckel, rubrik, sida, brytning forsta|standard|manuell|automatisk|null, borttagen}], varningar}, `ren`, `kontrollera` (own texts not yet checked against changed settings — say so before calling the document ready). Saving the file is for the person; nothing here files or signs. It is unsigned: the revisor signs the original. A missing ort, datum or revisor leaves that part out — read get_revisionsberattelse first and ask for what is missing rather than describing the document as complete. Errors: missing_fiscal_year.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_signering","group":"stamma","klass":"lasa","summary":"The Scrive signing of the year's documents, as Slutför shows it: the annual report's original and — for aktiebolag and föreningar — the stämmoprotokoll. Per document: `signering` (the latest, status draft|sent|completed|rejected|cancelled|expired|error, or null when never sent), `parter` live from Scrive (namn, roll signing_party|viewer|approver, ordning, metod, signerat, sett, avvisat, personnummer masked — null when Scrive could not be reached), `tidigare` (the year's earlier signings; the latest is the one that counts), `kontrollsumma` (of what was sent, computed as Bolagsverket computes theirs, base64), `utanfor` (the milestone 'signed' is marked done outside the program — see set_status_markering; signed outside the program: do not report a missing signing then) and `rad` (digital|traditionell). With `dokument` set, also the dialog's basis: who signs and in what order (undertecknare, then revisorer last), their email, personnummer (masked for you, xxxxxx-1234 — the send keeps the stored one) and method from Inställningar, the default texts before the names, `oppen` (a signing is under way) and `andrad` (true: the document changed after it was sent or signed — it must be signed again; null: cannot tell; can take a few seconds).","description":"The Scrive signing of the year's documents, as Slutför shows it: the annual report's original and — for aktiebolag and föreningar — the stämmoprotokoll. Per document: `signering` (the latest, status draft|sent|completed|rejected|cancelled|expired|error, or null when never sent), `parter` live from Scrive (namn, roll signing_party|viewer|approver, ordning, metod, signerat, sett, avvisat, personnummer masked — null when Scrive could not be reached), `tidigare` (the year's earlier signings; the latest is the one that counts), `kontrollsumma` (of what was sent, computed as Bolagsverket computes theirs, base64), `utanfor` (the milestone 'signed' is marked done outside the program — see set_status_markering; signed outside the program: do not report a missing signing then) and `rad` (digital|traditionell). With `dokument` set, also the dialog's basis: who signs and in what order (undertecknare, then revisorer last), their email, personnummer (masked for you, xxxxxx-1234 — the send keeps the stored one) and method from Inställningar, the default texts before the names, `oppen` (a signing is under way) and `andrad` (true: the document changed after it was sent or signed — it must be signed again; null: cannot tell; can take a few seconds).\n\nSending is not a tool: it emails the signatories, and a person presses the button in Slutför (ADR-0018). Errors: missing_fiscal_year, invalid_enum (dokument), not_applicable (protokoll for a form without a stämma). The send in Slutför can answer already_sent (a signing is under way — cancel it first), no_signatories (nobody who signs is in Inställningar) and invalid_party (an email or personnummer is wrong), and with the protokoll in the same file not_applicable (a stämma held as a meeting, an owner who does not sign the årsredovisning, a company as owner, or a revisor); tell the person what to fix in Inställningar. `protokoll` in the basis says whether the protokoll may go in the original`s file (no revisor, per capsulam, every owner signs the årsredovisning — a vd without shares may sign only that) and why not; `parning` says per person whether owner and board row matched on personnummer or only the name. The decision date is the last signature; stamma_datum is filled from it when empty. `ingick` on the protokoll means it is signed with the original.\n\nAn extra stämma (ADR-0025 punkt 10, under Verktyg) is its own document: dokument 'extrastamma' with stamma_id. The answer is then only that stämma's block, its signatories are the stämma's own people (not Inställningar), there is no `utanfor`, and Slutför never shows it. Errors: unknown_stamma (no such extra stämma for the year).","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dokument":{"type":"string","enum":["arsredovisning","stammoprotokoll","extrastamma"],"description":"Also return the signing dialog's basis for this document; extrastamma needs stamma_id"},"stamma_id":{"type":"integer","description":"The extra stämma, with dokument 'extrastamma'"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_skatteavstamning","group":"skatt","klass":"lasa_ute","summary":"The skatteavstämning (ADR-0036, the old app's 7.2): the company's tax debt (−) or claim (+) at the balance-sheet date for this and the previous fiscal year, reconciled against the books. Amounts in öre, debt negative. Answers ar and fg (the years), data (what is saved: per column inkomstskatt and loneskatt — null means the suggestion from the tax calculation in forslag — fastighet, ovrigt [{text, belopp}] and fskatt [{perioder, belopp, kalla}]; efter (F-skatt paid after the date that belongs to the years); konton (the accounts reconciled against, default 2510-2519,1640-1649); skattekonto {med, konto, saldo, kalla}), prel (which months the preliminary tax is paid, SFL 62:4 and 3:5 — a broken year June–May pays August–July), summor (per column, total, att_betala) and bokforing (the accounts' balances, differens, and avvikelse_skattekonto: account 1630 against Skatteverket's balance).","description":"The skatteavstämning (ADR-0036, the old app's 7.2): the company's tax debt (−) or claim (+) at the balance-sheet date for this and the previous fiscal year, reconciled against the books. Amounts in öre, debt negative. Answers ar and fg (the years), data (what is saved: per column inkomstskatt and loneskatt — null means the suggestion from the tax calculation in forslag — fastighet, ovrigt [{text, belopp}] and fskatt [{perioder, belopp, kalla}]; efter (F-skatt paid after the date that belongs to the years); konton (the accounts reconciled against, default 2510-2519,1640-1649); skattekonto {med, konto, saldo, kalla}), prel (which months the preliminary tax is paid, SFL 62:4 and 3:5 — a broken year June–May pays August–July), summor (per column, total, att_betala) and bokforing (the accounts' balances, differens, and avvikelse_skattekonto: account 1630 against Skatteverket's balance).\n\nThe answer also carries skattekonto: the saved tax account distributed (below), or null when this year's tax account is not fetched — no call to Skatteverket. The bookkeeping account (bokforing.skattekonto.konto) is the year setting skattekonto_konto, shared with get_skattekonto.\n\nskattekonto: true instead distributes the tax account (ADR-0050): this year's and the previous year's saved tax account (get_skattekonto), fetched and saved when missing; uppdatera: true fetches this year's again. Answers each debiterad preliminärskatt with avser (fg | fore | efter | annat) from the rule, Skatteverket's own balance at the balance-sheet date (saldo_ore), final-tax rows for information (kannedom), kalla and fg_kalla (sparat | live | saknas). Fetching needs the agency's ombud authority for the company: without it unauthorized. Show the person the distribution before saving the form.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, invalid_account; with skattekonto also missing_org_number, unauthorized, not_found, rejected, not_configured, provider_unreachable, provider_error; internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"skattekonto":{"type":"boolean","description":"Distribute the saved tax account instead (fetched and saved when missing)"},"uppdatera":{"type":"boolean","description":"With skattekonto: fetch this year's tax account again"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_skatteavstamning_justering","group":"skatt","klass":"lasa","summary":"The bokslutsjustering that would settle the skatteavstämning (ADR-0036) — a PROPOSAL in save_bokslut_justering's form (booking_date = the year's last day, category ovrigt, description, rows). vad = differens: the difference between the books (bokforing.total) and the skatteavstämning is taken off konto (default 2510; one of the reconciled accounts). vad = omforing: the tax account in the books (1630) differs from Skatteverket's balance — the difference is moved off 1630, usually to 2518 Betald F-skatt. The motkonto gets the opposite amount. The person ALWAYS chooses the motkonto — never pick one yourself; ask. resultatkonto: true when the motkonto changes the year's result — say so.","description":"The bokslutsjustering that would settle the skatteavstämning (ADR-0036) — a PROPOSAL in save_bokslut_justering's form (booking_date = the year's last day, category ovrigt, description, rows). vad = differens: the difference between the books (bokforing.total) and the skatteavstämning is taken off konto (default 2510; one of the reconciled accounts). vad = omforing: the tax account in the books (1630) differs from Skatteverket's balance — the difference is moved off 1630, usually to 2518 Betald F-skatt. The motkonto gets the opposite amount. The person ALWAYS chooses the motkonto — never pick one yourself; ask. resultatkonto: true when the motkonto changes the year's result — say so.\n\nThen book it with save_bokslut_justering (dry_run first), only after the person has said yes to exactly that entry; it then follows the bokföringsorder (get_bokforingsorder). Save the form first: the proposal is made from what is saved.\n\nErrors: nothing_to_book (no difference), invalid_account, invalid_enum, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"vad":{"type":"string","enum":["differens","omforing"],"description":"differens (against the books) or omforing (1630 against Skatteverket)"},"konto":{"type":"string","description":"differens: the account the difference is taken off (default 2510)"},"motkonto":{"type":"string","description":"The motkonto the person chose"}},"required":["client_id","fiscal_year_id","vad"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_skatteberakning","group":"skatt","klass":"lasa","summary":"The year's tax calculation, computed and ready to show: the INK2 fields in the form's flow, their values and sources, the taxable result, the tax, and the bookings it makes.","description":"The year's tax calculation, computed and ready to show: the INK2 fields in the form's flow, their values and sources, the taxable result, the tax, and the bookings it makes.\n\nREADS ONLY. It is always a dry run — opening the calculation never books anything. The system adjustment is written the first time something is saved with save_skatteberakning, and from then on it is recomputed automatically after every import and adjustment. `oppnad` says whether that has happened for this year.\n\nTHE ANSWER is the tax calculation (ADR-0016). By default (urval 'ifyllda') `falt` holds only the fields that have a value or are overridden, each {punkt, sru, etikett, datatyp, varde, kalla, skrivbar, overskriven, rader?}; `falt_utelamnade` counts the rest and `grupper` is left out. Ask for urval 'alla' when you need an empty field's help text, lagrum or whether it is shown — the whole form is 60 000–85 000 characters. The parts:\n  steg[] — the form's flow in order: {kod, rubrik, falt: [keys], dolda}. dolda counts advanced fields with no value that the form hides. Two steps are appendices whose content is in n_bilagor, not falt: n3b (before the tax adjustments, since its result feeds 4.8b/4.8d), n4 and n8 (before the tax adjustments; they feed 4.7c/4.7d and 4.11/4.12) and n9 (after the tax losses).\n  falt{} — keyed by the registry's own names (ej_avdragsgilla_kostnader), NOT by the blankett point. Each has punkt (\"4.3c\", or {+: \"4.15\", -: \"4.16\"} when the sign picks the box), etikett, hjalp, lagrum, datatyp (belopp | boolesk | text | flerval — a comma-separated list of keys from alternativ{}, e.g. INK3's ändamål | procent — '19,65' | antal — whole number, e.g. square metres), vikt (+1 adds to the taxable result, -1 subtracts), kalla, skrivbar, varde, overskriven, and forslag / foregaende / rader where they apply. forslag_konton lists the accounts behind a forslag [{konto, namn, text, belopp}] — each account's share in whole kronor, in the field's direction, only accounts with a balance; rounding per account can differ one krona from forslag. upplysning (with upplysning_konton) is the dividend booked on 8010/8012/8110–8113, shown at the MANUAL field 4.5b only as information — it is not in varde, and only the person decides whether it goes in (finding utdelning_skattefri_kontrollera).\n  kalla — where the value comes from: matris (the balances), forslag (summed from accounts, can be overridden), modul:inkomstskatt (computed, read-only), foregaende_ar (last year's loss carried forward, can be overridden — it rolls on over any number of years, since each year's carried value is saved when the year is computed for real, also with booking turned off), r_kolumn (INK3: the amount on the same row of the räkenskapsschema as booked, in `redovisning` — the taxable column's suggestion, overridden to take out what is tax-free), harledd (follows from another field), manuell. Only fields with skrivbar true can be saved.\n  berakning — underlag (4.15 with the calculated tax at zero), grundavdrag (INK3: 15 000 for an allmännyttig ideell förening, IL 63 kap. 11 §, otherwise 0; it lowers the booked tax, it is not on the form), avrundat (down to whole tens), skattesats, skatt (whole kronor, down), skattemassigt_resultat and its punkt.\n  val{} — choices that steer the calculation but are not on the blankett and never reach XBRL or the PDF: {etikett, hjalp, notis, alternativ, standard, varde}. steg[].val lists a step's choices; which exist depends on the form and the other choices. notis is a short warning always shown under the choice — relay it (N9 on INK4: not needed when only natural persons owned the partnership all year; on INK3: nothing is carried over, see bilagor). Examples: loneskatt_bokforing — auto (book the calculated löneskatt if none is booked; book nothing if what is booked is within the tolerance of it), alltid (always book it), aldrig (compute, never book); skatt_bokforing, aretsresultat_bokforing and periodiseringsfond_bokforing — the same three choices: auto books nothing when the same amount (within a krona) already stands booked, and the full calculated amount with a finding when something else does — never a difference; periodiseringsfond_avsattning; n9_upprattas (nej/ja); INK3's skattskyldighet and deklarationsvag; a brf's brf_beskattning.\n  berakning.loneskatt — särskild löneskatt on 1.4 minus 1.5: underlag, sats, loneskatt (whole kronor), bokford_ore (already on 7530/7532/7533), bokfors_ore / bokfors (what is booked now), tolerans, vid_avvikelse, and beslut: ingen | hela | mellanskillnad | redan_bokford | valt_bort. It is booked BEFORE the income tax, so 4.1 is the result after it.\n  berakning.overavskrivning — the Överavskrivningar tab, machinery and equipment: ingaende, anskaffningar (suggested from the year's debit, forslag.inkop), avyttringar, rader[] (per year: slut, belopp, andel, varde), lagsta_huvudregel, lagsta_komplettering, regel, lagsta, utrymme (negative means too much is written off), bokfort_av_bolaget, forandring, bokforing, beslut, ack_efter, ifylld. It books 8850/2150 only when forandring is saved. berakning.periodiseringsfond — fonder[] (the register: konto, arsgang = the year the fiscal year of the avsättning ENDED, as in BAS account names; ingaende, aterforing, kvar, tvingande = sixth year so reversed in full, sista_ar, kalla foregaende_ar | saldo | manuell, skrivet = what is saved), kalla, ib, slr_datum, berakning (schablon 4.6a, upprakning 4.6d, slr_anvand, andel, manader) and avsattning (underlag_fore, max, avsattning, konto). Återföring is booked årgång account / 8819, avsättning 8811 / 212x. Order: the återföring, then N9 (when upprättad), then the avsättning — its cap is 25 % of the result after N9's contributions to 4.3c/4.4b.\n  systemrader — what the calculation books: 7533/2514 the löneskatt, 21xx/8819 and 8811/21xx the funds, 8910/2510 the tax, 8999/2099 the result (2069 for ideella föreningar and stiftelser; for a handelsbolag 2019/2029/2039/2049, split between the partners by share). systemjustering names the locked adjustment they sit on (A-number) once written.\n  fynd — findings, e.g. skatt_redan_bokford (see get_bokslut_kontroller).\n  THE FORM FOLLOWS THE COMPANY (ADR-0016 point 15): aktiebolag and ekonomiska föreningar declare on INK2, ideella föreningar and stiftelser on INK3, handelsbolag and kommanditbolag on INK4. blankett says which. INK3's root is 7.9/7.10; 7.1/7.2 is the sum of the r_* fields — the räkenskapsschema's taxable column, 6.2–6.18 — and 6.1 medlemsavgifter and 6.19 tax have no taxable column, so they never reach 7.1. Its suf_* (föreningar, 4.x) and sus_* (stiftelser, 3.x) fields exist only when val.skattskyldighet is inskrankt (allmännyttig). skattskyldighet has NO default: until someone chooses, the year is computed with general rules and ink_val_saknas stops the filing — ask the person, never pick it. val.deklarationsvag kapital switches INK3 to INK3K: only capital and handelsbolag income, root 2.16/2.17 (overskott_kapital), no räkenskapsschema and no INK3S; shared fields such as underskott_foregaende_ar keep their key and move to their INK3K point (2.9). Fields whose condition does not hold are absent from falt{}. INK4 has NO income tax — the partners are taxed — so berakning.skatt, avrundat and skattesats are null, berakning.moduler lists what runs, and the root is 4.12/4.13, the result split between the partners.\n  berakning.delagare — INK4 only, null elsewhere: rader[] {sort_order 1–4, pnr, namn, utlandsk, andel (percent), resultat (this partner's share of 4.12/4.13 in whole kronor), konto_resultat (2019, 2029 …), tillskott/uttag (saved or null), tillskott_forslag/uttag_forslag (from the partner's capital accounts: uttag 2011–2013, tillskott 2017–2018 in their series), tillskott_varde/uttag_varde (what goes in the file)} and summa_andel.\n  skriven / ej_skriven — whether the system adjustment was written, and if not why: dry_run, ovrigt_noskatt (the setting that turns bookings off) or ar_last (closed year).\n\nAMOUNTS ARE WHOLE KRONOR, and entered POSITIVE — vikt gives the direction. Only fields with tvasidig true take a negative amount.\n\nErrors: missing_fiscal_year; form_unsupported (the company's organisationsform has no tax calculation — INK2, INK3 and INK4 are built; say so, do not retry); edition_unknown (the year is pinned to a taxonomy edition the program no longer knows; report it); internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"urval":{"type":"string","enum":["ifyllda","alla"],"description":"ifyllda (default): only fields with a value. alla: the whole form, every field's metadata."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_skatteberakning_xbrl","group":"skatt","klass":"lasa","summary":"The year's income tax return (INK2 with INK2R and INK2S; for a handelsbolag INK4 with INK4R, INK4S and the partners' details as one tuple each, listed in delagare[]) as the XBRL file the person uploads to skatteverket.se (ADR-0016). A partner's personnummer is masked in what you get (xxxxxx-1234, in xbrl, fakta and delagare); upload_skv_deklaration builds the file on the server with the full numbers.","description":"The year's income tax return (INK2 with INK2R and INK2S; for a handelsbolag INK4 with INK4R, INK4S and the partners' details as one tuple each, listed in delagare[]) as the XBRL file the person uploads to skatteverket.se (ADR-0016). A partner's personnummer is masked in what you get (xxxxxx-1234, in xbrl, fakta and delagare); upload_skv_deklaration builds the file on the server with the full numbers.\n\nCREATES A FILE, BOOKS NOTHING, SUBMITS NOTHING. The calculation runs as a dry run. upload_skv_deklaration uploads this file as a draft; the approval on skatteverket.se is always done by a person — never suggest you can file.\n\nTHE ANSWER: filnamn, utgava (taxonomy edition), xbrl (the file as text), antal_fakta, fakta[] ({begrepp, varde, kontext}: PERIOD0 for the fiscal year, BALANS0 for the balance date), fynd[] and fel (how many findings are errors), and bilagor[] — each appendix as its own file ({blankett, paketnamn, filnamn, utgava, xbrl, fakta, tupler}; N9 when n9_upprattas is 'ja'; N3B one per partnership with exemplar and identitet), filed in the same package. The main file has three parts: the company's organisationsnummer and dates, the calculation's fields (INK2 page 1 and INK2S), and INK2R summed from the balances AFTER the calculation's own bookings, through the same account → field mapping as the saldomatris. Amounts are whole kronor; the sign follows each concept's debit/credit balance, so revenue and equity are positive.\n\nA FILE WITH ERRORS MUST NOT BE FILED. Explain each error-level finding: ink2r_konto_tvetydigt (an account could be 7511 or 7512 — choose in the saldomatris), ink2r_konto_utan_falt, xbrl_begrepp_saknas, xbrl_motstridiga_fakta (4.1 and 3.26 disagree), ink2r_balanserar_inte (INK2R's balance sheet does not balance to the öre — the message names the cause: accounts without a field, the ledger itself not balancing, or the year's result transferred twice to 8999/2099), ink2r_resultat_avviker (INK2R's income statement does not sum to 3.26), xbrl_organisationsnummer_saknas. xbrl_berakning_ej_sparad is a warning: the calculation has not been saved, so the tax is in the file but not in the books.\n\nThe same basis is also printed on Skatteverket's form SKV 2002 by the card's PDF button (berakning/pdf, no tool — it returns a binary file), with the appendices after it: N9's pages (SKV 2158) and one N3B page (SKV 2167) per partnership, each on the form for the same period. If the person reports that it failed with template_missing, the form for that declaration period has not been added to the program yet; the XBRL file is unaffected.\n\nErrors: missing_fiscal_year; missing_org_number (the company has no valid organisationsnummer; no file is made); form_unsupported; edition_unknown; internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_skattekonto","group":"skatt","klass":"lasa_ute","summary":"The company's tax account (skattekonto) at Skatteverket for the fiscal year, saved (ADR-0050). Answers sparad, live, hamtad, hamtad_av, fonster {fran, till} (the year's start to the balance-sheet date plus one month), saldon {ib, ub, efter: {datum, avsett, skv, kfm}} — Skatteverket's own balance at the end of the day before the year, on the balance-sheet date and after (positive = a claim on Skatteverket; datum differs from avsett when that day has not come yet), transaktioner [{datum, text, skv, kfm, saldo (running, Skatteverket's part), forfallodag, kommande}], skv_fran and ofullstandig (Skatteverket gives transactions at most 915 days back; the balances are right anyway), konto {spec, kalla: installning | harlett} — the bookkeeping account for the tax account, the year setting skattekonto_konto or derived from the year's balances — bokfort, avvikelse (bokfort minus Skatteverket's balance on the balance-sheet date), andrad, tidigare and last. Amounts in öre.","description":"The company's tax account (skattekonto) at Skatteverket for the fiscal year, saved (ADR-0050). Answers sparad, live, hamtad, hamtad_av, fonster {fran, till} (the year's start to the balance-sheet date plus one month), saldon {ib, ub, efter: {datum, avsett, skv, kfm}} — Skatteverket's own balance at the end of the day before the year, on the balance-sheet date and after (positive = a claim on Skatteverket; datum differs from avsett when that day has not come yet), transaktioner [{datum, text, skv, kfm, saldo (running, Skatteverket's part), forfallodag, kommande}], skv_fran and ofullstandig (Skatteverket gives transactions at most 915 days back; the balances are right anyway), konto {spec, kalla: installning | harlett} — the bookkeeping account for the tax account, the year setting skattekonto_konto or derived from the year's balances — bokfort, avvikelse (bokfort minus Skatteverket's balance on the balance-sheet date), andrad, tidigare and last. Amounts in öre.\n\natgard uppdatera fetches from Skatteverket and saves; live {fran, till} fetches another interval and saves nothing (fran at most 915 days back, till at most today). Both need the agency's ombud authority: without it unauthorized — the person can fetch in their own name with BankID in the app; you cannot. uppdatera not in a locked year.\n\n(atgard excel — the saved account as the Excel file from Slutför, base64 — is for the app; not_fetched when nothing is saved.)\n\nErrors: missing_fiscal_year, unknown_fiscal_year, invalid_enum, year_locked, required, invalid_date, not_fetched; when fetching also missing_org_number, unauthorized, not_found, rejected, not_configured, provider_unreachable, provider_error, bankid_required; internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"atgard":{"type":"string","enum":["las","uppdatera","live"],"description":"las (default, what is saved), uppdatera (fetch and save) or live (another interval, not saved)"},"fran":{"type":"string","description":"live: from date YYYY-MM-DD"},"till":{"type":"string","description":"live: to date YYYY-MM-DD"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_skv_deklarationsstatus","group":"skatt","klass":"lasa_ute","summary":"The company's income tax returns at Skatteverket, per period: Deklaration utskickad, Deklaration inlämnad or Slutlig skatt fastställd. Reads Skatteverket; changes nothing there. A status that changed since the last fetch is recorded in the program's history and listed in andrade[] (one row per change, never overwritten — shown in Slutför).","description":"The company's income tax returns at Skatteverket, per period: Deklaration utskickad, Deklaration inlämnad or Slutlig skatt fastställd. Reads Skatteverket; changes nothing there. A status that changed since the last fetch is recorded in the program's history and listed in andrade[] (one row per change, never overwritten — shown in Slutför).\n\nmiljo is test (api.test.skatteverket.se) or prod (api.skatteverket.se); leave it out for the program's default. Each period carries raTom (the fiscal year's last day), deklarationstyp (INK2/3/4) and fiscal_year_id when a fiscal year in the program ends that day.\n\nErrors from Skatteverket's API Inkomstdeklaration 2-4: not_configured (the program has no API keys or certificate for that environment — tell the person, it is set up by the program's maintainers); unauthorized (the certificate's organisation lacks authority for the company: status and prefilled data need a firmatecknare, VD or deklarationsombud — tell the person that a board member, VD or ombud can fetch it in their own name with BankID, from \"Hämta förtryckta uppgifter\" in the calculation form or \"Hämta med BankID\" for the status in Slutför; you cannot log in with anyone's BankID); bankid_required (the same, when a fetch in the person's own name has no or an expired BankID login — only the form can start one); not_found; rejected (Skatteverket refused the request — quote its text); period_not_open (the declaration period is not open yet — Skatteverket's text gives the day it opens; the preview also says so while the fiscal year has not ended); provider_error, provider_unreachable (worth one retry later; an HTTP 503 without Skatteverket's period text is this — the service is down, not the period). missing_org_number, missing_fiscal_year, invalid_enum. Every error from Skatteverket carries `korrelation`, the id Skatteverket's support asks for.\n\nUploading is upload_skv_deklaration (berakning/inlamning). It refuses with declaration_has_errors while any finding is an error and with calculation_not_saved until the calculation is saved. After an upload Skatteverket returns a link where an authorised representative reviews and signs on Mina sidor; the program never signs.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"miljo":{"type":"string","enum":["test","prod"],"description":"Skatteverket's environment; default from the program's settings."}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_skv_fortryckt","group":"skatt","klass":"lasa_ute","summary":"What Skatteverket has prefilled on the year's income tax return — the basis for fastighetsavgift and fastighetsskatt — read into the calculation's fields. READS ONLY; nothing is written into the calculation.","description":"What Skatteverket has prefilled on the year's income tax return — the basis for fastighetsavgift and fastighetsskatt — read into the calculation's fields. READS ONLY; nothing is written into the calculation.\n\nfalt[] has sru (Skatteverket's field code), nyckel and punkt (the calculation's field, e.g. 1.8), etikett and varde. okanda{} holds codes the calculation does not know. Compare with get_skatteberakning and tell the person where they differ. Insert a value only when the person asks: save_skatteberakning with varden {nyckel: varde}, dry_run first. Fields the program computes (skrivbar false) cannot take one. For a company this is mostly fastighetsavgift and fastighetsskatt, and an empty falt[] is a normal answer, not an error.\n\nErrors from Skatteverket's API Inkomstdeklaration 2-4: not_configured (the program has no API keys or certificate for that environment — tell the person, it is set up by the program's maintainers); unauthorized (the certificate's organisation lacks authority for the company: status and prefilled data need a firmatecknare, VD or deklarationsombud — tell the person that a board member, VD or ombud can fetch it in their own name with BankID, from \"Hämta förtryckta uppgifter\" in the calculation form or \"Hämta med BankID\" for the status in Slutför; you cannot log in with anyone's BankID); bankid_required (the same, when a fetch in the person's own name has no or an expired BankID login — only the form can start one); not_found; rejected (Skatteverket refused the request — quote its text); period_not_open (the declaration period is not open yet — Skatteverket's text gives the day it opens; the preview also says so while the fiscal year has not ended); provider_error, provider_unreachable (worth one retry later; an HTTP 503 without Skatteverket's period text is this — the service is down, not the period). missing_org_number, missing_fiscal_year, invalid_enum. Every error from Skatteverket carries `korrelation`, the id Skatteverket's support asks for.\n\nUploading is upload_skv_deklaration (berakning/inlamning). It refuses with declaration_has_errors while any finding is an error and with calculation_not_saved until the calculation is saved. After an upload Skatteverket returns a link where an authorised representative reviews and signs on Mina sidor; the program never signs.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"miljo":{"type":"string","enum":["test","prod"],"description":"Skatteverket's environment; default from the program's settings."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_stammoprotokoll","group":"stamma","klass":"lasa","summary":"The stämmoprotokoll (ADR-0025): the year's årsstämma, or with `stamma_id` an extra stämma (list_extrastammor). Forms with a stämma only: aktiebolag, ekonomisk förening, bostadsrättsförening, ideell förening — others answer not_applicable.","description":"The stämmoprotokoll (ADR-0025): the year's årsstämma, or with `stamma_id` an extra stämma (list_extrastammor). Forms with a stämma only: aktiebolag, ekonomisk förening, bostadsrättsförening, ideell förening — others answer not_applicable.\n\nThe årsstämma's decisions (fastställelse, disposition, ansvarsfrihet), its date, place and type are YEAR SETTINGS — read and change them with get_bokslut_settings / save_bokslut_settings (stamma_datum, stamma_ort, stamma_typ, stamma_faststallelse, stamma_disposition_beslut, stamma_ansvarsfrihet, stamma_revisorsval …), and its people (ordförande, protokollförare, justerare, ägare) are list_bokslut_persons / save_bokslut_persons. Here: `beslut` and `installningar` echo them.\n\nAn extra stämma keeps its date, place, type and ärende on the stämma (`installningar` {datum, ort, typ, arende}; change with update_extrastamma) and has its OWN people (`personer`; save_extrastamma_person) — never the year's. `beslutspunkter` lists ready decision texts to add with set_stammoprotokoll_paragraf atgard 'ny'.\n\nThe first read of an open year creates the årsstämma and locks the template version. `dokument: true` also renders the whole protokoll as XHTML (`dokument`) — the årsstämma's disposition is read from the rendered annual report, so it takes a few seconds.\n\nThe answer is the protokoll as it stands: `stamma` {id, slag arsstamma|extra, paket — the template version locked on the stämma}, `texter` {stamma, stamman, protokoll, agare} in the form's words (årsstämma, föreningsstämma, årsmöte, extra bolagsstämma …), `typ` fysisk|digital|percapsulam, `paragrafer` in order — each {nyckel ('m:<kod>' a template paragraph, 'e:<id>' an own one), rubrik, text (with {fält} placeholders), html_rubrik/html_text (filled in), andrad (own text on a template paragraph), egen, dold, lagstadgad (cannot be hidden), kopplad (its content follows the decisions or the people while the text is the template's)}, `undertecknare` {namn, roller, har_email, har_personnummer}, and `saknas` {fält: what is missing — say it to the person, the document shows it marked}. `read_only` with a reason when the year is filed or locked. Errors: missing_fiscal_year, not_applicable, unknown_stamma, package_missing (no template for the form — a program fault, report it).","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"stamma_id":{"type":"integer","description":"An extra stämma; without it the årsstämma"},"dokument":{"type":"boolean","description":"Also render the whole protokoll as XHTML"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_statslaneranta","group":"skatt","klass":"lasa","summary":"The statslåneränta — the reference rate Swedish tax law uses — for a date, or the one a fiscal year's periodiseringsfond schablonintäkt (INK2 4.6a) is computed on (ADR-0016).","description":"The statslåneränta — the reference rate Swedish tax law uses — for a date, or the one a fiscal year's periodiseringsfond schablonintäkt (INK2 4.6a) is computed on (ADR-0016).\n\nPass rakenskapsar_slut to get the rate at the end of November the year BEFORE the calendar year in which the fiscal year ENDS (IL 30 kap. 6 a §): a year 2025-06-01—2026-05-31 uses 2025-11-30. The end decides, not the start. Pass datum for the rate in force on a given day. Pass neither for today's.\n\nTHE SOURCE IS RIKSGÄLDEN, NOT RIKSBANKEN. Riksgälden fixes the rate every Thursday, in force from Friday to the following Thursday. Riksbank's 10-year government bond is a different rate — 2.74 against 2.55 at the end of November 2025 — so never substitute it.\n\n`ranta` is a percentage as a string: \"2.55\" means 2,55 %. `galler_fran` is the Friday the rate took effect, which is usually a few days before `datum`. Rates are cached; Riksgälden is asked only when the cache is empty, more than a week old, or uppdatera is true. If that fetch fails but rates are cached, the answer still comes back with `varning` set — pass it on, the rate may be a week stale.\n\nErrors: invalid_date (fix the date, YYYY-MM-DD), out_of_range (no rate fixed on or before that date — the cache starts in 1986), provider_unreachable (nothing cached and Riksgälden did not answer; worth one retry later).","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"rakenskapsar_slut":{"type":"string","description":"Last day of the fiscal year, YYYY-MM-DD. Returns the rate at the end of November the year before the year it ends in."},"datum":{"type":"string","description":"A date, YYYY-MM-DD. Ignored if rakenskapsar_slut is given."},"uppdatera":{"type":"boolean","description":"Fetch from Riksgälden first, even if the cache is fresh."}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_status_oversikt","group":"bolag","klass":"lasa","summary":"The fiscal year's status as the start page shows it: rows in the order of the law — bokslut, arsredovisning (upprättad, signerad), protokoll (forms with a stämma), bolagsverket (aktiebolag: Uppladdad = uploaded to the company's own space, Intygad = the fastställelseintyg signed there so the annual report has come in (case arsred_inkommen or later), Registrerad; ekonomisk förening and brf: Kopia inskickad) and deklaration — each a list of milestones in order (`kod`, `namn`). A milestone marked in its step (Upprättad) carries `av` (who) in `system`. Per milestone two separate axes that never overwrite each other: `system` — what the program knows {lage: klar|pagar|varning|null, datum, text} — and `markering` — the user's mark 'done outside the program' {datum, anteckning, av, markerad} or null. `klar` is true when either says so. `nasta` is the first milestone not done. `ordning` lists warnings about the legal order — the copy certified (Intygad) before the original or the protokoll was signed (original_ej_signerat, stamma_ej_hallen) — an upload before the stämma is fine — or the protokoll signed before the original (protokoll_fore_original); warnings, not blocks — say them to the person. Reads only what is stored; never calls Scrive, Bolagsverket or Skatteverket — uploads and answers from their test environments do not count. Answers 'what is left for this year?'. The last row `ovrigt` (only when the year has any) is the agency's own steps (Inställningar → Övrigt → Egna steg): milestones with `egen: true`, `status` (todo|in_progress|done), `deadline` and `anteckning`; they are not part of `nasta` or `ordning`. `anteckningar` {ar, klient} are the person's notes for the year and about the client — read them before advising. Errors: missing_fiscal_year.","description":"The fiscal year's status as the start page shows it: rows in the order of the law — bokslut, arsredovisning (upprättad, signerad), protokoll (forms with a stämma), bolagsverket (aktiebolag: Uppladdad = uploaded to the company's own space, Intygad = the fastställelseintyg signed there so the annual report has come in (case arsred_inkommen or later), Registrerad; ekonomisk förening and brf: Kopia inskickad) and deklaration — each a list of milestones in order (`kod`, `namn`). A milestone marked in its step (Upprättad) carries `av` (who) in `system`. Per milestone two separate axes that never overwrite each other: `system` — what the program knows {lage: klar|pagar|varning|null, datum, text} — and `markering` — the user's mark 'done outside the program' {datum, anteckning, av, markerad} or null. `klar` is true when either says so. `nasta` is the first milestone not done. `ordning` lists warnings about the legal order — the copy certified (Intygad) before the original or the protokoll was signed (original_ej_signerat, stamma_ej_hallen) — an upload before the stämma is fine — or the protokoll signed before the original (protokoll_fore_original); warnings, not blocks — say them to the person. Reads only what is stored; never calls Scrive, Bolagsverket or Skatteverket — uploads and answers from their test environments do not count. Answers 'what is left for this year?'. The last row `ovrigt` (only when the year has any) is the agency's own steps (Inställningar → Övrigt → Egna steg): milestones with `egen: true`, `status` (todo|in_progress|done), `deadline` and `anteckning`; they are not part of `nasta` or `ordning`. `anteckningar` {ar, klient} are the person's notes for the year and about the client — read them before advising. Errors: missing_fiscal_year.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_todo_count","group":"ovrigt","klass":"lasa","summary":"Get a todo count (plus breakdown by severity) for a single client, with the same optional filters as get_todos. Use for a quick badge/summary instead of pulling the full list.","description":"Get a todo count (plus breakdown by severity) for a single client, with the same optional filters as get_todos. Use for a quick badge/summary instead of pulling the full list.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"status":{"type":"string","enum":["open","done","dismissed","all"],"description":"Defaults to 'open' if omitted."},"severity":{"type":"string","enum":["high","medium","low"]},"assignee_id":{"type":"integer"},"source_module":{"type":"string"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_todo_counts_by_client","group":"ovrigt","klass":"lasa","summary":"Get open-todo counts assigned to the logged-in user, grouped by client_id, across every company they have access to. Use for a cross-client 'what's on my plate' overview.","description":"Get open-todo counts assigned to the logged-in user, grouped by client_id, across every company they have access to. Use for a cross-client 'what's on my plate' overview.","dryRun":false,"inputSchema":{"type":"object","properties":{},"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"get_todos","group":"ovrigt","klass":"lasa","summary":"List todo items for the selected client. Defaults to open todos only. Use to check what's outstanding before creating a duplicate, or to find a todo_id for update_todo/complete_todo.","description":"List todo items for the selected client. Defaults to open todos only. Use to check what's outstanding before creating a duplicate, or to find a todo_id for update_todo/complete_todo.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"status":{"type":"string","enum":["open","done","dismissed","all"],"description":"Filter by status. Defaults to 'open' if omitted."},"severity":{"type":"string","enum":["high","medium","low"],"description":"Filter by severity"},"assignee_id":{"type":"integer","description":"Filter to todos assigned to this user ID"},"source_module":{"type":"string","description":"Filter by source module e.g. 'manual', 'vat'"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"import_bokslut_accounted","group":"import","klass":"ersatta_ute","summary":"Read the fiscal year's balances directly from the client's Accounted (ADR-0057). The client must be connected first with an API key from Accounted, which a person enters in Dataimport — never you.","description":"Read the fiscal year's balances directly from the client's Accounted (ADR-0057). The client must be connected first with an API key from Accounted, which a person enters in Dataimport — never you.\n\nIt is the same import as a SIE file, only the way in differs: Accounted exports the fiscal year as SIE 4 without the year-end closing entry (and the previous year's when the file does not carry it), and it goes through the same parser, checks and writing. Accounted's fiscal year is found on the exact period of ours.\n\nALWAYS dry_run FIRST and tell the person what `preview` says before writing — this replaces the whole year's balances. Adjustments survive: ub_adjusted is recomputed afterwards. Accounted is asked again on the real call.\n\n`preview.accounted`:\n  har_jamforelse false — Accounted has no previous year; the comparative column is left empty. Say so.\n  ib_avvikelser — balance accounts whose opening balance this year is not last year's closing balance. It does not stop the import; name the accounts to the person.\n\nErrors:\n  integration_not_connected — the person connects Accounted in Dataimport (not you).\n  missing_credentials, invalid_credentials — no key stored, or Accounted no longer accepts it (revoked); the person enters a new key in Dataimport.\n  provider_forbidden — the key lacks a scope (companies:read, reports:read) or access to the company.\n  no_matching_year — Accounted has no fiscal year with exactly this period; the message lists the years there. Do not pick another year.\n  orgnr_mismatch, unbalanced — returned together with `preview`; nothing is written.\n  provider_unreachable, provider_rate_limited (100 calls a minute per key), provider_error, credentials_unreadable, encryption_not_configured, parse_failed.\n  year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dry_run":{"type":"boolean","description":"true returns the preview without writing. Do this first."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"import_bokslut_bjornlunden","group":"import","klass":"ersatta_ute","summary":"Read the fiscal year's balances directly from the client's Björn Lundén (BL Administration / Lundify, ADR-0058). The client must be connected first, which a person does in Dataimport — never you.","description":"Read the fiscal year's balances directly from the client's Björn Lundén (BL Administration / Lundify, ADR-0058). The client must be connected first, which a person does in Dataimport — never you.\n\nIt is the same import as a SIE file, only the way in differs: Björn Lundén exports the fiscal year as SIE 4, with the previous year in the same file when BL has it (otherwise it is exported for itself), and it goes through the same parser, checks and writing. BL's fiscal year is found on the exact period of ours.\n\nALWAYS dry_run FIRST and tell the person what `preview` says before writing — this replaces the whole year's balances. Adjustments survive: ub_adjusted is recomputed afterwards. BL is asked again on the real call.\n\n`preview.bjornlunden`:\n  har_jamforelse false — BL has no previous year; the comparative column is left empty. Say so.\n  ib_avvikelser — balance accounts whose opening balance this year is not last year's closing balance. It does not stop the import; name the accounts to the person.\n\nErrors:\n  integration_not_connected — the person connects Björn Lundén in Dataimport (not you).\n  missing_credentials, invalid_credentials — BL no longer accepts the company's key (the integration was switched off in Lundify); the person connects again in Dataimport.\n  provider_not_configured — e-revisor's own BL credentials are missing or rejected on the server; tell the person, it is ours to fix.\n  provider_forbidden, provider_not_found, provider_validation — BL refused the request; the message says why.\n  no_matching_year — BL has no fiscal year with exactly this period; the message lists the years there. Do not pick another year.\n  orgnr_mismatch, unbalanced — returned together with `preview`; nothing is written.\n  provider_unreachable, provider_rate_limited, provider_error, credentials_unreadable, encryption_not_configured, parse_failed.\n  year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dry_run":{"type":"boolean","description":"true returns the preview without writing. Do this first."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"import_bokslut_bokforing_online","group":"import","klass":"ersatta_ute","summary":"Read the fiscal year's balances directly from the client's Bokföring Online. The client must be connected first (the person does it in the import step).","description":"Read the fiscal year's balances directly from the client's Bokföring Online. The client must be connected first (the person does it in the import step).\n\nIt is the same import as a SIE file, only the way in differs: Bokföring Online exports the year as SIE 4, with the previous year (#RAR -1) in the same file, and it goes through the same parser, checks and writing. The year is found on the exact period of ours.\n\nALWAYS dry_run FIRST and tell the person what `preview` says before writing — this replaces the whole year's balances. Adjustments survive: ub_adjusted is recomputed afterwards. Bokföring Online is asked again on the real call.\n\n`preview.bokforing_online`:\n  har_jamforelse false — the file carries no previous year; the comparative column is left empty. Say so.\n  ib_avvikelser — balance accounts whose opening balance this year is not last year's closing balance. It does not stop the import; name the accounts to the person.\n\nBokföring Online's file has å, ä and ö replaced (a, a, o). Account names come from the BAS plan anyway; verification texts lack them.\n\nErrors:\n  integration_not_connected — the person connects in the import step first.\n  no_matching_year — Bokföring Online has no fiscal year with exactly this period; the message lists the years it has. Do not pick another year.\n  orgnr_mismatch, unbalanced — returned together with `preview`; nothing is written.\n  provider_forbidden — usually a missing licence; the export requires a paid one.\n  missing_credentials, invalid_credentials, credentials_unreadable, encryption_not_configured, provider_unreachable, provider_rate_limited, provider_error, parse_failed — see connect_bokforingsprogram.\n  year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dry_run":{"type":"boolean","description":"true returns the preview without writing. Do this first."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"import_bokslut_bokio","group":"import","klass":"ersatta_ute","summary":"Read the fiscal year's balances directly from the client's Bokio (ADR-0054). The client must be connected first — and that is done ONLY by a person in the browser: \"Koppla Bokio\" in Dataimport sends them to Bokio, where they log in and approve e-revisor for the company. You cannot connect Bokio; if the client is not connected, tell the person to do it there.","description":"Read the fiscal year's balances directly from the client's Bokio (ADR-0054). The client must be connected first — and that is done ONLY by a person in the browser: \"Koppla Bokio\" in Dataimport sends them to Bokio, where they log in and approve e-revisor for the company. You cannot connect Bokio; if the client is not connected, tell the person to do it there.\n\nIt is the same import as a SIE file, only the way in differs: Bokio hands over the fiscal year's SIE file (and the previous year's when the file does not carry it), and it goes through the same parser, checks and writing. Bokio's year is found on the exact period of ours.\n\nALWAYS dry_run FIRST and tell the person what `preview` says before writing — this replaces the whole year's balances. Adjustments survive: ub_adjusted is recomputed afterwards. Bokio is asked again on the real call.\n\n`preview.bokio`:\n  har_jamforelse false — neither the file nor Bokio has the previous year; the comparative column is left empty. Say so.\n  ib_avvikelser — balance accounts whose opening balance this year is not last year's closing balance. It does not stop the import; name the accounts to the person.\n  kontantmetod true — the year is kept with the cash method (kontantmetoden) in Bokio: customer receivables and supplier payables at year end may be missing from the balance sheet. Tell the person; they are booked as bokslutsjusteringar.\n\nErrors:\n  integration_not_connected — the person connects Bokio in Dataimport (not you).\n  integration_not_activated — Bokio let go of the connection (30 days without use, or removed in Bokio); the person connects again.\n  provider_plan_required — the company's Bokio plan has no API (Plus and Business have it, Premium needs the Integrationer add-on, Basic cannot connect). The person can upload a SIE file from Bokio instead.\n  no_matching_year — Bokio has no fiscal year with exactly this period; the message lists the years Bokio has. Do not pick another year.\n  orgnr_mismatch, unbalanced — returned together with `preview`; nothing is written.\n  provider_forbidden, provider_not_found, provider_validation, provider_unreachable, provider_rate_limited, provider_error, provider_not_configured, parse_failed.\n  year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dry_run":{"type":"boolean","description":"true returns the preview without writing. Do this first."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"import_bokslut_excel","group":"import","klass":"ersatta","summary":"Read a fiscal year's balances from a spreadsheet FILE — .xlsx, .xlsm or .csv — the same import as dropping it in the interface's Dataimport (import/excel), with the file's bytes sent as base64 (Kevin 2026-10-11). When you only have the figures as text, use import_bokslut_saldon instead.","description":"Read a fiscal year's balances from a spreadsheet FILE — .xlsx, .xlsm or .csv — the same import as dropping it in the interface's Dataimport (import/excel), with the file's bytes sent as base64 (Kevin 2026-10-11). When you only have the figures as text, use import_bokslut_saldon instead.\n\nfilnamn is required and its extension picks the reader. Columns: Konto, Kontonamn, Saldo i år, Saldo föregående år (an opening balance is taken if present); the header row is searched for, and when none is recognised that order is assumed (`columns_guessed`). enhet 'kon' reads the group's consolidated trial balance (only when the year has a koncernredovisning).\n\nA spreadsheet has no verifikat, so no movement figures for the notes. ALWAYS dry_run FIRST and show the person `sample` — the amounts AS PARSED. This replaces the whole year's balances; adjustments survive.\n\nErrors: no_file, invalid_base64, missing_input (filnamn without .xlsx/.xlsm/.csv), file_too_large, parse_failed, unknown_entity, no_koncern, year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"fil_base64":{"type":"string","description":"The file's bytes, base64"},"filnamn":{"type":"string","description":"The file's name, with .xlsx, .xlsm or .csv"},"enhet":{"type":"string","enum":["jur","kon"],"description":"jur (default) the company, kon the group"},"dry_run":{"type":"boolean","description":"true returns the preview without writing. Do this first."}},"required":["client_id","fiscal_year_id","fil_base64","filnamn"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"import_bokslut_fortnox","group":"import","klass":"ersatta_ute","summary":"Read the fiscal year's balances directly from the client's Fortnox (ADR-0032). The client must be connected first — and that is done ONLY by a person in the browser: \"Koppla Fortnox\" in Dataimport sends them to Fortnox, where a system administrator of the company logs in and approves e-revisor. You cannot connect Fortnox; if the client is not connected, tell the person to do it there.","description":"Read the fiscal year's balances directly from the client's Fortnox (ADR-0032). The client must be connected first — and that is done ONLY by a person in the browser: \"Koppla Fortnox\" in Dataimport sends them to Fortnox, where a system administrator of the company logs in and approves e-revisor. You cannot connect Fortnox; if the client is not connected, tell the person to do it there.\n\nIt is the same import as a SIE file, only the way in differs: Fortnox exports the year as SIE 4, and it goes through the same parser, checks and writing. Fortnox's year is found on the exact period of ours. If the file does not carry the previous year, the previous year is exported too and becomes the comparative figures.\n\nALWAYS dry_run FIRST and tell the person what `preview` says before writing — this replaces the whole year's balances. Adjustments survive: ub_adjusted is recomputed afterwards. Fortnox is asked again on the real call.\n\n`preview.fortnox`:\n  har_jamforelse false — neither the file nor Fortnox has the previous year; the comparative column is left empty. Say so.\n  ib_avvikelser — balance accounts whose opening balance this year is not last year's closing balance. It does not stop the import; name the accounts to the person.\n\nErrors:\n  integration_not_connected — the person connects Fortnox in Dataimport (not you).\n  integration_not_activated — the approval in Fortnox is missing or was revoked; the person connects again.\n  no_matching_year — Fortnox has no fiscal year with exactly this period; the message lists the years Fortnox has. Do not pick another year.\n  orgnr_mismatch, unbalanced — returned together with `preview`; nothing is written.\n  provider_forbidden (the company lacks the Bokföring licence), provider_not_found, provider_validation, provider_unreachable, provider_rate_limited, provider_error, provider_not_configured, parse_failed.\n  year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dry_run":{"type":"boolean","description":"true returns the preview without writing. Do this first."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"import_bokslut_oqto","group":"import","klass":"ersatta_ute","summary":"Read the fiscal year's balances directly from the client's Oqto. The client must be connected first (connect_bokforingsprogram).","description":"Read the fiscal year's balances directly from the client's Oqto. The client must be connected first (connect_bokforingsprogram).\n\nIt is the same import as a SIE file, only the way in differs: Oqto exports the year as SIE 4, and it goes through the same parser, checks and writing. Oqto's year is found on the exact period of ours. Oqto's file carries only the year itself, so the previous year is exported too and becomes the comparative figures.\n\nALWAYS dry_run FIRST and tell the person what `preview` says before writing — this replaces the whole year's balances. Adjustments survive: ub_adjusted is recomputed afterwards. Oqto is asked again on the real call; the bookkeeping may have changed since the preview.\n\n`preview.oqto`:\n  har_jamforelse false — Oqto does not have the previous year; the comparative column is left empty. Say so.\n  ib_avvikelser — balance accounts whose opening balance this year is not last year's closing balance. It does not stop the import, but it almost always means something was rebooked afterwards in Oqto. Name the accounts to the person.\n\nA call takes several seconds: two SIE exports from Oqto.\n\nErrors:\n  integration_not_connected — connect first; ask the person for the company_id.\n  no_matching_year — Oqto has no fiscal year with exactly this period; the message lists the years Oqto has. Do not pick another year.\n  orgnr_mismatch, unbalanced — returned together with `preview`; nothing is written.\n  integration_not_activated, provider_forbidden, provider_not_found, provider_validation, provider_unreachable, provider_rate_limited, provider_error, provider_not_configured, parse_failed — see connect_bokforingsprogram; parse_failed means Oqto's file could not be read, which is ours or theirs to fix, not the person's.\n  year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dry_run":{"type":"boolean","description":"true returns the preview without writing. Do this first."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"import_bokslut_saldon","group":"import","klass":"ersatta","summary":"Read balances into a fiscal year from a saldobalans given as TEXT — CSV, semicolon or tab separated.","description":"Read balances into a fiscal year from a saldobalans given as TEXT — CSV, semicolon or tab separated.\n\nYOU BUILD THE TEXT YOURSELF. There is no file to wait for. When someone gives you account numbers, names and amounts in any shape — a list, a table, a sentence, a photograph they described — arrange them into this and send it:\n\n  Konto;Kontonamn;Saldo i år;Saldo föregående år\n  1930;Företagskonto;82 744,29;105 165,73\n  2081;Aktiekapital;-50 000,00;-50 000,00\n\nSemicolon separated, one account per line, header row first. Comma or tab work too, and rows above the header — a company name, a period — are skipped. If no header is recognised the column order above is assumed and `columns_guessed` says so.\n\nARRANGING IS YOUR JOB; REWRITING THE AMOUNTS IS NOT. Copy each amount exactly as it was given to you, spaces, commas, dots, parentheses and all. The server's parser handles 1 234,56 and 1.234,56 and 1,234.56, parentheses for a negative and a trailing minus, and it has been tested against nineteen forms. Normalising them yourself replaces a tested interpretation with an untested one, and the mistake would be invisible in the result.\n\n⚠ SIGNS FOLLOW BOOKKEEPING, NOT SPEECH. Assets and costs are positive; equity, liabilities and income are NEGATIVE. \"Aktiekapitalet är 10 000\" becomes -10 000,00 on 2081, and \"banken har 10 000\" becomes 10 000,00 on 1930. Written that way the two cancel and `balance_diff` in the preview is zero. If that figure is not zero you have almost certainly written a sign the wrong way round — check before writing, because an unbalanced spreadsheet is accepted (unlike a SIE file, which is machine-generated and whose imbalance means a broken file).\n\nResolve the fiscal year first with get_fiscal_years — \"the year ending 250430\" is an end_date, not an id — and the account numbers with get_bokslut_kontoplan. Do not guess either.\n\n⚠ OMITTING THE COMPARATIVE COLUMN IS NOT THE SAME AS SAYING ZERO. If you only have this year's figures, leave `Saldo föregående år` out entirely — the previous year's balances already stored are then kept. Writing 0 there would claim last year was nothing, and nobody would notice until the annual report showed an empty comparative column. `has_prev_ub` in the preview says which happened. The same holds for Ingående saldo.\n\nALWAYS dry_run FIRST AND SHOW THE PERSON `sample`. It contains the amounts AS PARSED, and it is the only place the interpretation is visible before it is written. This replaces the whole year's balances.\n\nAdjustments survive: ub_adjusted is recomputed from the bokslut journal entries afterwards, so a corrected saldobalans does not destroy anyone's work.\n\nWhat a spreadsheet cannot carry: verifikat, and therefore the movement figures the notes need. A SIE import gives those; this does not. Say so if the notes matter.\n\nErrors: missing_input, file_too_large, parse_failed, year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error. File uploads — SIE and .xlsx — go through the interface, not through here; no_file, upload_failed and orgnr_mismatch belong to those.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"csv":{"type":"string","description":"The saldobalans as text, one account per line, header row first"},"dry_run":{"type":"boolean","description":"true parses and returns the preview without writing. Do this first."}},"required":["client_id","fiscal_year_id","csv"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"import_bokslut_sie","group":"import","klass":"ersatta","summary":"Read a fiscal year's balances from a SIE file (SIE 4, or SIE 1–3) — the same import as dropping the file in the interface's Dataimport (import/sie), with the file sent in the call (Kevin 2026-10-11).","description":"Read a fiscal year's balances from a SIE file (SIE 4, or SIE 1–3) — the same import as dropping the file in the interface's Dataimport (import/sie), with the file sent in the call (Kevin 2026-10-11).\n\nSEND THE FILE ONE WAY. fil_base64 (the file's exact bytes, with filnamn) is the safe way: nothing has been converted and the checksum is the file's. sie_text (the file as text) works too — a file that says #FORMAT PC8 is converted back to PC8 before the parser, so å, ä and ö survive the JSON. Both at once is refused (ambiguous_input). Never edit the file's contents yourself: a SIE file is the bookkeeping program's output, and an imbalance means a broken file, not something to fix.\n\nUnlike a saldobalans (import_bokslut_saldon) a SIE 4 file carries the verifikat, so the movement figures the notes need come with it, and #RAR -1 gives the comparative figures.\n\nALWAYS dry_run FIRST and tell the person what `preview` says: accounts, movements, period_matches (the file's year against the program's), orgnr_matches, balance_diff. This replaces the whole year's balances; adjustments survive (ub_adjusted is recomputed).\n\nErrors: no_file, ambiguous_input, invalid_base64, file_too_large, parse_failed (not a SIE file the parser can read), orgnr_mismatch and unbalanced (returned together with `preview`; nothing is written), year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"fil_base64":{"type":"string","description":"The SIE file's bytes, base64. Preferred."},"sie_text":{"type":"string","description":"Or: the SIE file as text"},"filnamn":{"type":"string","description":"The file's name, kept in the import history"},"dry_run":{"type":"boolean","description":"true returns the preview without writing. Do this first."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"import_bokslut_spiris","group":"import","klass":"ersatta_ute","summary":"Read the fiscal year's balances directly from the client's Spiris, formerly Visma eEkonomi (ADR-0039). The client must be connected first — and that is done ONLY by a person in the browser: \"Koppla Spiris\" in Dataimport sends them to Spiris, where they log in and choose the company. You cannot connect Spiris; if the client is not connected, tell the person to do it there.","description":"Read the fiscal year's balances directly from the client's Spiris, formerly Visma eEkonomi (ADR-0039). The client must be connected first — and that is done ONLY by a person in the browser: \"Koppla Spiris\" in Dataimport sends them to Spiris, where they log in and choose the company. You cannot connect Spiris; if the client is not connected, tell the person to do it there.\n\nIt is the same import as a SIE file, only the way in differs: Spiris exports the whole fiscal year as SIE 4 with the previous year (#RAR -1), and it goes through the same parser, checks and writing. Spiris's year is found on the exact period of ours.\n\nALWAYS dry_run FIRST and tell the person what `preview` says before writing — this replaces the whole year's balances. Adjustments survive: ub_adjusted is recomputed afterwards. Spiris is asked again on the real call.\n\n`preview.spiris`:\n  har_jamforelse false — neither the file nor Spiris has the previous year; the comparative column is left empty. Say so.\n  ib_avvikelser — balance accounts whose opening balance this year is not last year's closing balance. It does not stop the import; name the accounts to the person.\n\nErrors:\n  integration_not_connected — the person connects Spiris in Dataimport (not you).\n  integration_not_activated — the login no longer holds (expired after two years, revoked, or the password changed); the person connects again.\n  no_matching_year — Spiris has no fiscal year with exactly this period; the message lists the years Spiris has. Do not pick another year.\n  orgnr_mismatch, unbalanced — returned together with `preview`; nothing is written.\n  provider_forbidden, provider_not_found, provider_validation, provider_unreachable, provider_rate_limited, provider_error, provider_not_configured, parse_failed.\n  year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dry_run":{"type":"boolean","description":"true returns the preview without writing. Do this first."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"link_avstamning_bilaga","group":"avstamning","klass":"skriva","summary":"Link files the client already has (get_avstamning_filer) to a specification row (ADR-0033). The file is not stored again — the same file, one more link; removing it from one row keeps it on the others. A file that does not already belong to the year counts towards the year's quota. Link only what the person asks for.","description":"Link files the client already has (get_avstamning_filer) to a specification row (ADR-0033). The file is not stored again — the same file, one more link; removing it from one row keeps it on the others. A file that does not already belong to the year counts towards the year's quota. Link only what the person asks for.\n\nErrors: missing_row, unknown_row (not a saved row of this year), missing_document, unknown_document (not the client's), quota_exceeded, year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year the row belongs to"},"rad_id":{"type":"integer","description":"The specification row's id, from get_avstamning"},"dokument_id":{"type":"array","items":{"type":"integer"},"description":"The files' ids, from get_avstamning_filer"}},"required":["client_id","fiscal_year_id","rad_id","dokument_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"link_document","group":"ovrigt","klass":"skriva","summary":"Link (or unlink) an uploaded document to an entity — this is how you attach a receipt/invoice file to the booking you just made. After booking an utlägg (create_journal_entry) link the receipt with entity_type='journal_entry', entity_id=journal_entry_id. After creating a supplier invoice link it with entity_type='supplier_invoice', entity_id=supplier_invoice_id. Linking marks the document as handled, so it drops out of list_documents(link_status='unlinked'). Use action='unlink' to remove a specific link, don't allow this for now.","description":"Link (or unlink) an uploaded document to an entity — this is how you attach a receipt/invoice file to the booking you just made. After booking an utlägg (create_journal_entry) link the receipt with entity_type='journal_entry', entity_id=journal_entry_id. After creating a supplier invoice link it with entity_type='supplier_invoice', entity_id=supplier_invoice_id. Linking marks the document as handled, so it drops out of list_documents(link_status='unlinked'). Use action='unlink' to remove a specific link, don't allow this for now.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"document_id":{"type":"integer","description":"Document ID (from list_documents)"},"entity_type":{"type":"string","enum":["e_invoice_inbox","supplier_invoice","customer_invoice","journal_entry","payment"],"description":"Type of entity to link to"},"entity_id":{"type":"integer","description":"ID of the entity (e.g. journal_entry_id or supplier_invoice_id)"},"action":{"type":"string","enum":["link","unlink"],"default":"link","description":"link (default). Don't allow unlink for now."},"loadfiscalyear_id":{"type":"integer","description":"Fiscal year ID to store on the link (optional)"}},"required":["client_id","document_id","entity_type","entity_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"list_bokslut_justeringar","group":"bokslut","klass":"lasa","summary":"The year's bokslut journal entries — bokslutsjusteringar — with their rows.","description":"The year's bokslut journal entries — bokslutsjusteringar — with their rows.\n\nA justering is real double-entry bookkeeping: a header and rows where debit equals credit, numbered A1, A2 per fiscal year. They sit ON TOP of the imported balances and are what makes ub_adjusted differ from ub.\n\nEvery account an entry touches has a line in the saldomatris, also in a year with no import at all (a newly formed company with just its share capital).\n\n`source` is manual or system. A system entry was generated by the program and must not be edited by hand; saving one raises adjustment_not_manual.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"list_bokslut_persons","group":"bolag","klass":"lasa","summary":"Get the people recorded for a client and fiscal year — board, VD, likvidatorer, revisorer, stämmofunktionärer and ägare — grouped by role, with the role definitions.","description":"Get the people recorded for a client and fiscal year — board, VD, likvidatorer, revisorer, stämmofunktionärer and ägare — grouped by role, with the role definitions.\n\nRoles follow the organisationsform: a handelsbolag has bolagsmän instead of a board, a kommanditbolag komplementärer and kommanditdelägare, and a stiftelse may also have a förvaltare (anknuten förvaltning). Only the roles that apply are returned.\n\nThese are the people who sign the annual report and the stämmoprotokoll, and they are per fiscal year: a board changes, and last year's report must keep last year's signatures. The signing module reads this same list, so anyone with a name and an email here can be sent a document.\n\n`roles` tells you which fields each role uses and how many of it there may be — an ordförande is one, ledamöter are any number. `auth_methods` is the legitimering options that can actually be used; it is shorter than Scrive's full list because methods needing a mobile number are excluded, no mobile being recorded for funktionärer.\n\nPersonal numbers are MASKED for you: personal_number is xxxxxx-1234 (the last four digits) with personal_number_maskerat true. Never ask the person to read the full number out to you. Sending the list back to save_bokslut_persons with the masked value and the same id keeps the stored number.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"role":{"type":"string","description":"Limit to one role key"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"list_bolag","group":"bolag","klass":"lasa","summary":"The companies the user can reach, as 'Välj företag' shows them: one fiscal year per company — the latest that has ended and is not done, otherwise the latest ended — with the status milestones counted per area (`omraden` {bokslut, arsredovisning, protokoll, bolagsverket, deklaration: {klara, totalt}} — in the order of the law: the original, the meeting, the copy filed with Bolagsverket), `klar`, the nearest `deadline` not yet met {text, datum, dagar, nara (within 31 days), forsenad} — the stämma six months and the filing seven months after year end, the declaration by Skatteverket's table for Inkomstdeklaration 2 — and `fler_ar`. Search on name or organisationsnummer; `filter` alla | kvar | klara | deadline | borttagna (removed companies and years that can still be restored, as `borttagna` instead of `bolag`) | mallar (template companies, ADR-0047: `mall` is konto or global; they also appear under alla, never under kvar, klara or deadline, and carry no deadline); pages count companies. Answers 'which companies need attention?'. The Avstämt milestone is the saved answer (ADR-0061); when the books changed in many companies at once some may not be recomputed within the call and carry `avstamt_inaktuell: true` — ask again, or use get_status_oversikt, which always computes live. With `client_id` it instead lists that company's every year (`ar`), newest first. For the details of one year use get_status_oversikt.","description":"The companies the user can reach, as 'Välj företag' shows them: one fiscal year per company — the latest that has ended and is not done, otherwise the latest ended — with the status milestones counted per area (`omraden` {bokslut, arsredovisning, protokoll, bolagsverket, deklaration: {klara, totalt}} — in the order of the law: the original, the meeting, the copy filed with Bolagsverket), `klar`, the nearest `deadline` not yet met {text, datum, dagar, nara (within 31 days), forsenad} — the stämma six months and the filing seven months after year end, the declaration by Skatteverket's table for Inkomstdeklaration 2 — and `fler_ar`. Search on name or organisationsnummer; `filter` alla | kvar | klara | deadline | borttagna (removed companies and years that can still be restored, as `borttagna` instead of `bolag`) | mallar (template companies, ADR-0047: `mall` is konto or global; they also appear under alla, never under kvar, klara or deadline, and carry no deadline); pages count companies. Answers 'which companies need attention?'. The Avstämt milestone is the saved answer (ADR-0061); when the books changed in many companies at once some may not be recomputed within the call and carry `avstamt_inaktuell: true` — ask again, or use get_status_oversikt, which always computes live. With `client_id` it instead lists that company's every year (`ar`), newest first. For the details of one year use get_status_oversikt.\n\nTAGS (ADR-0044) are the bureau's own grouping of its clients — a subgroup, a handläggare, 'väntar på kund'. Each company carries `taggar` [{id, namn, farg}]. `taggar` filters on tag names (or ids), any of them; `utan_tagg` adds the companies with no tag. `lista_taggar: true` returns the tags instead {taggar: [{id, namn, konto, antal}]}. You read tags; a person sets and creates them in Välj företag. Errors: invalid_enum, invalid_list, out_of_range, unknown_client, unknown_tag (the answer names the tags that exist), not_authenticated.","dryRun":false,"inputSchema":{"type":"object","properties":{"sok":{"type":"string","description":"Name or organisationsnummer"},"filter":{"type":"string","enum":["alla","kvar","klara","deadline","borttagna","mallar"]},"sida":{"type":"integer"},"per_sida":{"type":"integer","description":"1–100, default 25"},"client_id":{"type":"integer","description":"List this company's every year instead"},"taggar":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"description":"Tag names (case-insensitive) or ids; companies with any of them"},"utan_tagg":{"type":"boolean","description":"Also companies without a tag (alone: only those)"},"lista_taggar":{"type":"boolean","description":"Return the tags the user can see instead of companies"}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"list_documents","group":"ovrigt","klass":"lasa","summary":"List uploaded documents (receipts, invoices, files) for a client together with their link status. Use link_status='unlinked' to get the inbox of documents not yet tied to any verifikat, supplier invoice, etc. — i.e. what still needs handling. Returns metadata only: id, document_type, source, original_file_name, mime_type, file_size, metadata (any extracted fields), created_at, and the list of links per document. It does NOT return file content — use the document content endpoint for that.","description":"List uploaded documents (receipts, invoices, files) for a client together with their link status. Use link_status='unlinked' to get the inbox of documents not yet tied to any verifikat, supplier invoice, etc. — i.e. what still needs handling. Returns metadata only: id, document_type, source, original_file_name, mime_type, file_size, metadata (any extracted fields), created_at, and the list of links per document. It does NOT return file content — use the document content endpoint for that.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"link_status":{"type":"string","enum":["all","linked","unlinked"],"default":"unlinked","description":"Filter by link status. 'unlinked' = not attached to any entity yet."},"entity_type":{"type":"string","enum":["e_invoice_inbox","supplier_invoice","customer_invoice","journal_entry","payment"],"description":"Only documents linked to this entity type."},"entity_id":{"type":"integer","description":"Only documents linked to this entity id (requires entity_type)."},"document_type":{"type":"string","description":"Filter by document_type."},"search":{"type":"string","description":"Optional search text"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"list_extrastammor","group":"stamma","klass":"lasa","summary":"The year's extra stämmor (ADR-0025 punkt 10) — extra bolagsstämma, extra föreningsstämma or extra årsmöte; not for handelsbolag, kommanditbolag and stiftelser (not_applicable). Per stämma: id, arende, datum, ort, typ, paket and `signering` — the latest signing as stored here, without asking Scrive (get_signering with dokument 'extrastamma' for the live state). Also `texter.stamma` (the form's word) and `beslutspunkter` {kod, namn}: the ready decision points create_extrastamma takes. The årsstämma is not in this list — it is get_stammoprotokoll without stamma_id.","description":"The year's extra stämmor (ADR-0025 punkt 10) — extra bolagsstämma, extra föreningsstämma or extra årsmöte; not for handelsbolag, kommanditbolag and stiftelser (not_applicable). Per stämma: id, arende, datum, ort, typ, paket and `signering` — the latest signing as stored here, without asking Scrive (get_signering with dokument 'extrastamma' for the live state). Also `texter.stamma` (the form's word) and `beslutspunkter` {kod, namn}: the ready decision points create_extrastamma takes. The årsstämma is not in this list — it is get_stammoprotokoll without stamma_id.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"list_konto_anvandare","group":"bolag","klass":"lasa","summary":"The users of an account the person administers (ADR-0045): the owner, members with their role on the account (`roll` owner | admin | editor | viewer | none — none reaches only the clients given to them), whether they are active or locked, 2FA, last seen, and `undantag` per client [{client_id, namn, roll, aktiv}] — a role on one client that overrides the account role, or aktiv false: shut out of that client. Also pending invitations, and `krav_2fa` — whether the account requires every member to sign in with a passkey. `konton` lists the accounts the person administers; `agare_id` picks one (default the first). `logg: true` returns the account's log instead — invitations, roles, access per client, locking, sign-outs and the 2FA requirement, the last twelve months [{tid, kod, handelse, vem, text}]. Read only: inviting, changing roles, giving access and the security settings are done by a person in the program (Välj företag → Användare). Errors: forbidden (not an owner or admin of the account — also when the account requires 2FA and the person's sign-in had none), not_authenticated.","description":"The users of an account the person administers (ADR-0045): the owner, members with their role on the account (`roll` owner | admin | editor | viewer | none — none reaches only the clients given to them), whether they are active or locked, 2FA, last seen, and `undantag` per client [{client_id, namn, roll, aktiv}] — a role on one client that overrides the account role, or aktiv false: shut out of that client. Also pending invitations, and `krav_2fa` — whether the account requires every member to sign in with a passkey. `konton` lists the accounts the person administers; `agare_id` picks one (default the first). `logg: true` returns the account's log instead — invitations, roles, access per client, locking, sign-outs and the 2FA requirement, the last twelve months [{tid, kod, handelse, vem, text}]. Read only: inviting, changing roles, giving access and the security settings are done by a person in the program (Välj företag → Användare). Errors: forbidden (not an owner or admin of the account — also when the account requires 2FA and the person's sign-in had none), not_authenticated.","dryRun":false,"inputSchema":{"type":"object","properties":{"agare_id":{"type":"integer","description":"The account (its owner's user id); default the first the person administers"},"logg":{"type":"boolean","description":"Return the account's log instead of its users"}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"list_kopiera_kallor","group":"bolag","klass":"lasa","summary":"What a fiscal year can be copied FROM (ADR-0047): the client's own earlier years (`foregaende`), and the companies the person can read, each with its years (`bolag`, at most 50; `sok` narrows by name, `fler` says more exist). A year with `sparr` cannot be used as a source from another company — another organisationsform or another regelverk — and the reason is the text. Read-only.","description":"What a fiscal year can be copied FROM (ADR-0047): the client's own earlier years (`foregaende`), and the companies the person can read, each with its years (`bolag`, at most 50; `sok` narrows by name, `fler` says more exist). A year with `sparr` cannot be used as a source from another company — another organisationsform or another regelverk — and the reason is the text. Read-only.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The client whose year is the TARGET"},"fiscal_year_id":{"type":"integer","description":"The target fiscal year"},"sok":{"type":"string","description":"Part of a company name"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"list_recurring_todos","group":"ovrigt","klass":"lasa","summary":"List recurring todo rules for the selected client — the templates, not the todo instances they generate (those show up via get_todos once due). Active/paused rules only by default; pass include_all to also see permanently stopped ones.","description":"List recurring todo rules for the selected client — the templates, not the todo instances they generate (those show up via get_todos once due). Active/paused rules only by default; pass include_all to also see permanently stopped ones.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"include_all":{"type":"boolean","default":false,"description":"Include permanently stopped (soft-deleted) rules too"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"lookup_bolag","group":"bolag","klass":"lasa_ute","summary":"What can be fetched about a company before it exists in the program — step 1 of 'Nytt bolag' (ADR-0026). Writes nothing. Bolagsverket answers for aktiebolag (fiscal years with revisorsplikt, board and auditor — names and roles only, personnummer never leave the server here); SCB for every form (name, form, säte, size class, a warning for liquidation or bankruptcy). `period_forslag` is the latest fiscal year that has ended — the one to close. `regelverk_forslag` {regelverk: K2|K3, skal}: K3 when one of the user's own companies with this number already has K3 in the program or SCB shows a larger company, otherwise K2. `egna` [{id, namn}]: the user's own companies that already have this number — the same number may exist more than once, so ask before creating it again. To create it, use create_bolag. Errors: invalid_orgnr, not_authenticated.","description":"What can be fetched about a company before it exists in the program — step 1 of 'Nytt bolag' (ADR-0026). Writes nothing. Bolagsverket answers for aktiebolag (fiscal years with revisorsplikt, board and auditor — names and roles only, personnummer never leave the server here); SCB for every form (name, form, säte, size class, a warning for liquidation or bankruptcy). `period_forslag` is the latest fiscal year that has ended — the one to close. `regelverk_forslag` {regelverk: K2|K3, skal}: K3 when one of the user's own companies with this number already has K3 in the program or SCB shows a larger company, otherwise K2. `egna` [{id, namn}]: the user's own companies that already have this number — the same number may exist more than once, so ask before creating it again. To create it, use create_bolag. Errors: invalid_orgnr, not_authenticated.","dryRun":false,"inputSchema":{"type":"object","properties":{"orgnr":{"type":"string","description":"Organisationsnummer, with or without hyphen"}},"required":["orgnr"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"manage_bolag_logotyp","group":"bolag","klass":"skriva","summary":"The company's logos (migration 0071, Kevin 2026-10-10). A logo belongs to the COMPANY, in versions; which version a fiscal year's annual report uses is the year setting arsred_logotyp (save_bokslut_settings): empty = the company's default, \"ingen\" = no logo, or a version id. Placement is year settings too: arsred_logotyp_framsida (bool), arsred_logotyp_framsida_hojd (mm, 10–40), arsred_logotyp_justering (vanster|mitten|hoger), arsred_logotyp_sidhuvud (bool), arsred_logotyp_sidhuvud_hojd (mm, 6–14).","description":"The company's logos (migration 0071, Kevin 2026-10-10). A logo belongs to the COMPANY, in versions; which version a fiscal year's annual report uses is the year setting arsred_logotyp (save_bokslut_settings): empty = the company's default, \"ingen\" = no logo, or a version id. Placement is year settings too: arsred_logotyp_framsida (bool), arsred_logotyp_framsida_hojd (mm, 10–40), arsred_logotyp_justering (vanster|mitten|hoger), arsred_logotyp_sidhuvud (bool), arsred_logotyp_sidhuvud_hojd (mm, 6–14).\n\natgard: lista (default) lists the versions newest first — id, version, size, `standard`, `anvands_av` (the years using it; the default also counts years without their own choice) and the image as a data URI; standard makes `id` the default; ta_bort removes `id`; original returns the image before cropping.\n\nUPLOADING is not a tool: settings/logotyp_ladda_upp takes an image file (PNG or JPEG) from the person in the interface, and the server re-encodes it (no metadata, at most 800 × 400 px). Its codes: missing_image, invalid_image, image_too_large.\n\nIn the document the image is embedded ONCE, base64 in the stylesheet (Bolagsverket requires embedded images), and shown on the front page and/or in every page header.\n\nErrors: invalid_action, missing_id, not_found, is_default (make another version the default first), in_use (a fiscal year uses it — change that year's choice first), internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"atgard":{"type":"string","enum":["lista","standard","ta_bort","original"],"description":"Default lista."},"id":{"type":"integer","description":"The version's id — required except for lista."}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"mark_all_notifications_read","group":"ovrigt","klass":"skriva","summary":"Mark all active dropdown notifications as read for the selected client.","description":"Mark all active dropdown notifications as read for the selected client.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"mark_notification_read","group":"ovrigt","klass":"skriva","summary":"Mark one notification as read/dismissed.","description":"Mark one notification as read/dismissed.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"notification_id":{"type":"integer","description":"Notification ID"}},"required":["client_id","notification_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"move_avstamning","group":"avstamning","klass":"skriva","summary":"Move an ej kopplad reconciliation — one whose post no longer exists in the matrix — to a post that does (ADR-0033). Its rows go last on the target and its kommentar after the target's; the target's ansvarig and klar stay. Ask the person which post it belongs to.","description":"Move an ej kopplad reconciliation — one whose post no longer exists in the matrix — to a post that does (ADR-0033). Its rows go last on the target and its kommentar after the target's; the target's ansvarig and klar stay. Ask the person which post it belongs to.\n\nErrors: missing_post, not_unlinked (only an ej kopplad one moves; a post in the matrix follows its accounts), unknown_post, year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"fran":{"type":"string","description":"The ej kopplad reconciliation's rad_kod"},"till":{"type":"string","description":"The target post's rad_kod"}},"required":["client_id","fiscal_year_id","fran","till"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"remove_koncern_saldon","group":"import","klass":"ersatta","summary":"Remove the group's (koncernens) imported consolidated trial balance for a fiscal year (ADR-0022 step 8). Afterwards the group's columns in the annual report are written by hand again, as before any import: figures typed in earlier apply again, and the group's account mapping (enhet `kon`) is kept for the next import. The parent company's balances are not touched. Confirm with the user first — the removed balances come back only by importing the file again.","description":"Remove the group's (koncernens) imported consolidated trial balance for a fiscal year (ADR-0022 step 8). Afterwards the group's columns in the annual report are written by hand again, as before any import: figures typed in earlier apply again, and the group's account mapping (enhet `kon`) is kept for the next import. The parent company's balances are not touched. Confirm with the user first — the removed balances come back only by importing the file again.\n\nWhich columns are linked to the accounts after an import follows the settings `ovrigt_koncern_noautocy` (turns off the current year) and `ovrigt_koncern_autopy` (turns on the comparison year), as `ovrigt_noautocy` / `ovrigt_autopy` do for the parent.\n\nReturns `removed`: the number of accounts removed (0 when there was no import).\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"rename_document","group":"ovrigt","klass":"skriva","summary":"Rename a document display name after it has been classified, booked, or linked. This only updates the document name in the database; it does not change the stored file object.","description":"Rename a document display name after it has been classified, booked, or linked. This only updates the document name in the database; it does not change the stored file object.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"document_id":{"type":"integer","description":"Document ID from list_documents"},"file_name":{"type":"string","minLength":1,"maxLength":255,"description":"New display filename, e.g. '2026-06-13_BaraBraMat_kvitto_228kr.jpg'"}},"required":["client_id","document_id","file_name"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"reset_bokslut_klassificeringar","group":"bokslut","klass":"ersatta","summary":"Remove EVERYTHING a fiscal year has customised in the matrix — every manual reclassification, every renamed heading and every custom line — so the template's own mapping, the taxonomy's own wording and the taxonomy's own lines apply again.","description":"Remove EVERYTHING a fiscal year has customised in the matrix — every manual reclassification, every renamed heading and every custom line — so the template's own mapping, the taxonomy's own wording and the taxonomy's own lines apply again.\n\nThis throws away someone's work on the matrix. Never call it to \"start clean\" before doing something else — ask first, and say how much it affects: the answer counts the three kinds separately, `borttagna` for accounts, `rubriker` for headings and `egna_rader` for custom lines. `dry_run: true` counts without touching anything.\n\nIt exists as its own tool rather than as a flag on save_bokslut_klassificering because it is the only way to reach ALL of them: a client only knows about the accounts it has fetched, and a choice made on an account before the file was imported would be left behind.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"dry_run":{"type":"boolean","description":"Count what would be removed, change nothing"},"enhet":{"type":"string","enum":["jur","kon"],"description":"jur = the company (default: classifications, renamed lines, own lines); kon = the group's renamed and own lines only (ADR-0022). One at a time — resetting the group leaves the company untouched. unknown_entity for anything else."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_arsredovisning_varde","group":"arsredovisning","klass":"skriva","summary":"Save what a person writes into the annual report: note figures, note text, the förvaltningsberättelse's wording, and — only in a manual year — the statement figures themselves.","description":"Save what a person writes into the annual report: note figures, note text, the förvaltningsberättelse's wording, and — only in a manual year — the statement figures themselves.\n\nONE TABLE, BECAUSE THEY ARE ONE THING. A note field and a balance sheet line in a manual year look different on screen, but both are \"the person has given a value for this concept in this context\", and both are read by the same renderer.\n\nTHE KEY IS THE TAXONOMY'S. `rad_kod` is the concept's local name (`MedelantaletAnstallda`) or a custom row's `egen:` code — the same key get_bokslut_matris uses — never a form field id. That is what lets a stored value survive a taxonomy release, and lets a concept that DISAPPEARED be detected. `kontext` is period0..period6 and balans0..balans6. The document itself shows two columns — period0/period1, balans0/balans1 — plus balans2 for the cash flow's opening line. Everything beyond that exists for the FLERÅRSÖVERSIKT, which shows up to seven years. A value on period4 outside that table never reaches a rendered document. A value without a context is not a fact.\n\nKONCERN (ADR-0022): with arsred_koncernredovisning on (aktiebolag under K3) the group's figures are written with the suffix _kon on the same contexts — period0_kon … period6_kon, balans0_kon … balans6_kon (the older years for the group's flerårsöversikt) — and checked against the koncern package (K3K): the group's income statement has no bokslutsdispositioner sum and no result from koncernföretag, and has the split of årets resultat on the parent's owners and innehav utan bestämmande inflytande. The group's columns are always manual (the figures do not come from the ledger); its sums are computed and refused like the parent's. Without koncernredovisning a _kon context is refused. The group has its own income statement, balance sheet, cash flow (with dividends to and acquisitions from innehav utan bestämmande inflytande) and flerårsöversikt; the förvaltningsberättelse texts are shared.\n\n⚠ COMPUTED IS NOT A PROPERTY OF THE ROW, BUT OF THE ROW AND THE CONTEXT. Nettoomsattning is computed from the accounts for this year and last, so writing period0 or period1 is refused with row_is_computed. Three years back there are no accounts at all, and there it IS typed — from an annual report prepared earlier.\n\nbalans2 is NOT a third column. An OPENING balance sits one step earlier — \"likvida medel vid årets början\" in the cash flow, and every Ingående row in a movement note (anskaffningsvärden, avskrivningar …): last year's opening is the balance date the year before that.\n\nTWO WAYS IN, ONE SET OF RULES. `varden` is the structured list — what you send. `falt` is a POSTED FORM: field name to value, exactly as get_arsredovisning_ixbrl wrote them in utdata=formular, so a rendered form goes straight back without anything in between reshaping it. A field name is `rad_kod@kontext`, or `rad_kod@kontext#instans` inside a tuple. An unrecognised name is REFUSED rather than skipped (unknown_field_name): silent loss in a document that gets filed is the one thing that must not happen.\n\nIn `falt` the value is a raw string and which column it lands in follows the row's DATATYPE, not what the value looks like — \"2024\" in a text field is text. Swedish decimals work: 12,5 and 1 234,50 are read as numbers. A comma is always a decimal separator, never a thousands separator, because this is a Swedish product; 1,234 is 1.234. Say so if a figure looks a thousand times off.\n\nTHE WHOLE BATCH OR NONE. Every value is checked before anything is written, so a batch whose eleventh field is misspelled leaves nothing saved rather than ten. data.errors lists every value that failed, one error each (field varden[i]...), so fix them all and send again — a dry_run shows the same list. An amount is rounded to its row's precision (kronor and headcounts whole, ratios four decimals); `avrundade` lists each value that was, {field, rad_kod, kontext, fran, till} — tell the person. Send the fields you changed; you do not have to send the rest.\n\nEMPTY DELETES, and that is not the same as writing a zero. An absent concept is filed as xsi:nil, a zero as the number 0 — different claims. Send neither `belopp` nor `text` to clear a value; send `belopp: 0` only when the figure really is zero. ⚠ One exception, in `falt` only: an EMPTIED field in a manual column of the statements is saved as 0. There the stored value overrides the accounts, and deleting it would bring the accounts' figure back.\n\nSIGN: `varden` is the FACT's sign. `falt` is what the form showed, and rows read the other way are turned back with the same rule that drew them — costs in the income statement, accumulated depreciation and impairment in a movement note (−50 000 in the field is the fact 50 000), and a movement that decreases its balance (a sale shown −30 000 is the fact 30 000; see get_arsredovisning_ixbrl).\n\nWhich column applies is decided by the package's datatype for the row, not by you: text/datum/boolesk rows take `text`, everything else takes `belopp`. Sending the wrong one is wrong_datatype rather than a silent conversion.\n\n⚠ THE STATEMENTS BELONG TO THE MATRIX. Rows in a section whose `tar_konton` is true — balansräkning and resultaträkning — are computed from the accounts, and writing here is refused with row_is_computed. Reclassify with save_bokslut_klassificering instead. Computed lines outside the statements are refused the same way: a movement table's balance at balans0/balans1, and the computed note sums and the effective tax reconciliation's figures (see get_arsredovisning_ixbrl) — write the lines they sum. The exception is a year flagged `manual_report`, where there is no usable account detail and the figures are typed. Do not suggest turning that flag on to work around a classification problem: it changes where every figure in the year comes from.\n\n`instans` separates repetitions inside a tuple — three auditor's fees, five depreciation policies. 0 is the first occurrence. A tuple's rows are tied together by sharing one `instans`: the name, the type of engagement and the amount of auditor 2 are all instans 1. Mixing them up does not fail — it silently reports one auditor's fee under another's name.\n\nAN ENUMERATION TAKES A CONCEPT NAME, NOT FREE TEXT. Rows whose value is a choice — type of engagement, type of security pledged — store the member's qualified name, e.g. `se-mem-base:RevisorerRevisionsforetagUppdragRevisionsuppdragMember`. Anything else is refused with invalid_value, and the message lists what is allowed. get_arsredovisning_ixbrl in utdata=formular renders these as a select whose option values are exactly those names.\n\nValues do NOT carry to next year the way decisions do: a value is not a decision, and last year's headcount says nothing about this year. What carries is the COMPARISON COLUMN — last year's balans0 becomes this year's balans1, and its balans1 becomes this year's balans2 — exactly as prev_ub does for accounts. period1 does not carry: there is no period2. One exception: DEPRECIATION PERIODS (years/percent per asset type, own groups included) are a policy and are copied period0 → period0 when a year is created or settings are copied.\n\nA CONCEPT IN SEVERAL TUPLES IS NAMED WITH ITS TUPLE: `rad_kod` = \"Tuple/Concept\". The taxonomy reuses children — the depreciation of buildings and of machinery are the same three concepts (…Benamning, …Avskrivningsprocent, …Nyttjandeperiod) in five tuples, and group companies' name, orgnr and seat likewise — so e.g. `AvskrivningsprincipMateriellaAnlaggningstillgangarByggnaderTuple/AvskrivningsprincipMateriellAnlaggningstillgangNyttjandeperiod`. Without the tuple such a concept is refused with tuple_required. Depreciation is this year only (period0), text (\"5\" or \"5 år\"); the standard asset types have one row (instans 0), the Övriga tuple holds own named groups (…Benamning plus år/procent per instans).\n\nNOTES WITH AN ÖVRIGA TUPLE take what fits no named row. An amount that has no line of its own — 2990 Övriga upplupna kostnader in the K2 note on upplupna kostnader och förutbetalda intäkter — goes in the note's Övriga tuple: the type as text and the amount, same instans (e.g. OvrigaUpplupnaKostnaderForutbetaldaIntakterInterimspost and OvrigaUpplupnaKostnaderForutbetaldaIntakter on balans0, instans 0). Do not deselect a note because its named rows do not fit; the check's message names the Övriga row.\n\nHOLDINGS (group companies, associates, other holdings) are one company per instans: `<Tuple>/ForetagetsNamn`, `/Organisationsnummer`, `/ForetagetsSate` on period0, the figures on balans0 (årets resultat on period0), same instans. The filed document splits them in two tables — the holding, and the company's equity and result — and leaves out a company without a name. Name, orgnr, seat, type, number of shares and the two shares are carried to next year's column; carrying value, equity and result are not.\n\nPERCENTAGES ARE RATIOS HERE: a pure-unit concept (capital share, soliditet …) takes the fact, 0.3025 for 30.25 % — the form shows and takes percent, `varden` does not. Up to four decimals are stored.\n\nUse dry_run to check a batch before writing it.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, nothing_to_set (the list was empty), no_package (organisationsform or regelverk is not chosen), unknown_row, unknown_context, unknown_field_name (a key in `falt` is not in the form `rad_kod@kontext`), row_is_heading (an abstract concept may not carry a value and could never be filed), row_is_tuple (a tuple holds an occurrence together and carries no value of its own — write to the rows under it and separate occurrences with `instans`), tuple_required (the concept stands in several tuples — prefix it with the tuple: \"Tuple/Concept\"), row_is_computed, wrong_datatype, invalid_amount, invalid_value, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"varden":{"type":"array","items":{"type":"object","properties":{"rad_kod":{"type":"string","description":"Taxonomy concept local name, or egen:xxxxxxxx"},"kontext":{"type":"string","enum":["period0","period1","period2","period3","period4","period5","period6","balans0","balans1","balans2","balans3","balans4","balans5","balans6","period0_kon","period1_kon","period2_kon","period3_kon","period4_kon","period5_kon","period6_kon","balans0_kon","balans1_kon","balans2_kon","balans3_kon","balans4_kon","balans5_kon","balans6_kon"]},"instans":{"type":"integer","description":"Repetition inside a tuple. 0 (default) means no repetition."},"belopp":{"type":["number","null"],"description":"For monetary and numeric rows. Omit both fields to clear the value."},"text":{"type":["string","null"],"description":"For text rows. Omit both fields to clear the value."}},"required":["rad_kod","kontext"],"additionalProperties":false},"description":"The values to save. Checked as a whole before anything is written."},"falt":{"type":"object","additionalProperties":{"type":"string"},"description":"A posted form: field name to value, as utdata=formular wrote them. Send this OR `varden`; both end up in the same list and meet the same rules."},"dry_run":{"type":"boolean","description":"Check the batch without writing it."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_avstamning","group":"avstamning","klass":"skriva","summary":"Save a balance-sheet post's kommentar and/or specification rows (ADR-0033).","description":"Save a balance-sheet post's kommentar and/or specification rows (ADR-0033).\n\n`rader` is the post's rows in full: send every row to keep, WITH ITS `id` — a row with an id is updated and keeps its attachments, a row without one is new, and a row left out is deleted WITH its attachments. Omit `rader` to leave them, omit `kommentar` likewise. Amounts in KRONOR here (\"12 500,00\" or \"12500.50\"), with the bookkeeping sign (a liability is written with a minus, \"-45 000\"). `konto` (optional) ties a row to one of the post's accounts — it then counts towards that account and follows it if it moves. `kalla` makes the row a calculation (see get_avstamning `kallor`): its amount is read from the calculation, not from `belopp`. A row with neither text nor amount is dropped.\n\nA specification documents what the balance consists of — take the amounts from the person's underlag (bank statement, reskontra, contracts), never invent a row to make the Ospecificerat belopp zero. dry_run first and show the person the result.\n\nErrors: missing_post, unknown_post (not a post in this year's balance sheet), unknown_row (an id that is not one of the post's rows), invalid_rows, invalid_row, invalid_amount, text_too_long (500 characters), unknown_account (not one of the post's accounts), unknown_source, year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"rad_kod":{"type":"string","description":"The post, from get_avstamning"},"kommentar":{"type":"string","description":"How the post was reconciled; '' clears it"},"rader":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"The row's id from get_avstamning; omit for a new row"},"text":{"type":"string"},"belopp":{"type":"string","description":"Kronor, bookkeeping sign (liabilities negative)"},"konto":{"type":"string","description":"One of the post's accounts"},"kalla":{"type":"string","description":"A calculation from get_avstamning kallor"},"lanka_dokument":{"type":"array","items":{"type":"integer"},"description":"A NEW row only: existing attachments to link to it (from get_avstamning_forslag)"}},"additionalProperties":false},"description":"ALL the post's rows; replaces them"},"dry_run":{"type":"boolean","description":"Compute without saving"}},"required":["client_id","fiscal_year_id","rad_kod"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_bokslut_egen_rad","group":"bokslut","klass":"skriva","summary":"Add a line of the company's own to the annual report, change one, or remove one.","description":"Add a line of the company's own to the annual report, change one, or remove one.\n\nK3 ONLY. K2 permits renamed headings but no new lines, and the package says which (`paket.tillater[sektion].egen_rad` from get_bokslut_matris). A package that does not allow it answers `rows_not_allowed`. The notes take custom lines in both frameworks. In a movement note, put a custom CHANGE under the group's heading (e.g. …ForandringAnskaffningsvardenAbstract) with `efter` = the last change: it is then part of the computed closing balance. A few notes take no custom AMOUNT lines — the auditors' fees (occurrences), the average number of employees (a count) and the K3 option exercise price (an average) — and answer `rows_closed_here`; text still works. One heading is open in BOTH K2 and K3 although its section is not: the board's proposed appropriation, `foralder: ForslagDispositionAbstract`, for a special case the taxonomy lacks (use `balans: ospecificerad`; the proposal's total is still typed on ForslagDisposition). A custom balance-sheet line under FrittEgetKapitalAbstract stands automatically among the funds at the stämma's disposal.\n\nA custom line has NO taxonomy concept. At filing it is tagged as an undefined concept from the se-misc-base extended-information taxonomy, which is explicitly permitted — it is extension taxonomies and dimensions that are forbidden. Which element carries the amount depends on `balans`, and there is a distinct one for Credit, Debit and neither. That is why `balans` is REQUIRED when the line is created rather than guessed at filing time. Do not choose it yourself if the person has not said: a receivable is debit, a liability or equity is credit, and \"ospecificerad\" is for when the balance genuinely cannot be determined, not for skipping the question.\n\nWHERE THE LINE SITS IS EXPRESSED IN CONCEPTS, NOT ROW NUMBERS. `foralder` is the heading it goes under. It must be an abstract heading — posts carry amounts and have no sub-rows (`parent_not_heading`) — and it must ALREADY CARRY POSTS (`parent_has_no_posts`). Six K3 headings hold nothing but other headings and totals; \"Anlaggningstillgangar\" is intangible, tangible and financial and nothing else, and a lone amount among headings is not a row the report has a place for. The rule is structural, not a depth: posts sit at level 0 in the income statement and at level 3 under intangibles. `efter` is the sibling to place it after. Omitted on a new line: after the last own line under the same heading, or first under the heading when it has none — so lines added one after another keep that order. Both are taxonomy concepts, the only thing that survives a new taxonomy release.\n\nThe line then behaves like any other: accounts can be moved onto it with save_bokslut_klassificering, its figure flows up into the total above it, and it is carried into next year along with the reclassifications pointing at it.\n\nA CUSTOM TEXT NOTE. `datatyp: \"text\"` makes a text line instead of an amount; it is tagged as se-misc-base:OdefinieratBegreppTextTuple and needs no `balans`. Text is only allowed in the notes (`datatype_not_allowed` elsewhere). Put it directly under a note SECTION — UpplysningarBalansrakningenAbstract, UpplysningarResultatrakningenAbstract, OvrigaUpplysningarAbstract, RedovisningsprinciperAbstract — and it is a note of its own: it appears in set_arsredovisning_noter (called without `noter` it lists them), is numbered like any note and must be selected there to be rendered; its text is saved with save_arsredovisning_varde on `<rad_kod>@period0`. Put it under an existing note's heading and it is a text line in that note. Allowed in K2 and K3 alike. To rename, send only `rad_kod` and `etikett`: the line keeps its place and its datatype. Removing a text note also removes its place in the note selection and its text.\n\nA CUSTOM FIGURE NOTE. `datatyp: \"rubrik\"` directly under a note section makes a note heading; its lines have the heading as `foralder` — `monetart` lines (an amount this year and last, stored on @balans0 and @balans1 like other note lines), `text` lines, and at most one sum line: `summa`, or `summa_avstamd` when the sum must equal the line(s) in the statements that refer to the note (set_arsredovisning_nothanvisning) — a red check row shows the difference. A note that only lists part of a line (e.g. grants within it) uses `summa`. Change between them by sending rad_kod and datatyp. In the file each cell is an undefined concept named 'note heading, line'. This is also how a new custom note is made in the form (\"Egen not\"): a heading, filled with text and/or lines. A `text` line inside a note is a full-width paragraph and its `etikett` is OPTIONAL — a subheading when given, named 'note heading, text' in the file when empty. Removing the heading removes its lines and their values. A custom `monetart` or `text` line can also go directly under a taxonomy note that has lines of its own (e.g. NotInventarierVerktygInstallationer). A custom `monetart` line under a group heading inside a note whose total is computed or checked (e.g. LonerAndraErsattningarAbstract, ResultatAndelarKoncernforetagExklNedskrivningAbstract) joins that sum or check — the form's \"+ Rad\" in the group. Not among lines the note borrows from the income statement (group contributions).\n\nA CUSTOM FIXED-ASSET NOTE (\"Egen anläggningsnot\"). Create the note heading (`datatyp: \"rubrik\"` under a note section) with `mall: \"anlaggningsnot\"` and it is filled with four groups — Anskaffningsvärden, Avskrivningar, Nedskrivningar, Uppskrivningar — and a `summa_avstamd` line \"Redovisat värde\". A group is `datatyp: \"grupp\"` under the note; creating one also creates its `ingaende` and `utgaende` balance lines (\"Ingående <group>\", \"Utgående <group>\"). Inside a group the changes are `monetart` lines (Inköp, Årets avskrivningar …), one `ingaende` and one `utgaende` only, no text, no sum, no group. Computed, never written: the closing balance (opening plus the changes), this year's opening (last year's closing) and Redovisat värde (the groups' closing balances plus any amount lines directly under the note); save_arsredovisning_varde refuses them with row_is_computed. Write last year's opening on `<ingaende>@balans1` and the changes on @balans0/@balans1. Reductions are written with a minus (−23 000 for depreciation) and stand so in the document. Empty groups and lines are left out of the filed document. Every line can be renamed and removed; removing a group removes its lines and values. In the file each cell is named 'note, group, line'. With a koncernredovisning, a custom figure or fixed-asset note has ONE set of lines and two sets of amounts: the koncern's figures go on the same lines with the _kon contexts (`<rad_kod>@balans0_kon`), computed per block and reconciled against the koncern's statements. Create and rename these lines without `enhet` — they are the parent's lines; texts are shared and stand once.\n\nA CUSTOM KEY FIGURE. `foralder: \"Flerarsoversikt\"` adds a key figure (it can then be moved among the fixed rows with `flytt`) as the last row of the multi-year overview (K2 and K3 both allow extra key figures). `datatyp` is its type: `monetart` (an amount, with `balans: \"ospecificerad\"`), `procent`, `tal` (a whole number) or `tal_decimaler` (two decimals); nothing else is accepted there and these three are accepted nowhere else. `etikett` may be empty there (the form adds by type and the name is typed on the row), but a key figure without a name is left out of the filed document. Values are saved with save_arsredovisning_varde on `<rad_kod>@period0` … `@periodN`, one per column — always the period context, also for a balance. A `procent` is sent as a ratio (0.425 for 42.5 %). In the file it is tagged as se-misc-base:OdefinieratBegreppMonetartTuple or …NumerisktTuple. It is carried into next year like other custom lines, and this year's values become the comparison column.\n\nMOVING A LINE. Send `rad_kod`, the new `efter` and `flytt: true` — the same call as the arrows in the form. Only that line moves: the lines that stood after it keep their place, and a line that already stood after the new anchor follows the moved one. `efter` may be a fixed line under the same heading or another custom line; empty puts it first under the heading (in the notes; in the multi-year overview and the church's verksamhetsinformation a line without an anchor stands last). The order is carried into next year. move_needs_row without rad_kod or efter.\n\nREMOVING IT RELEASES THE ACCOUNTS. Send `ta_bort: true` with `rad_kod`. The accounts on the line go back to the package default — and since the line usually existed precisely because they had no home, they become unclassified again and the checks will say so. The answer counts them as `konton_lossade`; `dry_run: true` counts without touching anything. Say the number before you do it.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, no_package, unknown_row (no such custom line), rows_not_allowed, rows_closed_here, unknown_parent, parent_not_heading, label_empty, label_too_long, unknown_datatype, datatype_not_allowed, unknown_balance, unknown_sibling, move_needs_row, unknown_template (mall other than anlaggningsnot, or not on a new rubrik), internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"rad_kod":{"type":"string","description":"The custom line to change or remove. Omit to create a new one."},"etikett":{"type":"string","description":"The line's wording"},"foralder":{"type":"string","description":"Taxonomy concept of the heading it goes under, e.g. ImmateriellaAnlaggningstillgangarAbstract"},"efter":{"type":"string","description":"Sibling line to place it after. Omitted on a new line: after the last own line under the same heading, or first when there is none."},"balans":{"type":"string","enum":["debit","credit","ospecificerad"],"description":"Which se-misc-base element carries the amount. Required when creating an amount line; not used for text."},"datatyp":{"type":"string","enum":["monetart","text","rubrik","summa","summa_avstamd","procent","tal","tal_decimaler","grupp","ingaende","utgaende"],"description":"monetart (default) for an amount line, text for a text line or a custom text note, rubrik for a custom figure note, summa / summa_avstamd for its sum line; grupp / ingaende / utgaende in a custom fixed-asset note; procent / tal / tal_decimaler only for a key figure under Flerarsoversikt. Omitted on a change, the line keeps its own."},"enhet":{"type":"string","enum":["jur","kon"],"description":"Whose lines: jur = the company itself (default), kon = the group (koncern, ADR-0022). The group's lines have the same concept names as the parent's, so a renamed line or own line belongs to one of them. kon requires arsred_koncernredovisning (aktiebolag under K3) and is refused with no_koncern otherwise; an unknown value is unknown_entity."},"mall":{"type":"string","enum":["anlaggningsnot"],"description":"With a new datatyp rubrik note: fill it as a fixed-asset note (four groups and Redovisat värde)."},"flytt":{"type":"boolean","description":"With rad_kod and efter: move the line to stand after efter; only it moves"},"ta_bort":{"type":"boolean","description":"Remove the line instead of saving it"},"dry_run":{"type":"boolean","description":"With ta_bort: count the accounts that would be released, change nothing"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_bokslut_justering","group":"bokslut","klass":"skriva","summary":"Create or change a bokslutsjustering: a double-entry journal entry on top of the imported balances.","description":"Create or change a bokslutsjustering: a double-entry journal entry on top of the imported balances.\n\n⚠ THIS CHANGES THE FIGURES THE ANNUAL REPORT IS BUILT FROM. Saving one immediately moves ub_adjusted on every account it touches. Do not post an entry on your own judgement: an accrual, a depreciation or a tax entry is a professional decision, and the amount and the accounts are the person's to confirm. The one exception is carrying last year's result forward (2099 to 2091) as the server instructions describe. A finding's detalj.aterforing (get_skatteberakning) is saved only on the person's yes, with its rows unchanged. Propose it with dry_run, show what it does, and write only when they have said yes to that entry.\n\nOmit `id` to create; pass it to change an existing one, in which case THE ROWS ARE REPLACED IN FULL — send every row you want kept, not just the changed ones.\n\nRules, all enforced: at least two rows (too_few_rows); debit must equal credit (unbalanced); each row carries debit OR credit, never both (both_sides) and never a negative (negative_amount) and never zero (zero_amount); the account must be a number that exists (invalid_account); a description is required (description_required) because an entry nobody can read in a year is an entry nobody dares touch; the category must be one of periodisering, avskrivning, skatt, omklassificering, ovrigt (unknown_category); and the date must be YYYY-MM-DD (invalid_date).\n\nAmounts may be written 1234.56 or 1 234,56 — both are read in öre, never as floating point. A booking date outside the fiscal year does NOT block: it comes back as date_outside_year, because a close made after the fact has to be possible. Mention it.\n\nA locked entry or a locked year refuses: adjustment_locked, year_locked. An id that is not yours or does not exist gives unknown_adjustment.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"id":{"type":"integer","description":"The entry to change. Omit to create a new one."},"booking_date":{"type":"string","description":"YYYY-MM-DD, normally the last day of the fiscal year"},"category":{"type":"string","enum":["periodisering","avskrivning","skatt","omklassificering","ovrigt"],"description":"What kind of entry this is"},"description":{"type":"string","description":"What the entry does, for someone reading it later"},"rows":{"type":"array","items":{"type":"object","properties":{"account_no":{"type":"string","description":"From get_bokslut_kontoplan"},"debit":{"type":["string","number"]},"credit":{"type":["string","number"]},"note":{"type":"string","description":"Row text, optional"}},"required":["account_no"],"additionalProperties":false},"description":"At least two rows; debit total must equal credit total"},"dry_run":{"type":"boolean","description":"true validates and writes nothing"}},"required":["client_id","fiscal_year_id","booking_date","category","description","rows"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_bokslut_klassificering","group":"bokslut","klass":"skriva","summary":"Move one or more accounts to another line in the annual report, to another INK2 field, or back to the package default.","description":"Move one or more accounts to another line in the annual report, to another INK2 field, or back to the package default.\n\n`account_no` takes a single account or a list. Every account in a list gets the same line and the same field, all of it in one transaction, and every account is checked before anything is written — a list whose eleventh account is misspelled leaves nothing moved rather than ten. The answer's `konton` array carries one entry per account.\n\nTHE PRESENCE OF THE KEY DECIDES, NOT ITS VALUE. Omitting `rad_kod` leaves the line alone; sending `rad_kod: null` resets it to the package default. The same for `sru_falt`. Send only the one you mean to change — a client that echoes the whole object back would wipe the other choice.\n\nThere is no delete. Resetting both to null removes the stored row, because the table holds only deviations. That matters next year: what is carried forward are the DECISIONS, and a row saying \"default\" would carry a decision nobody made and pin it against the next package.\n\nThe two mappings are independent. Setting the line never changes the field and the reverse, because a reclassification made for the annual report's sake must not silently change the tax return. When you move an account to a line whose other accounts go to a different INK2 field, ask the person whether the field should follow, and set it only if they say so. The fields an account can take are in get_bokslut_matris `sru_val` ({falt, rad, benamning, sektion}); a chosen field applies whatever the account's sign, so it replaces a sign-dependent pair such as 8810.\n\nWHAT CANNOT BE CHOSEN: a heading (`row_is_heading`) carries no figures of its own, and a total (`row_is_total`) is computed from its components, so an account on it would be counted twice. Use get_bokslut_matris to see which lines take accounts — they are the ones with `rubrik: false`, `ar_summa: false` AND in a section whose `tar_konton` is true. NOTE LINES TAKE NO ACCOUNTS: the chain is one account to one line, so an account put in a note would LEAVE the balance sheet and it would stop balancing. A note gets its figure from the statements, not from the ledger. Never suggest a note line.\n\nThe answer carries `upplosning`: what the account resolves to after the change, including the line's label. Suggest a line and let the person confirm it; do not reclassify on your own initiative — except an account on the wrong side, which the server instructions let you move (with its INK2 field, and last year's figures typed where needed).\n\nTHE GROUP (`enhet: 'kon'`): an account in the group's consolidated trial balance (imported with the Excel import and enhet kon) is mapped into the group's lines. The default is the parent's BAS mapping, with retained earnings and the year's result moved to annat eget kapital and the share premium to övrigt tillskjutet kapital. Untaxed reserves, appropriations and shares in group companies stay UNMAPPED on purpose — in a consolidated balance they should already be split or eliminated; ask the person. Group-only lines (innehav utan bestämmande inflytande, group goodwill) have no BAS account and are always chosen by hand. The INK2 field belongs to the parent, so `sru_falt` is refused for the group.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, missing_account, unknown_account (the account has no balance in the year), no_package (the year has no organisationsform or regelverk, so there is nothing to classify into), nothing_to_set (neither key was sent), unknown_row, row_is_heading, row_is_total, row_takes_no_accounts (the line exists but sits in a section that holds no accounts, such as the notes — do not retry with a different note line), unknown_field, field_wrong_statement (the INK2R field belongs to the other statement — a balance-sheet account, 1xxx–2xxx, takes a 2.x field and a result account, 3xxx–8xxx, a 3.x field; moving across makes INK2R stop balancing), unknown_entity (enhet is not jur or kon), no_koncern (enhet kon, but the year prepares no koncernredovisning), not_for_entity (sru_falt sent with enhet kon — the group files no tax return), internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"account_no":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The account to reclassify, e.g. \"1330\", or a list of accounts that all get the same line and field"},"rad_kod":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Taxonomy line code, or null to reset to the package default. Omit to leave alone."},"sru_falt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"INK2 field code, or null to reset to the table default. Omit to leave alone."},"enhet":{"type":"string","enum":["jur","kon"],"description":"jur (default) the parent company, kon the group's consolidated trial balance"}},"required":["client_id","fiscal_year_id","account_no"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_bokslut_persons","group":"bolag","klass":"skriva","summary":"Save the people for one or more roles.","description":"Save the people for one or more roles.\n\n⚠ Each role you send is REPLACED BY WHAT YOU SEND. A person of that role who is not in your list is deleted. Roles you do not send are untouched. So call list_bokslut_persons first, change what you mean to change, and send the whole list for that role back — including the `id` of everyone who already existed. A person sent without an id is created as a new one.\n\nSend the id, always, for anyone who exists. Dropping it does not update them: it deletes them and creates a stranger with the same name, losing their history and any signing that points at them.\n\nRules the server enforces, so you do not have to guess: a role has a maximum and an ordförande is one; a personnummer must have a valid check digit; a legitimering that requires a personnummer refuses a person without one; and exactly one person may sign the fastställelseintyg, checked across the whole year and not only your call.\n\nBOLAGSMÄN AND FÖRVALTARE: in a kommanditbolag the komplementärer always sign; the kommanditdelägare sign only when the setting arsred_kb_endast_komplementar is off (it is on by default). A stiftelse's förvaltare is recorded only with anknuten förvaltning: when one is recorded, the förvaltare signs and avger instead of the board. A bolagsman, komplementär or förvaltare may be a legal person: put its name in `juridisk_person` and the name of the firmatecknare who signs for it in first_name/last_name.\n\nWHO SIGNS THE ANNUAL REPORT: everyone in a signing role does, EXCEPT a styrelsesuppleant, who signs only when serving in an ordinary member's place that year. Only that role takes `signs_ar`; omit it or send false and the suppleant does not sign — also after a Bolagsverket fetch. It is per year and is NOT copied to the next year. Ask the person rather than guessing that a suppleant served.\n\nChanging someone's role is allowed and is recorded as a change, not as a delete and an add — send them back under the new role WITH their id, in the same call as the role they are leaving.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"persons":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"Omit ONLY for a new person"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"personal_number":{"type":"string","description":"12 digits, valid check digit"},"auth_method":{"type":"string","description":"Key from list_bokslut_persons.auth_methods"},"sign_date":{"type":"string","description":"YYYY-MM-DD. Not for revisor/medrevisor — the auditor's påteckning has one date for all auditors, the setting revisor_datum_underskrift"},"title":{"type":"string","description":"revisor/medrevisor only: the title under the name in the påteckning, e.g. 'Auktoriserad revisor' or 'Godkänd revisor'. Empty means Auktoriserad revisor. Bolagsverket's register does not have it — ask rather than guess."},"juridisk_person":{"type":"string","description":"bolagsman/komplementar/kommanditdelagare/forvaltare only: the legal person this person signs for as firmatecknare, e.g. 'Komplementären AB'. Empty for a natural person."},"signs_fastst":{"type":"boolean","description":"Signs the fastställelseintyg — at most one person. Not in a handelsbolag, kommanditbolag, stiftelse or ideell förening, which have none"},"signs_ar":{"type":"boolean","description":"styrelsesuppleant only: true when the suppleant serves in an ordinary member's place this year and signs the annual report. Default false. Ignored for other roles, which always sign."},"shares":{"type":"integer","description":"Ägare only"},"votes":{"type":"integer","description":"Ägare only"}},"additionalProperties":false}},"description":"Map of role key to the COMPLETE list of people in that role"},"dry_run":{"type":"boolean"}},"required":["client_id","fiscal_year_id","persons"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_bokslut_rubrik","group":"bokslut","klass":"skriva","summary":"Rename one line in the annual report, or put the taxonomy's own wording back.","description":"Rename one line in the annual report, or put the taxonomy's own wording back.\n\nONLY THE TEXT CHANGES. The taxonomy concept, the totals and the accounts on the line all stay as they are; the difference is filed as an XBRL footnote under the LogChangedLabel role. This is why it is a separate tool from save_bokslut_klassificering: moving an account changes a FIGURE, renaming a line changes a TEXT, and the two decisions have nothing to do with each other.\n\nEVERY taxonomy line can be renamed — posts, totals and abstract headings alike. This is NOT the same rule as save_bokslut_klassificering's: a total refuses accounts, because that would be double counting, but accepts a new wording. Bolagsverket's own tagging example 5 renames se-gen-base:LangfristigaSkulder, whose taxonomy wording is \"Summa långfristiga skulder\", to just \"Summa\".\n\nBUT NOT EVERY CHANGE CAN BE REPORTED, and the answer says which. `etikett_andrad` is the comparison; `etikett_loggas` says whether it becomes a LogChangedLabel footnote. For an abstract heading the first is true and the second false: the concept is declared abstract, so XBRL forbids reporting it as a fact, and the footnote can only attach to a fact. Such a heading is never tagged at all, so the XBRL data is identical however it is worded — only the rendered document changes. Say so if the person renames one.\n\nWHAT MAY BE RENAMED AT ALL IS THE PACKAGE'S CALL, NOT YOURS. K2 allows renamed headings but no new lines, K3 allows both, and the flag sits per section in the package file. get_bokslut_matris reports it as `paket.tillater`. A package that does not allow it answers `label_not_allowed`; do not look for another route.\n\nRESETTING IS DELETING. `etikett: null` removes the stored wording. So does sending the taxonomy's own text verbatim — it is not a deviation, and storing it would freeze the wording so that a corrected formulation in the next taxonomy release never reached this client. The answer says what actually remained: `etikett` is what will be shown, `etikett_taxonomi` is the taxonomy's, and `etikett_andrad` is the comparison between them — never a flag someone sets.\n\nA renamed line is carried into next year like any other decision. Propose wording and let the person confirm it; the label ends up in a filed document.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, missing_row, nothing_to_set (the etikett key was not sent), no_package, unknown_row, label_not_allowed, label_too_long, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"rad_kod":{"type":"string","description":"Taxonomy line code to rename, e.g. \"LangfristigaSkulder\""},"etikett":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The wording to show, or null to go back to the taxonomy's own"},"enhet":{"type":"string","enum":["jur","kon"],"description":"Whose lines: jur = the company itself (default), kon = the group (koncern, ADR-0022). The group's lines have the same concept names as the parent's, so a renamed line or own line belongs to one of them. kon requires arsred_koncernredovisning (aktiebolag under K3) and is refused with no_koncern otherwise; an unknown value is unknown_entity."}},"required":["client_id","fiscal_year_id","rad_kod","etikett"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_bokslut_settings","group":"bolag","klass":"skriva","summary":"Set one or more year-end settings for a client and fiscal year.","description":"Set one or more year-end settings for a client and fiscal year.\n\nSend ONLY the settings you are actually changing. Everything left out keeps its value. Do not read all the settings and post them back — another person may have changed one since you read it, and you would overwrite their work with a stale value.\n\nValues are typed: bool as true/false, date as YYYY-MM-DD, int as a number, enum as one of the option keys from get_bokslut_settings. An empty value resets the setting to its default, which deletes the stored row rather than storing a blank.\n\nEvery change is written to the behandlingshistorik with its old value and who made it.\n\nWHAT YOU MAY DECIDE: every definition carries `source`.\n  bolagsverket, derived, sie — you may propose a value from data you have\n  agency — the firm's own standing details; reuse what other years or clients of the same agency use, do not invent\n  user_choice — a judgement. Ask the person. Do not guess, and do not infer it from a similar company.\nRead `description` before setting anything: it says what the setting actually affects, which the label does not.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"settings":{"type":"object","additionalProperties":{},"description":"Map of setting_name to value, containing only what should change"},"dry_run":{"type":"boolean","description":"true returns the plan and writes nothing"}},"required":["client_id","fiscal_year_id","settings"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_egna_steg","group":"bokslut","klass":"skriva","summary":"Create, rename, reorder or remove the year's own steps (Inställningar → Övrigt → Egna steg) — the row `ovrigt` in get_status_oversikt and the column Övrigt in Välj företag. Send the WHOLE list as it should be, in order: a step not in the list is removed, an empty list removes them all. Keep each existing step's `id` (from get_status_oversikt, kod egen.<id>) so its status and anteckning stay when the text changes; a new step has no id and gets the next free one. `text` max 60 characters, `deadline` YYYY-MM-DD or omitted. At most 20 steps. The steps follow to next year without status, the deadline moved a year. They are the agency's checklist: add or change them when the person asks. Status is set with set_egna_steg_status.","description":"Create, rename, reorder or remove the year's own steps (Inställningar → Övrigt → Egna steg) — the row `ovrigt` in get_status_oversikt and the column Övrigt in Välj företag. Send the WHOLE list as it should be, in order: a step not in the list is removed, an empty list removes them all. Keep each existing step's `id` (from get_status_oversikt, kod egen.<id>) so its status and anteckning stay when the text changes; a new step has no id and gets the next free one. `text` max 60 characters, `deadline` YYYY-MM-DD or omitted. At most 20 steps. The steps follow to next year without status, the deadline moved a year. They are the agency's checklist: add or change them when the person asks. Status is set with set_egna_steg_status.\n\nALWAYS dry_run first when steps would be removed, and tell the person which — a removed step loses its status.\n\nErrors: invalid_value (a text too long, a bad deadline, too many steps), missing_fiscal_year, year_locked.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"steg":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"description":"An existing step's id; omit for a new step"},"text":{"type":"string","description":"The step, max 60 characters"},"deadline":{"type":"string","description":"YYYY-MM-DD, optional"}},"required":["text"],"additionalProperties":false},"description":"The whole list, in order"},"dry_run":{"type":"boolean","description":"Validate and show the change without saving"}},"required":["client_id","fiscal_year_id","steg"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_extrastamma_person","group":"stamma","klass":"skriva","summary":"An extra stämma's OWN people (migration 0066) — never the year's people, and nothing is written back to them.","description":"An extra stämma's OWN people (migration 0066) — never the year's people, and nothing is written back to them.\n\n`atgard`:\n  spara        `person` {id? (omit to add), role, first_name, last_name, email?, personal_number?, auth_method?, shares?, votes?}. role: stamma_ordforande | stamma_protokollforare | stamma_justerare | agare | stamma_ovrig. `fran_person_id`: a row from list_bokslut_persons to start from — the fields you do not send are taken from it (handy for choosing the ordförande among the board). Personnummer reach you MASKED, xxxxxx-1234 (the last four digits); sending the masked value back for the same person keeps the stored number. Never ask the person to read a full number out to you.\n  ta_bort      id\n  hamta_agare  the owners copied again from the year's people, replacing the stämma's; the functionaries are left alone. Use it when shares changed hands after the stämma was created.\n\nThe answer is the protokoll as it stands: `stamma` {id, slag arsstamma|extra, paket — the template version locked on the stämma}, `texter` {stamma, stamman, protokoll, agare} in the form's words (årsstämma, föreningsstämma, årsmöte, extra bolagsstämma …), `typ` fysisk|digital|percapsulam, `paragrafer` in order — each {nyckel ('m:<kod>' a template paragraph, 'e:<id>' an own one), rubrik, text (with {fält} placeholders), html_rubrik/html_text (filled in), andrad (own text on a template paragraph), egen, dold, lagstadgad (cannot be hidden), kopplad (its content follows the decisions or the people while the text is the template's)}, `undertecknare` {namn, roller, har_email, har_personnummer}, and `saknas` {fält: what is missing — say it to the person, the document shows it marked}. `read_only` with a reason when the year is filed or locked. Errors: unknown_stamma, unknown_person, invalid_enum (role), and the person checks: name_required, invalid_email, invalid_personal_number, personal_number_required, invalid_auth_method, invalid_int.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"stamma_id":{"type":"integer"},"atgard":{"type":"string","enum":["spara","ta_bort","hamta_agare"]},"person":{"type":"object","properties":{"id":{"type":"integer"},"role":{"type":"string","enum":["stamma_ordforande","stamma_protokollforare","stamma_justerare","agare","stamma_ovrig"]},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"personal_number":{"type":"string"},"auth_method":{"type":"string"},"shares":{"type":"integer"},"votes":{"type":"integer"}},"additionalProperties":false},"id":{"type":"integer","description":"ta_bort: the person's id on the stämma"},"fran_person_id":{"type":"integer","description":"spara: a year person to start from"}},"required":["client_id","fiscal_year_id","stamma_id","atgard"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_k10","group":"k10","klass":"skriva","summary":"Change a K10 (ADR-0056). Only the fields sent change; null or '' clears a field so the suggestion applies again. Use dry_run first and show the person what changes. Fields (`falt`): namn, pnr, numrering (1–99, several K10 for the same company), aktier and aktier_totalt (at the start of the income year), utlandskt, sarskilt_kvalificerade (booleans), andel_andra_procent (the SUM of the person's ownership in OTHER fåmansföretag, in percent — splits the grundbelopp), omkostnadsbelopp, sparat_in (1.4), loneunderlag (4.1, cash pay to employees the year before), loneunderlag_dotter (4.2), dotterforetag [orgnr, at most four], egen_lon (the person's or a närstående's cash pay the year before — caps the salary-based room at 50 ×), utdelning (2.1), forsaljning {antal, datum (in the income year), ersattning, omkostnadsbelopp, utdelning_fore} or null, for_hand {kopta_fore_aret, makar, gava_arv, flera_forsaljningar: bool}. Amounts in kronor.","description":"Change a K10 (ADR-0056). Only the fields sent change; null or '' clears a field so the suggestion applies again. Use dry_run first and show the person what changes. Fields (`falt`): namn, pnr, numrering (1–99, several K10 for the same company), aktier and aktier_totalt (at the start of the income year), utlandskt, sarskilt_kvalificerade (booleans), andel_andra_procent (the SUM of the person's ownership in OTHER fåmansföretag, in percent — splits the grundbelopp), omkostnadsbelopp, sparat_in (1.4), loneunderlag (4.1, cash pay to employees the year before), loneunderlag_dotter (4.2), dotterforetag [orgnr, at most four], egen_lon (the person's or a närstående's cash pay the year before — caps the salary-based room at 50 ×), utdelning (2.1), forsaljning {antal, datum (in the income year), ersattning, omkostnadsbelopp, utdelning_fore} or null, for_hand {kopta_fore_aret, makar, gava_arv, flera_forsaljningar: bool}. Amounts in kronor.\n\nNever overwrite a sparat_in the person entered without asking; it may follow Skatteverket's decision rather than last year's K10 (warning k10_sparat_avviker). A K10 answer: `rad` (what is ENTERED; null in a field means the suggestion applies), `forslag` {field: {varde, kalla}} (aktier/aktier_totalt from the röstlängd of the fiscal year ending just before the income year, loneunderlag 4.1 from the AGI receipts of the year before, sparat_in 1.4 from last year's K10), `varden` (what is computed on: entered, else suggested), `belopp` (the year's amounts: grundbelopp, loneavdrag, tak_utdelning, tak_vinst, ranta %), and `berakning` {punkter {\"1.1\": kr, …} named as on K10 edition 39 — A 1.1–1.6, B 2.1–2.10, C 3.1–3.13, D 4.1–4.12; a point that does not apply is absent — gransbelopp, sparat_ut (to next year), varningar [{kod, text}], for_hand [keys]} or null with `fel` when the year cannot be computed. A non-empty `for_hand` means the case is outside what the tool computes (shares bought the year before, spouses, gift/inheritance, several sales): say so and do not present the figures as the K10. Errors: unknown_k10, invalid_value, invalid_pnr, invalid_orgnr, invalid_date, too_long, duplicate_k10.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"id":{"type":"integer","description":"The K10 id"},"falt":{"type":"object","additionalProperties":{},"description":"The fields to change"},"dry_run":{"type":"boolean","description":"Compute without saving"}},"required":["client_id","id","falt"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_revisionsberattelse","group":"revision","klass":"skriva","summary":"Change the audit report (ADR-0072). The year-end is never changed, and it is allowed in a locked year. Everything is optional; only what is sent changes: uppgifter {key: value | null} — a setting changed here (keys as in `uppgifter`, except namn, orgnr, start, slut, form, which come from the company and year). null removes the change so the year-end applies again; an empty mottagare restores the default. revisorer replaces the whole list (one to six, first and last name; titel defaults to Auktoriserad revisor). datum ÅÅÅÅ-MM-DD. block {kod: {text?, rubrik?, plural?}} — text: an own text (turns off `ren`; '' leaves the block out of the document; each line is its own paragraph, blank lines are ignored, and a line starting with \"- \" is a bullet, as in the standard texts), null: back to the standard text. rubrik: an own heading, null: the standard one. plural: the plural heading where the block has one (har_plural). sidbrytning {nyckel, ny_sida: true | false | null} — a page break, as in the annual report: the key is a section's `nyckel` from get_revisionsberattelse_ixbrl's `sidindelning.avsnitt`; true starts a new page there, false removes a default break, null returns to the default. Style only — allowed with `ren`. ren true — back to the standard wording: EVERY own text and heading is removed. Ask first. kvittera [kod] — the revisor has read these own texts against the new settings. Never overwrite an own text (egen) without showing the person the old and the new and asking. Use dry_run first: it answers the report as it would be, plus `andringar` {uppgifter [keys], block [kod], ren (the new value, or null when unchanged)} — the same list a real save answers. An audit report answer: `finns` (saved yet), `ren` (standardformulering: the texts follow the settings; any own text turns it off), `uppgifter` (the settings in force — namn, orgnr, start, slut, form, regelverk k2|k3, vd, ledamoter, resultat vinst|forlust, utdelning, kassaflode, koncern (the parent company prepares koncernredovisning: the texts speak of årsredovisningen och koncernredovisningen, FAR RevR 700 exempel 2), ansvar_kort, revisionsbolag, revisorer [{fornamn, efternamn, titel, huvudansvarig}], ort, datum, mottagare, anmarkning_skatter, anmarkning_sen, and the appearance: stil standard or the id of a style profile the audit firm's account has (an e-revisor administrator makes and assigns them; its defaults apply where neither the report nor the account chose), typsnitt opensans|profil, storlek standard (as the annual report)|8|8.5|9|9.5|10|10.5|11|11.5|12 (pt), spalter 1|2 (two columns: the title over both, the text in two columns per page), sidhuvud logo_vanster|logo_hoger (the logo left and the page number right, or the reverse; the header has no company name), logotyp — the audit firm's logo, uploaded by a person under Konto och företag — logotyp_hojd 8|12|16|20 (mm) and logotyp_sidor alla|forsta (every page, or only the first); the base style, margins, page header and page numbers are the annual report's), `kalla` per setting (bokslut: read from the year-end; har: changed here; grund: not in the year-end, entered here; konto: the audit firm's account default; profil: the style profile's default; standard: the program's default), `stilar` [{id, namn}] (the account's style profiles; empty: no stil to choose), `block` [{kod, sektion ar|ak, rubrik, text, egen, plural, har_plural, begrepp, tillhor, forslag [names], kontrollera}] in document order (`ar` = the report on the annual report, `ak` = on other requirements), `kontrollera` [kod] (own texts written before a setting changed — read them against the new settings, then acknowledge with save_revisionsberattelse kvittera), and `paket` {form ab|ef|brf|hb|ideell|stiftelse (hb also for kommanditbolag), version, kalla, namn, koncern (the package has group texts — only aktiebolag), taggad (tagged iXBRL that Bolagsverket takes digitally — only aktiebolag; the others are a plain document the revisor signs as PDF)}. The form follows the company's organisationsform in the year-end; svenska_kyrkan answers unsupported_form. `paket.uppgifter` lists settings only that form has — for stiftelse: revideras arsredovisning|arsbokslut|sammanstallning (what the revisor audited; it renames the report and what the opinion tests against — ask, never guess), forvaltare (true: managed by a förvaltare, from the year-end's persons) and tryggandelagen (a pension or staff foundation, RevR 700 example 12). `paket.vd` and `paket.disposition` false: the form has no VD or no disposition statement, and those settings change nothing. The blocks have the same kod in every form; the package names them (hb and ideell: 'Uttalande' in the singular, no fastställelse, hb's Företagsledningens ansvar) and leaves out what does not apply. A block with empty text is left out of the document; `tillhor` means it has no heading of its own and is appended to that block's text (ak_forteckning_lan after ak_uttalanden). `kontroller` [{kod, niva fel|varning|info, text, block?}] are the program's checks before Bolagsverket's: fel holds up filing — rb_revisor_saknas, rb_ort_saknas, rb_datum_saknas, rb_uttalanden_saknas, rb_ansvarsfrihet_saknas, rb_datum_fore_styrelsen (dated before the board signed); varning does not — rb_datum_efter_stamman, rb_ansvar_bada / rb_ansvar_inget (styrelsens or likvidatorns ansvar: one, not both and not neither), rb_grund_utan_beskrivning (a modified opinion whose Grund för uttalanden is only the standard text), rb_hakparentes (a [placeholder] left from a suggestion), rb_kontrollera; info: rb_otaggat (inkomstskatterapporten and the anmärkning flags stay untagged until Bolagsverket accepts the 2026-09-09 concepts; the text is still in the document). A fel about the date, ort or revisor is a question for the person — never fill in a date or a place yourself.","description":"Change the audit report (ADR-0072). The year-end is never changed, and it is allowed in a locked year. Everything is optional; only what is sent changes:\n  uppgifter {key: value | null} — a setting changed here (keys as in `uppgifter`, except namn, orgnr, start, slut, form, which come from the company and year). null removes the change so the year-end applies again; an empty mottagare restores the default. revisorer replaces the whole list (one to six, first and last name; titel defaults to Auktoriserad revisor). datum ÅÅÅÅ-MM-DD.\n  block {kod: {text?, rubrik?, plural?}} — text: an own text (turns off `ren`; '' leaves the block out of the document; each line is its own paragraph, blank lines are ignored, and a line starting with \"- \" is a bullet, as in the standard texts), null: back to the standard text. rubrik: an own heading, null: the standard one. plural: the plural heading where the block has one (har_plural).\n  sidbrytning {nyckel, ny_sida: true | false | null} — a page break, as in the annual report: the key is a section's `nyckel` from get_revisionsberattelse_ixbrl's `sidindelning.avsnitt`; true starts a new page there, false removes a default break, null returns to the default. Style only — allowed with `ren`.\n  ren true — back to the standard wording: EVERY own text and heading is removed. Ask first.\n  kvittera [kod] — the revisor has read these own texts against the new settings.\nNever overwrite an own text (egen) without showing the person the old and the new and asking. Use dry_run first: it answers the report as it would be, plus `andringar` {uppgifter [keys], block [kod], ren (the new value, or null when unchanged)} — the same list a real save answers. An audit report answer: `finns` (saved yet), `ren` (standardformulering: the texts follow the settings; any own text turns it off), `uppgifter` (the settings in force — namn, orgnr, start, slut, form, regelverk k2|k3, vd, ledamoter, resultat vinst|forlust, utdelning, kassaflode, koncern (the parent company prepares koncernredovisning: the texts speak of årsredovisningen och koncernredovisningen, FAR RevR 700 exempel 2), ansvar_kort, revisionsbolag, revisorer [{fornamn, efternamn, titel, huvudansvarig}], ort, datum, mottagare, anmarkning_skatter, anmarkning_sen, and the appearance: stil standard or the id of a style profile the audit firm's account has (an e-revisor administrator makes and assigns them; its defaults apply where neither the report nor the account chose), typsnitt opensans|profil, storlek standard (as the annual report)|8|8.5|9|9.5|10|10.5|11|11.5|12 (pt), spalter 1|2 (two columns: the title over both, the text in two columns per page), sidhuvud logo_vanster|logo_hoger (the logo left and the page number right, or the reverse; the header has no company name), logotyp — the audit firm's logo, uploaded by a person under Konto och företag — logotyp_hojd 8|12|16|20 (mm) and logotyp_sidor alla|forsta (every page, or only the first); the base style, margins, page header and page numbers are the annual report's), `kalla` per setting (bokslut: read from the year-end; har: changed here; grund: not in the year-end, entered here; konto: the audit firm's account default; profil: the style profile's default; standard: the program's default), `stilar` [{id, namn}] (the account's style profiles; empty: no stil to choose), `block` [{kod, sektion ar|ak, rubrik, text, egen, plural, har_plural, begrepp, tillhor, forslag [names], kontrollera}] in document order (`ar` = the report on the annual report, `ak` = on other requirements), `kontrollera` [kod] (own texts written before a setting changed — read them against the new settings, then acknowledge with save_revisionsberattelse kvittera), and `paket` {form ab|ef|brf|hb|ideell|stiftelse (hb also for kommanditbolag), version, kalla, namn, koncern (the package has group texts — only aktiebolag), taggad (tagged iXBRL that Bolagsverket takes digitally — only aktiebolag; the others are a plain document the revisor signs as PDF)}. The form follows the company's organisationsform in the year-end; svenska_kyrkan answers unsupported_form. `paket.uppgifter` lists settings only that form has — for stiftelse: revideras arsredovisning|arsbokslut|sammanstallning (what the revisor audited; it renames the report and what the opinion tests against — ask, never guess), forvaltare (true: managed by a förvaltare, from the year-end's persons) and tryggandelagen (a pension or staff foundation, RevR 700 example 12). `paket.vd` and `paket.disposition` false: the form has no VD or no disposition statement, and those settings change nothing. The blocks have the same kod in every form; the package names them (hb and ideell: 'Uttalande' in the singular, no fastställelse, hb's Företagsledningens ansvar) and leaves out what does not apply. A block with empty text is left out of the document; `tillhor` means it has no heading of its own and is appended to that block's text (ak_forteckning_lan after ak_uttalanden). `kontroller` [{kod, niva fel|varning|info, text, block?}] are the program's checks before Bolagsverket's: fel holds up filing — rb_revisor_saknas, rb_ort_saknas, rb_datum_saknas, rb_uttalanden_saknas, rb_ansvarsfrihet_saknas, rb_datum_fore_styrelsen (dated before the board signed); varning does not — rb_datum_efter_stamman, rb_ansvar_bada / rb_ansvar_inget (styrelsens or likvidatorns ansvar: one, not both and not neither), rb_grund_utan_beskrivning (a modified opinion whose Grund för uttalanden is only the standard text), rb_hakparentes (a [placeholder] left from a suggestion), rb_kontrollera; info: rb_otaggat (inkomstskatterapporten and the anmärkning flags stay untagged until Bolagsverket accepts the 2026-09-09 concepts; the text is still in the document). A fel about the date, ort or revisor is a question for the person — never fill in a date or a place yourself.\n\nTHE REPORT IS THE REVISOR'S OPINION, not the company's document. The standard wording is FAR's normal text for a clean report (RevR 700). Whether the opinion is modified, whether there is an anmärkning, whether ansvarsfrihet is recommended, and what goes under Övrig upplysning or Särskilt betydelsefulla områden is the revisor's judgement: write them only from what the revisor tells you, and never choose them because the books seem to point that way — say what you see and ask. Settings that come from the year-end (VD, utdelning, kassaflöde, K2/K3, the revisor) you may read; change them here only when the person says the report should differ. A company in liquidation has no setting: empty styrelsens_ansvar (and ak_styrelsens_ansvar) and write likvidatorns_ansvar instead. Filing the report to Bolagsverket is not a tool — the revisor or the company submits it from the card in the app (revisionsberattelse/forbered and /inlamning), as a digital copy tied to the annual report by the org.nr and the same signer. Its codes, should you meet them: rb_check_failed (the program's own checks found a fel — nothing went to Bolagsverket; read `kontroller`), check_failed (Bolagsverket's check found errors), agreement_required, signer_missing (nobody marked to sign in the year-end settings and no one chosen), invalid_personal_number, missing_email, filing_disabled. Errors: invalid_field (unknown setting or block, or plural where there is none), invalid_enum, invalid_type, invalid_date, required (a revisor without a name), too_long, missing_fiscal_year.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"uppgifter":{"type":"object","additionalProperties":{},"description":"Settings to change, {key: value | null}"},"block":{"type":"object","additionalProperties":{"type":"object","properties":{"text":{"type":["string","null"]},"rubrik":{"type":["string","null"]},"plural":{"type":"boolean"}},"additionalProperties":false},"description":"Own texts, headings and plural per block kod"},"sidbrytning":{"type":"object","properties":{"nyckel":{"type":"string","description":"The section's key, from sidindelning.avsnitt"},"ny_sida":{"type":["boolean","null"],"description":"true: new page here; false: remove a default break; null: back to the default"}},"required":["nyckel","ny_sida"],"additionalProperties":false,"description":"A page break, as in the annual report's preview"},"ren":{"type":"boolean","description":"true: back to the standard wording, own texts removed"},"kvittera":{"type":"array","items":{"type":"string"},"description":"Own texts checked against the new settings"},"dry_run":{"type":"boolean","description":"Show the result without saving"}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_skatteavstamning","group":"skatt","klass":"skriva","summary":"Save the whole skatteavstämning form (ADR-0036) — the same shape as data in get_skatteavstamning: { ar: {inkomstskatt, loneskatt, fastighet, ovrigt: [{text, belopp}], fskatt: [{perioder, belopp}]}, fg: {…same}, efter: [{perioder, belopp}], konton: \"2510-2519,1640-1649\", skattekonto: {med, konto, saldo} }. Amounts in öre (integers) or as text (\"-7 739\"); debt negative; inkomstskatt/loneskatt null = the suggestion. The whole form is replaced: read it first and send it back with your changes. Answers the form as get_skatteavstamning does.","description":"Save the whole skatteavstämning form (ADR-0036) — the same shape as data in get_skatteavstamning: { ar: {inkomstskatt, loneskatt, fastighet, ovrigt: [{text, belopp}], fskatt: [{perioder, belopp}]}, fg: {…same}, efter: [{perioder, belopp}], konton: \"2510-2519,1640-1649\", skattekonto: {med, konto, saldo} }. Amounts in öre (integers) or as text (\"-7 739\"); debt negative; inkomstskatt/loneskatt null = the suggestion. The whole form is replaced: read it first and send it back with your changes. Answers the form as get_skatteavstamning does.\n\nErrors: required (data missing), invalid_amount, too_long (text over 255), out_of_range (perioder 0–24), invalid_account, invalid_enum, year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"data":{"type":"object","additionalProperties":{},"description":"The whole form: { ar, fg, efter, konton, skattekonto }"}},"required":["client_id","fiscal_year_id","data"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"save_skatteberakning","group":"skatt","klass":"skriva","summary":"Save values in the year's tax calculation and recompute it.","description":"Save values in the year's tax calculation and recompute it.\n\nTHIS BOOKS. Without dry_run it writes the values AND writes or updates the locked system adjustment with the tax and the year's result — the bookings the company has to enter in its own books. Run it with dry_run first, show the person the tax it gives, and save only when they agree. Never save to see what happens.\n\n`varden` maps registry keys to values: an amount in whole kronor, 'true'/'false' for boolesk fields, text for text fields, or null to remove a saved value so the forslag or last year's figure applies again. `rader` replaces a field's specification rows ({text, belopp}); only fields with specifikation true take them, and their value is the rows' sum. Use get_skatteberakning for the keys — never guess one from a blankett point. A choice from val{} goes in `varden` too, as one of its alternativ (loneskatt_bokforing: 'aldrig'), or null for its standard. periodiseringsfond_avsattning takes whole kronor or 'max' (follows the 25 % cap as the result changes); an amount over the cap is refused with out_of_range, its message giving the cap — offer 'max' or that amount.\n\n`fonder` edits the periodiseringsfond register: [{konto 2110–2139, arsgang?, ingaende?, aterforing?}]. A value overrides the suggestion; all three null removes what was typed. A fund in its sixth year is reversed in full whatever aterforing says.\n\n`delagare` (INK4, handelsbolag) replaces the partner list: up to four, in order — partner 1 has capital accounts 201x, partner 2 202x. Each {namn, pnr, utlandsk?, andel, tillskott?, uttag?, avdrag_arbetsgivaravgift?}: pnr a personnummer (12 digits) or organisationsnummer (10), checked by its control digit unless utlandsk; andel a percent 0–100 that splits both the taxable result and the year's result; tillskott/uttag whole kronor, or null for the suggestion from their capital accounts. [] removes the partners. Personnummer are personal data — ask the person for them, never invent or guess one. A partner's personnummer reaches you masked, xxxxxx-1234 (an organisationsnummer does not); the masked value back in the same place in the list keeps the stored number.\n\n`infoga_forslag` turns a field's forslag into its specification rows, one per account (\"6072 Representation, ej avdragsgill\", 2663), so the person can see and edit what the figure is made of. Only for fields with specifikation true and a forslag. It replaces the rows already there — show the person first, and run it with dry_run.\n\n`bilagor` fills the return's appendices (ADR-0016 point 18, ADR-0062, ADR-0063, ADR-0064): N3B, N4, N7, N8 and N9.\nN7, övertagande av fonder (SKV 2170) — on INK2 and INK3 (not INK4) the year the company took over periodiseringsfonder (conversion of a sole trader or partnership into a company, merger, transfer of business) or a sole trader's expansionsfond ended because everything was transferred. One exemplar per transferor, no choice needed: bilagor.n7 = {exemplar: {<the transferor's personnummer (12 digits) or organisationsnummer (10)>: {varden}}, ta_bort: [nummer]}. Keys: overlatare_namn (text, on the PDF only), datum_overlatelse (YYYY-MM-DD), arv_gava ('true'/'false', on the PDF only), fond_6 … fond_1 (the provision made the sixth … the first year before the company's tax year), fond_arets (made during the tax year), expansionsfond. Manual: no calculation and nothing carried to the main form — the funds themselves are linked to their year in the fund register as before. Filed only that year; last year's transferors are not suggested. Its own file per transferor (n7-1.xbrl …) and SKV 2170 page.\nN4, uppskov vid andelsbyten (SKV 2154) — on INK2 and INK3 (not INK4: a partnership's share exchange is declared by its partners). Set n4_upprattas to 'ja' (default 'nej'; it turns on by itself when last year's N4 left deferrals). bilagor.n4 = {tabeller: {<tabell>: [rows] | null}}, each table replaced whole; an empty row is dropped; null removes the table. Tables and columns: avyttrade (A.1: antal, beteckning, vinst incl. cash, ersattning in cash), begart (A.2: antal, beteckning of the RECEIVED shares, orgnr, vinst, per_andel), senare_byte (A.3, a later exchange of received shares: antal, beteckning, orgnr, vinst — negative for a loss, tidigare, begart), aterforing (A.4: antal, beteckning, aterfors, aterstaende), koncernintern (B.1, reversal of a deferral from an intra-group disposal: same columns) and ingaende (the remaining deferrals at the start of the year: beteckning, antal, kvarvarande — carried from last year's C when last year is in the program; writing it overrides, null goes back). kvarvarande (C) is computed: ingaende − reversed + A.2. Columns with suggestions — leave them null to take the suggestion (n_bilagor.n4.tabeller.<t>.rader[].forslag): A.2 vinst = the same row number in A.1, vinst − ersattning; per_andel = vinst / antal, two decimals as text ('35.56'); A.3 tidigare = ingaende for that beteckning, begart = tidigare + vinst; aterstaende = ingaende − reversed. Beteckning matches across tables ignoring case and spaces. Contributions, as locked rows: INK2 — A.2 to 4.7c, A.3 tidigare + A.4 + B.1 to 4.7d; INK3 — the same to 2.7/2.8 on the kapital path, nothing on the näringsverksamhet path (n4_ink3_manuellt). A.3's begart is NOT carried: at a later exchange the new deferral (tidigare + vinst) is requested again in A.2 (SKV 294). The amounts, shares and which exchange qualifies (IL 48 a kap.) come from the person — ask, never guess. N4 is filed only when A or B has rows: its own file (n4.xbrl) and one SKV 2154 page per row, numbered.\nN8, skogsavdrag och substansminskningsavdrag (SKV 2155) — on INK2, INK3 (näringsverksamhet path) and INK4. Set n8_upprattas to 'ja' (default 'nej'; on by itself when last year's N8 has properties). bilagor.n8 = {tabeller: {<tabell>: [rows] | null}}, same rules as N4. The register fastigheter (beteckning, andel — percent '50.50', anskaffning, skog_utrymme — suggested 25 % of anskaffning, skog_gjorda, skog_ej_redovisad, subst_utrymme, subst_gjorda, subst_ej_redovisad) is carried from last year's fastigheter_ut; write it only the first year. Tables: skog_begart (A.1 per property: beteckning, intakt = avdragsgrundande skogsintäkt — upplåten avverkningsrätt + 60 % of sold or withdrawn forest products, begart — suggested 50 % of intakt in whole hundreds, at most the room left), skog_aterfort (A.2: beteckning, andel, belopp — suggested the deductions made on it), skog_utrymme (A.3: beteckning, andel, andring — negative when the room shrinks; a new property enters the register here), subst_begart, subst_aterfort, subst_utrymme (B, the same for substansminskning). skog_sparat/subst_sparat (room changes from years without N8) and fastigheter_ut are computed. Contributions as locked rows: A.1 + B.1 to INK2 4.11 / INK4 4.4a / INK3 7.7; A.2 + B.2 to 4.12 / 4.6a / 7.8. Filed only when something is requested or reversed; own file (n8.xbrl) and SKV 2155 pages. Forest income, room and acquisition values come from the person and SKV 2194 — ask, never guess. FOREST PROPERTY ABROAD (within the EEA; years on edition 2026-08-31, form edition 12): a property in the register with an `adress` lies abroad — set it in fastigheter or in A.3 (skog_utrymme.adress) when bought this year. utland_avdrag (B.1, the year a deduction is made) and utland_ar (B.2, every year a deduction was made earlier — N8 is then filed even without new deductions) are computed; utland_ny_agare (B.3: namn, adress, nummer) is written when such a property passed by gift or inheritance. In that edition substansminskning is section C (C.1–C.3).\nN3B, andel i handelsbolag (SKV 2167) — one per partnership the company owns a share in, on INK2, INK3 and INK4, no choice needed: bilagor.n3b = {exemplar: {<the partnership's organisationsnummer>: {varden}}, ta_bort: [organisationsnummer]}. A new number adds a partnership; ta_bort removes one (an unsaved one is simply dropped). Ten digits, or anything for a foreign company with varden.utlandskt 'true'. Keys (n_bilagor.n3b.exemplar[].falt): hb_namn (text, on the PDF only), utlandskt, hb_forsta/hb_sista (dates YYYY-MM-DD, suggested as the company's own year), andel (p. 1/2, the share of the partnership's taxable result — NEGATIVE for a loss; ask the person, it comes from the partnership's INK4, never guess it), kapitalvinst_fastighet 3a, kapitalforlust_fastighet 3b, kapitalvinst_vardepapper 4a, kapitalforlust_vardepapper 4b, intaktsposter 5a, kostnadsposter 5b, uppskov_n4 6, aterfort_uppskov_n4 7, underskott_foregaende 8 (carried from last year's 9 for the same partnership), underskott_sparas 9, and — only on INK4, a partnership owning a partnership — anskaffning_ib 11 (carried from last year's 16/17, may be negative), tillskott 13, uttag 14; begransat_ansvar 18 (carried). resultat (10) and anskaffning_ub (16/17) are computed. The result goes as locked rows to 4.8b/4.8d (INK2, INK4) or INK3K 2.1, summed over the partnerships; on INK3's näringsverksamhet path there is no field — notis and finding n3b_ink3_manuellt. 4.8a/4.8c are now suggested from 8030, 8130–8133 and 8240 (the booked share), so the booked share comes out and N3B's taxable result goes in. n_bilagor.n3b.forra_aret lists last year's partnerships not yet added. Each partnership is its own file (n3b-1.xbrl …) in get_skatteberakning_xbrl bilagor[], and its own page (SKV 2167, for the main form's period) in the PDF.\nN9, begränsning av ränteavdrag — on INK2, INK4 and INK3 (only deklarationsvag naringsverksamhet). N9 applies to all legal persons and Swedish handelsbolag, except handelsbolag owned only by natural persons all year. Set the choice n9_upprattas to 'ja' in varden first — its default is 'nej', and finding n9_kan_behovas (warning) says when the accounts' negative räntenetto is over 5 000 000. bilagor.n9 = {varden, rader, infoga_forslag} with N9's own keys (see n_bilagor.n9.falt from get_skatteberakning): varden amounts in whole kronor or null, plus regel 'forenklingsregeln' | 'ebitda'; rader for the specification fields and the two repeated groups — overtaget [{orgnr, belopp}] (C.2) and intressegemenskap [{grupp, orgnr, belopp}] (section F, grupp is the community's number). The sums and rules (A.10, B.5/B.6, D.10, D.11 = 30 %, E.2 cap, E.4/E.5) are computed. N9 field sources (kalla): manuell, forslag (from accounts), regel (computed, read-only), regel_forslag (computed suggestion in forslag, with forslag_etikett, that can be overwritten; null removes the override) — E.2 the largest deduction, D.1 the main calculation's result after adjustments and underskott but before N9 and the avsättning (with C.5 − C.2), D.2 the underskott deduction up to a negative D.1, D.8 the fund återföring with 4.6d, E.3 the largest deduction of kvarstående räntenetton (EBITDA only, oldest first) — and foregaende_ar: G's five kvarstående rows carried from last year's N9 (its G.4 and rows, less this year's E.3, one row down; foregaende holds the carried figure; what is left of the oldest lapses, finding n9_kvarstaende_forfaller). They are saved in the year's N9 when the year is booked, so next year can read them. Under forenklingsregeln the EBITDA-only fields (section D, E.3, G.2/G.4) are empty (varde null) and stay out of the file and PDF, even when forslag has a figure. Contributions to the main form, as locked rows (falt.<key>.bidrag) on top of what the person typed: INK2 — E.4, C.5, E.6 to 4.3c and C.2, E.5 to 4.4b; INK4 — E.4 to 4.3b, E.5 to 4.4b; INK3 — none: the person enters the reversal in 6.15's taxable column and the deduction in 7.4, and finding n9_ink3_manuellt (warning) says how much goes where. N9 becomes its own file in get_skatteberakning_xbrl bilagor[] and its own pages in the PDF, on SKV 2158 for the same period as the main form.\n\nALL OR NOTHING: every value is checked first, and one error saves nothing. All errors come back at once in data.errors, each with the key in `field`.\n\nTHE ANSWER is the tax calculation (ADR-0016). By default (urval 'ifyllda') `falt` holds only the fields that have a value or are overridden, each {punkt, sru, etikett, datatyp, varde, kalla, skrivbar, overskriven, rader?}; `falt_utelamnade` counts the rest and `grupper` is left out. Ask for urval 'alla' when you need an empty field's help text, lagrum or whether it is shown — the whole form is 60 000–85 000 characters. The parts:\n  steg[] — the form's flow in order: {kod, rubrik, falt: [keys], dolda}. dolda counts advanced fields with no value that the form hides. Two steps are appendices whose content is in n_bilagor, not falt: n3b (before the tax adjustments, since its result feeds 4.8b/4.8d), n4 and n8 (before the tax adjustments; they feed 4.7c/4.7d and 4.11/4.12) and n9 (after the tax losses).\n  falt{} — keyed by the registry's own names (ej_avdragsgilla_kostnader), NOT by the blankett point. Each has punkt (\"4.3c\", or {+: \"4.15\", -: \"4.16\"} when the sign picks the box), etikett, hjalp, lagrum, datatyp (belopp | boolesk | text | flerval — a comma-separated list of keys from alternativ{}, e.g. INK3's ändamål | procent — '19,65' | antal — whole number, e.g. square metres), vikt (+1 adds to the taxable result, -1 subtracts), kalla, skrivbar, varde, overskriven, and forslag / foregaende / rader where they apply. forslag_konton lists the accounts behind a forslag [{konto, namn, text, belopp}] — each account's share in whole kronor, in the field's direction, only accounts with a balance; rounding per account can differ one krona from forslag. upplysning (with upplysning_konton) is the dividend booked on 8010/8012/8110–8113, shown at the MANUAL field 4.5b only as information — it is not in varde, and only the person decides whether it goes in (finding utdelning_skattefri_kontrollera).\n  kalla — where the value comes from: matris (the balances), forslag (summed from accounts, can be overridden), modul:inkomstskatt (computed, read-only), foregaende_ar (last year's loss carried forward, can be overridden — it rolls on over any number of years, since each year's carried value is saved when the year is computed for real, also with booking turned off), r_kolumn (INK3: the amount on the same row of the räkenskapsschema as booked, in `redovisning` — the taxable column's suggestion, overridden to take out what is tax-free), harledd (follows from another field), manuell. Only fields with skrivbar true can be saved.\n  berakning — underlag (4.15 with the calculated tax at zero), grundavdrag (INK3: 15 000 for an allmännyttig ideell förening, IL 63 kap. 11 §, otherwise 0; it lowers the booked tax, it is not on the form), avrundat (down to whole tens), skattesats, skatt (whole kronor, down), skattemassigt_resultat and its punkt.\n  val{} — choices that steer the calculation but are not on the blankett and never reach XBRL or the PDF: {etikett, hjalp, notis, alternativ, standard, varde}. steg[].val lists a step's choices; which exist depends on the form and the other choices. notis is a short warning always shown under the choice — relay it (N9 on INK4: not needed when only natural persons owned the partnership all year; on INK3: nothing is carried over, see bilagor). Examples: loneskatt_bokforing — auto (book the calculated löneskatt if none is booked; book nothing if what is booked is within the tolerance of it), alltid (always book it), aldrig (compute, never book); skatt_bokforing, aretsresultat_bokforing and periodiseringsfond_bokforing — the same three choices: auto books nothing when the same amount (within a krona) already stands booked, and the full calculated amount with a finding when something else does — never a difference; periodiseringsfond_avsattning; n9_upprattas (nej/ja); INK3's skattskyldighet and deklarationsvag; a brf's brf_beskattning.\n  berakning.loneskatt — särskild löneskatt on 1.4 minus 1.5: underlag, sats, loneskatt (whole kronor), bokford_ore (already on 7530/7532/7533), bokfors_ore / bokfors (what is booked now), tolerans, vid_avvikelse, and beslut: ingen | hela | mellanskillnad | redan_bokford | valt_bort. It is booked BEFORE the income tax, so 4.1 is the result after it.\n  berakning.overavskrivning — the Överavskrivningar tab, machinery and equipment: ingaende, anskaffningar (suggested from the year's debit, forslag.inkop), avyttringar, rader[] (per year: slut, belopp, andel, varde), lagsta_huvudregel, lagsta_komplettering, regel, lagsta, utrymme (negative means too much is written off), bokfort_av_bolaget, forandring, bokforing, beslut, ack_efter, ifylld. It books 8850/2150 only when forandring is saved. berakning.periodiseringsfond — fonder[] (the register: konto, arsgang = the year the fiscal year of the avsättning ENDED, as in BAS account names; ingaende, aterforing, kvar, tvingande = sixth year so reversed in full, sista_ar, kalla foregaende_ar | saldo | manuell, skrivet = what is saved), kalla, ib, slr_datum, berakning (schablon 4.6a, upprakning 4.6d, slr_anvand, andel, manader) and avsattning (underlag_fore, max, avsattning, konto). Återföring is booked årgång account / 8819, avsättning 8811 / 212x. Order: the återföring, then N9 (when upprättad), then the avsättning — its cap is 25 % of the result after N9's contributions to 4.3c/4.4b.\n  systemrader — what the calculation books: 7533/2514 the löneskatt, 21xx/8819 and 8811/21xx the funds, 8910/2510 the tax, 8999/2099 the result (2069 for ideella föreningar and stiftelser; for a handelsbolag 2019/2029/2039/2049, split between the partners by share). systemjustering names the locked adjustment they sit on (A-number) once written.\n  fynd — findings, e.g. skatt_redan_bokford (see get_bokslut_kontroller).\n  THE FORM FOLLOWS THE COMPANY (ADR-0016 point 15): aktiebolag and ekonomiska föreningar declare on INK2, ideella föreningar and stiftelser on INK3, handelsbolag and kommanditbolag on INK4. blankett says which. INK3's root is 7.9/7.10; 7.1/7.2 is the sum of the r_* fields — the räkenskapsschema's taxable column, 6.2–6.18 — and 6.1 medlemsavgifter and 6.19 tax have no taxable column, so they never reach 7.1. Its suf_* (föreningar, 4.x) and sus_* (stiftelser, 3.x) fields exist only when val.skattskyldighet is inskrankt (allmännyttig). skattskyldighet has NO default: until someone chooses, the year is computed with general rules and ink_val_saknas stops the filing — ask the person, never pick it. val.deklarationsvag kapital switches INK3 to INK3K: only capital and handelsbolag income, root 2.16/2.17 (overskott_kapital), no räkenskapsschema and no INK3S; shared fields such as underskott_foregaende_ar keep their key and move to their INK3K point (2.9). Fields whose condition does not hold are absent from falt{}. INK4 has NO income tax — the partners are taxed — so berakning.skatt, avrundat and skattesats are null, berakning.moduler lists what runs, and the root is 4.12/4.13, the result split between the partners.\n  berakning.delagare — INK4 only, null elsewhere: rader[] {sort_order 1–4, pnr, namn, utlandsk, andel (percent), resultat (this partner's share of 4.12/4.13 in whole kronor), konto_resultat (2019, 2029 …), tillskott/uttag (saved or null), tillskott_forslag/uttag_forslag (from the partner's capital accounts: uttag 2011–2013, tillskott 2017–2018 in their series), tillskott_varde/uttag_varde (what goes in the file)} and summa_andel.\n  skriven / ej_skriven — whether the system adjustment was written, and if not why: dry_run, ovrigt_noskatt (the setting that turns bookings off) or ar_last (closed year).\n\nAMOUNTS ARE WHOLE KRONOR, and entered POSITIVE — vikt gives the direction. Only fields with tvasidig true take a negative amount.\n\nErrors: missing_fiscal_year; missing_input (nothing to save — no varden, rader or fonder — and bokfor not set); unknown_field (no such key on this year's blankett); read_only (computed by the program — 4.3a, 4.1, 1.1/1.2, 4.15/4.16; do not try another way to set it); not_specifiable (rows on a field that takes none, also for infoga_forslag); no_suggestion (infoga_forslag on a field with no forslag accounts); invalid_int, out_of_range (a negative amount on a one-sided field), invalid_enum (also a choice outside its alternativ), invalid_account (a fund on an account outside 2110–2139), invalid_identity (a partner's number fails its control digit), not_applicable (delagare on a form that has no partners — only INK4; bilagor the form does not have), invalid_orgnr (a repeated N9 row, an N4 row, or an N3B partnership, whose organisationsnummer is not ten digits; an N7 transferor that is neither 12 nor 10 digits), required (an N4/N8 row without beteckning), invalid_decimal (N4 per_andel not kronor with two decimals, or an N8 andel not a percent up to 100 with two decimals), invalid_type (an N4/N8 table that is not a list), invalid_date (an N3B date that is not YYYY-MM-DD), duplicate (the same partnership twice), missing_group (an intressegemenskap row without its number), too_long — fix the value; form_unsupported; edition_unknown; internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"varden":{"type":"object","additionalProperties":{"type":["number","string","null"]},"description":"Registry key → whole kronor, 'true'/'false', text, or null to remove."},"rader":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"belopp":{"type":"integer"}},"required":["text","belopp"],"additionalProperties":false}},"description":"Registry key → specification rows. Replaces the field's rows; [] removes them."},"dry_run":{"type":"boolean","description":"Compute and answer as if saved, but save and book nothing. Use it first."},"overavskrivning":{"type":"object","properties":{"ingaende":{"anyOf":[{"type":"integer"},{"type":"null"}]},"anskaffningar":{"anyOf":[{"type":"integer"},{"type":"null"}]},"avyttringar":{"anyOf":[{"type":"integer"},{"type":"null"}]},"bokfort":{"anyOf":[{"type":"integer"},{"type":"null"}]},"ack_ingaende":{"anyOf":[{"type":"integer"},{"type":"null"}]},"forandring":{"anyOf":[{"type":"integer"},{"type":"null"}]},"bokforing":{"type":"string","enum":["auto","alltid","aldrig"]},"tidigare":{"type":"object","additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]}}},"additionalProperties":false,"description":"The Överavskrivningar tab, machinery and equipment (read berakning.overavskrivning in get_skatteberakning: utrymme is the room left, rader the years). Only keys sent change; null restores the suggestion: anskaffningar is suggested from the year's debit on the accounts (forslag.inkop; check it all remains), and avyttringar is never suggested — it is the sale price, and forslag.minskning is only the cost that left the accounts. tidigare: remaining acquisition cost per year, keyed by that year's end date. forandring: + increase, − reversal, null for no booking. The year's amount is a tax choice the person makes: suggest, and save it only when they ask."},"fonder":{"type":"array","items":{"type":"object","properties":{"konto":{"type":"string"},"arsgang":{"anyOf":[{"type":"integer"},{"type":"null"}]},"ingaende":{"anyOf":[{"type":"integer"},{"type":"null"}]},"aterforing":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["konto"],"additionalProperties":false},"description":"Periodiseringsfond register rows to write. All three null removes the override."},"delagare":{"type":"array","items":{"type":"object","properties":{"namn":{"type":"string"},"pnr":{"type":"string"},"utlandsk":{"type":"boolean"},"andel":{"type":["string","number"]},"tillskott":{"anyOf":[{"type":"integer"},{"type":"null"}]},"uttag":{"anyOf":[{"type":"integer"},{"type":"null"}]},"avdrag_arbetsgivaravgift":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["namn","pnr","andel"],"additionalProperties":false},"description":"INK4: the handelsbolag's partners, replacing the list. [] removes them."},"infoga_forslag":{"type":"array","items":{"type":"string"},"description":"Registry keys whose forslag becomes their specification rows, one per account with a balance (the rows in the field's forslag_konton). Replaces the field's rows; rader for the same key wins."},"bokfor":{"type":"boolean","description":"With no varden and no rader: compute and book what already stands. For a year where nothing needs filling in. Same warning as above — it books."},"bilagor":{"type":"object","properties":{"n3b":{"type":"object","properties":{"exemplar":{"type":"object","additionalProperties":{"type":"object","properties":{"varden":{"type":"object","additionalProperties":{"type":["number","string","boolean","null"]}}},"additionalProperties":false}},"ta_bort":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"n4":{"type":"object","properties":{"tabeller":{"type":"object","additionalProperties":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":["number","string","null"]}}},{"type":"null"}]}}},"required":["tabeller"],"additionalProperties":false},"n7":{"type":"object","properties":{"exemplar":{"type":"object","additionalProperties":{"type":"object","properties":{"varden":{"type":"object","additionalProperties":{"type":["number","string","boolean","null"]}}},"additionalProperties":false}},"ta_bort":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"n8":{"type":"object","properties":{"tabeller":{"type":"object","additionalProperties":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":["number","string","null"]}}},{"type":"null"}]}}},"required":["tabeller"],"additionalProperties":false},"n9":{"type":"object","properties":{"varden":{"type":"object","additionalProperties":{"type":["number","string","null"]}},"rader":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"orgnr":{"type":"string"},"grupp":{"type":"string"},"belopp":{"type":"integer"}},"required":["belopp"],"additionalProperties":false}}},"infoga_forslag":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"additionalProperties":false,"description":"Appendices: n3b (N3B andel i handelsbolag, one exemplar per partnership), n7 (N7 övertagna fonder, one exemplar per transferor), n4 (N4 uppskov vid andelsbyten, needs n4_upprattas 'ja'), n8 (N8 skogs- och substansminskningsavdrag, needs n8_upprattas 'ja') and n9 (N9 begränsning av ränteavdrag, needs n9_upprattas 'ja')."},"urval":{"type":"string","enum":["ifyllda","alla"],"description":"The answer: ifyllda (default) only fields with a value; alla the whole form."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"search_kunskap","group":"kunskap","klass":"lasa","summary":"Search e-revisor's knowledge base: articles written and reviewed by e-revisor on how the program works and on the rules behind it (periodiseringsfond, N-bilagor, K2/K3, the integrations). Read it before answering a how-do-I or why question, and cite the article (`titel`, and for a public one https://app.e-revisor.se/hjalp/<slug>). Only published articles the person may see come back: public and customer articles, and internal ones only for support and appadmin. Without `q`: the latest, or a category's. `ar_start` (YYYY-MM-DD, the fiscal year's first day) leaves out articles whose `giltig_fran`/`giltig_tom` do not cover that year — pass it when the question is about a specific year. Each hit has slug, titel, sammanfattning, kategori; `antal` counts the hits per category. get_kunskap gives the whole text. The knowledge base is read-only here: articles are written and published by people on the admin page. An article describes the rule in short — the company's own figures and the warnings in get_bokslut_kontroller come first. Errors: invalid_date, invalid_enum, not_authenticated.","description":"Search e-revisor's knowledge base: articles written and reviewed by e-revisor on how the program works and on the rules behind it (periodiseringsfond, N-bilagor, K2/K3, the integrations). Read it before answering a how-do-I or why question, and cite the article (`titel`, and for a public one https://app.e-revisor.se/hjalp/<slug>). Only published articles the person may see come back: public and customer articles, and internal ones only for support and appadmin. Without `q`: the latest, or a category's. `ar_start` (YYYY-MM-DD, the fiscal year's first day) leaves out articles whose `giltig_fran`/`giltig_tom` do not cover that year — pass it when the question is about a specific year. Each hit has slug, titel, sammanfattning, kategori; `antal` counts the hits per category. get_kunskap gives the whole text. The knowledge base is read-only here: articles are written and published by people on the admin page. An article describes the rule in short — the company's own figures and the warnings in get_bokslut_kontroller come first. Errors: invalid_date, invalid_enum, not_authenticated.\n\nNEWS (ADR-0066): `typ: \"nyhet\"` searches e-revisor's news instead — about the program and from Skatteverket, Bolagsverket and accounting (kategori programmet, skatteverket, bolagsverket, redovisning, ovrigt), newest first with pinned ones on top; each hit has `publicerad`, and a public one is at https://app.e-revisor.se/nyheter/<slug>. Use it for what is new or changed; news ages, so check the date.","dryRun":false,"inputSchema":{"type":"object","properties":{"q":{"type":"string","description":"Search words, Swedish — e.g. 'periodiseringsfond återföring'"},"typ":{"type":"string","enum":["artikel","nyhet"],"description":"artikel (default): the knowledge base; nyhet: the news"},"kategori":{"type":"string","enum":["komma-igang","bokslut","skatt-och-deklaration","arsredovisning","integrationer","konto-och-licens","ai-och-mcp","ovrigt","programmet","skatteverket","bolagsverket","redovisning"],"description":"A category of the chosen typ"},"ar_start":{"type":"string","description":"YYYY-MM-DD: the fiscal year's start, to filter by validity"},"max":{"type":"integer","minimum":1,"maximum":50,"description":"Default 20"}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_arsredovisning_ek_rader","group":"arsredovisning","klass":"skriva","summary":"The rows of the equity change table (Förändringar i eget kapital). The table shows årets resultat, every row with an amount and the proposal for last year's disposition; any other taxonomy row, or a custom row, is ADDED here — the way the user does with \"+ Lägg till rad\". The choice carries to next year like the note selection.","description":"The rows of the equity change table (Förändringar i eget kapital). The table shows årets resultat, every row with an amount and the proposal for last year's disposition; any other taxonomy row, or a custom row, is ADDED here — the way the user does with \"+ Lägg till rad\". The choice carries to next year like the note selection.\n\nCalled with no action it reads: `valda` (added rows) and `tillgangliga` (every taxonomy row, with its key and whether it adjusts the opening balance). Actions, one per call:\n- `lagg_till`: a taxonomy row key, e.g. \"Nyemission\" or \"EffektRattelseFel\". Its amounts are then written with save_arsredovisning_varde on the movement concepts.\n- `egen`: a heading — adds a CUSTOM row and returns its key (ek_egen_<8 hex>). Write its amounts with save_arsredovisning_varde on `<key>:<balance-sheet item>@period0`, e.g. ek_egen_ab12cd34:BalanseratResultat, as the signed EFFECT on the column. In the file each cell is an undefined concept (se-misc-base tuple) named 'heading, column'. Prefer a taxonomy row when one fits.\n- `dopa`: { nyckel, etikett } renames a custom row.\n- `flytta`: { nyckel, efter } places a custom row after another movement — a catalogue row, the church's fixed row or another custom row — or first among the movements with efter \"^\". Only that row moves (the rows after it keep their place); never among the adjustments of the opening balance or after the year's result (unknown_sibling). Without a place a custom row stands last among the movements. Both years' choices of the row move together.\n- `ta_bort`: a key — removes the row AND its amounts in that year (a row with amounts would otherwise reappear). The other year's amounts stay.\n\nWith the comparison year shown (arsred_ekpy) each year has its own choice: pass `ar: 1` with lagg_till or egen to add the row to the comparison year. Its key gets the suffix #fjol (e.g. Nyemission#fjol), and ta_bort with that key removes it from the comparison year only. A custom row keeps its id without the suffix for its amounts (`<id>:<item>@period1`). Only this year's choices carry to next year.\n\nA custom balance-sheet row under eget kapital (added in the matrix, K3) is its own COLUMN, with opening and closing balances from the balance sheet; its movements go on custom rows, column key `egen:<id>`.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, no_package, no_equity_table (a partnership has none), unknown_row, label_empty, label_too_long, no_koncern, unknown_entity, internal_error.\n\nKONCERN (ADR-0022): with enhet=kon the rows are those of the group's table, \"Förändringar i koncernens eget kapital\": columns from K3K — aktiekapital, övrigt tillskjutet kapital, annat eget kapital, the parent's owners' share and innehav utan bestämmande inflytande. Its amounts are written with arsredovisning/varde on _kon contexts. Årets resultat is filled in from the group's income statement split.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"lagg_till":{"type":"string","description":"Add this taxonomy row, by key."},"egen":{"type":"string","description":"Add a custom row with this heading."},"flytta":{"type":"object","properties":{"nyckel":{"type":"string"},"efter":{"type":"string"}},"required":["nyckel","efter"],"additionalProperties":false,"description":"Place a custom row after another movement (or first with \"^\")"},"dopa":{"type":"object","properties":{"nyckel":{"type":"string"},"etikett":{"type":"string"}},"required":["nyckel","etikett"],"additionalProperties":false,"description":"Rename a custom row."},"ta_bort":{"type":"string","description":"Remove this row, with its amounts in that year (#fjol = the comparison year)."},"ar":{"type":"integer","minimum":0,"maximum":1,"description":"For lagg_till and egen: 0 this year (default), 1 the comparison year."},"enhet":{"type":"string","enum":["jur","kon"],"description":"jur = the company's table (default), kon = the group's (requires arsred_koncernredovisning)."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_arsredovisning_noter","group":"arsredovisning","klass":"skriva","summary":"Which notes the annual report has, and in what order.","description":"Which notes the annual report has, and in what order.\n\nK2 offers 51 notes and K3 127; a company has perhaps eight. Without a choice the form is 657 rows long and the rendered document is unusable, so this is a real decision and not a formality.\n\nCalled WITHOUT `noter` it reads: `tillgangliga` lists every note the package offers with its `avdelning` (Redovisningsprinciper, Upplysningar till balansräkningen and so on) and `nummer` when it is chosen. With form 'full' each also carries `vagledning` — what the rules require of the note, or null. Use it to explain a note, never as text for the report. A custom text note (created with save_bokslut_egen_rad, datatyp text) is listed among them with `egen: true`. Read this before writing — the list comes from the package and changes with the taxonomy release, so a code you remember from another client may not exist here.\n\nCalled WITH `noter` it replaces the WHOLE set: a gate is a set, not a row of switches. Send every note the report should have, in the order they should appear. Sending one note removes the rest, so read first and send the full list back with your change in it.\n\nTHE ORDER IS THE LIST'S. Note numbers are computed 1..N from it and are not stored — a stored number would leave a gap when a note is removed, or give two notes the same number, and both only show up in the finished document.\n\nTHE NUMBERING IS OURS, and a reorder simply renumbers everywhere. The references from the statements (\"Not 3\" beside a line) are tagged in the file with se-misc-base:ReferensInstansDokumentTuple, and the tag carries the number — it is rewritten on every render, so it always matches. Which lines refer to which notes is set with set_arsredovisning_nothanvisning.\n\nA note is a row in the tree, not a concept whose name starts with Not — that guess misses the seven accounting-principle notes in K2 and the 28 in K3, and would include fields that live INSIDE a note. Only what `tillgangliga` lists can be chosen.\n\nThe choice is a DECISION and carries to next year, unlike the values in save_arsredovisning_varde, which shift to the comparison column. A company that had a note about pledged assets last year almost certainly has one this year.\n\n`forslag: true` PROPOSES a set and writes nothing. Two rules: the accounting-principles note always, then every line in the income statement or balance sheet that carries a figure in EITHER column brings its own note along. The link is read from the package — Goodwill lives in the balance sheet and is shown in its movement note — never guessed from a name. Each entry carries `skal` (alltid / post_med_belopp) and `ankare`, the line that pulled the note in, so the person can ask why. Show them the list and let them choose; applying it is an ordinary write with `noter`.\n\n`forslag_utan_not` names lines that sit in a note in the package but whose note could not be resolved — 0 in K2, 11 equity lines in K3. Reported, not silenced.\n\nK3 only: each note carries `storre` — the rule (ÅRL/K3 paragraph) when only larger companies must give it, else null — and the response carries `storre_bolag`, the year's setting (null outside K3). For a smaller company the suggestion leaves those notes out; they can still be chosen.\n\n`standardtext` returns boilerplate for the written parts: `inga` (default), `specifika` (only the suggested notes) or `alla`. The texts come from a register per package family (ab-k2, ab-k3, ekfor-k2 …) — Bolagsverket's wording for the accounting principles and the old e-revisor texts, sorted by regelverk; a field without a written text has none. The first suggestion per field is used. The result is keyed by FIELD NAME and goes straight to save_arsredovisning_varde as `falt`. It is a PROPOSAL stored like anything the person typed, so they can edit it afterwards — nothing here asserts anything about this particular company.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, no_package, no_notes (the year's package predates the notes section and must be rebuilt), unknown_note, duplicate_note (the same note twice is not an order, it is a contradiction), invalid_value, internal_error.\n\nKONCERN (ADR-0022): with koncernredovisning on, the group's four own notes can be chosen too — RedovisningsprinciperKoncernredovisning, RedovisningsprinciperAndelarIntresseforetagGemensamtStyrdaForetagAgarintresse, RedovisningsprinciperAktieagartillskott and NotUpplysningarKoncernredovisning — and are numbered among the company's. A note both have shows a block for the company and one for the group (Moderbolaget / Koncernen); the group's block holds only the figures, written on _kon contexts, because the note's texts are shared.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"noter":{"type":"array","items":{"type":"string"},"description":"Every note the report should have, in order. Omit to read. Sending this REPLACES the whole set."},"forslag":{"type":"boolean","description":"Propose a set from the figures. Writes nothing — the choice stays the person's."},"ordna":{"type":"boolean","description":"Put the notes in the order of the statements (ÅRL 5 kap. 3 §): principles, estimates, notes to items in the order their main item stands in the income statement, balance sheet and cash flow, other notes last. With `noter` it orders that list; without, it reorders the year's choice. Renumbers the notes — the response's `ordning_avviker` says whether the current choice deviates."},"standardtext":{"type":"string","enum":["inga","specifika","alla"],"description":"Boilerplate for the written parts, keyed by field name and ready to post to save_arsredovisning_varde. Default inga."},"dry_run":{"type":"boolean","description":"Check the choice without saving it."},"form":{"type":"string","enum":["kompakt","full"],"description":"kompakt (default): each available note as {kod, etikett, avdelning, nummer?, egen?, storre?}. full: also `vagledning` and the rest — ask for it when you need to explain what a note requires."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_arsredovisning_nothanvisning","group":"arsredovisning","klass":"skriva","summary":"Which notes a line in the income statement, balance sheet or cash flow statement refers to — the \"Not 3\" in the note column.","description":"Which notes a line in the income statement, balance sheet or cash flow statement refers to — the \"Not 3\" in the note column.\n\nCalled WITHOUT `rad_kod` it reads: `hanvisningar` has every line with at least one reference, each with `noter` (what applies now) and `auto` (the default from the taxonomy, which places some lines inside their note — the closing balance of a fixed asset note is the balance sheet line). Most notes have no such placement: auditors' fees, other operating expenses and every custom note are linked by hand.\n\nCalled WITH `rad_kod` and `noter` it sets that line's references to EXACTLY that list. Only the difference from the default is stored, so sending the default back removes the line's deviations. Read first and send the full list back with your change in it; a line can refer to several notes (\"3, 17\").\n\n`rad_kod` is the line's taxonomy concept or a custom line's 'egen:' code, and must stand in rr, br or kassaflode. `noter` are note codes as set_arsredovisning_noter lists them — taxonomy notes or custom text notes. A reference to a note that is not selected is kept but not shown until the note is selected. Numbers are never stored; they follow the note order.\n\nIn the filed document each reference is tagged as se-misc-base:ReferensInstansDokumentTuple in ix:hidden (Bolagsverket's application guidance 2.21), pointing from the line's fact to the note's facts, per year. The choice carries to next year like the note selection.\n\nWith a koncernredovisning, `enhet: 'kon'` reads and sets the KONCERN's statements. Their default is the parent company's current references for the same line (the note has both blocks), or the koncern taxonomy's default for a line only the koncern has (minority interest, a custom koncern line). Only the koncern's deviations from that are stored, so without any the koncern follows the parent — also when the parent's choice changes later.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, no_package, unknown_entity, no_koncern (enhet kon without a koncernredovisning), unknown_row (no such line in the document), row_has_no_note_column (the line is not in the income statement, balance sheet or cash flow statement), unknown_note, invalid_value, internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"enhet":{"type":"string","enum":["jur","kon"],"description":"jur (default) = the parent company's statements, kon = the koncern's."},"rad_kod":{"type":"string","description":"The line to set. Omit to read every line's references."},"noter":{"type":"array","items":{"type":"string"},"description":"The notes the line should refer to — REPLACES its references."},"dry_run":{"type":"boolean","description":"Check without saving."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_arsredovisning_oversattning","group":"arsredovisning","klass":"skriva","summary":"The translated annual report (ADR-0023): what is to be translated, and the client's translations. The filed document is always Swedish; the translation is rendered with get_arsredovisning_ixbrl sprak=en (untagged, never filed).","description":"The translated annual report (ADR-0023): what is to be translated, and the client's translations. The filed document is always Swedish; the translation is rendered with get_arsredovisning_ixbrl sprak=en (untagged, never filed).\n\nCalled WITHOUT `texter` it reads `lista` — by default only the texts still waiting (urval att_gora); urval alla gives every text visible in the English document, in document order, grouped by `del`. Each item: `typ` (rubrik = a line heading; varde = a text the user wrote; ek_rad = a custom row in the equity table), `nycklar` (the keys — one heading text shared by several rows, like 'Redovisat värde', carries all of them), `svenska`, `utskrivet` (what the translation prints now), `oversattning` (the client's own, or null), `taxonomi` (the taxonomy's English label, or null), `status` — oversatt, inaktuell (the Swedish changed since the translation was saved; the old one still prints), taxonomi (the taxonomy's label, counts as done), register (our curated register for headings the taxonomy has no English for, reviewed, counts as done), standardtext (the Swedish text IS one of the standard texts word for word, so the English standard text prints, counts as done), utkast (the register's or standard text's English, not yet reviewed — it prints, but counts as saknas) or saknas (Swedish is printed); `forval` is what prints without the client's own translation. A text value that is not a standard text carries `standardtexter` — the field's English standard texts {namn, text} to start from. `antal.utkast` counts the drafts within `antal.saknas`. — and for a heading the user renamed in Swedish `andrad_fran` and `forslag` (the taxonomy's English for the ORIGINAL heading — check it still fits before using it). `antal` counts totalt, klara, saknas, inaktuella. Names, organisationsnummer, säte and ort are never translated and are not listed; nor are texts without a letter.\n\nWITH `texter` it saves: each {typ, enhet, nyckel, tupel, kontext, instans, text} as in `nycklar` — save every key of an item. An empty text removes the translation (the taxonomy or Swedish prints again); saving the same text again makes a stale one current. The hash of the Swedish source is computed by the server from the document as it is now. The answer is `antal` after saving, with `sparade` and `borttagna` (urval 'alla' for the list too).\n\nA new year carries the year's Swedish free texts and every translation over (fiscalyear/create): unchanged Swedish keeps its translation; edited Swedish makes it inaktuell.\n\nWhatever you save here is stored as a PROPOSAL (status maskin; it shows as forslag and counts as saknas) until a person approves it in the step — never as reviewed (ADR-0018). The step can also ask an AI service for proposals (arsredovisning/oversattning_forslag, not a tool; the provider is set on the server — Mistral, OpenAI or Anthropic): the user confirms there that the text is sent and that they are responsible for it (consent_required without it); it may answer too_many (over 50 texts), nothing_to_translate, quota_exceeded (the account's monthly token cap), provider_not_configured, provider_unreachable, provider_rate_limited, provider_error or provider_bad_answer.\n\nTranslate faithfully into the register of a Swedish annual report in English (ÅRL terms as in the taxonomy's English labels). Propose; let the user decide when unsure.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, invalid_enum (sprak — Swedish is the original and is not translated — or typ), invalid_value (texter is not a list), unknown_text (no such text in the document now — read the list again), too_long (over 20 000 characters), and what get_arsredovisning_ixbrl answers when the document cannot be rendered (no_package, package_too_old, missing_corporate_id), internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"sprak":{"type":"string","enum":["en"],"description":"The language translated into. en (default)."},"texter":{"type":"array","items":{"type":"object","properties":{"typ":{"type":"string","enum":["rubrik","varde","ek_rad"]},"enhet":{"type":"string","enum":["jur","kon"]},"nyckel":{"type":"string"},"tupel":{"type":"string"},"kontext":{"type":"string"},"instans":{"type":"integer"},"text":{"type":"string","description":"The translation. Empty removes it."}},"required":["typ","nyckel","text"],"additionalProperties":false},"description":"Translations to save. Omit to read."},"dry_run":{"type":"boolean","description":"Check without saving."},"urval":{"type":"string","enum":["att_gora","alla","ingen"],"description":"Which part of `lista` comes back. att_gora: the texts still waiting (saknas, utkast, forslag, inaktuell) — the default when reading. ingen: only `antal` — the default when saving. alla: every text (over 100 000 characters for a full report). `lista_utelamnade` counts what was left out."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_arsredovisning_sidbrytning","group":"arsredovisning","klass":"skriva","summary":"Manual page breaks in the annual report — \"Ny sida här\" and removing a break.","description":"Manual page breaks in the annual report — \"Ny sida här\" and removing a break.\n\nThe document is paginated as it is filed (get_arsredovisning_ixbrl with sidindela=true). By default a new page starts before the förvaltningsberättelse, the income statement, the balance sheet, the cash flow statement and the notes, and wherever the engine says a page is full. `sidindelning.avsnitt` there lists every section: `nyckel`, `rubrik`, `sida`, and `brytning` — why it starts a page: forsta, standard, manuell, automatisk (the page before was full), or null (it does not). `borttagen` marks a default break the user removed; `delad` a '(forts.)' continuation the pagination made itself.\n\nCalled WITHOUT `nyckel` it reads `brytningar`: the year's deviations, nyckel => true (page added) or false (default removed). WITH `nyckel` and `ny_sida`: true adds a break before the section, false removes the default one, null goes back to the default. `aterstall: true` (without nyckel) takes every break back to the default at once and answers `aterstallda` (how many deviations were removed). Only deviations are stored. An automatic break cannot be removed — it comes back at the next measuring, because the page is full. Per year, and carried to the next year like the note references (a section missing that year is ignored).\n\nThe key is the section's id (del-rr) or its heading without the note number ('Ställda säkerheter'), so adding a note does not move a break.\n\nONE BREAK INSIDE A TABLE: `brytpunkt:del-br/EgetKapitalSkulderAbstract` — a new page before Eget kapital och skulder in the balance sheet; in a group report the group's balance sheet has its own, `brytpunkt:del-koncern_br/EgetKapitalSkulderAbstract`, chosen separately. No default: it is listed in avsnitt with brytning null until chosen. Chosen, the table is split there as when it is too long — 'Balansräkning (forts.)' with the year headings — and every fact stays the same. Only the person chooses it.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, invalid_value (ny_sida, or aterstall together with nyckel), unknown_section (no such section now — read avsnitt again), first_section (the first section always starts page 1), and what get_arsredovisning_ixbrl answers when the document cannot be rendered (no_package, package_too_old, missing_corporate_id), internal_error.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"nyckel":{"type":"string","description":"The section, as sidindelning.avsnitt lists it. Omit to read."},"ny_sida":{"type":["boolean","null"],"description":"true = new page before it, false = no new page (removes a default break), null = back to the default. Required with nyckel."},"aterstall":{"type":"boolean","description":"true = every break back to the default for the year. Not together with nyckel."},"dry_run":{"type":"boolean","description":"Check without saving."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_avstamning_status","group":"avstamning","klass":"skriva","summary":"Tick a balance-sheet post as klar, and/or set who is ansvarig for it (ADR-0033). Both are information for the byrå: ticking klar does NOT remove a warning about an Ospecificerat belopp, and the step's own klar (set_status_markering) is a separate thing. Tick klar only when the person says the post is reconciled.","description":"Tick a balance-sheet post as klar, and/or set who is ansvarig for it (ADR-0033). Both are information for the byrå: ticking klar does NOT remove a warning about an Ospecificerat belopp, and the step's own klar (set_status_markering) is a separate thing. Tick klar only when the person says the post is reconciled.\n\nklar true stores who, when and the post's balance; if the balance changes later, get_avstamning shows klar.andrat. ansvarig is a user id from get_avstamning `anvandare`, or null for none.\n\nErrors: missing_post, unknown_post, unknown_user (no access to the client), year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"rad_kod":{"type":"string","description":"The post, from get_avstamning"},"klar":{"type":"boolean","description":"true ticks, false unticks"},"ansvarig":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"User id from get_avstamning anvandare, or null"}},"required":["client_id","fiscal_year_id","rad_kod"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_bokslut_regelverk","group":"bolag","klass":"skriva","summary":"Set which regelverk — K2 or K3 — the annual report for this fiscal year is prepared under.","description":"Set which regelverk — K2 or K3 — the annual report for this fiscal year is prepared under.\n\nThis is NOT a setting. It decides which settings exist at all, and it is stored on the fiscal year, so a company can use K2 one year and K3 the next while the old year keeps producing its old report.\n\nChanging it can make already saved values irrelevant — funktionsindelad resultaträkning and koncernredovisning exist only under K3 (a voluntary kassaflödesanalys exists under both). The response lists them as `orphaned`. Nothing is deleted: switching back brings the values into view again. Always dry_run first and tell the person what would fall away before you change it.\n\nASK BEFORE SETTING THIS. The choice follows from the company's size, its ownership and what it did last year, and it is not yours to infer. The licence may also not include K3; the response carries `licence`, which says what the plan covers — today it reports but does not refuse.\n\nSWITCHING TO K3 CAN COST MONEY. When the year is already paid for as K2 (or the company is counted as K2 in an agency's paid licence), the switch costs the difference, added as a charge the person pays under Licens. The dry run's `licens_kostnad` {belopp, moms in öre, text} says so; null means it costs nothing. Tell the person the amount and get a yes before you switch. Switching back to K2 refunds nothing.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"value":{"anyOf":[{"type":"string","enum":["k2","k3"]},{"type":"null"}],"description":"k2, k3, or null to clear"},"dry_run":{"type":"boolean"}},"required":["client_id","fiscal_year_id","value"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_bokslut_saldo","group":"bokslut","klass":"skriva","summary":"Change an imported account balance by hand, or restore the imported amount (migration 0055). The same for the parent (`enhet: 'jur'`) and the group (`'kon'`): `falt: 'ub'` is the year's closing balance as imported — for the parent BEFORE adjustments (justeringar), which are added on top and recomputed, as is the tax calculation — and `falt: 'prev_ub'` the comparison year.","description":"Change an imported account balance by hand, or restore the imported amount (migration 0055). The same for the parent (`enhet: 'jur'`) and the group (`'kon'`): `falt: 'ub'` is the year's closing balance as imported — for the parent BEFORE adjustments (justeringar), which are added on top and recomputed, as is the tax calculation — and `falt: 'prev_ub'` the comparison year.\n\nThe amount is RAW, as in a trial balance: debit positive, credit negative (equity, liabilities and revenue are negative). `belopp: null` restores the imported amount; setting it back to the imported amount also counts as untouched. Accounts in get_bokslut_matris carry `inlast` with the imported amounts when they have been changed.\n\nA change is ONE-SIDED: it is not a journal entry and the balance sheet may stop balancing — say so to the person. When the change should be booked against another account, use an adjustment (justering) instead. A new import of the year REPLACES all changes; the import preview reports how many in `edited_accounts`. Confirm the amount with the person before changing it. Every change is written to the treatment history.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, year_locked, unknown_entity, no_koncern, missing_account, unknown_account (the account is not in the year's trial balance — a change cannot add an account), unknown_field (falt is not ub or prev_ub), missing_amount (send belopp, or null to restore), invalid_amount, no_comparison_year (the group's file had no comparison column), internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"account_no":{"type":"string","description":"The account, e.g. \"1930\""},"falt":{"type":"string","enum":["ub","prev_ub"],"description":"ub = this year's closing balance, prev_ub = comparison year"},"belopp":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}],"description":"New raw amount in kronor (debit +, credit −; comma accepted as decimal sign), or null to restore"},"enhet":{"type":"string","enum":["jur","kon"],"description":"jur (default) the parent company, kon the group's consolidated trial balance"}},"required":["client_id","fiscal_year_id","account_no","falt","belopp"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_bokslut_steg","group":"bokslut","klass":"skriva","summary":"Mark one step todo, in_progress or done.","description":"Mark one step todo, in_progress or done.\n\nTHIS SIGNS SOMETHING OFF IN SOMEBODY'S NAME. The row records the authenticated user as `marked_by` with a timestamp, and for an agency reviewing somebody else's close that is a statement about who checked what. Do not mark a step done on your own initiative, and do not walk a run of steps to done to tidy up a view. Ask, and name the step.\n\nIt writes the person's axis only. It never touches the warnings — marking a step done over a warning is allowed and is the point: \"done despite a warning\" is exactly what a reviewer needs to be able to see. So do not run the checks first and refuse. If a warning matters, say so and let the person decide.\n\nSetting todo CLEARS the sign-off — marked_by, marked_at and note all go — because they describe an assertion that no longer stands. There is no way to get them back.\n\n`step_code` is a slug from get_bokslut_steg, e.g. bokslut.filimport. `note` is at most 255 characters and is dropped when the status is todo. The answer carries `is_stale` straight away, so you need not re-fetch the whole workflow to see it.\n\nNOTE: this endpoint predates the closed error-code set (ADR-0010). Its failures come back as Swedish prose in `msg` with no `code`. Pass the message through rather than inventing a code for it.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"step_code":{"type":"string","description":"Step slug, e.g. bokslut.filimport"},"status":{"type":"string","enum":["todo","in_progress","done"],"description":"The person's status for the step"},"note":{"type":"string","description":"Optional comment, max 255 characters. Dropped when the status is todo."}},"required":["client_id","fiscal_year_id","step_code","status"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_bolag_mall","group":"bolag","klass":"skriva","summary":"Read or set whether a company is a TEMPLATE (mallbolag, ADR-0047). Without `mall` it reads: `mall` is null, 'konto' (the account's own template) or 'global' (e-revisor's, which anyone may copy from), and `kan_andra`. With `mall` true/false it marks or unmarks the account's template. A template is listed first when a year is copied (list_kopiera_kallor), appears under list_bolag's filters alla and mallar (not kvar, klara, deadline), and has no deadlines. It costs a licence like any company. Marking is the person's decision — never on your own initiative. Only the owner and the account's admin change it (not_allowed); a global template is changed only by e-revisor (mall_global). Errors: unknown_client, not_allowed, mall_global.","description":"Read or set whether a company is a TEMPLATE (mallbolag, ADR-0047). Without `mall` it reads: `mall` is null, 'konto' (the account's own template) or 'global' (e-revisor's, which anyone may copy from), and `kan_andra`. With `mall` true/false it marks or unmarks the account's template. A template is listed first when a year is copied (list_kopiera_kallor), appears under list_bolag's filters alla and mallar (not kvar, klara, deadline), and has no deadlines. It costs a licence like any company. Marking is the person's decision — never on your own initiative. Only the owner and the account's admin change it (not_allowed); a global template is changed only by e-revisor (mall_global). Errors: unknown_client, not_allowed, mall_global.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The company"},"mall":{"type":"boolean","description":"true marks it as the account's template, false unmarks; omit to read"}},"required":["client_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_egna_steg_status","group":"bokslut","klass":"skriva","summary":"Set one of the year's own steps (the row `ovrigt` in get_status_oversikt) to todo, in_progress or done, and/or its anteckning. The steps themselves are the year setting egna_steg (save_bokslut_settings). A step's status is the person's statement, like the other steps: change it only when the person asks. Omit `status` to change only the anteckning; an empty anteckning removes it. Answers the updated overview. Errors: unknown_step (not among the year's own steps — read get_status_oversikt), invalid_enum, too_long (anteckning over 255), missing_fiscal_year.","description":"Set one of the year's own steps (the row `ovrigt` in get_status_oversikt) to todo, in_progress or done, and/or its anteckning. The steps themselves are the year setting egna_steg (save_bokslut_settings). A step's status is the person's statement, like the other steps: change it only when the person asks. Omit `status` to change only the anteckning; an empty anteckning removes it. Answers the updated overview. Errors: unknown_step (not among the year's own steps — read get_status_oversikt), invalid_enum, too_long (anteckning over 255), missing_fiscal_year.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"kod":{"type":"string","description":"The step's kod, e.g. egen.2"},"status":{"type":"string","enum":["todo","in_progress","done"],"description":"The new status; omitted keeps it"},"anteckning":{"type":"string","description":"Note, max 255 characters; empty removes it"}},"required":["client_id","fiscal_year_id","kod"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_moms_obetalda","group":"skatt","klass":"skriva","summary":"Choose which VAT periods were declared but UNPAID on the balance-sheet date (ADR-0049, addendum 2026-10-27). get_momsdeklarationer answers obetalda: {perioder, kalla (forslag | valt), forslag, over, saknas, belopp, forfallodagar}. The proposal (forslag) is the declared periods that end on or before the balance-sheet month and fall due after it (the 12th of the second month after — the rule for up to 40 Mkr; above 40 Mkr monthly VAT falls due on the 26th of the month after, so the month before is already paid). belopp — minus the sum of box 49 — is the calculation \"Moms enligt Skatteverket\" in the avstämning, against the VAT accounts (year setting moms_konton, default 1650,2610-2650). over (a period running past the balance-sheet date) or saknas (the balance-sheet month not declared) leave the proposal uncalculated; a choice is calculated anyway.","description":"Choose which VAT periods were declared but UNPAID on the balance-sheet date (ADR-0049, addendum 2026-10-27). get_momsdeklarationer answers obetalda: {perioder, kalla (forslag | valt), forslag, over, saknas, belopp, forfallodagar}. The proposal (forslag) is the declared periods that end on or before the balance-sheet month and fall due after it (the 12th of the second month after — the rule for up to 40 Mkr; above 40 Mkr monthly VAT falls due on the 26th of the month after, so the month before is already paid). belopp — minus the sum of box 49 — is the calculation \"Moms enligt Skatteverket\" in the avstämning, against the VAT accounts (year setting moms_konton, default 1650,2610-2650). over (a period running past the balance-sheet date) or saknas (the balance-sheet month not declared) leave the proposal uncalculated; a choice is calculated anyway.\n\nperioder: the list of YYYYMM to keep; null goes back to the proposal. Only change it when the person says the company files differently (e.g. above 40 Mkr) — never guess. Not in a locked year.\n\nErrors: missing_fiscal_year, unknown_fiscal_year, invalid_value, year_locked; internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"perioder":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"The unpaid periods as YYYYMM, or null for the proposal"}},"required":["client_id","fiscal_year_id","perioder"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_stammoprotokoll_paragraf","group":"stamma","klass":"skriva","summary":"Change the protokoll's paragraphs (ADR-0025 punkt 3) — the årsstämma's, or an extra stämma's with `stamma_id`. Only deviations from the template are stored: a template paragraph set back to the template's text follows the template again.","description":"Change the protokoll's paragraphs (ADR-0025 punkt 3) — the årsstämma's, or an extra stämma's with `stamma_id`. Only deviations from the template are stored: a template paragraph set back to the template's text follows the template again.\n\n`atgard`:\n  andra          nyckel + rubrik and/or text. Placeholders like {ordforande} are filled in.\n  aterstall      nyckel: the template's rubrik and text back (not_template for an own paragraph)\n  dolj, visa     nyckel. A lagstadgad paragraph cannot be hidden (required_paragraph)\n  ny             rubrik + text, efter? (a nyckel). Without efter: before the closing paragraph — for an extra stämma at the end when there is none (per capsulam). For an extra stämma, take the text of a ready decision from get_stammoprotokoll `beslutspunkter` and fill in what is in brackets.\n  ta_bort        nyckel: an own paragraph only (not_own — hide a template paragraph instead)\n  flytta         ordning: EVERY nyckel in the new order (incomplete_order otherwise)\n  aterstall_allt every deviation removed, own paragraphs too. Destructive: ask the person first.\n\n`dry_run: true` checks everything and writes nothing (ADR-0010). Read with get_stammoprotokoll first — the nycklar come from there. The answer is the protokoll as it stands: `stamma` {id, slag arsstamma|extra, paket — the template version locked on the stämma}, `texter` {stamma, stamman, protokoll, agare} in the form's words (årsstämma, föreningsstämma, årsmöte, extra bolagsstämma …), `typ` fysisk|digital|percapsulam, `paragrafer` in order — each {nyckel ('m:<kod>' a template paragraph, 'e:<id>' an own one), rubrik, text (with {fält} placeholders), html_rubrik/html_text (filled in), andrad (own text on a template paragraph), egen, dold, lagstadgad (cannot be hidden), kopplad (its content follows the decisions or the people while the text is the template's)}, `undertecknare` {namn, roller, har_email, har_personnummer}, and `saknas` {fält: what is missing — say it to the person, the document shows it marked}. `read_only` with a reason when the year is filed or locked. Errors: unknown_paragraph (the nyckel is not in the protokoll — read again), nothing_to_change, required (an empty rubrik), too_long (rubrik 255, text 10000), not_template, not_own, required_paragraph, incomplete_order, year_locked, unknown_stamma.","dryRun":true,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"stamma_id":{"type":"integer","description":"An extra stämma; without it the årsstämma"},"atgard":{"type":"string","enum":["andra","aterstall","dolj","visa","ny","ta_bort","flytta","aterstall_allt"]},"nyckel":{"type":"string","description":"'m:<kod>' or 'e:<id>' from get_stammoprotokoll"},"rubrik":{"type":"string"},"text":{"type":"string"},"efter":{"type":"string","description":"ny: the nyckel to place the new paragraph after"},"ordning":{"type":"array","items":{"type":"string"},"description":"flytta: every nyckel in the new order"},"dry_run":{"type":"boolean"}},"required":["client_id","fiscal_year_id","atgard"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"set_status_markering","group":"bolag","klass":"skriva","summary":"Mark a milestone as done outside the program — signed on paper, filed by someone else, made in another program — or remove the mark (`markera: false`). The program's own status is never touched. Ask the person first: it is their statement about what happened. `kod` is a milestone kod from get_status_oversikt that is `markerbar` (not deklaration.slutlig). `datum` is the day it was done. To change an existing mark's datum or anteckning, call again with `markera: true`: the mark is replaced, not duplicated (send both fields — an omitted one is cleared). Answers the updated overview. Errors: invalid_enum (unknown kod for the form), invalid_date, too_long (anteckning over 255), missing_fiscal_year. A locked year can be marked too: filing on paper is filing, and it changes nothing in the year.","description":"Mark a milestone as done outside the program — signed on paper, filed by someone else, made in another program — or remove the mark (`markera: false`). The program's own status is never touched. Ask the person first: it is their statement about what happened. `kod` is a milestone kod from get_status_oversikt that is `markerbar` (not deklaration.slutlig). `datum` is the day it was done. To change an existing mark's datum or anteckning, call again with `markera: true`: the mark is replaced, not duplicated (send both fields — an omitted one is cleared). Answers the updated overview. Errors: invalid_enum (unknown kod for the form), invalid_date, too_long (anteckning over 255), missing_fiscal_year. A locked year can be marked too: filing on paper is filing, and it changes nothing in the year.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"kod":{"type":"string","description":"Milestone kod, e.g. arsredovisning.signerad"},"markera":{"type":"boolean","description":"true to mark, false to remove the mark"},"datum":{"type":"string","description":"YYYY-MM-DD, the day it was done"},"anteckning":{"type":"string","description":"Optional note, max 255 characters"}},"required":["client_id","fiscal_year_id","kod","markera"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"stop_recurring_todo","group":"ovrigt","klass":"ersatta","summary":"Permanently stop a recurring todo series (soft delete — no more instances will be generated). Todo instances already generated from it are untouched. For a temporary pause instead, use update_recurring_todo with active=false.","description":"Permanently stop a recurring todo series (soft delete — no more instances will be generated). Todo instances already generated from it are untouched. For a temporary pause instead, use update_recurring_todo with active=false.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"recurrence_id":{"type":"integer","description":"Recurrence rule ID (from list_recurring_todos)"}},"required":["client_id","recurrence_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"update_extrastamma","group":"stamma","klass":"skriva","summary":"Change an extra stämma's ärende, datum, ort or typ. Only the fields sent change; an empty datum or ort clears it, an empty arende is refused. Switching to percapsulam makes the owners the signatories and drops the meeting paragraphs. The answer is the protokoll as it stands: `stamma` {id, slag arsstamma|extra, paket — the template version locked on the stämma}, `texter` {stamma, stamman, protokoll, agare} in the form's words (årsstämma, föreningsstämma, årsmöte, extra bolagsstämma …), `typ` fysisk|digital|percapsulam, `paragrafer` in order — each {nyckel ('m:<kod>' a template paragraph, 'e:<id>' an own one), rubrik, text (with {fält} placeholders), html_rubrik/html_text (filled in), andrad (own text on a template paragraph), egen, dold, lagstadgad (cannot be hidden), kopplad (its content follows the decisions or the people while the text is the template's)}, `undertecknare` {namn, roller, har_email, har_personnummer}, and `saknas` {fält: what is missing — say it to the person, the document shows it marked}. `read_only` with a reason when the year is filed or locked. Errors: unknown_stamma, nothing_to_change, required, invalid_date, invalid_enum, too_long, year_locked.","description":"Change an extra stämma's ärende, datum, ort or typ. Only the fields sent change; an empty datum or ort clears it, an empty arende is refused. Switching to percapsulam makes the owners the signatories and drops the meeting paragraphs. The answer is the protokoll as it stands: `stamma` {id, slag arsstamma|extra, paket — the template version locked on the stämma}, `texter` {stamma, stamman, protokoll, agare} in the form's words (årsstämma, föreningsstämma, årsmöte, extra bolagsstämma …), `typ` fysisk|digital|percapsulam, `paragrafer` in order — each {nyckel ('m:<kod>' a template paragraph, 'e:<id>' an own one), rubrik, text (with {fält} placeholders), html_rubrik/html_text (filled in), andrad (own text on a template paragraph), egen, dold, lagstadgad (cannot be hidden), kopplad (its content follows the decisions or the people while the text is the template's)}, `undertecknare` {namn, roller, har_email, har_personnummer}, and `saknas` {fält: what is missing — say it to the person, the document shows it marked}. `read_only` with a reason when the year is filed or locked. Errors: unknown_stamma, nothing_to_change, required, invalid_date, invalid_enum, too_long, year_locked.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"stamma_id":{"type":"integer"},"arende":{"type":"string"},"datum":{"type":"string","description":"YYYY-MM-DD, or empty to clear"},"ort":{"type":"string"},"typ":{"type":"string","enum":["fysisk","digital","percapsulam"]}},"required":["client_id","fiscal_year_id","stamma_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"update_recurring_todo","group":"ovrigt","klass":"skriva","summary":"Update a recurring todo rule — pause (active=false) or resume (active=true) it, reassign it, or change its schedule. Only the fields provided are changed. Changing frequency/interval_n/weekday/day_of_month re-anchors the next occurrence date from today. To permanently stop a series instead of pausing it, use stop_recurring_todo.","description":"Update a recurring todo rule — pause (active=false) or resume (active=true) it, reassign it, or change its schedule. Only the fields provided are changed. Changing frequency/interval_n/weekday/day_of_month re-anchors the next occurrence date from today. To permanently stop a series instead of pausing it, use stop_recurring_todo.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"recurrence_id":{"type":"integer","description":"Recurrence rule ID (from list_recurring_todos)"},"title":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"assignee_id":{"type":"integer","description":"Must have access to this client."},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"interval_n":{"type":"integer"},"weekday":{"type":"integer","minimum":0,"maximum":6},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"action_url":{"type":"string"},"source_module":{"type":"string"},"active":{"type":"boolean","description":"false = pause (reversible), true = resume"}},"required":["client_id","recurrence_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"update_todo","group":"ovrigt","klass":"skriva","summary":"Update fields on an existing todo — e.g. change severity, status, due date, or reassign it. Only the fields provided are changed. Reassigning to a new assignee_id sends a fresh assignment notification and is rejected if that user doesn't have access to the client.","description":"Update fields on an existing todo — e.g. change severity, status, due date, or reassign it. Only the fields provided are changed. Reassigning to a new assignee_id sends a fresh assignment notification and is rejected if that user doesn't have access to the client.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"todo_id":{"type":"integer","description":"Todo ID (from get_todos)"},"title":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"status":{"type":"string","enum":["open","done","dismissed"],"description":"Use complete_todo instead for marking done — it also notifies the creator."},"due_date":{"type":"string","description":"YYYY-MM-DD, or empty string to clear"},"action_url":{"type":"string"},"assignee_id":{"type":"integer","description":"New assignee's user ID. Must have access to this client."},"source_module":{"type":"string"}},"required":["client_id","todo_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"upload_avstamning_bilaga","group":"avstamning","klass":"skriva","summary":"Attach a file to a specification row in the avstämning (ADR-0033): a bank statement, a reskontra, an invoice — the underlag that shows the row is right. Only a file the person has given you, for the row they name; never fetch or invent one.","description":"Attach a file to a specification row in the avstämning (ADR-0033): a bank statement, a reskontra, an invoice — the underlag that shows the row is right. Only a file the person has given you, for the row they name; never fetch or invent one.\n\nrad_id is the row's id from get_avstamning (rader[].id) — the row must be saved first (save_avstamning). Send the file as fil_base64 + filnamn (with extension). Allowed: pdf, jpg, png, xlsx, xls, csv, docx, txt; at most 5 MB per file and 100 MB per client and fiscal year by default (get_avstamning `bilagor` gives the limits in bytes and what the year already uses). The same file twice is stored once.\n\nYou can list attachments (get_avstamning, rader[].bilagor: id, namn, mime, storlek) but NOT read their contents — agents do not read attachments until open question 74 is settled.\n\nErrors: missing_row, unknown_row (not a saved row of this year), no_file, ambiguous_input, invalid_base64, invalid_filename, empty_file, file_too_large, file_type_not_allowed, file_type_mismatch (the content is not what the extension says), quota_exceeded (the year's 100 MB), upload_failed, storage_failed, storage_not_configured (our storage is not set up — tell the person, it is ours to fix), invalid_key, unknown_entity_type, year_locked, missing_fiscal_year, unknown_fiscal_year, internal_error.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"rad_id":{"type":"integer","description":"The specification row's id, from get_avstamning"},"fil_base64":{"type":"string","description":"The file's bytes, base64"},"filnamn":{"type":"string","description":"The file name with extension, e.g. kontoutdrag-dec.pdf"}},"required":["client_id","fiscal_year_id","rad_id","fil_base64","filnamn"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}},{"name":"upload_skv_deklaration","group":"skatt","klass":"skriva_ute","summary":"Upload the year's income tax return (the XBRL file from get_skatteberakning_xbrl) to Skatteverket as a DRAFT in the company's own space (API Inkomstdeklaration 2-4).","description":"Upload the year's income tax return (the XBRL file from get_skatteberakning_xbrl) to Skatteverket as a DRAFT in the company's own space (API Inkomstdeklaration 2-4).\n\nAN UPLOAD IS NOT A FILING. Nothing is filed until an authorised representative opens the returned `url`, reviews the draft and signs on Mina sidor. The program never signs, and neither do you — never say the return is filed. A new upload for the same period replaces the draft.\n\nTWO STEPS. Without bekrafta nothing is sent: the answer is a preview {redo, hinder[], miljo, kontakt, historik[]} — whether it can be uploaded, what stops it, which environment and contact person would be used, and earlier attempts. Show it to the person. With bekrafta: true the file is uploaded and the answer is {url, korrelation, inlamning_id, filnamn, miljo}; give the person the url. Upload only when the person has asked for it, and to prod only when they have said prod.\n\nkontakt is the file producer's contact person, {namn, epost, telefon?}; left out it is the logged-in user. The package holds the main file and each appendix as its own file (n9.xbrl, n3b-1.xbrl, n3b-2.xbrl …); Skatteverket accepts that (N9, and two N3B — tried against production). The test environment accepts real organisationsnummer for an upload. Every attempt, successful or not, is logged with the files as sent; historik[] gives each attempt's blankett and bilagor[] ({blankett, utgava, filnamn, sha256}) — say which appendices went with it.\n\nErrors besides Skatteverket's (below): declaration_has_errors (fix the error-level findings first — see get_skatteberakning_xbrl); calculation_not_saved (save the calculation first); missing_input (contact name or a valid e-mail is missing); filing_disabled (filing to Skatteverket's production is switched off on this server — SKV_INLAMNING_PROD; say so and stop, never retry against prod or suggest a way around it); internal_error.\n\nErrors from Skatteverket's API Inkomstdeklaration 2-4: not_configured (the program has no API keys or certificate for that environment — tell the person, it is set up by the program's maintainers); unauthorized (the certificate's organisation lacks authority for the company: status and prefilled data need a firmatecknare, VD or deklarationsombud — tell the person that a board member, VD or ombud can fetch it in their own name with BankID, from \"Hämta förtryckta uppgifter\" in the calculation form or \"Hämta med BankID\" for the status in Slutför; you cannot log in with anyone's BankID); bankid_required (the same, when a fetch in the person's own name has no or an expired BankID login — only the form can start one); not_found; rejected (Skatteverket refused the request — quote its text); period_not_open (the declaration period is not open yet — Skatteverket's text gives the day it opens; the preview also says so while the fiscal year has not ended); provider_error, provider_unreachable (worth one retry later; an HTTP 503 without Skatteverket's period text is this — the service is down, not the period). missing_org_number, missing_fiscal_year, invalid_enum. Every error from Skatteverket carries `korrelation`, the id Skatteverket's support asks for.\n\nUploading is upload_skv_deklaration (berakning/inlamning). It refuses with declaration_has_errors while any finding is an error and with calculation_not_saved until the calculation is saved. After an upload Skatteverket returns a link where an authorised representative reviews and signs on Mina sidor; the program never signs.","dryRun":false,"inputSchema":{"type":"object","properties":{"client_id":{"type":"integer","description":"The accounting client ID"},"fiscal_year_id":{"type":"integer","description":"The fiscal year ID"},"miljo":{"type":"string","enum":["test","prod"],"description":"Skatteverket's environment; default from the program's settings."},"bekrafta":{"type":"boolean","description":"true uploads. Left out: a preview, nothing is sent."},"kontakt":{"type":"object","properties":{"namn":{"type":"string"},"epost":{"type":"string"},"telefon":{"type":"string"}},"required":["namn","epost"],"additionalProperties":false,"description":"The file producer's contact person. Default: the logged-in user."}},"required":["client_id","fiscal_year_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}]}
