Merge pull request 'Fix Eror Grafik Realisasi' (#77) from nico/6-mar-26/fix-container-portainer-1 into staggingweb
Reviewed-on: #77
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
import { Paper, Title, Progress, Stack, Text, Group, Box } from '@mantine/core';
|
import { Paper, Title, Progress, Stack, Text, Group, Box } from '@mantine/core';
|
||||||
|
|
||||||
function Summary({ title, data }: any) {
|
function Summary({ title, data }: any) {
|
||||||
@@ -86,20 +85,20 @@ export default function GrafikRealisasi({ apbdesData }: any) {
|
|||||||
const belanja = items.filter((i: any) => i.tipe === 'belanja');
|
const belanja = items.filter((i: any) => i.tipe === 'belanja');
|
||||||
const pembiayaan = items.filter((i: any) => i.tipe === 'pembiayaan');
|
const pembiayaan = items.filter((i: any) => i.tipe === 'pembiayaan');
|
||||||
|
|
||||||
// Hitung total keseluruhan
|
// // Hitung total keseluruhan
|
||||||
const totalAnggaranSemua = items.reduce((s: number, i: any) => s + i.anggaran, 0);
|
// const totalAnggaranSemua = items.reduce((s: number, i: any) => s + i.anggaran, 0);
|
||||||
// Use realisasi field (already mapped from totalRealisasi in transformAPBDesData)
|
// // Use realisasi field (already mapped from totalRealisasi in transformAPBDesData)
|
||||||
const totalRealisasiSemua = items.reduce((s: number, i: any) => s + (i.realisasi || i.totalRealisasi || 0), 0);
|
// const totalRealisasiSemua = items.reduce((s: number, i: any) => s + (i.realisasi || i.totalRealisasi || 0), 0);
|
||||||
const persenSemua = totalAnggaranSemua > 0 ? (totalRealisasiSemua / totalAnggaranSemua) * 100 : 0;
|
// const persenSemua = totalAnggaranSemua > 0 ? (totalRealisasiSemua / totalAnggaranSemua) * 100 : 0;
|
||||||
|
|
||||||
const formatRupiah = (angka: number) => {
|
// const formatRupiah = (angka: number) => {
|
||||||
return new Intl.NumberFormat('id-ID', {
|
// return new Intl.NumberFormat('id-ID', {
|
||||||
style: 'currency',
|
// style: 'currency',
|
||||||
currency: 'IDR',
|
// currency: 'IDR',
|
||||||
minimumFractionDigits: 0,
|
// minimumFractionDigits: 0,
|
||||||
maximumFractionDigits: 0,
|
// maximumFractionDigits: 0,
|
||||||
}).format(angka);
|
// }).format(angka);
|
||||||
};
|
// };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paper withBorder p="md" radius="md">
|
<Paper withBorder p="md" radius="md">
|
||||||
|
|||||||
Reference in New Issue
Block a user