-- PAYE deduction settings for Fiji
-- Applies separately to residents and non-residents
-- Values not provided default to 0 or NULL as appropriate

INSERT INTO deduction_settings (
    name, start_salary, end_salary, base_amount, percent,
    company_contribution, start_date, end_date, applies_to,
    scope, country_id, company_id
) VALUES
    ('PAYE', 0, 30000.0, 0, 0, 0, NULL, NULL, 'resident', 'country', 1, NULL),
    ('PAYE', 30001, 50000.0, 0, 18, 0, NULL, NULL, 'resident', 'country', 1, NULL),
    ('PAYE', 50001, 270000.0, 3600, 20, 0, NULL, NULL, 'resident', 'country', 1, NULL),
    ('PAYE', 270001, 300000.0, 47600, 33, 0, NULL, NULL, 'resident', 'country', 1, NULL),
    ('PAYE', 300001, 350000.0, 57500, 34, 0, NULL, NULL, 'resident', 'country', 1, NULL),
    ('PAYE', 350001, 400000.0, 74500, 35, 0, NULL, NULL, 'resident', 'country', 1, NULL),
    ('PAYE', 400001, 450000.0, 92000, 36, 0, NULL, NULL, 'resident', 'country', 1, NULL),
    ('PAYE', 450001, 500000.0, 110000, 37, 0, NULL, NULL, 'resident', 'country', 1, NULL),
    ('PAYE', 500001, 1000000.0, 128500, 38, 0, NULL, NULL, 'resident', 'country', 1, NULL),
    ('PAYE', 1000001, NULL, 318500, 39, 0, NULL, NULL, 'resident', 'country', 1, NULL),
    ('PAYE', 0, 30000.0, 0, 20, 0, NULL, NULL, 'non_resident', 'country', 1, NULL),
    ('PAYE', 30001, 50000.0, 6000, 20, 0, NULL, NULL, 'non_resident', 'country', 1, NULL),
    ('PAYE', 50001, 270000.0, 10000, 20, 0, NULL, NULL, 'non_resident', 'country', 1, NULL),
    ('PAYE', 270001, 300000.0, 54000, 33, 0, NULL, NULL, 'non_resident', 'country', 1, NULL),
    ('PAYE', 300001, 350000.0, 63900, 34, 0, NULL, NULL, 'non_resident', 'country', 1, NULL),
    ('PAYE', 350001, 400000.0, 80900, 35, 0, NULL, NULL, 'non_resident', 'country', 1, NULL),
    ('PAYE', 400001, 450000.0, 98400, 36, 0, NULL, NULL, 'non_resident', 'country', 1, NULL),
    ('PAYE', 450001, 500000.0, 116400, 37, 0, NULL, NULL, 'non_resident', 'country', 1, NULL),
    ('PAYE', 500001, 1000000.0, 134900, 38, 0, NULL, NULL, 'non_resident', 'country', 1, NULL),
    ('PAYE', 1000001, NULL, 324900, 39, 0, NULL, NULL, 'non_resident', 'country', 1, NULL),
    ('FNPF', 0, NULL, 0, 8, 10, NULL, NULL, 'resident', 'country', 1, NULL);

-- Default application settings
INSERT INTO settings (
    name, value, category, company_id
) VALUES
    ('default_currency', 'FJD', 'finance', NULL),
    ('timezone', 'Pacific/Fiji', 'system', 1);
