Commit ea1cb16c authored by epsi sayidina's avatar epsi sayidina

PPh ps 17: Tarif Progresif

parent b21fe75c
-- penghasilan kena pajak
pkp :: Int
pkp = 1000000000
pkp = 10^9
-- pajak penghasilan = tarif progresif pasal 17
pph :: Int -> Int
pph pkp = round $ pph_rec $ fromIntegral pkp
where
(t1, t2, t3) = (50000000, 250000000, 500000000)
[t1, t2, t3] = map (* 10^6) [50, 250, 500]
pph_rec pkp_r = pkp_guard pkp_r
pkp_guard pkp
| pkp <= t1 = pkp * 0.05
......
-- taxable income
pkp :: Int
pkp = 1000000000
pkp = 10^9
-- income tax using progressive tariff
pph :: Int -> Int
......
......@@ -2,12 +2,12 @@
-- penghasilan kena pajak
pkp :: Int
pkp = 1000000000
pkp = 10^9
-- pajak penghasilan = tarif progresif pasal 17
pph :: Int -> Int
pph pkp = round $ maximum $
[ fromIntegral pkp * fst(x) - snd(x)*(10^6)
[ fromIntegral pkp * fst(x) - snd(x) * (10^6)
| x <- [(0.05, 0), (0.15, 5), (0.25, 30), (0.30, 55)]
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment