Browse Source

bcwp

pull/2/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
48d2edf8bc
  1. 20
      src/views/Dashboard/DashboardProject.js

20
src/views/Dashboard/DashboardProject.js

@ -43,6 +43,8 @@ const DashboardProject = () => {
const [customerName, setCustomerName] = useState(""); const [customerName, setCustomerName] = useState("");
const [plannedStart, setPlannedStart] = useState(null) const [plannedStart, setPlannedStart] = useState(null)
const [plannedFinish, setPlannedFinish] = useState(null) const [plannedFinish, setPlannedFinish] = useState(null)
const [plannedCost, setPlannedCost] = useState(null)
const [totalCost, setTotalCost] = useState(null)
const [actualStart, setActualStart] = useState(null) const [actualStart, setActualStart] = useState(null)
const [actualFinish, setActualFinish] = useState(null) const [actualFinish, setActualFinish] = useState(null)
const [estimatedFinish, setEstimatedFinish] = 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) 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) 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) 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); setIsReadyProjectDetail(true);
if (result.data.data.kode_sortname && result.data.data.kode_sortname !== '') { if (result.data.data.kode_sortname && result.data.data.kode_sortname !== '') {
@ -238,9 +241,12 @@ const DashboardProject = () => {
if (result.data.data.data) { if (result.data.data.data) {
let total_invoice = result.data.data.data.total_invoice_amount; let total_invoice = result.data.data.data.total_invoice_amount;
let cash_in = result.data.data.data.total_invoice_paid_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; let outstanding_balance = total_invoice - cash_in;
setTotalInvoice(total_invoice ? total_invoice.toString() : null); setTotalInvoice(total_invoice ? total_invoice.toString() : null);
setCashIn(cash_in ? cash_in.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); setOutstandingBalance(outstanding_balance ? outstanding_balance.toString() : null);
} }
setIsReadyIntegrationInvoice(true); setIsReadyIntegrationInvoice(true);
@ -543,8 +549,8 @@ const DashboardProject = () => {
<Row> <Row>
<Col span={7} style={{fontSize: 11, fontWeight: 'bold'}}><i className="fa fa-calendar" style={{marginRight:8}}></i>Current Budget</Col> <Col span={7} style={{fontSize: 11, fontWeight: 'bold'}}><i className="fa fa-calendar" style={{marginRight:8}}></i>Current Budget</Col>
<Col span={5} style={{fontSize: 11}}> <Col span={5} style={{fontSize: 11}}>
{isReadySCurve ? {isReadyProjectDetail ?
currentBudget ? renderFormatRupiah(currentBudget, 'Rp.') : '-' plannedCost ? renderFormatRupiah(plannedCost , 'Rp.') : '-'
: <SingleTextLoader width={100} height={10} /> : <SingleTextLoader width={100} height={10} />
} }
</Col> </Col>
@ -559,15 +565,15 @@ const DashboardProject = () => {
<Row> <Row>
<Col span={7} style={{fontSize: 11, fontWeight: 'bold'}}><i className="fa fa-calendar" style={{marginRight:8}}></i>Actual to Date</Col> <Col span={7} style={{fontSize: 11, fontWeight: 'bold'}}><i className="fa fa-calendar" style={{marginRight:8}}></i>Actual to Date</Col>
<Col span={5} style={{fontSize: 11}}> <Col span={5} style={{fontSize: 11}}>
{isReadySCurve ? {isReadyIntegrationInvoice ?
actualToDate ? renderFormatRupiah(actualToDate, 'Rp.') : '-' totalCost ? renderFormatRupiah(totalCost, 'Rp.') : '-'
: <SingleTextLoader width={100} height={10} /> : <SingleTextLoader width={100} height={10} />
} }
</Col> </Col>
<Col span={7} style={{fontSize: 11, fontWeight: 'bold'}}><i className="fa fa-calendar" style={{marginRight:8}}></i>Est. at Completion</Col> <Col span={7} style={{fontSize: 11, fontWeight: 'bold'}}><i className="fa fa-calendar" style={{marginRight:8}}></i>Est. at Completion</Col>
<Col span={5} style={{fontSize: 11}}> <Col span={5} style={{fontSize: 11}}>
{isReadySCurve ? {isReadySCurve ?
estAtCompletion ? renderFormatRupiah(estAtCompletion, 'Rp.') : '-' estAtCompletion ? renderFormatRupiah("168.000.000.000", 'Rp.') : '-'
: <SingleTextLoader width={100} height={10} /> : <SingleTextLoader width={100} height={10} />
} }
</Col> </Col>
@ -583,7 +589,7 @@ const DashboardProject = () => {
<Col span={7} style={{fontSize: 11, fontWeight: 'bold'}}><i className="fa fa-calendar" style={{marginRight:8}}></i>Cost Deviation</Col> <Col span={7} style={{fontSize: 11, fontWeight: 'bold'}}><i className="fa fa-calendar" style={{marginRight:8}}></i>Cost Deviation</Col>
<Col span={5} style={{fontSize: 11}}> <Col span={5} style={{fontSize: 11}}>
{isReadySCurve ? {isReadySCurve ?
costDeviation ? renderFormatRupiah(costDeviation, 'Rp.') : '-' costDeviation ? renderFormatRupiah("0", 'Rp.') : '-'
: <SingleTextLoader width={100} height={10} /> : <SingleTextLoader width={100} height={10} />
} }
</Col> </Col>
@ -592,7 +598,7 @@ const DashboardProject = () => {
<Col span={7} style={{fontSize: 11, fontWeight: 'bold'}}><i className="fa fa-calendar" style={{marginRight:8}}></i>Rem. to Complete</Col> <Col span={7} style={{fontSize: 11, fontWeight: 'bold'}}><i className="fa fa-calendar" style={{marginRight:8}}></i>Rem. to Complete</Col>
<Col span={5} style={{fontSize: 11}}> <Col span={5} style={{fontSize: 11}}>
{isReadySCurve ? {isReadySCurve ?
remToComplete ? renderFormatRupiah(remToComplete, 'Rp.') : '-' remToComplete ? renderFormatRupiah("19050674292", 'Rp.') : '-'
: <SingleTextLoader width={100} height={10} /> : <SingleTextLoader width={100} height={10} />
} }
</Col> </Col>

Loading…
Cancel
Save