From bbfe5c0f3adea95cf4d45221fa0e903048bcb64e Mon Sep 17 00:00:00 2001 From: wahyun Date: Tue, 30 Jul 2024 15:34:43 +0700 Subject: [PATCH 1/3] fix: project expenditure & komen command --- src/views/Dashboard/DashboardBOD.js | 40 ++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/views/Dashboard/DashboardBOD.js b/src/views/Dashboard/DashboardBOD.js index 5601b4f..85c8462 100644 --- a/src/views/Dashboard/DashboardBOD.js +++ b/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) => { ], }} /> - : : -- 2.25.1 From b20d6b26a98489c385ce1e6a67b6b009c17bae33 Mon Sep 17 00:00:00 2001 From: wahyun Date: Tue, 30 Jul 2024 15:35:39 +0700 Subject: [PATCH 2/3] fix: Anggaran Biaya <-> Nilai Kontrak --- src/views/SimproV2/CreatedProyek/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index 3eeae26..1dfed29 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/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) => { -- 2.25.1 From 2f8a76758cd76e06b863350bd479da4c1704e009 Mon Sep 17 00:00:00 2001 From: wahyun Date: Tue, 30 Jul 2024 15:36:00 +0700 Subject: [PATCH 3/3] fix: Anggaran Biaya <-> Nilai Kontrak & Income Year --- src/views/SimproV2/CreatedProyek/ViewProject.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/ViewProject.js b/src/views/SimproV2/CreatedProyek/ViewProject.js index 9456da3..d8cbefe 100644 --- a/src/views/SimproV2/CreatedProyek/ViewProject.js +++ b/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

Nilai Kontrak

-

{currency}. {formatThousand(budget)}

+

 {currency}. {formatThousand(budget)}

@@ -502,7 +505,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha

Pendapatan Pertahun

-

 {valueProyek ?? '-'}

+

 {currency}. {formatThousand(incomeYearly) ?? '-'}

@@ -510,7 +513,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha

Anggaran Biaya

-

 {valueProyek ?? '-'}

+

 {currency}. {formatThousand(valueProyek) ?? '-'}

-- 2.25.1