|
|
|
@ -301,7 +301,20 @@ const DashboardBOD = () => {
|
|
|
|
|
if (result.data.data.length > 0) { |
|
|
|
|
let tableData = []; |
|
|
|
|
result.data.data.map((item, idx) => { |
|
|
|
|
let outstanding_balance = item.invoice?.invoiced - item.invoice?.paid; |
|
|
|
|
let outstanding_balance = 0; |
|
|
|
|
if (item.invoice) { |
|
|
|
|
outstanding_balance = item.invoice.invoiced - item.invoice.paid; |
|
|
|
|
if (outstanding_balance < 1) { |
|
|
|
|
outstanding_balance = '-' |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
outstanding_balance = toRupiah(outstanding_balance); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
outstanding_balance = '-'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tableData.push({ |
|
|
|
|
"id": item.id, |
|
|
|
|
"last_gantt_id": item.lastGanttId?.last_gantt_id, |
|
|
|
@ -312,7 +325,7 @@ const DashboardBOD = () => {
|
|
|
|
|
"project_budget": item.rencana_biaya ? toRupiah(item.rencana_biaya) : '-' , |
|
|
|
|
"invoice": item.invoice?.invoiced ? toRupiah(item.invoice.invoiced) : '-', |
|
|
|
|
"cash_in": item.invoice?.paid ? toRupiah(item.invoice.paid) : '-', |
|
|
|
|
"outstanding_balance": toRupiah(outstanding_balance), |
|
|
|
|
"outstanding_balance": outstanding_balance, |
|
|
|
|
"progress": `${item.scurve?.progress ? item.scurve.progress : 0}%` |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|