| | |
| | import json |
| | from IS_taux import calculate_is |
| |
|
| | |
| | with open("IS_taux.json", "r", encoding="utf-8") as f: |
| | RATES = json.load(f) |
| |
|
| | print("Barème IS 2025 chargé :\n") |
| | print(f" Taux normal : {RATES['standard_rate']*100}%") |
| | print(f" Taux réduit PME : 15% jusqu'à {RATES['reduced_rates'][0]['profit_max']:,} €") |
| | print(f" Éligibilité PME : CA < {RATES['eligibility']['turnover_max']:,} € HT, capital libéré, ≥{RATES['eligibility']['ownership_min_individuals']}% détenu par personnes physiques") |
| | print("-" * 80) |
| |
|
| |
|
| | |
| | def print_result(title, result): |
| | print(f"\n{title}") |
| | print(f" → Bénéfice imposable : {result['taxable_profit']:,.2f} €") |
| | print(f" → Impôt IS : {result['tax']:,.2f} €") |
| | print(f" → PME éligible : {'Oui' if result['eligible_sme'] else 'Non'}") |
| | if not result['eligible_sme']: |
| | print(f" Raison : {result['reason']}") |
| | print(f" → Note : {result['note']}") |
| |
|
| |
|
| | |
| |
|
| | print("TESTS DE VÉRIFICATION IS 2025\n") |
| |
|
| | |
| | result = calculate_is( |
| | profit=540000, company_type="SASU", turnover_prev_year=8000000, |
| | ownership_percentage=100, capital_fully_paid=True, bic_regime='real' |
| | ) |
| | print_result("1. PME SASU – Bénéfice 540 000 € (ton cas)", result) |
| | assert result['tax'] == 130750.0, "ERREUR : impôt doit être 130 750 €" |
| | assert result['eligible_sme'] is True |
| |
|
| | |
| | result = calculate_is( |
| | profit=42500, company_type="EURL", turnover_prev_year=5000000, |
| | ownership_percentage=100, capital_fully_paid=True, bic_regime='real' |
| | ) |
| | print_result("2. PME – Bénéfice pile 42 500 €", result) |
| | assert result['tax'] == 6375.0 |
| |
|
| | |
| | result = calculate_is( |
| | profit=100000, company_type="SARL", turnover_prev_year=9000000, |
| | ownership_percentage=80, capital_fully_paid=True, bic_regime='real' |
| | ) |
| | print_result("3. PME – Bénéfice 100 000 €", result) |
| | assert result['tax'] == 6375 + (100000 - 42500) * 0.25 |
| |
|
| | |
| | result = calculate_is( |
| | profit=200000, company_type="SAS", turnover_prev_year=12000000, |
| | ownership_percentage=100, capital_fully_paid=True, bic_regime='real' |
| | ) |
| | print_result("4. NON PME – CA > 10 M€", result) |
| | assert result['tax'] == 200000 * 0.25 |
| | assert result['eligible_sme'] is False |
| |
|
| | |
| | result = calculate_is( |
| | profit=50000, company_type="SASU", turnover_prev_year=5000000, |
| | ownership_percentage=100, capital_fully_paid=False, bic_regime='real' |
| | ) |
| | print_result("5. NON PME – Capital non libéré", result) |
| | assert result['eligible_sme'] is False |
| |
|
| | |
| | result = calculate_is( |
| | profit=150000, company_type="SARL", turnover_prev_year=9000000, |
| | ownership_percentage=100, capital_fully_paid=True, |
| | bic_regime='simplified', activity_type='sales_goods' |
| | ) |
| | print_result("6. Simplifié BIC – Vente marchandises (abattement 71%)", result) |
| | expected_profit = 150000 * (1 - 0.71) |
| | assert abs(result['taxable_profit'] - expected_profit) < 1 |
| |
|
| | |
| | result = calculate_is( |
| | profit=200000, company_type="EURL", turnover_prev_year=5000000, |
| | ownership_percentage=100, capital_fully_paid=True, |
| | bic_regime='simplified', activity_type='sales_goods' |
| | ) |
| | print_result("7. Micro-BIC dépassé (200k > 188.7k)", result) |
| | assert result['taxable_profit'] == 0 |
| | assert "exceeds micro threshold" in result['reason'] |
| |
|
| | |
| | result = calculate_is( |
| | profit=0, company_type="SASU", turnover_prev_year=1000000, |
| | ownership_percentage=100, capital_fully_paid=True, bic_regime='real' |
| | ) |
| | print_result("8. Bénéfice nul", result) |
| | assert result['tax'] == 0 |
| |
|
| | |
| | result = calculate_is( |
| | profit=70000, company_type="SELARL", turnover_prev_year=6000000, |
| | ownership_percentage=75, capital_fully_paid=True, |
| | bic_regime='simplified', activity_type='liberal_professions_bnc' |
| | ) |
| | print_result("9. Simplifié BNC – Profession libérale", result) |
| | expected = 70000 * (1 - 0.34) |
| | assert abs(result['taxable_profit'] - expected) < 1 |
| |
|
| | |
| | result = calculate_is( |
| | profit=100000, company_type="GIE", turnover_prev_year=5000000, |
| | ownership_percentage=100, capital_fully_paid=True, bic_regime='real' |
| | ) |
| | print_result("10. Société non listée (GIE)", result) |
| | assert result['eligible_sme'] is False |
| |
|
| | print("\nTOUS LES TESTS SONT PASSÉS !") |
| | print("Ton calculateur IS 2025 est 100% conforme au barème officiel.") |