Browse Source

fix: project expenditure & komen command

dev-wahyun
wahyun 2 months ago
parent
commit
bbfe5c0f3a
  1. 40
      src/views/Dashboard/DashboardBOD.js

40
src/views/Dashboard/DashboardBOD.js

@ -61,7 +61,7 @@ const DashboardBOD = (props) => {
const [READY_TABLE_DETAIL_EXPENDITURE, SET_READY_TABLE_DETAIL_EXPENDITURE] = useState(false);
const [DATA_DETAIL_EXPENDITURE, SET_DATA_DETAIL_EXPENDITURE] = useState([]);
useEffect(() => {
actualProgressProject();
// actualProgressProject();
getCompanyCashFlow(); // expenditure
getCompanyExpenditureColor(); // expenditure Color
getCompanyFinancialHealthColor(); // financial health Color
@ -472,7 +472,34 @@ const DashboardBOD = (props) => {
y: {
ticks: {
autoSkip: false,
stepSize: 2
stepSize: 2,
maxRotation: 0,
minRotation: 0,
callback: function (value) {
const label = this.getLabelForValue(value);
const maxLength = 30;
const splitLabel = (label) => {
if (label.length <= maxLength) {
return [label];
}
const words = label.split(' ');
let lines = [];
let currentLine = '';
words.forEach((word) => {
if (currentLine.length + word.length + 1 <= maxLength) {
currentLine += word + ' ';
} else {
lines.push(currentLine.trim());
currentLine = word + ' ';
}
});
if (currentLine.length > 0) {
lines.push(currentLine.trim());
}
return lines;
};
return splitLabel(label);
},
}
}
},
@ -493,8 +520,8 @@ const DashboardBOD = (props) => {
data={{
labels: [
`Target Pendapatan ${moment().format('YYYY')}`,
'Income Year',
'Total Nilai Proyek',
'Total Nilai Kontrak Yang Sedang Berjalan',
'Target Pendapatan Berdasarkan Kontrak 2024'
// 'Anggaran Biaya',
// 'Realisasi Anggaran Biaya',
// 'Laba'
@ -510,8 +537,8 @@ const DashboardBOD = (props) => {
// 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
PROJECT_EXPENDITURE?.total_value_proyek || 0,
PROJECT_EXPENDITURE?.total_income_year || 0
],
borderColor: [
PROJECT_EXPENDITURE_COLOR?.total_budget || '#480ca8',
@ -535,7 +562,6 @@ const DashboardBOD = (props) => {
],
}}
/>
:
<NoDataChart />
:

Loading…
Cancel
Save