{"action":"created","comment":{"url":"https://api.github.com/repos/openfisca/openfisca-france/pulls/comments/172123715","pull_request_review_id":101086673,"id":172123715,"diff_hunk":"@@ -1480,14 +1518,85 @@ class duflot(Variable):\n     def formula_2013_01_01(foyer_fiscal, period, parameters):\n         '''\n         Investissements locatifs interméiaires (loi Duflot)\n-        2013-\n+        2013\n+        '''\n+        f7gh = foyer_fiscal('f7gh', period)\n+        f7gi = foyer_fiscal('f7gi', period)\n+        P = parameters(period).impot_revenu.reductions_impots.duflot\n+\n+        return (\n+            min_(P.plafond - f7gi, f7gh) * P.taux_m + \n+            min_(P.plafond, f7gi) * P.taux_om) / 9\n+\n+    def formula_2014_01_01(foyer_fiscal, period, parameters):\n+        '''\n+        Investissements locatifs intermediaires (loi Duflot)\n+        2014\n+        '''\n+        f7ek = foyer_fiscal('f7ek', period)\n+        f7el = foyer_fiscal('f7el', period)\n+        f7fi = foyer_fiscal('f7fi', period)\n+        f7gh = foyer_fiscal('f7gh', period)\n+        f7gi = foyer_fiscal('f7gi', period)\n+        f7qa = foyer_fiscal('f7qa', period)\n+        f7qb = foyer_fiscal('f7qb', period)\n+        f7qc = foyer_fiscal('f7qc', period)\n+        f7qd = foyer_fiscal('f7qd', period)\n+        P = parameters(period).impot_revenu.reductions_impots.duflot\n+\n+        max1 = max_(0, P.plafond - f7el - f7qd) # 2014 : plafond commun 'duflot' et 'rpinel'\n+        max2 = max_(0, max1 - f7qc)\n+        max3 = max_(0, max2 - f7ek - f7qb)\n+      \n+        return (","path":"openfisca_france/model/prelevements_obligatoires/impot_revenu/reductions_impot.py","position":null,"original_position":161,"commit_id":"2b678075ba8b684392ec6f82dfce8ae3af59ad12","original_commit_id":"20a01cab1ff2f0556cfe51afc3bf4ff1f7b43813","user":{"login":"ClaireLeroyIPP","id":31621856,"avatar_url":"https://avatars3.githubusercontent.com/u/31621856?v=4","gravatar_id":"","url":"https://api.github.com/users/ClaireLeroyIPP","html_url":"https://github.com/ClaireLeroyIPP","followers_url":"https://api.github.com/users/ClaireLeroyIPP/followers","following_url":"https://api.github.com/users/ClaireLeroyIPP/following{/other_user}","gists_url":"https://api.github.com/users/ClaireLeroyIPP/gists{/gist_id}","starred_url":"https://api.github.com/users/ClaireLeroyIPP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClaireLeroyIPP/subscriptions","organizations_url":"https://api.github.com/users/ClaireLeroyIPP/orgs","repos_url":"https://api.github.com/users/ClaireLeroyIPP/repos","events_url":"https://api.github.com/users/ClaireLeroyIPP/events{/privacy}","received_events_url":"https://api.github.com/users/ClaireLeroyIPP/received_events","type":"User","site_admin":false},"body":"cf. PR #909","created_at":"2018-03-05T09:09:31Z","updated_at":"2018-03-05T09:09:31Z","html_url":"https://github.com/openfisca/openfisca-france/pull/910#discussion_r172123715","pull_request_url":"https://api.github.com/repos/openfisca/openfisca-france/pulls/910","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/openfisca/openfisca-france/pulls/comments/172123715"},"html":{"href":"https://github.com/openfisca/openfisca-france/pull/910#discussion_r172123715"},"pull_request":{"href":"https://api.github.com/repos/openfisca/openfisca-france/pulls/910"}},"in_reply_to_id":171245081},"pull_request":{"url":"https://api.github.com/repos/openfisca/openfisca-france/pulls/910","id":170005829,"html_url":"https://github.com/openfisca/openfisca-france/pull/910","diff_url":"https://github.com/openfisca/openfisca-france/pull/910.diff","patch_url":"https://github.com/openfisca/openfisca-france/pull/910.patch","issue_url":"https://api.github.com/repos/openfisca/openfisca-france/issues/910","number":910,"state":"open","locked":false,"title":"Ipp 4 :  Update des réductions d'IR en rapport avec les investissements immobiliers","user":{"login":"ClaireLeroyIPP","id":31621856,"avatar_url":"https://avatars3.githubusercontent.com/u/31621856?v=4","gravatar_id":"","url":"https://api.github.com/users/ClaireLeroyIPP","html_url":"https://github.com/ClaireLeroyIPP","followers_url":"https://api.github.com/users/ClaireLeroyIPP/followers","following_url":"https://api.github.com/users/ClaireLeroyIPP/following{/other_user}","gists_url":"https://api.github.com/users/ClaireLeroyIPP/gists{/gist_id}","starred_url":"https://api.github.com/users/ClaireLeroyIPP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClaireLeroyIPP/subscriptions","organizations_url":"https://api.github.com/users/ClaireLeroyIPP/orgs","repos_url":"https://api.github.com/users/ClaireLeroyIPP/repos","events_url":"https://api.github.com/users/ClaireLeroyIPP/events{/privacy}","received_events_url":"https://api.github.com/users/ClaireLeroyIPP/received_events","type":"User","site_admin":false},"body":"Les modifications de cette PR sont comparées à la branche `ipp-update-credit-and-reduction` (https://github.com/openfisca/openfisca-france/pull/909)\r\n\r\n* Évolution du système socio-fiscal.\r\n* Périodes concernées : principalement à partir du 01/01/2014 \r\n* Zones impactées : \r\n- `openfisca_france/model/prelevements_obligatoires/impot_revenu/reductions_impots.py`.\r\n- `openfisca_france/model/prelevements_obligatoires/impot_revenu/variables_reductions_credits.py`\r\n-  `openfisca_france/parameters/impot_revenu/reductions_impots/` : rpinel, locmeu, scelli\r\n* Détails :\r\n   - Mise à jour des formules (2014-2016) des réductions d'impôts :  'resimm' (réduction d'impot Malraux), 'locmeu' (réduction d'impôt Censi-Bouvard), 'scelli' (réduction d'impôt Scellier) et 'duflot (réduction d'impôt Duflot) qui sont toutes des réductions d'impôts portant sur les investissements immobiliers.\r\n   - Correction de la formule de la réduction Duflot en 2013 (plafonnement)\r\n   - Renommage de paramètres de taux de réduction de manière plus explicite\r\n   - Ajout de la réduction d'impôt Pinel crée en 2014 (variabl 'rpinel') + Paramètres associés\r\n   - Ajout d'inputs variables associées à ces réductions (i.e les nouvelles cases des déclarations fiscales, ex: f7ek)\r\n- - - -\r\n\r\nCes changements :\r\n\r\n- Ajoutent une fonctionnalité (par exemple ajout d'une variable).\r\n- Corrigent ou améliorent un calcul déjà existant.","created_at":"2018-02-19T16:32:51Z","updated_at":"2018-03-05T09:09:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8242662b002d6e77c8a50463ecfe129fe47b27d6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"benjello","id":1175927,"avatar_url":"https://avatars0.githubusercontent.com/u/1175927?v=4","gravatar_id":"","url":"https://api.github.com/users/benjello","html_url":"https://github.com/benjello","followers_url":"https://api.github.com/users/benjello/followers","following_url":"https://api.github.com/users/benjello/following{/other_user}","gists_url":"https://api.github.com/users/benjello/gists{/gist_id}","starred_url":"https://api.github.com/users/benjello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjello/subscriptions","organizations_url":"https://api.github.com/users/benjello/orgs","repos_url":"https://api.github.com/users/benjello/repos","events_url":"https://api.github.com/users/benjello/events{/privacy}","received_events_url":"https://api.github.com/users/benjello/received_events","type":"User","site_admin":false},{"login":"sandcha","id":6567910,"avatar_url":"https://avatars1.githubusercontent.com/u/6567910?v=4","gravatar_id":"","url":"https://api.github.com/users/sandcha","html_url":"https://github.com/sandcha","followers_url":"https://api.github.com/users/sandcha/followers","following_url":"https://api.github.com/users/sandcha/following{/other_user}","gists_url":"https://api.github.com/users/sandcha/gists{/gist_id}","starred_url":"https://api.github.com/users/sandcha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandcha/subscriptions","organizations_url":"https://api.github.com/users/sandcha/orgs","repos_url":"https://api.github.com/users/sandcha/repos","events_url":"https://api.github.com/users/sandcha/events{/privacy}","received_events_url":"https://api.github.com/users/sandcha/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openfisca/openfisca-france/pulls/910/commits","review_comments_url":"https://api.github.com/repos/openfisca/openfisca-france/pulls/910/comments","review_comment_url":"https://api.github.com/repos/openfisca/openfisca-france/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openfisca/openfisca-france/issues/910/comments","statuses_url":"https://api.github.com/repos/openfisca/openfisca-france/statuses/2b678075ba8b684392ec6f82dfce8ae3af59ad12","head":{"label":"openfisca:ipp-update-tax-reductions-immobiliers","ref":"ipp-update-tax-reductions-immobiliers","sha":"2b678075ba8b684392ec6f82dfce8ae3af59ad12","user":{"login":"openfisca","id":1794404,"avatar_url":"https://avatars0.githubusercontent.com/u/1794404?v=4","gravatar_id":"","url":"https://api.github.com/users/openfisca","html_url":"https://github.com/openfisca","followers_url":"https://api.github.com/users/openfisca/followers","following_url":"https://api.github.com/users/openfisca/following{/other_user}","gists_url":"https://api.github.com/users/openfisca/gists{/gist_id}","starred_url":"https://api.github.com/users/openfisca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfisca/subscriptions","organizations_url":"https://api.github.com/users/openfisca/orgs","repos_url":"https://api.github.com/users/openfisca/repos","events_url":"https://api.github.com/users/openfisca/events{/privacy}","received_events_url":"https://api.github.com/users/openfisca/received_events","type":"Organization","site_admin":false},"repo":{"id":15510233,"name":"openfisca-france","full_name":"openfisca/openfisca-france","owner":{"login":"openfisca","id":1794404,"avatar_url":"https://avatars0.githubusercontent.com/u/1794404?v=4","gravatar_id":"","url":"https://api.github.com/users/openfisca","html_url":"https://github.com/openfisca","followers_url":"https://api.github.com/users/openfisca/followers","following_url":"https://api.github.com/users/openfisca/following{/other_user}","gists_url":"https://api.github.com/users/openfisca/gists{/gist_id}","starred_url":"https://api.github.com/users/openfisca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfisca/subscriptions","organizations_url":"https://api.github.com/users/openfisca/orgs","repos_url":"https://api.github.com/users/openfisca/repos","events_url":"https://api.github.com/users/openfisca/events{/privacy}","received_events_url":"https://api.github.com/users/openfisca/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openfisca/openfisca-france","description":"French tax and benefit system for OpenFisca","fork":false,"url":"https://api.github.com/repos/openfisca/openfisca-france","forks_url":"https://api.github.com/repos/openfisca/openfisca-france/forks","keys_url":"https://api.github.com/repos/openfisca/openfisca-france/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openfisca/openfisca-france/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openfisca/openfisca-france/teams","hooks_url":"https://api.github.com/repos/openfisca/openfisca-france/hooks","issue_events_url":"https://api.github.com/repos/openfisca/openfisca-france/issues/events{/number}","events_url":"https://api.github.com/repos/openfisca/openfisca-france/events","assignees_url":"https://api.github.com/repos/openfisca/openfisca-france/assignees{/user}","branches_url":"https://api.github.com/repos/openfisca/openfisca-france/branches{/branch}","tags_url":"https://api.github.com/repos/openfisca/openfisca-france/tags","blobs_url":"https://api.github.com/repos/openfisca/openfisca-france/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openfisca/openfisca-france/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openfisca/openfisca-france/git/refs{/sha}","trees_url":"https://api.github.com/repos/openfisca/openfisca-france/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openfisca/openfisca-france/statuses/{sha}","languages_url":"https://api.github.com/repos/openfisca/openfisca-france/languages","stargazers_url":"https://api.github.com/repos/openfisca/openfisca-france/stargazers","contributors_url":"https://api.github.com/repos/openfisca/openfisca-france/contributors","subscribers_url":"https://api.github.com/repos/openfisca/openfisca-france/subscribers","subscription_url":"https://api.github.com/repos/openfisca/openfisca-france/subscription","commits_url":"https://api.github.com/repos/openfisca/openfisca-france/commits{/sha}","git_commits_url":"https://api.github.com/repos/openfisca/openfisca-france/git/commits{/sha}","comments_url":"https://api.github.com/repos/openfisca/openfisca-france/comments{/number}","issue_comment_url":"https://api.github.com/repos/openfisca/openfisca-france/issues/comments{/number}","contents_url":"https://api.github.com/repos/openfisca/openfisca-france/contents/{+path}","compare_url":"https://api.github.com/repos/openfisca/openfisca-france/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openfisca/openfisca-france/merges","archive_url":"https://api.github.com/repos/openfisca/openfisca-france/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openfisca/openfisca-france/downloads","issues_url":"https://api.github.com/repos/openfisca/openfisca-france/issues{/number}","pulls_url":"https://api.github.com/repos/openfisca/openfisca-france/pulls{/number}","milestones_url":"https://api.github.com/repos/openfisca/openfisca-france/milestones{/number}","notifications_url":"https://api.github.com/repos/openfisca/openfisca-france/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openfisca/openfisca-france/labels{/name}","releases_url":"https://api.github.com/repos/openfisca/openfisca-france/releases{/id}","deployments_url":"https://api.github.com/repos/openfisca/openfisca-france/deployments","created_at":"2013-12-29T15:15:09Z","updated_at":"2018-03-02T10:55:52Z","pushed_at":"2018-03-05T09:07:48Z","git_url":"git://github.com/openfisca/openfisca-france.git","ssh_url":"git@github.com:openfisca/openfisca-france.git","clone_url":"https://github.com/openfisca/openfisca-france.git","svn_url":"https://github.com/openfisca/openfisca-france","homepage":"https://www.openfisca.fr/","size":29130,"stargazers_count":80,"watchers_count":80,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":70,"mirror_url":null,"archived":false,"open_issues_count":113,"license":null,"forks":70,"open_issues":113,"watchers":80,"default_branch":"master"}},"base":{"label":"openfisca:ipp-update-credit-and-reduction","ref":"ipp-update-credit-and-reduction","sha":"b47f2ae26654d5bfc3b8e1f40ee696ee5b533d5f","user":{"login":"openfisca","id":1794404,"avatar_url":"https://avatars0.githubusercontent.com/u/1794404?v=4","gravatar_id":"","url":"https://api.github.com/users/openfisca","html_url":"https://github.com/openfisca","followers_url":"https://api.github.com/users/openfisca/followers","following_url":"https://api.github.com/users/openfisca/following{/other_user}","gists_url":"https://api.github.com/users/openfisca/gists{/gist_id}","starred_url":"https://api.github.com/users/openfisca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfisca/subscriptions","organizations_url":"https://api.github.com/users/openfisca/orgs","repos_url":"https://api.github.com/users/openfisca/repos","events_url":"https://api.github.com/users/openfisca/events{/privacy}","received_events_url":"https://api.github.com/users/openfisca/received_events","type":"Organization","site_admin":false},"repo":{"id":15510233,"name":"openfisca-france","full_name":"openfisca/openfisca-france","owner":{"login":"openfisca","id":1794404,"avatar_url":"https://avatars0.githubusercontent.com/u/1794404?v=4","gravatar_id":"","url":"https://api.github.com/users/openfisca","html_url":"https://github.com/openfisca","followers_url":"https://api.github.com/users/openfisca/followers","following_url":"https://api.github.com/users/openfisca/following{/other_user}","gists_url":"https://api.github.com/users/openfisca/gists{/gist_id}","starred_url":"https://api.github.com/users/openfisca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfisca/subscriptions","organizations_url":"https://api.github.com/users/openfisca/orgs","repos_url":"https://api.github.com/users/openfisca/repos","events_url":"https://api.github.com/users/openfisca/events{/privacy}","received_events_url":"https://api.github.com/users/openfisca/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openfisca/openfisca-france","description":"French tax and benefit system for OpenFisca","fork":false,"url":"https://api.github.com/repos/openfisca/openfisca-france","forks_url":"https://api.github.com/repos/openfisca/openfisca-france/forks","keys_url":"https://api.github.com/repos/openfisca/openfisca-france/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openfisca/openfisca-france/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openfisca/openfisca-france/teams","hooks_url":"https://api.github.com/repos/openfisca/openfisca-france/hooks","issue_events_url":"https://api.github.com/repos/openfisca/openfisca-france/issues/events{/number}","events_url":"https://api.github.com/repos/openfisca/openfisca-france/events","assignees_url":"https://api.github.com/repos/openfisca/openfisca-france/assignees{/user}","branches_url":"https://api.github.com/repos/openfisca/openfisca-france/branches{/branch}","tags_url":"https://api.github.com/repos/openfisca/openfisca-france/tags","blobs_url":"https://api.github.com/repos/openfisca/openfisca-france/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openfisca/openfisca-france/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openfisca/openfisca-france/git/refs{/sha}","trees_url":"https://api.github.com/repos/openfisca/openfisca-france/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openfisca/openfisca-france/statuses/{sha}","languages_url":"https://api.github.com/repos/openfisca/openfisca-france/languages","stargazers_url":"https://api.github.com/repos/openfisca/openfisca-france/stargazers","contributors_url":"https://api.github.com/repos/openfisca/openfisca-france/contributors","subscribers_url":"https://api.github.com/repos/openfisca/openfisca-france/subscribers","subscription_url":"https://api.github.com/repos/openfisca/openfisca-france/subscription","commits_url":"https://api.github.com/repos/openfisca/openfisca-france/commits{/sha}","git_commits_url":"https://api.github.com/repos/openfisca/openfisca-france/git/commits{/sha}","comments_url":"https://api.github.com/repos/openfisca/openfisca-france/comments{/number}","issue_comment_url":"https://api.github.com/repos/openfisca/openfisca-france/issues/comments{/number}","contents_url":"https://api.github.com/repos/openfisca/openfisca-france/contents/{+path}","compare_url":"https://api.github.com/repos/openfisca/openfisca-france/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openfisca/openfisca-france/merges","archive_url":"https://api.github.com/repos/openfisca/openfisca-france/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openfisca/openfisca-france/downloads","issues_url":"https://api.github.com/repos/openfisca/openfisca-france/issues{/number}","pulls_url":"https://api.github.com/repos/openfisca/openfisca-france/pulls{/number}","milestones_url":"https://api.github.com/repos/openfisca/openfisca-france/milestones{/number}","notifications_url":"https://api.github.com/repos/openfisca/openfisca-france/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openfisca/openfisca-france/labels{/name}","releases_url":"https://api.github.com/repos/openfisca/openfisca-france/releases{/id}","deployments_url":"https://api.github.com/repos/openfisca/openfisca-france/deployments","created_at":"2013-12-29T15:15:09Z","updated_at":"2018-03-02T10:55:52Z","pushed_at":"2018-03-05T09:07:48Z","git_url":"git://github.com/openfisca/openfisca-france.git","ssh_url":"git@github.com:openfisca/openfisca-france.git","clone_url":"https://github.com/openfisca/openfisca-france.git","svn_url":"https://github.com/openfisca/openfisca-france","homepage":"https://www.openfisca.fr/","size":29130,"stargazers_count":80,"watchers_count":80,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":70,"mirror_url":null,"archived":false,"open_issues_count":113,"license":null,"forks":70,"open_issues":113,"watchers":80,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openfisca/openfisca-france/pulls/910"},"html":{"href":"https://github.com/openfisca/openfisca-france/pull/910"},"issue":{"href":"https://api.github.com/repos/openfisca/openfisca-france/issues/910"},"comments":{"href":"https://api.github.com/repos/openfisca/openfisca-france/issues/910/comments"},"review_comments":{"href":"https://api.github.com/repos/openfisca/openfisca-france/pulls/910/comments"},"review_comment":{"href":"https://api.github.com/repos/openfisca/openfisca-france/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openfisca/openfisca-france/pulls/910/commits"},"statuses":{"href":"https://api.github.com/repos/openfisca/openfisca-france/statuses/2b678075ba8b684392ec6f82dfce8ae3af59ad12"}},"author_association":"NONE"}}
{"actor":{"display_login":"ClaireLeroyIPP"}}