-- db: wms2 -- Seeds standard parent (header) COA accounts for every existing company. -- These are grouping-only accounts (is_posting=0); item accounts are added by each company. INSERT IGNORE INTO `ac_account` (company_id, account_code, account_name, account_type, parent_code, is_posting, status) SELECT c.company_id, a.account_code, a.account_name, a.account_type, NULL, 0, 1 FROM ( SELECT '1000' AS account_code, 'Assets' AS account_name, 'asset' AS account_type UNION ALL SELECT '1100', 'Current Assets', 'asset' UNION ALL SELECT '1200', 'Accounts Receivable', 'asset' UNION ALL SELECT '1300', 'Inventory', 'asset' UNION ALL SELECT '1400', 'Other Current Assets', 'asset' UNION ALL SELECT '1500', 'Fixed Assets', 'asset' UNION ALL SELECT '2000', 'Liabilities', 'liability' UNION ALL SELECT '2100', 'Accounts Payable', 'liability' UNION ALL SELECT '2200', 'Output VAT Payable', 'liability' UNION ALL SELECT '2300', 'Other Current Liabilities', 'liability' UNION ALL SELECT '3000', 'Equity', 'equity' UNION ALL SELECT '3100', 'Share Capital', 'equity' UNION ALL SELECT '3200', 'Retained Earnings', 'equity' UNION ALL SELECT '4000', 'Revenue', 'revenue' UNION ALL SELECT '4100', 'Sales Revenue', 'revenue' UNION ALL SELECT '4200', 'Other Income', 'revenue' UNION ALL SELECT '5000', 'Cost of Goods Sold', 'expense' UNION ALL SELECT '6000', 'Operating Expenses', 'expense' UNION ALL SELECT '6100', 'Selling Expenses', 'expense' UNION ALL SELECT '6200', 'General & Administrative Expenses', 'expense' UNION ALL SELECT '7000', 'Financial Expenses', 'expense' UNION ALL SELECT '8000', 'Tax Expenses', 'expense' UNION ALL SELECT '9000', 'Other Expenses', 'expense' ) a CROSS JOIN (SELECT DISTINCT company_id FROM ac_account UNION SELECT company_id FROM ac_period) c;