Published Date : 2021年5月9日5:53

【Androidアプリ:パート16】個人事業主と給与所得者の所得税と住民税を計算するAndroidアプリ
【Android app:Part 16】Android App Calculates Income and Resident Taxes for sole proprietors and 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 app I'm going to show you for calculating income and residence taxes for salaried workers and Individual employers, etc. is just a simple application for playing.

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

​This app 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 app.

個人事業主と給与所得者の所得税と住民税を計算するAndroidアプリパート16。

Android App Calculates Income and Resident Taxes for sole proprietors and salaried workers, Part 16.

前回の続きです。

Continued from last time.

前回の動画で作成したパッケージ内に様々な税金を計算するためのクラスファイル群を作成していきましょう。

Let's create a set of class files within the package we created in the previous video to calculate various taxes.


Responsive image

しかし、コードの内容自体は前回の動画シリーズで作成したものとほぼ一緒なので、おさらい程度に見ていてください。

However, the code itself is pretty much the same as the one you created in the previous video series, so please watch the video with the intention of reviewing.


Responsive image

public Map<String, String> spVDcasualtyLossDeduction(int cld) {
    spPaymentAmountA = cld;
    spCasualtyLossDeduction = cld;

    int lossAmountComp1 = spCasualtyLossDeduction - (int)(super.getSpProvisionalTaxableIncome() * 0.1);
    int lossAmountComp2 = spCasualtyLossDeduction - 50000;

    if (lossAmountComp1 < lossAmountComp2) {
        spCasualtyLossDeduction = lossAmountComp2;
    }
    if (lossAmountComp1 > lossAmountComp2) {
        spCasualtyLossDeduction = lossAmountComp1;
    }
    if (lossAmountComp1 <= 0 && lossAmountComp2 <= 0) {
        spCasualtyLossDeduction = 0;
    }

    Map<String, String> spCasualtyLossDeductionMap = new HashMap<String, String>() {
        {
            put("雑損控除_所得税", String.format("%,d", spCasualtyLossDeduction));
            put("雑損控除_住民税", String.format("%,d", spCasualtyLossDeduction));
        }
    };
    return spCasualtyLossDeductionMap;
}

Responsive image

public Map<String, String> spVDmedicalExpenseDeduction(int med) {
    spPaymentAmountB = med;
    spMedicalExpenseDeduction = med;

    if (spMedicalExpenseDeduction <= 100000) {
        spMedicalExpenseDeduction = 0;
    }

    Map<String, String> spMedicalExpenseDeductionMap = new HashMap<String, String>() {
        {
            put("医療費控除_所得税", String.format("%,d", spMedicalExpenseDeduction));
            put("医療費控除_住民税", String.format("%,d", spMedicalExpenseDeduction));
        }
    };

    return spMedicalExpenseDeductionMap;
}

Responsive image


Responsive image

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Map<String, String> residentTaxMap = new HashMap<String, String>() {
        {
            put("所得控除_住民税", String.format("%,d", spResidentTaxDeduction));
            put("課税所得_住民税", String.format("%,d", spTaxableIncomeForResidentTax));
            put("住民税", String.format("%,d", spResidentTax));
            put("住民税_都民税", String.format("%,d", spTokyoResidentTax));
            put("都民税率", (spTokyoResidentTaxRate * 100) + "%");
            put("均等割額_都民税", String.format("%,d", spFbcOtokyoResidentTax));
            put("調整控除額_都民税", String.format("%,d", spAAtokyoResidentTax));
            put("住民税_区民税", String.format("%,d", spSpecialWardResidentTax));
            put("区民税率", (spSpecialWardResidentTaxRate * 100) + "%");
            put("均等割額_区民税", String.format("%,d", spFbcOspecialWardResidentTax));
            put("調整控除額_区民税", String.format("%,d", spAAspecialWardResidentTax));
            put("住民税の月割", String.format("%,d", spMonthlyResidentTax));

            put("所得控除_住民税(青色)", String.format("%,d", spBrResidentTaxDeduction));
            put("課税所得_住民税(青色)", String.format("%,d", spBrTaxableIncomeForResidentTax));
            put("住民税(青色)", String.format("%,d", spBrResidentTax));
            put("住民税_都民税(青色)", String.format("%,d", spBrTokyoResidentTax));
            put("住民税_区民税(青色)", String.format("%,d", spBrSpecialWardResidentTax));
            put("住民税の月割(青色)", String.format("%,d", spBrMonthlyResidentTax));
        }
    };

    return residentTaxMap;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Responsive image

今回もゆっくりと動画を再生させます。時間が無い方は6倍速くらいで見たほうが丁度いいかもしれません。

I will play the video slowly again this time. If you don't have time, it might be just right to watch at 6 times speed.

控除額の詳しい計算方法は国税庁のホームページを参考にしてください。

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

令和2年度あたりから控除額が変動してますので、逐一国税庁のホームページをチェックすることをお勧めします。

Since the amount of deduction has changed since around 2020, I recommend you to check the website of the National Tax Agency one by one.

パート17へ続く。

Continue to Part 17.



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

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