Published Date : 2021年3月29日16:45

パート15: 給与所得者の所得税と住民税を計算するAndroidアプリ
Part 15: Android App Calculates Income and Resident Taxes for Salaried Workers


This blog has an English translation


ニコニコ動画にアップした動画のまとめ記事です。

This is a summary blog post about a video I uploaded to NicoNico.

細かい部分は動画を参考にしてください。

Please refer to the video for details.


目次

Table of Contents




① 動画の説明
① Video Description



警告:

今回説明する給与所得者の所得税及び住民税を計算するツールは、あくまで簡易的なお遊び用のツールです。

正確な数値、計算方法は各自で調べて下さい。

このツールは大雑把に大体の見積りを計算して楽しむ為のツールです。

決して従業員の年末調整や個人の確定申告等に使用しないでください。

さらに、税金の計算方法は変更される場合があり、控除についても同様です。

また、控除や税金の計算方法が間違っている可能性もありますので、

あまり信用せずに、各自で調べてから実験してみてください。

このツールを使って何かしらの損害が発生したとしても、私は一切の責任を負いません。

Warning:

​The tool I'm going to show you for calculating income and residence taxes for salaried workers is just a simple tool for playing.

​Please check the exact number and calculation method by yourself.

​This tool is used to calculate rough estimates and enjoy them.

​Do not use for year-end adjustment of employees or for individual tax return.

In addition, the method of calculating taxes and deductions may change.

Also, there is a possibility that the deduction and tax calculation methods are incorrect.

Don't trust it too much, and test it yourself.

​I will not be liable for any damage caused by using this tool.

前回の続きです。

Continued from last time.

障害者控除の額の場合。

Case of the amount of deduction for persons with disabilities.

case R.id.dForPersonsWDisabilitiesForm:
    Map<String, String> dForPersonsWDisabilitiesMap = taxCalc.vDdForPersonsWDisabilities(
            Integer.parseInt(vd));
    editText.setText(String.format("%,d", Integer.parseInt(vd)));
    incomeDForPersonsWDisabilitiesText.setText(dForPersonsWDisabilitiesMap.get("障害者控除_所得税"));
    residentDForPersonsWDisabilitiesText.setText(dForPersonsWDisabilitiesMap.get("障害者控除_住民税"));
    break;
public Map<String, String> vDdForPersonsWDisabilities(int dpwd) {
    dForPersonsWDisabilities_incomeTax = dpwd;
    if (dForPersonsWDisabilities_incomeTax == 750000) {
        dForPersonsWDisabilities_residentTax = 530000;
    }
    else if (dForPersonsWDisabilities_incomeTax == 400000) {
        dForPersonsWDisabilities_residentTax = 300000;
    }
    else if (dForPersonsWDisabilities_incomeTax == 270000) {
        dForPersonsWDisabilities_residentTax = 260000;
    }
    else {
        dForPersonsWDisabilities_incomeTax = 0;
        dForPersonsWDisabilities_residentTax = 0;
    }

    Map<String, String> dForPersonsWDisabilitiesMap = new HashMap<String, String>() {
        {
            put("障害者控除_所得税", String.format("%,d", dForPersonsWDisabilities_incomeTax));
            put("障害者控除_住民税", String.format("%,d", dForPersonsWDisabilities_residentTax));
        }
    };

    return dForPersonsWDisabilitiesMap;
}

扶養控除まで一気に終わらせましょう。

Let's write the code all the way to the amount of deduction for dependents at once.

詳しい計算方法は国税庁のサイトを参考にしてください。

Please refer to the website of the National Tax Agency for the detailed calculation method.

寡婦控除の額の場合。

Case of the amount of widow deduction.

case R.id.widowsDeductionForm:
    Map<String, String> widowsDeductionMap = taxCalc.vDwidowsDeduction(Integer.parseInt(vd));
    editText.setText(String.format("%,d", Integer.parseInt(vd)));
    widowsIncomeDeductionText.setText(widowsDeductionMap.get("寡婦控除_所得税"));
    widowsResidentDeductionText.setText(widowsDeductionMap.get("寡婦控除_住民税"));
    break;
public Map<String, String> vDwidowsDeduction(int wowd) {
    widowsDeduction_incomeTax = wowd;

    if (widowsDeduction_incomeTax == 270000) {
        widowsDeduction_residentTax = 260000;
    }
    else {
        widowsDeduction_incomeTax = 0;
        widowsDeduction_residentTax = 0;
    }

    Map<String, String> widowsDeductionMap = new HashMap<String, String>() {
        {
            put("寡婦控除_所得税", String.format("%,d", widowsDeduction_incomeTax));
            put("寡婦控除_住民税", String.format("%,d", widowsDeduction_residentTax));
        }
    };

    return widowsDeductionMap;
}

