accounting_category_groups_schema.sql 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. -- Accounting category groups schema
  2. -- Groups accounting categories by first three digits of category code
  3. CREATE TABLE IF NOT EXISTS accounting_category_group_names (
  4. id INT AUTO_INCREMENT PRIMARY KEY,
  5. category_group_code VARCHAR(3) NOT NULL,
  6. category_group_name VARCHAR(200) NOT NULL,
  7. description TEXT NULL,
  8. created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  9. updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  10. UNIQUE KEY unique_category_group_code (category_group_code)
  11. );
  12. -- Insert default category groups based on Finnish accounting standards
  13. INSERT IGNORE INTO accounting_category_group_names (category_group_code, category_group_name, description) VALUES
  14. ('300', 'Myyntituotot', 'Sales revenue'),
  15. ('301', 'Myyntituotot', 'Sales revenue'),
  16. ('302', 'Myyntituotot', 'Sales revenue'),
  17. ('303', 'Myyntituotot', 'Sales revenue'),
  18. ('308', 'Myyntituotot', 'Sales revenue'),
  19. ('309', 'Myyntituotot', 'Sales revenue'),
  20. ('310', 'Myyntituotot', 'Sales revenue'),
  21. ('311', 'Myyntituotot', 'Sales revenue'),
  22. ('312', 'Myyntituotot', 'Sales revenue'),
  23. ('313', 'Myyntituotot', 'Sales revenue'),
  24. ('314', 'Myyntituotot', 'Sales revenue'),
  25. ('333', 'Ainekset ja palvelut', 'Cost of goods and services'),
  26. ('334', 'Henkilöstökulut', 'Personnel expenses'),
  27. ('335', 'Poistot ja alaskennaukset', 'Depreciation and write-downs'),
  28. ('336', 'Muut kulut', 'Other expenses'),
  29. ('337', 'Rahoituskulut', 'Financing costs'),
  30. ('341', 'Varausten muutokset', 'Asset changes'),
  31. ('343', 'Varausten myynnit', 'Asset sales'),
  32. ('344', 'Matkakulut', 'Travel expenses'),
  33. ('346', 'Muut kulut', 'Other expenses'),
  34. ('349', 'Poistot', 'Depreciation'),
  35. ('353', 'Varainsiirrot', 'Asset transfers'),
  36. ('354', 'Vähennyskelvottomat kulut', 'Non-deductible expenses'),
  37. ('365', 'Vakuutukset', 'Insurance'),
  38. ('366', 'Verot ja maksut', 'Taxes and fees'),
  39. ('367', 'Yhtiölainat ja muut rahoituskulut', 'Company loans and other financing costs');