dev-wahyun #12

Merged
farhantock merged 3 commits from dev-wahyun into staging 3 months ago
  1. 40
      src/views/Dashboard/DashboardBOD.js
  2. 9
      src/views/SimproV2/CreatedProyek/ViewProject.js
  3. 14
      src/views/SimproV2/CreatedProyek/index.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 />
:

9
src/views/SimproV2/CreatedProyek/ViewProject.js

@ -25,6 +25,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
const [durasi, setDurasiProyek] = useState("")
const [mulaiProyek, setMulaiProyek] = useState("")
const [valueProyek, setValueProyek] = useState("")
const [incomeYearly, setIncomeYearly] = useState("")
const [scoupeProyek, setScoupeProyek] = useState("")
const [sponsorProyek, setSponsorProyek] = useState("")
const [lateProyek, setLateConsequenceProyek] = useState("")
@ -67,6 +68,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
setDurasiProyek("")
setMulaiProyek("")
setValueProyek("")
setIncomeYearly("")
setScoupeProyek("")
setSponsorProyek("")
setLateConsequenceProyek("")
@ -99,6 +101,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
setDurasiProyek(projectCharter.durasi_proyek);
setMulaiProyek(projectCharter.mulai_proyek);
setValueProyek(projectCharter.value_proyek);
setIncomeYearly(projectCharter.income_year);
setScoupeProyek(projectCharter.scoupe_of_work);
setSponsorProyek(projectCharter.nama_divisi);
setLateConsequenceProyek(projectCharter.late_consequence);
@ -494,7 +497,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
<p style={pStyle}>Nilai Kontrak</p>
</td>
<td colSpan="2" style={tdStyle}>
<p style={{ ...pStyle, fontWeight: 'normal' }}>{currency}. {formatThousand(budget)}</p>
<p>&nbsp;{currency}. {formatThousand(budget)}</p>
</td>
</tr>
<tr>
@ -502,7 +505,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
<p style={pStyle}>Pendapatan Pertahun</p>
</td>
<td colSpan="2" style={tdStyle}>
<p>&nbsp;{valueProyek ?? '-'}</p>
<p>&nbsp;{currency}. {formatThousand(incomeYearly) ?? '-'}</p>
</td>
</tr>
<tr>
@ -510,7 +513,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
<p style={pStyle}>Anggaran Biaya</p>
</td>
<td colSpan="2" style={tdStyle}>
<p>&nbsp;{valueProyek ?? '-'}</p>
<p>&nbsp;{currency}. {formatThousand(valueProyek) ?? '-'}</p>
</td>
</tr>
<tr>

14
src/views/SimproV2/CreatedProyek/index.js

@ -671,8 +671,8 @@ const CreatedProyek = ({ params, ...props }) => {
.catch((error) => error.response);
if (result && result.data && result.data.code == 200) {
const { value_proyek, area_kerja, scoupe_of_work, kode_sortname, nama, mulai_proyek, rencana_biaya, keterangan, durasi_proyek, project_objectives, potential_risk, currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when } = result.data.data;
const dataToSend = { value_proyek, area_kerja, scoupe_of_work, kode_sortname, nama, mulai_proyek, rencana_biaya, keterangan, durasi_proyek, project_objectives, potential_risk, currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when };
const { value_proyek, area_kerja, scoupe_of_work, kode_sortname, nama, mulai_proyek, rencana_biaya, keterangan, durasi_proyek, project_objectives, potential_risk, currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when, income_year } = result.data.data;
const dataToSend = { value_proyek, area_kerja, scoupe_of_work, kode_sortname, nama, mulai_proyek, rencana_biaya, keterangan, durasi_proyek, project_objectives, potential_risk, currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when, income_year };
setProjectCharter(dataToSend);
} else {
NotificationManager.error("Gagal Mengambil Data!!", "Failed");
@ -1476,11 +1476,11 @@ const CreatedProyek = ({ params, ...props }) => {
const data = resData.map((elt) => [
elt.nama,
`Rp. ${formatThousand(elt.rencana_biaya)}`,
`Rp. ${formatThousand(elt.income_year)}`,
`Rp. ${formatThousand(elt.value_proyek)}`,
elt.join_second_name,
elt.join_first_name,
`${moment(elt.mulai_proyek).format(format)} - ${moment(
elt.akhir_proyek
).format(format)}`,
`${moment(elt.mulai_proyek).format(format)} - ${moment(elt.akhir_proyek).format(format)}`,
]);
// Or use javascript directly:
doc.text(4, 15, "Project Charter");
@ -1741,7 +1741,7 @@ const CreatedProyek = ({ params, ...props }) => {
},
},
{
title: "Nilai Kontrak", dataIndex: "value_proyek",
title: "Anggaran Biaya", dataIndex: "value_proyek",
key: "value_proyek",
render: (text, record) => {
const valueProyek = text ?? '-';
@ -1751,7 +1751,7 @@ const CreatedProyek = ({ params, ...props }) => {
},
},
{
title: "Anggaran Biaya",
title: "Nilai Kontrak",
dataIndex: "rencana_biaya",
key: "rencana_biaya",
render: (text, record) => {

Loading…
Cancel
Save