add_vat_column.sql 633 B

12345678910111213141516171819
  1. -- Add VAT percentage column to chart_of_accounts table
  2. ALTER TABLE chart_of_accounts
  3. ADD COLUMN vat_percentage DECIMAL(5,2) DEFAULT 0.00
  4. AFTER current_balance;
  5. -- Update existing revenue accounts to have default VAT rates (24% for Finland)
  6. UPDATE chart_of_accounts
  7. SET vat_percentage = 24.00
  8. WHERE account_type = 'revenue';
  9. -- Update existing expense accounts that typically have VAT
  10. UPDATE chart_of_accounts
  11. SET vat_percentage = 24.00
  12. WHERE account_type = 'expense' AND (
  13. account_name LIKE '%rent%' OR
  14. account_name LIKE '%utilities%' OR
  15. account_name LIKE '%supplies%' OR
  16. account_name LIKE '%services%'
  17. );