From 0a89f4c79653bc52a5ddd6023c2d135dfb1bbe5b Mon Sep 17 00:00:00 2001 From: Muhammad Sulaiman Yusuf Date: Wed, 16 Nov 2022 17:38:05 +0700 Subject: [PATCH] bugfix comma cost plan --- edit-mode/function/ganttConfig.js | 6 ------ edit-mode/function/ganttEvent.js | 9 --------- 2 files changed, 15 deletions(-) diff --git a/edit-mode/function/ganttConfig.js b/edit-mode/function/ganttConfig.js index 1158ce1..0f037c4 100644 --- a/edit-mode/function/ganttConfig.js +++ b/edit-mode/function/ganttConfig.js @@ -87,11 +87,9 @@ gantt.config.auto_scheduling = true; gantt.config.fit_tasks = true; if (!base_url) { base_url = `https://api-iu.ospro.id/api/`; - // console.log("cek base url 2",base_url) }else{ base_url = base_url+"/"; } -// console.log("cek base url 3",base_url) // gantt plugins gantt.plugins({ marker: true, @@ -258,9 +256,6 @@ var allColumns = [ { name: "end_date", label: "Finish Date", align: "center", min_width: 80, editor: editor.end_date, resize: true }, { name: "duration", label: "Duration", align: "center", min_width: 50, editor: editor.duration, resize: true }, { name: "rencana_biaya", label: "Cost Planning", align: "center", min_width: 100, resize: true, template: function (text) { - if(text.id == 2085 || text.id == 2089){ - console.log("text", text); - } if(!text.rencana_biaya){ return } @@ -338,7 +333,6 @@ var allColumns = [ return } let bobot_planning = parseFloat(text.bobot_planning); - // console.log("bobot_planning", bobot_planning); return roundToTwo(bobot_planning); } }, { name: "progress", label: "Actual Progress (%)", align: "center", editor: progressEditor, min_width: 125, template: function (text) { diff --git a/edit-mode/function/ganttEvent.js b/edit-mode/function/ganttEvent.js index ae85693..fba50f6 100644 --- a/edit-mode/function/ganttEvent.js +++ b/edit-mode/function/ganttEvent.js @@ -23,7 +23,6 @@ gantt.attachEvent("onTaskRowClick", function(id,row){ gantt.ext.inlineEditors.attachEvent("onBeforeEditStart", function(state){ let id = parseInt(state.id) let ganttData = gantt.getTask(id); - // console.log("cek ganttData", ganttData); if(ganttData.type_activity && ganttData.type_activity=="header"){ return false } @@ -36,13 +35,11 @@ gantt.ext.inlineEditors.attachEvent("onBeforeEditStart", function(state){ } if(column=="cost_actual"){ - // let ganttData = gantt.getTask(id); let progress = ganttData.progress ? ganttData.progress : 0 if(progress <= 0){ return false } } - // console.log("cek state", state); return true }); @@ -57,18 +54,12 @@ gantt.attachEvent("onBeforeTaskUpdate", function(id,new_item){ progress = progress*100 } progress = progress/100; - // format cost planning - let costPlanning = new_item.rencana_biaya; - costPlanning = replaceAll(costPlanning, ".", ""); - costPlanning = replaceAll(costPlanning, ",", "."); - new_item['rencana_biaya'] = costPlanning; new_item['progress'] = progress; }); gantt.attachEvent("onBeforeLinkAdd", function(id,link){ //any custom logic here - // console.log("cek link", link); let source = link.source; let target = link.target; let parents = gantt.getParent(source);