寡夫控除の額の場合。

Case of the amount of widower deduction.

case R.id.widowersDeductionForm:
    Map<String, String> widowersDeductionMap = taxCalc.vDwidowersDeduction(Integer.parseInt(vd));
    editText.setText(String.format("%,d", Integer.parseInt(vd)));
    widowersIncomeDeductionText.setText(widowersDeductionMap.get("寡夫控除_所得税"));
    widowersResidentDeductionText.setText(widowersDeductionMap.get("寡夫控除_住民税"));
    break;
public Map&lt;String, String&gt; vDwidowersDeduction(int wowrd) &#123;
    widowersDeduction_incomeTax = wowrd;

    if (widowersDeduction_incomeTax == 270000) &#123;
        widowersDeduction_residentTax = 260000;
    &#125;
    else &#123;
        widowersDeduction_incomeTax = 0;
        widowersDeduction_residentTax = 0;
    &#125;

    Map&lt;String, String&gt; widowersDeductionMap = new HashMap&lt;String, String&gt;() &#123;
        &#123;
            put(&quot;寡夫控除_所得税&quot;, String.format(&quot;&#037;,d&quot;, widowersDeduction_incomeTax));
            put(&quot;寡夫控除_住民税&quot;, String.format(&quot;&#037;,d&quot;, widowersDeduction_residentTax));
        &#125;
    &#125;;

    return widowersDeductionMap;
&#125;

勤労学生控除の額の場合。

Case of the amount of deduction for working students.

case R.id.dForWorkingStudentsForm:
    Map<String, String> dForWorkingStudentsMap = taxCalc.vDdForWorkingStudents(
            Integer.parseInt(vd));
    editText.setText(String.format("%,d", Integer.parseInt(vd)));
    incomeDForWorkingStudentsText.setText(dForWorkingStudentsMap.get("勤労学生控除_所得税"));
    residentDForWorkingStudentsText.setText(dForWorkingStudentsMap.get("勤労学生控除_住民税"));
    break;
public Map<String, String> vDdForWorkingStudents(int dws) {
    dForWorkingStudents_incomeTax = dws;
    if (dForWorkingStudents_incomeTax == 270000) {
        dForWorkingStudents_residentTax = 260000;
    }
    else {
        dForWorkingStudents_incomeTax = 0;
        dForWorkingStudents_residentTax = 0;
    }
    Map<String, String> dForWorkingStudentsMap = new HashMap<String, String>() {
        {
            put("勤労学生控除_所得税", String.format("%,d", dForWorkingStudents_incomeTax));
            put("勤労学生控除_住民税", String.format("%,d", dForWorkingStudents_residentTax));
        }
    };

    return dForWorkingStudentsMap;
}

扶養控除の額の場合。

Case of the amount of deduction for dependents.

case R.id.dForDependentsForm:
    Map<String, String> dFordependentsMap = taxCalc.vDdFordependents(Integer.parseInt(vd));
    editText.setText(String.format("%,d", Integer.parseInt(vd)));
    incomeDForDependentsText.setText(dFordependentsMap.get("扶養控除_所得税"));
    residentDForDependentsText.setText(dFordependentsMap.get("扶養控除_住民税"));
    break;
public Map<String, String> vDdFordependents(int dfd) {
    dFordependents_incomeTax = dfd;

    if (dFordependents_incomeTax == 380000) {
        dFordependents_residentTax = 330000;
    }
    else if (dFordependents_incomeTax == 630000) {
        dFordependents_residentTax = 450000;
    }
    else if (dFordependents_incomeTax == 480000) {
        dFordependents_residentTax = 380000;
    }
    else if (dFordependents_incomeTax == 580000) {
        dFordependents_residentTax = 450000;
    }
    else {
        dFordependents_incomeTax = 0;
        dFordependents_residentTax = 0;
    }

    Map<String, String> dFordependentsMap = new HashMap<String, String>() {
        {
            put("扶養控除_所得税", String.format("%,d", dFordependents_incomeTax));
            put("扶養控除_住民税", String.format("%,d", dFordependents_residentTax));
        }
    };

    return dFordependentsMap;
}

パート16へ続く。

Continue to Part 16.



以上です。お疲れ様です。

That's all. Thank you for your hard work.