This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$date_beli = strtotime("2019-11-01"); | |
$nominal_pembelian = 1684900; | |
$persen_penyusutan = 50; | |
$lama_tahun_penyusutan = 4; | |
$string = ""; | |
$sisa_nominal = $nominal_pembelian; | |
if (date("d", $date_beli) <= 15) { | |
$bulan_berjalan = 0; | |
} else { | |
$bulan_berjalan = 1; | |
} | |
for ($aa = 0; $aa < ($lama_tahun_penyusutan); $aa++) { | |
$penyusutan_per_tahun = ROUND((($persen_penyusutan / 100) * $sisa_nominal), 2); | |
if (($aa + 1) == $lama_tahun_penyusutan) { | |
$sisa_nominal = $sisa_nominal; | |
} else { | |
$sisa_nominal = $sisa_nominal - $penyusutan_per_tahun; | |
} | |
echo "Tahun ke-" . ($aa + 1) . ": " . $sisa_nominal . "\n"; | |
for ($bb = 0; $bb < 12; $bb++) { | |
$hitung_bulan = date('m', strtotime("+" . $bulan_berjalan . " months", $date_beli)); | |
$hitung_tahun = date('Y', strtotime("+" . $bulan_berjalan . " months", $date_beli)); | |
echo ($aa + 1) . " - " . ($bb + 1) . " - " . $hitung_bulan . "/" . $hitung_tahun . " - " . ROUND(($sisa_nominal / 12), 2) . "\n"; | |
$bulan_berjalan++; | |
} | |
} | |
?> | |
Tahun ke-1: 842450 | |
1 - 1 - 11/2019 - 70204.166666667 | |
1 - 2 - 12/2019 - 70204.166666667 | |
1 - 3 - 01/2020 - 70204.166666667 | |
1 - 4 - 02/2020 - 70204.166666667 | |
1 - 5 - 03/2020 - 70204.166666667 | |
1 - 6 - 04/2020 - 70204.166666667 | |
1 - 7 - 05/2020 - 70204.166666667 | |
1 - 8 - 06/2020 - 70204.166666667 | |
1 - 9 - 07/2020 - 70204.166666667 | |
1 - 10 - 08/2020 - 70204.166666667 | |
1 - 11 - 09/2020 - 70204.166666667 | |
1 - 12 - 10/2020 - 70204.166666667 | |
Tahun ke-2: 421225 | |
2 - 1 - 11/2020 - 35102.083333333 | |
2 - 2 - 12/2020 - 35102.083333333 | |
2 - 3 - 01/2021 - 35102.083333333 | |
2 - 4 - 02/2021 - 35102.083333333 | |
2 - 5 - 03/2021 - 35102.083333333 | |
2 - 6 - 04/2021 - 35102.083333333 | |
2 - 7 - 05/2021 - 35102.083333333 | |
2 - 8 - 06/2021 - 35102.083333333 | |
2 - 9 - 07/2021 - 35102.083333333 | |
2 - 10 - 08/2021 - 35102.083333333 | |
2 - 11 - 09/2021 - 35102.083333333 | |
2 - 12 - 10/2021 - 35102.083333333 | |
Tahun ke-3: 210612.5 | |
3 - 1 - 11/2021 - 17551.041666667 | |
3 - 2 - 12/2021 - 17551.041666667 | |
3 - 3 - 01/2022 - 17551.041666667 | |
3 - 4 - 02/2022 - 17551.041666667 | |
3 - 5 - 03/2022 - 17551.041666667 | |
3 - 6 - 04/2022 - 17551.041666667 | |
3 - 7 - 05/2022 - 17551.041666667 | |
3 - 8 - 06/2022 - 17551.041666667 | |
3 - 9 - 07/2022 - 17551.041666667 | |
3 - 10 - 08/2022 - 17551.041666667 | |
3 - 11 - 09/2022 - 17551.041666667 | |
3 - 12 - 10/2022 - 17551.041666667 | |
Tahun ke-4: 210612.5 | |
4 - 1 - 11/2022 - 17551.041666667 | |
4 - 2 - 12/2022 - 17551.041666667 | |
4 - 3 - 01/2023 - 17551.041666667 | |
4 - 4 - 02/2023 - 17551.041666667 | |
4 - 5 - 03/2023 - 17551.041666667 | |
4 - 6 - 04/2023 - 17551.041666667 | |
4 - 7 - 05/2023 - 17551.041666667 | |
4 - 8 - 06/2023 - 17551.041666667 | |
4 - 9 - 07/2023 - 17551.041666667 | |
4 - 10 - 08/2023 - 17551.041666667 | |
4 - 11 - 09/2023 - 17551.041666667 | |
4 - 12 - 10/2023 - 17551.041666667 |
Tidak ada komentar:
Posting Komentar