๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Lect & Tip/javascript, jQuery

2023๋…„ ์ผ์šฉ์ง ์†Œ๋“์„ธ ๊ณ„์‚ฐ๊ธฐ

by ๋‚ฏ์„ ๊ณต๊ฐ„2019 2023. 7. 3.

๋ชฉ์ฐจ

    2023๋…„ ์ผ์šฉ์ง ์†Œ๋“์„ธ ๊ณ„์‚ฐ๊ธฐ

    ์•„๋ž˜๋Š” JavaScript๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ผ์šฉ์ง ๊ทผ๋กœ์ž์˜ ์†Œ๋“์„ธ๋ฅผ ๊ณ„์‚ฐํ•˜๋Š” ๊ฐ„๋‹จํ•œ ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค.

    function calculateTax(dailyWage) {
        const basicDeduction = 150000; // ๊ธฐ๋ณธ๊ณต์ œ์•ก
        const taxRate = 0.06; // ์„ธ์œจ
        const taxDeductionRate = 0.55; // ์„ธ์•ก๊ณต์ œ์œจ
        const localTaxRate = 0.1; // ์ง€๋ฐฉ์„ธ์œจ
    
        // ๊ณผ์„ธํ‘œ์ค€ ๊ณ„์‚ฐ
        const taxableIncome = dailyWage - basicDeduction;
        if (taxableIncome <= 0) {
            return {
                incomeTax: 0,
                localTax: 0
            };
        }
    
        // ์‚ฐ์ถœ์„ธ์•ก ๊ณ„์‚ฐ
        const calculatedTax = taxableIncome * taxRate;
    
        // ์„ธ์•ก๊ณต์ œ ์ ์šฉ
        const incomeTax = calculatedTax * taxDeductionRate;
    
        // ์ง€๋ฐฉ์†Œ๋“์„ธ ๊ณ„์‚ฐ
        const localTax = incomeTax * localTaxRate;
    
        return {
            incomeTax: incomeTax.toFixed(0),
            localTax: localTax.toFixed(0)
        };
    }
    
    // ์‚ฌ์šฉ ์˜ˆ
    let dailyWage = 200000; // ์ผ๋‹น
    let tax = calculateTax(dailyWage);
    console.log(`๊ทผ๋กœ์†Œ๋“์„ธ: ${tax.incomeTax}์›, ์ง€๋ฐฉ์†Œ๋“์„ธ: ${tax.localTax}์›`);

    ์ด ํ•จ์ˆ˜๋Š” ์ผ๋‹น(dailyWage)์„ ์ธ์ž๋กœ ๋ฐ›์•„, ๊ทผ๋กœ์†Œ๋“์„ธ์™€ ์ง€๋ฐฉ์†Œ๋“์„ธ๋ฅผ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. ๊ณ„์‚ฐ ๊ฒฐ๊ณผ๋Š” ๋ฐ˜์˜ฌ๋ฆผํ•˜์—ฌ ์ •์ˆ˜๋กœ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๊ณผ์„ธํ‘œ์ค€์ด 0 ๋˜๋Š” ์Œ์ˆ˜์ธ ๊ฒฝ์šฐ, ์ฆ‰ ์ผ๋‹น์ด ๊ธฐ๋ณธ๊ณต์ œ์•ก ์ดํ•˜์ธ ๊ฒฝ์šฐ์—๋Š” ์„ธ๊ธˆ์„ ๋‚ฉ๋ถ€ํ•˜์ง€ ์•Š์•„์•ผ ํ•˜๋ฏ€๋กœ ๊ทผ๋กœ์†Œ๋“์„ธ์™€ ์ง€๋ฐฉ์†Œ๋“์„ธ๋ฅผ 0์œผ๋กœ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ์ผ์ผ ์ผ๋‹น์„ ์ž…๋ ฅํ•˜๋ฉด, ํ•ด๋‹น ์ผ๋‹น์— ๋Œ€ํ•œ ๊ทผ๋กœ์†Œ๋“์„ธ์™€ ์ง€๋ฐฉ์†Œ๋“์„ธ๋ฅผ ๊ณ„์‚ฐํ•œ ๊ฒฐ๊ณผ๋ฅผ ์ฝ˜์†”์— ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์ผ๋‹น์„ ๋ณ€๊ฒฝํ•˜์—ฌ ๋‹ค์–‘ํ•œ ๊ฒฝ์šฐ์˜ ์„ธ๊ธˆ์„ ๊ณ„์‚ฐํ•ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    ๋ฐ˜์‘ํ˜•

    ๋Œ“๊ธ€