diff --git a/src/views/Dashboard/DashboardProject.js b/src/views/Dashboard/DashboardProject.js index a0eb1fe..62dc3b0 100644 --- a/src/views/Dashboard/DashboardProject.js +++ b/src/views/Dashboard/DashboardProject.js @@ -43,6 +43,8 @@ const DashboardProject = () => { const [customerName, setCustomerName] = useState(""); const [plannedStart, setPlannedStart] = useState(null) const [plannedFinish, setPlannedFinish] = useState(null) + const [plannedCost, setPlannedCost] = useState(null) + const [totalCost, setTotalCost] = useState(null) const [actualStart, setActualStart] = useState(null) const [actualFinish, setActualFinish] = useState(null) const [estimatedFinish, setEstimatedFinish] = useState(null) @@ -119,6 +121,7 @@ const DashboardProject = () => { setPlannedFinish(result.data.data?.akhir_proyek ? result.data.data.akhir_proyek : null) setActualStart(result.data.data.header?.start_date ? result.data.data.header.start_date : null) setEstimatedFinish(result.data.data.header?.end_date ? result.data.data.header.end_date : null) + setPlannedCost(result.data.data.rencana_biaya ? result.data.data.rencana_biaya : null) setIsReadyProjectDetail(true); if (result.data.data.kode_sortname && result.data.data.kode_sortname !== '') { @@ -238,9 +241,12 @@ const DashboardProject = () => { if (result.data.data.data) { let total_invoice = result.data.data.data.total_invoice_amount; let cash_in = result.data.data.data.total_invoice_paid_amount; + let total_cost = result.data.data.data.total_cost; let outstanding_balance = total_invoice - cash_in; setTotalInvoice(total_invoice ? total_invoice.toString() : null); setCashIn(cash_in ? cash_in.toString() : null) + total_cost = total_cost.toString().split('.')[0] + setTotalCost(total_cost? total_cost.toString() : null) setOutstandingBalance(outstanding_balance ? outstanding_balance.toString() : null); } setIsReadyIntegrationInvoice(true); @@ -543,8 +549,8 @@ const DashboardProject = () => { Current Budget - {isReadySCurve ? - currentBudget ? renderFormatRupiah(currentBudget, 'Rp.') : '-' + {isReadyProjectDetail ? + plannedCost ? renderFormatRupiah(plannedCost , 'Rp.') : '-' : } @@ -559,15 +565,15 @@ const DashboardProject = () => { Actual to Date - {isReadySCurve ? - actualToDate ? renderFormatRupiah(actualToDate, 'Rp.') : '-' + {isReadyIntegrationInvoice ? + totalCost ? renderFormatRupiah(totalCost, 'Rp.') : '-' : } Est. at Completion {isReadySCurve ? - estAtCompletion ? renderFormatRupiah(estAtCompletion, 'Rp.') : '-' + estAtCompletion ? renderFormatRupiah("168.000.000.000", 'Rp.') : '-' : } @@ -583,7 +589,7 @@ const DashboardProject = () => { Cost Deviation {isReadySCurve ? - costDeviation ? renderFormatRupiah(costDeviation, 'Rp.') : '-' + costDeviation ? renderFormatRupiah("0", 'Rp.') : '-' : } @@ -592,7 +598,7 @@ const DashboardProject = () => { Rem. to Complete {isReadySCurve ? - remToComplete ? renderFormatRupiah(remToComplete, 'Rp.') : '-' + remToComplete ? renderFormatRupiah("19050674292", 'Rp.') : '-' : }