@moatless/bookkeeping 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,388 @@
1
+ export const SWEDISH_BOOKKEEPING_SKILL = {
2
+ name: "swedish-bookkeeping",
3
+ description: "Swedish bookkeeping and accounting using BAS kontoplan. Use when creating journal entries (verifikationer), handling Swedish VAT (moms), categorizing expenses, or working with Swedish accounting data. Triggers on tasks involving BAS accounts (1xxx-9xxx), moms/VAT codes, reverse charge (omvänd skattskyldighet), supplier invoices, or financial record-keeping for Swedish companies.",
4
+ content: `# Swedish Bookkeeping
5
+
6
+ Create journal entries following Swedish BAS accounting standards with correct VAT handling.
7
+
8
+ ## Quick Reference
9
+
10
+ - **Accounts**: See accounts section below for BAS account codes
11
+ - **VAT/Tax codes**: See VAT codes section below for tax code selection
12
+
13
+ ## Journal Entry Structure
14
+
15
+ Every entry (verifikation) must balance: total debits = total credits.
16
+
17
+ \`\`\`yaml
18
+ series: D # A=Admin, B=Customer invoices, C=Customer payments,
19
+ # D=Supplier invoices, E=Supplier payments, K=Salary
20
+ entryNumber: 1
21
+ entryDate: 2024-01-15
22
+ description: Supplier Name - Invoice description
23
+ status: POSTED
24
+ currency: SEK
25
+ lines:
26
+ - account: "5422" # Expense account
27
+ debit: 1000.00
28
+ memo: SaaS subscription
29
+ - account: "2645" # VAT (if applicable)
30
+ debit: 250.00
31
+ memo: Input VAT reverse charge
32
+ - account: "2614" # Output VAT for reverse charge
33
+ credit: 250.00
34
+ memo: Output VAT reverse charge
35
+ - account: "2820" # Balancing account
36
+ credit: 1000.00
37
+ memo: Credit card payment
38
+ \`\`\`
39
+
40
+ ## Tax Code Selection
41
+
42
+ \`\`\`
43
+ Swedish supplier (VAT on invoice)?
44
+ ├─ YES → SE_VAT_25_PURCHASE_DOMESTIC (or 12%/6%/exempt)
45
+ └─ NO → Is it a service?
46
+ ├─ YES, EU supplier → SE_VAT_25_PURCHASE_EU_SERVICES_RC
47
+ ├─ YES, non-EU (US/UK) → SE_VAT_25_PURCHASE_NON_EU_SERVICES_RC
48
+ └─ NO (goods) → SE_VAT_25_PURCHASE_EU_GOODS_RC or import
49
+ \`\`\`
50
+
51
+ ## Common Expense Accounts
52
+
53
+ | Type | Account | Example Vendors |
54
+ |------|---------|-----------------|
55
+ | SaaS/Software | 5422 | AWS, GitHub, Anthropic, Slack |
56
+ | IT services | 6540 | Consulting, development |
57
+ | Accounting | 6530 | Bokio, Fortnox |
58
+ | Bank fees | 6570 | Bank charges (VAT exempt) |
59
+ | Internet/Telecom | 6230 | ISP, phone plans |
60
+ | Office supplies | 6110 | Stationery, small equipment |
61
+ | Travel | 5800 | Flights, trains |
62
+ | Meals (business) | 5831 | Hotels, business meals |
63
+
64
+ ## Balancing Accounts
65
+
66
+ | Method | Account | Use |
67
+ |--------|---------|-----|
68
+ | Supplier payable | 2440 | When paying later via bank transfer |
69
+ | Credit card | 2820 | Direct credit card charge |
70
+ | Bank account | 1930 | Direct debit/immediate payment |
71
+
72
+ ## Workflow: Creating an Entry
73
+
74
+ 1. **Identify the supplier** - Swedish, EU, or non-EU?
75
+ 2. **Determine expense type** - Select appropriate 5xxx/6xxx account
76
+ 3. **Select tax code** - Based on supplier location and transaction type
77
+ 4. **Choose balancing account** - 2440 (payable), 2820 (credit card), or 1930 (bank)
78
+ 5. **Create balanced entry** - Ensure debits = credits
79
+
80
+ ## Currency Handling
81
+
82
+ Foreign currency amounts must be converted to SEK using the exchange rate on the transaction date. Use Riksbank published rates.
83
+
84
+ ## Series Codes
85
+
86
+ | Series | Swedish | Use |
87
+ |--------|---------|-----|
88
+ | A | Administration | Internal adjustments, corrections |
89
+ | B | Kundfakturor | Customer invoices (sales) |
90
+ | C | Kundbetalningar | Customer payments received |
91
+ | D | Leverantörsfakturor | Supplier invoices (purchases) |
92
+ | E | Leverantörsbetalningar | Supplier payments made |
93
+ | K | Löner | Salary and payroll |
94
+
95
+ ---
96
+
97
+ # Swedish BAS Account Codes
98
+
99
+ The BAS chart of accounts (kontoplan) is the standard accounting framework used by Swedish companies. Account numbers have 4 digits where the first digit indicates the account class.
100
+
101
+ ## Account Classes
102
+
103
+ | Class | Swedish Name | English | Description |
104
+ |-------|-------------|---------|-------------|
105
+ | 1xxx | Tillgångar | Assets | Cash, receivables, inventory, fixed assets |
106
+ | 2xxx | Skulder & Eget kapital | Liabilities & Equity | Payables, loans, VAT, equity |
107
+ | 3xxx | Intäkter | Revenue | Sales, other income |
108
+ | 4xxx | Inköp/Varor | Cost of Goods | Direct costs, materials |
109
+ | 5xxx | Övriga externa kostnader | External Expenses | Rent, services, supplies |
110
+ | 6xxx | Övriga externa kostnader | External Expenses | Marketing, admin, IT |
111
+ | 7xxx | Personalkostnader | Personnel Costs | Salaries, benefits, taxes |
112
+ | 8xxx | Finansiella poster | Financial Items | Interest, currency gains/losses |
113
+ | 9xxx | Bokslutsdispositioner | Year-end Items | Appropriations, tax |
114
+
115
+ ## Account Number Structure
116
+
117
+ - **First digit**: Account class (1-9)
118
+ - **First two digits**: Account group
119
+ - **Ending in 00**: Control account (aggregates entire group)
120
+ - **Ending in 0**: Main account
121
+ - **Ending in 1-9**: Sub-accounts (detailed breakdown)
122
+
123
+ ## Commonly Used Accounts
124
+
125
+ ### Assets (1xxx)
126
+
127
+ | Account | Name | Use |
128
+ |---------|------|-----|
129
+ | 1510 | Kundfordringar | Accounts receivable |
130
+ | 1630 | Skattekonto | Tax account (Skatteverket) |
131
+ | 1930 | Företagskonto | Business bank account |
132
+ | 1940 | Placeringskonto | Savings/investment account |
133
+
134
+ ### Liabilities & Equity (2xxx)
135
+
136
+ | Account | Name | Use |
137
+ |---------|------|-----|
138
+ | 2010 | Eget kapital | Owner's equity |
139
+ | 2091 | Balanserad vinst | Retained earnings |
140
+ | 2099 | Årets resultat | Current year profit/loss |
141
+ | 2440 | Leverantörsskulder | Accounts payable |
142
+ | 2510 | Skatteskulder | Tax liabilities |
143
+ | 2610 | Utgående moms 25% | Output VAT 25% (sales) |
144
+ | 2611 | Utgående moms 12% | Output VAT 12% |
145
+ | 2612 | Utgående moms 6% | Output VAT 6% |
146
+ | 2614 | Utgående moms omvänd skattskyldighet | Output VAT reverse charge |
147
+ | 2640 | Ingående moms | Input VAT (general) |
148
+ | 2641 | Ingående moms 25% | Input VAT 25% (domestic) |
149
+ | 2645 | Ingående moms omvänd skattskyldighet | Input VAT reverse charge |
150
+ | 2650 | Momsredovisningskonto | VAT settlement account |
151
+ | 2820 | Kortfristiga skulder | Short-term liabilities (credit card) |
152
+ | 2898 | Outtagen vinstutdelning | Undistributed dividends |
153
+
154
+ ### Revenue (3xxx)
155
+
156
+ | Account | Name | Use |
157
+ |---------|------|-----|
158
+ | 3000 | Försäljning | Sales (general) |
159
+ | 3001 | Försäljning 25% moms | Sales 25% VAT |
160
+ | 3002 | Försäljning 12% moms | Sales 12% VAT |
161
+ | 3003 | Försäljning 6% moms | Sales 6% VAT |
162
+ | 3041 | Försäljning tjänster EU | Services sold to EU |
163
+ | 3051 | Försäljning varor EU | Goods sold to EU |
164
+ | 3305 | Försäljning utanför EU | Sales outside EU |
165
+ | 3740 | Öres- och kronutjämning | Rounding adjustments |
166
+ | 3960 | Valutakursvinster | Currency gains |
167
+
168
+ ### Cost of Goods (4xxx)
169
+
170
+ | Account | Name | Use |
171
+ |---------|------|-----|
172
+ | 4000 | Inköp varor | Goods purchased |
173
+ | 4010 | Inköp material | Materials purchased |
174
+ | 4531 | Import EU varor | Imports from EU (goods) |
175
+ | 4535 | Import utanför EU varor | Imports from non-EU (goods) |
176
+ | 4545 | Inköp tjänster EU | Services from EU |
177
+ | 4546 | Inköp tjänster utanför EU | Services from non-EU |
178
+
179
+ ### External Expenses (5xxx-6xxx)
180
+
181
+ | Account | Name | Use |
182
+ |---------|------|-----|
183
+ | 5010 | Lokalhyra | Office rent |
184
+ | 5400 | Förbrukningsinventarier | Consumable equipment |
185
+ | 5410 | Förbrukningsmat. | Consumables |
186
+ | 5420 | Programvara | Software |
187
+ | 5422 | Programvara, onlinetjänster | SaaS subscriptions |
188
+ | 5480 | Arbetskläder | Work clothing |
189
+ | 5500 | Reparation maskiner | Repairs machinery |
190
+ | 5800 | Resekostnader | Travel expenses |
191
+ | 5831 | Kost och logi | Meals and accommodation |
192
+ | 5910 | Annonsering | Advertising |
193
+ | 6071 | Representation | Business entertainment |
194
+ | 6110 | Kontorsmaterial | Office supplies |
195
+ | 6212 | Mobiltelefon | Mobile phone |
196
+ | 6230 | Datakommunikation | Internet/data |
197
+ | 6310 | Företagsförsäkringar | Business insurance |
198
+ | 6420 | Ersättning styrelsen | Board compensation |
199
+ | 6530 | Redovisningstjänster | Accounting services |
200
+ | 6540 | IT-tjänster | IT services |
201
+ | 6570 | Bankkostnader | Bank charges |
202
+ | 6970 | Tidningar och tidskrifter | Subscriptions |
203
+
204
+ ### Personnel Costs (7xxx)
205
+
206
+ | Account | Name | Use |
207
+ |---------|------|-----|
208
+ | 7010 | Löner tjänstemän | Salaries (employees) |
209
+ | 7082 | Sjuklön | Sick pay |
210
+ | 7090 | Förändring semesterlöneskuld | Vacation pay accrual |
211
+ | 7210 | Löner styrelse | Board salaries |
212
+ | 7381 | Kostnadsersättning | Expense reimbursement |
213
+ | 7510 | Arbetsgivaravgifter | Employer contributions |
214
+ | 7533 | Särskild löneskatt pensionskostnader | Special payroll tax (pensions) |
215
+ | 7820 | Utbildning | Training/education |
216
+
217
+ ### Financial Items (8xxx)
218
+
219
+ | Account | Name | Use |
220
+ |---------|------|-----|
221
+ | 8310 | Ränteintäkter | Interest income |
222
+ | 8410 | Räntekostnader | Interest expenses |
223
+ | 8423 | Räntekostnader skattekonto | Tax account interest |
224
+ | 8910 | Skatt på årets resultat | Income tax |
225
+
226
+ ## Double-Entry Principles
227
+
228
+ Swedish bookkeeping follows standard double-entry principles:
229
+ - **Debit (debet)**: Increases assets (1xxx), decreases liabilities (2xxx), increases expenses (4xxx-8xxx)
230
+ - **Credit (kredit)**: Decreases assets, increases liabilities/equity, increases revenue (3xxx)
231
+
232
+ Every transaction must balance: total debits = total credits.
233
+
234
+ ---
235
+
236
+ # Swedish VAT (Moms) Tax Codes
237
+
238
+ Swedish VAT (Mervärdesskatt/Moms) uses different rates and reporting rules depending on the type of transaction and geographic origin.
239
+
240
+ ## VAT Rates
241
+
242
+ | Rate | Description | Common Uses |
243
+ |------|-------------|-------------|
244
+ | 25% | Standard rate | Most goods and services |
245
+ | 12% | Reduced rate | Food, hotels, restaurants |
246
+ | 6% | Reduced rate | Books, newspapers, public transport, cultural events |
247
+ | 0% | Zero-rated | Exports, certain financial services |
248
+
249
+ ## Tax Code Patterns
250
+
251
+ ### Domestic Purchases (Swedish Seller)
252
+
253
+ When purchasing from a Swedish company that charges VAT:
254
+
255
+ | Tax Code | Rate | Expense Account | VAT Account | Balancing |
256
+ |----------|------|-----------------|-------------|-----------|
257
+ | \`SE_VAT_25_PURCHASE_DOMESTIC\` | 25% | Expense (5xxx/6xxx) | 2641 | 2440 |
258
+ | \`SE_VAT_12_PURCHASE_DOMESTIC\` | 12% | Expense | 2641 | 2440 |
259
+ | \`SE_VAT_6_PURCHASE_DOMESTIC\` | 6% | Expense | 2641 | 2440 |
260
+ | \`SE_VAT_EXEMPT_PURCHASE\` | 0% | Expense | - | 2440/2820 |
261
+
262
+ **Example**: SEK 1,250 domestic purchase with 25% VAT
263
+ \`\`\`
264
+ Debit 5420 (Software) 1,000.00
265
+ Debit 2641 (Input VAT) 250.00
266
+ Credit 2440 (Supplier payables) 1,250.00
267
+ \`\`\`
268
+
269
+ ### Reverse Charge - EU Services
270
+
271
+ For B2B services from EU countries (not goods), the buyer reports VAT:
272
+
273
+ | Tax Code | Use Case | VAT Handling |
274
+ |----------|----------|--------------|
275
+ | \`SE_VAT_25_PURCHASE_EU_SERVICES_RC\` | SaaS, consulting from EU | Reverse charge 25% |
276
+ | \`SE_VAT_12_PURCHASE_EU_SERVICES_RC\` | Reduced rate EU services | Reverse charge 12% |
277
+
278
+ **Journal pattern** (25% reverse charge):
279
+ \`\`\`
280
+ Debit 5422 (Expense) 1,000.00 # Net amount
281
+ Debit 2645 (Input VAT RC) 250.00 # Deductible VAT
282
+ Credit 2614 (Output VAT RC) 250.00 # VAT liability
283
+ Credit 2440 (Supplier payables) 1,000.00 # Net to pay
284
+ \`\`\`
285
+
286
+ ### Reverse Charge - Non-EU Services
287
+
288
+ For B2B services from countries outside EU (US, UK, etc.):
289
+
290
+ | Tax Code | Use Case | VAT Handling |
291
+ |----------|----------|--------------|
292
+ | \`SE_VAT_25_PURCHASE_NON_EU_SERVICES_RC\` | US SaaS (AWS, GitHub, etc.) | Reverse charge 25% |
293
+ | \`SE_VAT_12_PURCHASE_NON_EU_SERVICES_RC\` | Reduced rate non-EU services | Reverse charge 12% |
294
+
295
+ **Journal pattern** (US SaaS subscription USD 100 = SEK 1,000):
296
+ \`\`\`
297
+ Debit 5422 (SaaS expense) 1,000.00
298
+ Debit 2645 (Input VAT RC) 250.00
299
+ Credit 2614 (Output VAT RC) 250.00
300
+ Credit 2820 (Credit card) 1,000.00
301
+ \`\`\`
302
+
303
+ ### Reverse Charge - EU Goods
304
+
305
+ Physical goods purchased from EU require different handling:
306
+
307
+ | Tax Code | Use Case |
308
+ |----------|----------|
309
+ | \`SE_VAT_25_PURCHASE_EU_GOODS_RC\` | Hardware, equipment from EU |
310
+ | \`SE_VAT_12_PURCHASE_EU_GOODS_RC\` | Reduced rate goods from EU |
311
+
312
+ ### Sales Tax Codes
313
+
314
+ | Tax Code | Use Case |
315
+ |----------|----------|
316
+ | \`SE_VAT_25_SALE_DOMESTIC\` | Domestic sales 25% |
317
+ | \`SE_VAT_12_SALE_DOMESTIC\` | Domestic sales 12% |
318
+ | \`SE_VAT_6_SALE_DOMESTIC\` | Domestic sales 6% |
319
+ | \`SE_VAT_EXEMPT_SALE_EU\` | B2B sales to EU (reverse charge applies to buyer) |
320
+ | \`SE_VAT_EXEMPT_SALE_EXPORT\` | Sales outside EU (export) |
321
+
322
+ ## Determining the Right Tax Code
323
+
324
+ \`\`\`
325
+ Is the supplier Swedish?
326
+ ├─ YES → Use DOMESTIC tax code
327
+ │ └─ Match VAT rate on invoice (25%, 12%, 6%, or exempt)
328
+
329
+ └─ NO → Is it a service or goods?
330
+
331
+ ├─ SERVICE → Is supplier in EU?
332
+ │ ├─ YES → SE_VAT_25_PURCHASE_EU_SERVICES_RC
333
+ │ └─ NO → SE_VAT_25_PURCHASE_NON_EU_SERVICES_RC
334
+
335
+ └─ GOODS → Is supplier in EU?
336
+ ├─ YES → SE_VAT_25_PURCHASE_EU_GOODS_RC
337
+ └─ NO → Import VAT (customs declaration)
338
+ \`\`\`
339
+
340
+ ## Key VAT Accounts
341
+
342
+ | Account | Swedish Name | Use |
343
+ |---------|-------------|-----|
344
+ | 2610 | Utgående moms 25% | Output VAT on sales |
345
+ | 2611 | Utgående moms 12% | Output VAT 12% |
346
+ | 2612 | Utgående moms 6% | Output VAT 6% |
347
+ | 2614 | Utgående moms omvänd skattskyldighet | Output VAT (reverse charge liability) |
348
+ | 2640 | Ingående moms | Input VAT (general) |
349
+ | 2641 | Ingående moms | Input VAT on domestic purchases |
350
+ | 2645 | Ingående moms omvänd skattskyldighet | Input VAT (reverse charge deduction) |
351
+ | 2650 | Momsredovisningskonto | VAT settlement/clearing |
352
+
353
+ ## VAT Reporting Periods
354
+
355
+ | Annual Turnover | Reporting Frequency |
356
+ |-----------------|---------------------|
357
+ | > SEK 40 million | Monthly |
358
+ | SEK 1-40 million | Quarterly (or monthly by choice) |
359
+ | < SEK 1 million | Annually (or quarterly by choice) |
360
+
361
+ ## Common Scenarios
362
+
363
+ ### US SaaS Subscription (GitHub, AWS, Anthropic)
364
+ - Tax code: \`SE_VAT_25_PURCHASE_NON_EU_SERVICES_RC\`
365
+ - Expense account: 5422 (Software/online services)
366
+ - Balancing: 2820 (credit card) or 2440 (payables)
367
+
368
+ ### EU Software/Service (Hetzner, OVH)
369
+ - Tax code: \`SE_VAT_25_PURCHASE_EU_SERVICES_RC\`
370
+ - Expense account: 5422 or appropriate 5xxx/6xxx
371
+ - Balancing: 2440 or 2820
372
+
373
+ ### Swedish Accounting Service (Bokio, Fortnox)
374
+ - Tax code: \`SE_VAT_25_PURCHASE_DOMESTIC\`
375
+ - Expense account: 6530 (Accounting services)
376
+ - Balancing: 2440
377
+
378
+ ### Bank Charges (Swedish Bank)
379
+ - Tax code: \`SE_VAT_EXEMPT_PURCHASE\` (financial services exempt)
380
+ - Expense account: 6570 (Bank charges)
381
+ - No VAT accounts involved
382
+
383
+ ### Domain Registration (EU or US Registrar)
384
+ - EU: \`SE_VAT_25_PURCHASE_EU_SERVICES_RC\`
385
+ - US: \`SE_VAT_25_PURCHASE_NON_EU_SERVICES_RC\`
386
+ - Expense account: 6230 (Data communication)
387
+ `,
388
+ };
@@ -0,0 +1,2 @@
1
+ import type { Skill } from "./types";
2
+ export declare const TRAVEL_EXPENSES_SKILL: Skill;