Fix create admin & progress bar persentase

This commit is contained in:
2025-11-18 17:23:38 +08:00
parent 2608a5ffdd
commit b3c169a2d4
4 changed files with 18 additions and 18 deletions

View File

@@ -115,21 +115,21 @@ function EditAPBDes() {
if (!kode || !uraian) {
return toast.warn('Kode dan uraian wajib diisi');
}
const finalTipe = level === 1 ? 'pendapatan' : tipe; // Berikan default
const selisih = realisasi - anggaran;
const persentase = anggaran > 0 ? (realisasi / anggaran) * 100 : 0;
const finalTipe = level === 1 ? null : tipe;
const selisih = realisasi - anggaran;
const persentase = anggaran > 0 ? (realisasi / anggaran) * 100 : 0;
apbdesState.edit.addItem({
kode,
uraian,
anggaran,
realisasi,
selisih,
persentase,
level,
tipe: finalTipe, // ✅ Tidak akan undefined
});
apbdesState.edit.addItem({
kode,
uraian,
anggaran,
realisasi,
selisih,
persentase,
level,
tipe: finalTipe, // ✅ Tidak akan undefined
});
setNewItem({