Browse Source

fix: project expenditure label

pull/10/head
wahyun 4 months ago
parent
commit
dfe0ef2bba
  1. 53
      src/views/Dashboard/DashboardBOD.js

53
src/views/Dashboard/DashboardBOD.js

@ -437,20 +437,11 @@ const DashboardBOD = (props) => {
<div style={{ color: '#888888', fontSize: 12 }}>Total Project Expenditure from on-going project.</div> <div style={{ color: '#888888', fontSize: 12 }}>Total Project Expenditure from on-going project.</div>
</div> </div>
{PROJECT_EXPENDITURE ? {PROJECT_EXPENDITURE ?
<>
<div style={{ flex: 6, display: 'flex', justifyContent: 'center', alignItems: 'center' }} onClick={handleGetDetailExpenditure}> <div style={{ flex: 6, display: 'flex', justifyContent: 'center', alignItems: 'center' }} onClick={handleGetDetailExpenditure}>
<div style={{ backgroundColor: '#DDDDDD', color: '#4C4747', borderRadius: 5, padding: 4, fontWeight: 500, cursor: 'pointer', fontSize: 12, textAlign: 'center', lineHeight: 'normal' }}> <div style={{ backgroundColor: '#DDDDDD', color: '#4C4747', borderRadius: 5, padding: 4, fontWeight: 500, cursor: 'pointer', fontSize: 12, textAlign: 'center', lineHeight: 'normal' }}>
Detailed View Detailed View
</div> </div>
</div> </div>
{/* <div style={{ flex: 6, display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<Link to="/dashboard-perproject" style={{ textDecoration: 'none' }}>
<div style={{ backgroundColor: '#DDDDDD', color: '#4C4747', borderRadius: 5, padding: 4, fontWeight: 500, cursor: 'pointer', fontSize: 12, textAlign: 'center', lineHeight: 'normal' }}>
All Dashboard
</div>
</Link>
</div> */}
</>
: :
<div style={{ flex: 6, display: 'flex', justifyContent: 'center', alignItems: 'center' }}> <div style={{ flex: 6, display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<div style={{ backgroundColor: '#DDDDDD', color: '#4C4747', borderRadius: 5, padding: 4, fontWeight: 500, fontSize: 12, textAlign: 'center', lineHeight: 'normal' }}>Detailed View</div> <div style={{ backgroundColor: '#DDDDDD', color: '#4C4747', borderRadius: 5, padding: 4, fontWeight: 500, fontSize: 12, textAlign: 'center', lineHeight: 'normal' }}>Detailed View</div>
@ -475,12 +466,7 @@ const DashboardBOD = (props) => {
y: { y: {
ticks: { ticks: {
autoSkip: false, autoSkip: false,
stepSize: 2, stepSize: 2
// callback: function (value) {
// if (value === 0 || value === null || value === undefined) {
// return '';
// }
// }
} }
} }
}, },
@ -501,38 +487,41 @@ const DashboardBOD = (props) => {
data={{ data={{
labels: [ labels: [
`Target Pendapatan ${moment().format('YYYY')}`, `Target Pendapatan ${moment().format('YYYY')}`,
'Realisasi Pendapatan', 'Income Year',
'Realisasi Cash In', 'Total Nilai Proyek',
'Anggaran Biaya', // 'Anggaran Biaya',
'Realisasi Anggaran Biaya', // 'Realisasi Anggaran Biaya',
'Laba' // 'Laba'
], ],
datasets: [ datasets: [
{ {
label: '', label: '',
data: [ data: [
PROJECT_EXPENDITURE?.total_budget || 0, // PROJECT_EXPENDITURE?.total_budget || 0,
PROJECT_EXPENDITURE?.total_expenditure || 0, // PROJECT_EXPENDITURE?.total_expenditure || 0,
PROJECT_EXPENDITURE?.total_invoice ? Math.floor(PROJECT_EXPENDITURE.total_invoice) : 0, // PROJECT_EXPENDITURE?.total_invoice ? Math.floor(PROJECT_EXPENDITURE.total_invoice) : 0,
PROJECT_EXPENDITURE?.total_paid_invoice || 0, // PROJECT_EXPENDITURE?.total_paid_invoice || 0,
PROJECT_EXPENDITURE?.total_paid_invoice || 0, // PROJECT_EXPENDITURE?.total_paid_invoice || 0,
PROJECT_EXPENDITURE?.total_paid_invoice || 0 // PROJECT_EXPENDITURE?.total_paid_invoice || 0
98000000000,
PROJECT_EXPENDITURE?.total_income_year || 0,
PROJECT_EXPENDITURE?.total_value_proyek || 0
], ],
borderColor: [ borderColor: [
PROJECT_EXPENDITURE_COLOR?.total_budget || '#480ca8', PROJECT_EXPENDITURE_COLOR?.total_budget || '#480ca8',
PROJECT_EXPENDITURE_COLOR?.total_expenditure || '#b5179e', PROJECT_EXPENDITURE_COLOR?.total_expenditure || '#b5179e',
PROJECT_EXPENDITURE_COLOR?.total_invoice || '#a26a16', PROJECT_EXPENDITURE_COLOR?.total_invoice || '#a26a16',
PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#4c4747', // PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#4c4747',
PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#e00000', // PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#e00000',
PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#033a37' // PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#033a37'
], ],
backgroundColor: [ backgroundColor: [
PROJECT_EXPENDITURE_COLOR?.total_budget || '#480ca8', PROJECT_EXPENDITURE_COLOR?.total_budget || '#480ca8',
PROJECT_EXPENDITURE_COLOR?.total_expenditure || '#b5179e', PROJECT_EXPENDITURE_COLOR?.total_expenditure || '#b5179e',
PROJECT_EXPENDITURE_COLOR?.total_invoice || '#a26a16', PROJECT_EXPENDITURE_COLOR?.total_invoice || '#a26a16',
PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#4c4747', // PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#4c4747',
PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#e00000', // PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#e00000',
PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#033a37' // PROJECT_EXPENDITURE_COLOR?.total_paid_invoice || '#033a37'
], ],
borderRadius: 5, borderRadius: 5,
borderSkipped: false borderSkipped: false

Loading…
Cancel
Save