From 6b0ca97b8fa0cabbb526009e11caac59c16eb906 Mon Sep 17 00:00:00 2001 From: ibnu Date: Tue, 12 Dec 2023 06:33:42 +0700 Subject: [PATCH] update log and alert --- edit-mode/function/ganttConfig.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/edit-mode/function/ganttConfig.js b/edit-mode/function/ganttConfig.js index 0c07b6a..c410033 100644 --- a/edit-mode/function/ganttConfig.js +++ b/edit-mode/function/ganttConfig.js @@ -320,7 +320,10 @@ var allColumns = [ { name: "bobot_planning", label: "Bobot (%)", align: "center", editor: editor.bobot_planning, resize: true, min_width: 115, template: function (text) { let bobot = parseFloat(text.bobot_planning); + console.log("bobot roundToTwo ", roundToTwo(bobot)); + console.log("bobot toFixed ", bobot.toFixed(2)); if (bobot.toFixed(2) > 100) { + gantt.alert("Bobot tidak boleh lebih dari 100%!"); return; } @@ -480,10 +483,14 @@ var allColumns = [ name: "progress_actual", label: "Total Actual Progress (%)", align: "center", min_width: 150, template: function (text) { let progress = text.progress progress = progress * 100 + + console.log("progress roundToTwo ", roundToTwo(progress)); + console.log("progress toFixed ", progress.toFixed(2)); if (progress.toFixed(2) > 100) { - gantt.alert("Bobot tidak boleh lebih dari 100%!"); + gantt.alert("Progress tidak boleh lebih dari 100%!"); return; } + let bobot = text.bobot_planning let actual = (progress * bobot) / 100 return roundToTwo(actual);