fix: formatPercentage in report rekapitulasi gangguan
This commit is contained in:
@@ -91,10 +91,14 @@ const formatData = (rawData: any, groupBy: boolean) => {
|
||||
data[nama_uid][i].nama_regu,
|
||||
formatNumber(data[nama_uid][i].total),
|
||||
formatNumber(data[nama_uid][i].total_selesai),
|
||||
formatPercentage((data[nama_uid][i].total_selesai / data[nama_uid][i].total) * 100),
|
||||
formatPercentage(
|
||||
!data[nama_uid][i].total || !data[nama_uid][i].total_selesai
|
||||
? '0%'
|
||||
: (data[nama_uid][i].total_selesai / data[nama_uid][i].total) * 100
|
||||
),
|
||||
formatNumber(data[nama_uid][i].total_inproses),
|
||||
formatPercentage(
|
||||
data[nama_uid][i].total_inproses == null || data[nama_uid][i].total == null
|
||||
!data[nama_uid][i].total_inproses || !data[nama_uid][i].total
|
||||
? '0%'
|
||||
: (data[nama_uid][i].total_inproses / data[nama_uid][i].total) * 100
|
||||
),
|
||||
@@ -149,9 +153,17 @@ const formatData = (rawData: any, groupBy: boolean) => {
|
||||
{ content: 'TOTAL', colSpan: 3, styles: { fontStyle: 'bold' } },
|
||||
formatNumber(total.total_laporan),
|
||||
formatNumber(total.total_laporan_sudah_selesai),
|
||||
formatPercentage((total.total_laporan_sudah_selesai / total.total_laporan) * 100),
|
||||
formatPercentage(
|
||||
!total.total_laporan || !total.total_laporan_sudah_selesai
|
||||
? '0%'
|
||||
: (total.total_laporan_sudah_selesai / total.total_laporan) * 100
|
||||
),
|
||||
formatNumber(total.total_laporan_belum_selesai),
|
||||
formatPercentage((total.total_laporan_belum_selesai / total.total_laporan) * 100),
|
||||
formatPercentage(
|
||||
!total.total_laporan || !total.total_laporan_belum_selesai
|
||||
? '0%'
|
||||
: (total.total_laporan_belum_selesai / total.total_laporan) * 100
|
||||
),
|
||||
formatNumber(total.total_response_time_total),
|
||||
formatNumber(
|
||||
total.total_response_time_rata_rata.length
|
||||
@@ -184,10 +196,14 @@ const formatData = (rawData: any, groupBy: boolean) => {
|
||||
rawData[i].nama_regu,
|
||||
formatNumber(rawData[i].total),
|
||||
formatNumber(rawData[i].total_selesai),
|
||||
formatPercentage((rawData[i].total_selesai / rawData[i].total) * 100),
|
||||
formatPercentage(
|
||||
!rawData[i].total || !rawData[i].total_selesai
|
||||
? '0%'
|
||||
: (rawData[i].total_selesai / rawData[i].total) * 100
|
||||
),
|
||||
formatNumber(rawData[i].total_inproses),
|
||||
formatPercentage(
|
||||
rawData[i].total_inproses == null || rawData[i].total == null
|
||||
!rawData[i].total_inproses || !rawData[i].total
|
||||
? '0%'
|
||||
: (rawData[i].total_inproses / rawData[i].total) * 100
|
||||
),
|
||||
@@ -227,9 +243,17 @@ const formatData = (rawData: any, groupBy: boolean) => {
|
||||
{ content: 'GRAND TOTAL', colSpan: 3, styles: { fontStyle: 'bold' } },
|
||||
formatNumber(grandTotal.total_laporan),
|
||||
formatNumber(grandTotal.total_laporan_sudah_selesai),
|
||||
formatPercentage((grandTotal.total_laporan_sudah_selesai / grandTotal.total_laporan) * 100),
|
||||
formatPercentage(
|
||||
!grandTotal.total_laporan || !grandTotal.total_laporan_sudah_selesai
|
||||
? '0%'
|
||||
: (grandTotal.total_laporan_sudah_selesai / grandTotal.total_laporan) * 100
|
||||
),
|
||||
formatNumber(grandTotal.total_laporan_belum_selesai),
|
||||
formatPercentage((grandTotal.total_laporan_belum_selesai / grandTotal.total_laporan) * 100),
|
||||
formatPercentage(
|
||||
!grandTotal.total_laporan || !grandTotal.total_laporan_belum_selesai
|
||||
? '0%'
|
||||
: (grandTotal.total_laporan_belum_selesai / grandTotal.total_laporan) * 100
|
||||
),
|
||||
formatNumber(grandTotal.total_response_time_total),
|
||||
formatNumber(
|
||||
grandTotal.total_response_time_rata_rata.length
|
||||
|
Reference in New Issue
Block a user