BalanceSheetOLPA.js 294 KB
Newer Older
Deni Rinaldi's avatar
Deni Rinaldi committed
1 2 3 4 5 6 7 8 9 10 11
import { createMuiTheme, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, FormControlLabel, withStyles, Snackbar } from '@material-ui/core'
import { Alert } from '@material-ui/lab';
import MUIDataTable from 'mui-datatables'
import React, { Component } from 'react'
import NumberFormat from 'react-number-format';
import { PropagateLoader } from 'react-spinners';
import ReactTooltip from 'react-tooltip';
import api from '../../api';
import Images from '../../assets/Images';
import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
Deni Rinaldi's avatar
Deni Rinaldi committed
12
import * as R from 'ramda'
Deni Rinaldi's avatar
Deni Rinaldi committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

const LightTooltip = withStyles((theme) => ({
    tooltip: {
        backgroundColor: theme.palette.common.white,
        color: 'rgba(0, 0, 0, 0.87)',
        boxShadow: theme.shadows[1],
        fontSize: 11,
    },
}))(Tooltip);

var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());

const options = ct.customOptionsFixedColumn();

const style = {
    position: "sticky",
    left: 0,
    zIndex: 101,
    background: "white",
};
const style2 = {
    position: "sticky",
    background: "white",
    zIndex: 100
};

export default class BalanceSheetOLPA extends Component {
    constructor(props) {
        super(props)
        this.state = {
            dataTable: [],
            visibleBalanceSheet: true,
            disabledSave: true,
            editable: false,
            buttonError: false,
            judulColumn: null,
            updateBy: '-',
            handleTekTekTek: 0
        }
    }

    componentDidMount() {
        this.getItemHierarki()
Deni Rinaldi's avatar
Deni Rinaldi committed
57
        this.lastUpdate()
Deni Rinaldi's avatar
Deni Rinaldi committed
58
        // console.log(this.props);
Deni Rinaldi's avatar
Deni Rinaldi committed
59 60
    }

Deni Rinaldi's avatar
Deni Rinaldi committed
61
    lastUpdate() {
Deni Rinaldi's avatar
Deni Rinaldi committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
        let payload = {
            "outlook_pa_id": this.props.outlook_pa_id,
            "report_id": this.props.report_id,
            "revision": this.props.revision,
            "periode": this.props.periode,
            "company_id": this.props.company.company_id
        }
        api.create().getLastestUpdateOLPA(payload).then(response => {
            if (response.data) {
                if (response.data.status === "success") {
                    this.setState({
                        updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
                    })
                }
            }
        })
    }

Deni Rinaldi's avatar
Deni Rinaldi committed
80 81 82
    async getItemHierarki() {
        this.setState({ loading: true, judulColumn: null })
        let payload = {
Deni Rinaldi's avatar
Deni Rinaldi committed
83
            "outlook_pa_id": this.props.outlook_pa_id,
Deni Rinaldi's avatar
Deni Rinaldi committed
84
            "report_id": this.props.report_id,
Deni Rinaldi's avatar
Deni Rinaldi committed
85
            "revision": this.props.revision,
Deni Rinaldi's avatar
Deni Rinaldi committed
86
            "periode": this.props.periode,
Deni Rinaldi's avatar
Deni Rinaldi committed
87
            "company_id": this.props.company.company_id
Deni Rinaldi's avatar
Deni Rinaldi committed
88
        }
Deni Rinaldi's avatar
Deni Rinaldi committed
89
        let response = await api.create().getDetailReportOLPA(payload)
Deni Rinaldi's avatar
Deni Rinaldi committed
90
        console.log(response);
Deni Rinaldi's avatar
Deni Rinaldi committed
91 92 93 94 95 96 97 98 99 100 101 102 103 104
        let dataTable = []
        if (response.data) {
            let res = response.data.data
            const handlePushChild = (item) => {
                let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
                if (indexIDzz === -1) {
                    dataTable.push([
                        item.type_report_id,
                        item.id,
                        item.parent,
                        item.formula,
                        item.level,
                        item.description,
                        item.balance_sheet.total_actual_before === null ? "0" : item.balance_sheet.total_actual_before === "" ? "0" : item.balance_sheet.total_actual_before,
Deni Rinaldi's avatar
Deni Rinaldi committed
105 106 107 108 109 110 111 112 113 114 115 116 117
                        Number(item.balance_sheet.january).toFixed(1),
                        Number(item.balance_sheet.february).toFixed(1),
                        Number(item.balance_sheet.march).toFixed(1),
                        Number(item.balance_sheet.april).toFixed(1),
                        Number(item.balance_sheet.may).toFixed(1),
                        Number(item.balance_sheet.june).toFixed(1),
                        Number(item.balance_sheet.july).toFixed(1),
                        Number(item.balance_sheet.august).toFixed(1),
                        Number(item.balance_sheet.september).toFixed(1),
                        Number(item.balance_sheet.october).toFixed(1),
                        Number(item.balance_sheet.november).toFixed(1),
                        Number(item.balance_sheet.december).toFixed(1),
                        Number(item.balance_sheet.total_current_year).toFixed(1),
Deni Rinaldi's avatar
Deni Rinaldi committed
118
                        item.order,
Deni Rinaldi's avatar
Deni Rinaldi committed
119
                        item.condition_it_should_be,
Deni Rinaldi's avatar
Deni Rinaldi committed
120 121
                        item.condition_if_wrong,
                        item.balance_sheet.forecast_formula == null ? [] : item.balance_sheet.forecast_formula
Deni Rinaldi's avatar
Deni Rinaldi committed
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
                    ])
                }
                if (item.children !== null) {
                    if (item.children.length > 0) {
                        item.children.map((items, indexs) => {
                            handlePushChild(items)
                        })
                    }
                }
            }
            res.map((item, index) => {
                dataTable.push([
                    item.type_report_id,
                    item.id,
                    item.parent,
                    item.formula,
                    item.level,
                    item.description,
                    item.balance_sheet.total_actual_before === null ? "0" : item.balance_sheet.total_actual_before === "" ? "0" : item.balance_sheet.total_actual_before,
Deni Rinaldi's avatar
Deni Rinaldi committed
141 142 143 144 145 146 147 148 149 150 151 152 153
                    Number(item.balance_sheet.january).toFixed(1),
                    Number(item.balance_sheet.february).toFixed(1),
                    Number(item.balance_sheet.march).toFixed(1),
                    Number(item.balance_sheet.april).toFixed(1),
                    Number(item.balance_sheet.may).toFixed(1),
                    Number(item.balance_sheet.june).toFixed(1),
                    Number(item.balance_sheet.july).toFixed(1),
                    Number(item.balance_sheet.august).toFixed(1),
                    Number(item.balance_sheet.september).toFixed(1),
                    Number(item.balance_sheet.october).toFixed(1),
                    Number(item.balance_sheet.november).toFixed(1),
                    Number(item.balance_sheet.december).toFixed(1),
                    Number(item.balance_sheet.total_current_year).toFixed(1),
Deni Rinaldi's avatar
Deni Rinaldi committed
154 155
                    item.order,
                    item.condition_it_should_be,
Deni Rinaldi's avatar
Deni Rinaldi committed
156 157
                    item.condition_if_wrong,
                    item.balance_sheet.forecast_formula == null ? [] : item.balance_sheet.forecast_formula
Deni Rinaldi's avatar
Deni Rinaldi committed
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
                ])
                if (item.children !== null) {
                    if (item.children.length > 0) {
                        item.children.map((items, indexs) => {
                            handlePushChild(items)
                        })
                    }
                }
            })
            this.setState({ dataTable, loading: false, buttonError: true, editable: true })
        } else {
            this.setState({ dataTable, loading: false, buttonError: true, editable: true })
        }
    }

    backToMasterBudget(type) {
        let data = []
        this.state.dataTable.map(i => {
            data.push({
                item_report_id: i[1],
Deni Rinaldi's avatar
Deni Rinaldi committed
178 179 180 181 182 183 184 185 186 187 188 189 190 191
                total_actual_before: String(Number(i[6]).toFixed(1)),
                january: i[0] === 3 && i[7] === "" ? "0.0" : String(Number(i[7]).toFixed(1)),
                february: i[0] === 3 && i[8] === "" ? "0.0" : String(Number(i[8]).toFixed(1)),
                march: i[0] === 3 && i[9] === "" ? "0.0" : String(Number(i[9]).toFixed(1)),
                april: i[0] === 3 && i[10] === "" ? "0.0" : String(Number(i[10]).toFixed(1)),
                may: i[0] === 3 && i[11] === "" ? "0.0" : String(Number(i[11]).toFixed(1)),
                june: i[0] === 3 && i[12] === "" ? "0.0" : String(Number(i[12]).toFixed(1)),
                july: i[0] === 3 && i[13] === "" ? "0.0" : String(Number(i[13]).toFixed(1)),
                august: i[0] === 3 && i[14] === "" ? "0.0" : String(Number(i[14]).toFixed(1)),
                september: i[0] === 3 && i[15] === "" ? "0.0" : String(Number(i[15]).toFixed(1)),
                october: i[0] === 3 && i[16] === "" ? "0.0" : String(Number(i[16]).toFixed(1)),
                november: i[0] === 3 && i[17] === "" ? "0.0" : String(Number(i[17]).toFixed(1)),
                december: i[0] === 3 && i[18] === "" ? "0.0" : String(Number(i[18]).toFixed(1)),
                total_current_year: i[0] === 3 && i[19] === "" ? "0.0" : String(Number(i[19]).toFixed(1)),
Deni Rinaldi's avatar
Deni Rinaldi committed
192 193 194
            })
        })
        let payload = {
Deni Rinaldi's avatar
Deni Rinaldi committed
195
            "outlook_pa_id": this.props.outlook_pa_id,
Deni Rinaldi's avatar
Deni Rinaldi committed
196 197 198 199 200 201 202 203
            "company_id": this.props.company.company_id,
            "periode": this.props.periode,
            "report_id": this.props.report_id,
            "status": type,
            "balance_sheet": data
        }
        // console.log(data);
        this.setState({ loading: false })
Deni Rinaldi's avatar
Deni Rinaldi committed
204
        this.props.saveToOLPA(payload)
Deni Rinaldi's avatar
Deni Rinaldi committed
205 206 207 208 209
        this.props.onClickClose()
    }

    downloadTemplate = async () => {
        let res = await fetch(
faisalhamdi's avatar
faisalhamdi committed
210
            `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/outlook_pa/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
Deni Rinaldi's avatar
Deni Rinaldi committed
211 212
        )
        res = await res.blob()
Deni Rinaldi's avatar
Deni Rinaldi committed
213
        // console.log(res)
Deni Rinaldi's avatar
Deni Rinaldi committed
214 215 216 217
        if (res.size > 0) {
            let url = window.URL.createObjectURL(res);
            let a = document.createElement('a');
            a.href = url;
Deni Rinaldi's avatar
Deni Rinaldi committed
218
            a.download = 'Template Outlook PA Balance Sheet.xlsx';
Deni Rinaldi's avatar
Deni Rinaldi committed
219 220 221 222 223 224 225 226 227 228 229 230 231
            a.click();
        }
    }

    fileHandler = (event) => {
        let fileObj = event
        ExcelRenderer(fileObj, (err, resp) => {
            // console.log(resp)
            if (err) {
                console.log(err);
            }
            else {
                let isi = resp.rows.slice(3)
Deni Rinaldi's avatar
Deni Rinaldi committed
232
                // console.log(resp.rows[2]);
Deni Rinaldi's avatar
Deni Rinaldi committed
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
                let payload = []
                let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
                isi.map((i, index) => {
                    if (i.length > 0) {
                        payload.push({
                            item_report_id: i[0] === undefined ? "" : String(i[0]).trim(),
                            item_report: i[1] === undefined ? "" : String(i[1]).trim(),
                            total_actual_before: i[2] === undefined ? "0" : reg.test(String(i[2])) === false ? "0" : String(i[2]).trim(),
                            january: i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(),
                            february: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
                            march: i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(),
                            april: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(),
                            may: i[7] === undefined ? "0" : reg.test(String(i[7])) === false ? "0" : String(i[7]).trim(),
                            june: i[8] === undefined ? "0" : reg.test(String(i[8])) === false ? "0" : String(i[8]).trim(),
                            july: i[9] === undefined ? "0" : reg.test(String(i[9])) === false ? "0" : String(i[9]).trim(),
                            august: i[10] === undefined ? "0" : reg.test(String(i[10])) === false ? "0" : String(i[10]).trim(),
                            september: i[11] === undefined ? "0" : reg.test(String(i[11])) === false ? "0" : String(i[11]).trim(),
                            october: i[12] === undefined ? "0" : reg.test(String(i[12])) === false ? "0" : String(i[12]).trim(),
                            november: i[13] === undefined ? "0" : reg.test(String(i[13])) === false ? "0" : String(i[13]).trim(),
                            december: i[14] === undefined ? "0" : reg.test(String(i[14])) === false ? "0" : String(i[14]).trim(),
                            total_current_year: i[15] === undefined ? "0" : reg.test(String(i[15])) === false ? "0" : String(i[15]).trim(),
                        })
                    }
                })
                let body = {
                    company_id: this.props.company.company_id,
                    periode: this.props.periode,
                    report_id: this.props.report_id,
                    balance_sheet: payload
                }
Deni Rinaldi's avatar
Deni Rinaldi committed
263
                // console.log(body)
Deni Rinaldi's avatar
Deni Rinaldi committed
264 265 266 267 268 269
                this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] })
            }
        });
    }

    checkUpload() {
Deni Rinaldi's avatar
Deni Rinaldi committed
270
        api.create().checkUploadOLPA(this.state.payload).then(response => {
Deni Rinaldi's avatar
Deni Rinaldi committed
271
            // console.log(JSON.stringify(this.state.payload));
Deni Rinaldi's avatar
Deni Rinaldi committed
272
            console.log(response)
Deni Rinaldi's avatar
Deni Rinaldi committed
273 274 275 276 277 278 279 280 281 282 283 284
            if (response.data) {
                if (response.data.status === 'success') {
                    this.setState({ visibleUpload: false, visibleBalanceSheet: false, loading: true })
                    let dataTable = response.data.data.map((item, index) => {
                        return [
                            item.type_report_id,
                            item.item_report_id,
                            item.parent,
                            item.formula,
                            item.level,
                            item.item_report,
                            item.total_actual_before,
Deni Rinaldi's avatar
Deni Rinaldi committed
285 286 287 288 289 290 291 292 293 294 295 296 297
                            Number(item.january).toFixed(1),
                            Number(item.february).toFixed(1),
                            Number(item.march).toFixed(1),
                            Number(item.april).toFixed(1),
                            Number(item.may).toFixed(1),
                            Number(item.june).toFixed(1),
                            Number(item.july).toFixed(1),
                            Number(item.august).toFixed(1),
                            Number(item.september).toFixed(1),
                            Number(item.october).toFixed(1),
                            Number(item.november).toFixed(1),
                            Number(item.december).toFixed(1),
                            Number(item.total_current_year).toFixed(1),
Deni Rinaldi's avatar
Deni Rinaldi committed
298 299 300
                            item.orders,
                            item.condition_it_should_be,
                            item.condition_if_wrong,
Deni Rinaldi's avatar
Deni Rinaldi committed
301
                            item.forecast_formula == null ? [] : item.forecast_formula,
Deni Rinaldi's avatar
Deni Rinaldi committed
302 303 304
                            item.error
                        ]
                    })
Deni Rinaldi's avatar
Deni Rinaldi committed
305
                    console.log(this.state.dataTable);
Deni Rinaldi's avatar
Deni Rinaldi committed
306 307
                    this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
                        this.state.dataTable.map(item => {
Deni Rinaldi's avatar
Deni Rinaldi committed
308
                            if (item[24].length > 0) {
Deni Rinaldi's avatar
Deni Rinaldi committed
309
                                // console.log('masuk')
Deni Rinaldi's avatar
Deni Rinaldi committed
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
                                this.setState({ buttonError: true, errorPreview: true, editable: true })
                            }
                        })
                        // console.log(this.state.dataTable);
                    })
                }
            }
        })
    }

    uploadBalanceSheet(type) {
        let data = []
        this.state.dataTable.map(i => {
            data.push({
                item_report_id: i[1],
Deni Rinaldi's avatar
Deni Rinaldi committed
325 326 327 328 329 330 331 332 333 334 335 336 337 338
                total_actual_before: String(Number(i[6]).toFixed(1)),
                january: i[0] === 3 && i[7] === "" ? "0.0" : String(Number(i[7]).toFixed(1)),
                february: i[0] === 3 && i[8] === "" ? "0.0" : String(Number(i[8]).toFixed(1)),
                march: i[0] === 3 && i[9] === "" ? "0.0" : String(Number(i[9]).toFixed(1)),
                april: i[0] === 3 && i[10] === "" ? "0.0" : String(Number(i[10]).toFixed(1)),
                may: i[0] === 3 && i[11] === "" ? "0.0" : String(Number(i[11]).toFixed(1)),
                june: i[0] === 3 && i[12] === "" ? "0.0" : String(Number(i[12]).toFixed(1)),
                july: i[0] === 3 && i[13] === "" ? "0.0" : String(Number(i[13]).toFixed(1)),
                august: i[0] === 3 && i[14] === "" ? "0.0" : String(Number(i[14]).toFixed(1)),
                september: i[0] === 3 && i[15] === "" ? "0.0" : String(Number(i[15]).toFixed(1)),
                october: i[0] === 3 && i[16] === "" ? "0.0" : String(Number(i[16]).toFixed(1)),
                november: i[0] === 3 && i[17] === "" ? "0.0" : String(Number(i[17]).toFixed(1)),
                december: i[0] === 3 && i[18] === "" ? "0.0" : String(Number(i[18]).toFixed(1)),
                total_current_year: i[0] === 3 && i[19] === "" ? "0.0" : String(Number(i[19]).toFixed(1)),
Deni Rinaldi's avatar
Deni Rinaldi committed
339 340 341
            })
        })
        let body = {
Deni Rinaldi's avatar
Deni Rinaldi committed
342
            outlook_pa_id: this.props.outlook_pa_id,
Deni Rinaldi's avatar
Deni Rinaldi committed
343 344 345 346 347 348
            company_id: this.props.company.company_id,
            periode: this.props.periode,
            report_id: this.props.report_id,
            balance_sheet: data,
            status: type
        }
Deni Rinaldi's avatar
Deni Rinaldi committed
349
        // console.log(JSON.stringify(body));
Deni Rinaldi's avatar
Deni Rinaldi committed
350
        api.create('UPLOAD').uploadOLPA(body).then(response => {
Deni Rinaldi's avatar
Deni Rinaldi committed
351
            // console.log(response);
Deni Rinaldi's avatar
Deni Rinaldi committed
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
            if (response.data) {
                if (response.data.status === "success") {
                    this.props.onClickClose()
                    this.props.getReport()
                } else {
                    alert(response.data.status)
                }
            } else {
                this.setState({ loading: false })
                alert(response.problem)
            }
        })
    }

    async downloadAllData() {
faisalhamdi's avatar
faisalhamdi committed
367
        let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=${this.props.outlook_pa_id}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
Deni Rinaldi's avatar
Deni Rinaldi committed
368
        // console.log(url);
Deni Rinaldi's avatar
Deni Rinaldi committed
369
        let res = await fetch(
faisalhamdi's avatar
faisalhamdi committed
370
            `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=${this.props.outlook_pa_id === null ? "" : this.props.outlook_pa_id}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
Deni Rinaldi's avatar
Deni Rinaldi committed
371 372 373 374 375 376 377
        )
        res = await res.blob()
        this.setState({ loading: false })
        if (res.size > 0) {
            let url = window.URL.createObjectURL(res);
            let a = document.createElement('a');
            a.href = url;
Deni Rinaldi's avatar
Deni Rinaldi committed
378
            a.download = 'Outlook PA Balance Sheet.xlsx';
Deni Rinaldi's avatar
Deni Rinaldi committed
379 380 381 382 383 384 385 386 387 388 389
            a.click();
        }
    }

    handleValidate() {
        let data = []
        // console.log(this.state.dataTable)
        this.state.dataTable.map(i => {
            data.push({
                item_report_id: i[1],
                total_actual_before: String(i[6]),
Deni Rinaldi's avatar
Deni Rinaldi committed
390 391 392 393 394 395 396 397 398 399 400 401 402
                january: i[0] === 3 && i[7] === "" ? "0.0" : String(Number(i[7]).toFixed(1)),
                february: i[0] === 3 && i[8] === "" ? "0.0" : String(Number(i[8]).toFixed(1)),
                march: i[0] === 3 && i[9] === "" ? "0.0" : String(Number(i[9]).toFixed(1)),
                april: i[0] === 3 && i[10] === "" ? "0.0" : String(Number(i[10]).toFixed(1)),
                may: i[0] === 3 && i[11] === "" ? "0.0" : String(Number(i[11]).toFixed(1)),
                june: i[0] === 3 && i[12] === "" ? "0.0" : String(Number(i[12]).toFixed(1)),
                july: i[0] === 3 && i[13] === "" ? "0.0" : String(Number(i[13]).toFixed(1)),
                august: i[0] === 3 && i[14] === "" ? "0.0" : String(Number(i[14]).toFixed(1)),
                september: i[0] === 3 && i[15] === "" ? "0.0" : String(Number(i[15]).toFixed(1)),
                october: i[0] === 3 && i[16] === "" ? "0.0" : String(Number(i[16]).toFixed(1)),
                november: i[0] === 3 && i[17] === "" ? "0.0" : String(Number(i[17]).toFixed(1)),
                december: i[0] === 3 && i[18] === "" ? "0.0" : String(Number(i[18]).toFixed(1)),
                total_current_year: i[0] === 3 && i[19] === "" ? "0.0" : String(Number(i[19]).toFixed(1)),
Deni Rinaldi's avatar
Deni Rinaldi committed
403 404 405 406
            })
        })
        // console.log(JSON.stringify(data))
        let payload = {
Deni Rinaldi's avatar
Deni Rinaldi committed
407
            "outlook_pa_id": this.props.outlook_pa_id,
Deni Rinaldi's avatar
Deni Rinaldi committed
408 409 410 411 412 413
            "company_id": this.props.company.company_id,
            "periode": this.props.periode,
            "report_id": this.props.report_id,
            "balance_sheet": data,
            "status": "submitted"
        }
Deni Rinaldi's avatar
Deni Rinaldi committed
414
        api.create().validateSubmitReportOLPA(payload).then((response) => {
Deni Rinaldi's avatar
Deni Rinaldi committed
415
            // console.log(response)
Deni Rinaldi's avatar
Deni Rinaldi committed
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445
            if (response.data.data.result) {
                this.setState({ loading: false, buttonError: false, editable: false })
            } else {
                this.setState({ loading: false, buttonError: true, editable: true })
            }
        })
    }

    closeAlert() {
        this.setState({ alert: false })
    }

    render() {
        let dataTable2 = this.state.dataTable
        const handleChange = (value, tableMeta, type) => {
            let val = String(value).split(",").join("")
            if (type === "actual") {
                dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
            } else {
                let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2])
                if (indexParent > 0) {
                    // console.log(indexParent)
                    let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
                    let jagain = dataTable2[indexParent][tableMeta.columnIndex]
                    a = dataTable2[indexParent][tableMeta.columnIndex] = jagain === undefined ? (0 + Number(val)) : (jagain + Number(val))
                } else {
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
                }
            }
        }
Deni Rinaldi's avatar
Deni Rinaldi committed
446

Deni Rinaldi's avatar
Deni Rinaldi committed
447 448 449 450
        const handleValue = (data) => {
            let total = 0
            dataTable2.map((item, index) => {
                if (data.rowData[1] === item[2]) {
Deni Rinaldi's avatar
Deni Rinaldi committed
451 452
                    let itemVal = item[data.columnIndex].value !== undefined ? Number(item[data.columnIndex].value) : Number(item[data.columnIndex])
                    total = item[data.columnIndex] === undefined ? Number(total) + 0 : Number(total) + itemVal
Deni Rinaldi's avatar
Deni Rinaldi committed
453 454 455 456 457 458 459
                }
            })
            let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[data.rowIndex][2])
            let a = dataTable2[data.rowIndex][data.columnIndex] = Number(total)
            // console.log(indexParent);
            return a
        }
idlanirined's avatar
idlanirined committed
460

Deni Rinaldi's avatar
Deni Rinaldi committed
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477

        const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
            let splitFormula = String(tableMeta.rowData[3]).split('@')
            let baru = []
            let anjay = []
            splitFormula.map((item, index) => {
                let items = String(item).substr(Number(String(item).length) - 1, 1)
                let re = /^[a-zA-Z0-9]+$/;
                let asd = ''
                if (item !== "") {
                    if (!re.test(items)) {
                        if (String(item).substr(Number(String(item).length) - 1, 1) === ']') {
                            baru.push(String(item))
                        } else {
                            baru.push(String(item).substr(0, Number(String(item).length) - 1))
                            baru.push(String(item).substr(Number(String(item).length) - 1, 1))
                        }
Deni Rinaldi's avatar
Deni Rinaldi committed
478
                    } else {
Deni Rinaldi's avatar
Deni Rinaldi committed
479
                        baru.push(String(item))
Deni Rinaldi's avatar
Deni Rinaldi committed
480 481 482 483
                    }
                }
            })

Deni Rinaldi's avatar
Deni Rinaldi committed
484 485 486
            baru.map((item, index) => {
                if (item == '-' || item == '+' || item == '/' || item == '*') {
                    anjay.push(item)
Deni Rinaldi's avatar
Deni Rinaldi committed
487
                } else {
Deni Rinaldi's avatar
Deni Rinaldi committed
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551
                    if (String(item).includes('#')) {
                        if (forecast !== undefined) {
                            let forecastt = 0
                            forecast.map((items, index) => {
                                if (items.periode == periode) {
                                    forecastt += Number(items.value)
                                }
                            })
                            anjay.push(forecastt)
                        } else if (String(item).includes('[M-1]')) {
                            let tst = String(item).replace('[M-1]', '')
                            let data = tableMeta.columnIndex == 7 ? 18 : tableMeta.columnIndex - 1
                            let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode
                            // console.log(tableMeta.columnIndex)
                            let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
                            // console.log(indexID)
                            if (indexID !== -1) {
                                let valuezz = tableMeta.rowData[data].formula[indexID].value
                                // baru.push(valuezz)
                                anjay.push(valuezz == "" ? 0 : valuezz)
                                // console.log(valuezz)
                            }
                        } else {
                            // console.log(baru);
                            // console.log(value);
                            let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
                            // console.log(indexID)
                            if (indexID !== -1) {
                                // console.log(value.formula[indexID].value)
                                let valuezz = value.formula[indexID].value
                                anjay.push(valuezz == "" ? 0 : valuezz)
                            }
                        }
                    } else if (String(item).includes('[M-1]')) {
                        let tst = String(item).replace('[M-1]', '')
                        if (tableMeta.columnIndex === 7 || tableMeta.columnIndex === 19) {
                            let indexID = dataTable2.findIndex((val) => val[20] == tst)
                            if (indexID !== -1) {
                                let valuezz = dataTable2[indexID][6]
                                anjay.push(valuezz == "" ? 0 : valuezz)
                            }
                        } else {
                            let data = tableMeta.columnIndex - 1
                            let indexID = dataTable2.findIndex((val) => val[20] == tst)
                            if (indexID !== -1) {
                                let valuezz = dataTable2[indexID][data].value !== undefined ? dataTable2[indexID][data].value : dataTable2[indexID][data]
                                anjay.push(valuezz == "" ? 0 : valuezz)
                            }
                            // console.log(tst, data, tableMeta.rowData[data]);
                        }
                    } else {
                        let indexID = dataTable2.findIndex((val) => val[20] == item)
                        // console.log(dataTable2[indexID])
                        if (indexID !== -1) {
                            let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined ? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value
                            anjay.push(valuezz == "" ? 0 : valuezz)
                        } else {
                            if (item === '(-1)') {
                                anjay.push(-1)
                            }
                            // console.log(item);

                        }
                    }
Deni Rinaldi's avatar
Deni Rinaldi committed
552 553
                }
            })
Deni Rinaldi's avatar
Deni Rinaldi committed
554 555 556
            // console.log(baru)
            // console.log(anjay)

Deni Rinaldi's avatar
Deni Rinaldi committed
557 558
            let total = 0
            let opt = ""
Deni Rinaldi's avatar
Deni Rinaldi committed
559
            anjay.map((item, index) => {
Deni Rinaldi's avatar
Deni Rinaldi committed
560 561 562 563 564 565 566 567 568
                if (item == "+") {
                    opt = "tambah"
                } else if (item == "-") {
                    opt = "kurang"
                } else if (item == "*") {
                    opt = "kali"
                } else if (item == "/") {
                    opt = "bagi"
                } else {
Deni Rinaldi's avatar
Deni Rinaldi committed
569
                    item = item == "" ? 0 : item
Deni Rinaldi's avatar
Deni Rinaldi committed
570 571 572 573 574 575 576
                    if (opt == "tambah") {
                        total = Number(total) + Number(item)
                    } else if (opt == "kurang") {
                        total = Number(total) - Number(item)
                    } else if (opt == "kali") {
                        total = Number(total) * Number(item)
                    } else if (opt == "bagi") {
Deni Rinaldi's avatar
Deni Rinaldi committed
577
                        total = Number(total) / Number(item) == NaN ? 0 : Number(total) / Number(item)
Deni Rinaldi's avatar
Deni Rinaldi committed
578
                    } else {
Deni Rinaldi's avatar
Deni Rinaldi committed
579
                        total += Number(item)
Deni Rinaldi's avatar
Deni Rinaldi committed
580 581 582
                    }
                }
            })
Deni Rinaldi's avatar
Deni Rinaldi committed
583 584 585 586 587 588 589 590 591 592 593 594 595 596
            total = R.equals(total, NaN) ? "0.0" : total

            if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value == undefined) {
                // console.log([tableMeta.rowIndex][tableMeta.columnIndex])
                dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
            } else {
                dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value = total
            }

            return total
        }

        const handleValidation = (data, tableMeta) => {
            let a = handleValueFormula(data, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
597 598 599
            return a
        }

Deni Rinaldi's avatar
Deni Rinaldi committed
600 601 602 603 604 605 606
        const handleForecast = (tableMeta, periode, column) => {
            let total = 0
            total = handleValueFormula(dataTable2[tableMeta.rowIndex][column], tableMeta, column, periode, dataTable2[tableMeta.rowIndex][23])
            // console.log(total)
            return total
        }

Deni Rinaldi's avatar
Deni Rinaldi committed
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670
        const columns = [{
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "Account",
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 300 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style }),
                customBodyRender: (val, tableMeta) => {
                    return (
                        <div style={{ width: 300 }}>
                            {tableMeta.rowData[4] == 0 ?
                                <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
                                :
                                <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
                                    <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
                                </div>
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `31 Dec ${Number(this.props.periode) - 1} Actual`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
                        <Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 ?
                                null
                                : tableMeta.rowData[0] === 1 ?
                                    null :
idlanirined's avatar
idlanirined committed
671 672 673 674 675 676 677 678 679 680 681
                                    // <div style={{ flex: 1 }}>
                                    //     <FormControlLabel
                                    //         style={{ margin: 0 }}
                                    //         value={value}
                                    //         control={
                                    //             <NumberFormat
                                    //                 thousandSeparator={true}
                                    //                 style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //                 type="text"
                                    //                 placeholder=""
                                    //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
682
                                    //                 value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
683 684 685 686
                                    //             />
                                    //         }
                                    //     />
                                    // </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
687 688 689 690 691 692 693
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
idlanirined's avatar
idlanirined committed
694
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
695 696
                                                    type="text"
                                                    placeholder=""
idlanirined's avatar
idlanirined committed
697
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
698
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
699 700 701 702
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
Deni Rinaldi's avatar
Deni Rinaldi committed
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735
                                                />
                                            }
                                        />
                                    </div>
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Jan ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
736
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
737 738
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
739
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
740 741 742 743 744 745
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
746 747 748 749 750 751 752
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
753
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
754 755 756 757 758 759 760 761 762 763 764 765 766
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
767
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
768 769 770 771 772 773
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
774
                                        />
idlanirined's avatar
idlanirined committed
775
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
776 777 778 779 780
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
781 782 783 784 785 786
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
787
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
788 789 790 791 792 793 794 795 796 797 798 799
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
800
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
801 802 803 804 805 806 807 808
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
809 810
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
811 812 813 814 815 816
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
817
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
818 819 820 821 822 823 824 825 826 827 828 829
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
830
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
831 832 833 834 835 836 837 838
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
839 840 841 842 843
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
844
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
845 846 847 848 849 850 851 852 853 854 855 856 857 858
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
859
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
876
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
894
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
895 896 897 898 899 900 901
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
902 903
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
904
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
905 906
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
907
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
908
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
909 910 911
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
912 913
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
914 915 916
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Feb ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
948
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
949 950
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
951
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
952 953 954 955 956 957
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
958 959 960 961 962 963 964
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
965
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
966 967 968 969 970 971 972 973 974 975 976 977 978
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
979
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
980 981 982 983 984 985
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
986
                                        />
idlanirined's avatar
idlanirined committed
987
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
988 989 990 991 992
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
993 994 995 996 997 998
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
999
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1012
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1013 1014 1015 1016 1017 1018 1019 1020
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1021 1022
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
1023 1024 1025 1026 1027 1028
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1029
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1042
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1043 1044 1045 1046 1047 1048 1049 1050
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1051 1052 1053 1054 1055
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1056
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1071
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1088
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1106
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1107 1108 1109 1110 1111 1112 1113
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
1114 1115
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
1116
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1117 1118
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
1119
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1120
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1121 1122 1123
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
1124 1125
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
1126 1127 1128
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Mar ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1160
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1161 1162
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
1163
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
1164 1165 1166 1167 1168 1169
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
1170 1171 1172 1173 1174 1175 1176
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1177
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1191
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1192 1193 1194 1195 1196 1197
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
1198
                                        />
idlanirined's avatar
idlanirined committed
1199
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1200 1201 1202 1203 1204
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
1205 1206 1207 1208 1209 1210
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1211
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1224
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1225 1226 1227 1228 1229 1230 1231 1232
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1233 1234
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
1235 1236 1237 1238 1239 1240
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1241
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1254
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1255 1256 1257 1258 1259 1260 1261 1262
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1263 1264 1265 1266 1267
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1268
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1283
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1300
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1318
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1319 1320 1321 1322 1323 1324 1325
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
1326 1327
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
1328
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1329 1330
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
1331
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1332
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1333 1334 1335
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
1336 1337
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
1338 1339 1340
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Apr ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1372
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1373 1374
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
1375
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
1376 1377 1378 1379 1380 1381
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
1382 1383 1384 1385 1386 1387 1388
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1389
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1403
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1404 1405 1406 1407 1408 1409
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
1410
                                        />
idlanirined's avatar
idlanirined committed
1411
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1412 1413 1414 1415 1416
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
1417 1418 1419 1420 1421 1422
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1423
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1436
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1437 1438 1439 1440 1441 1442 1443 1444
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1445 1446
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
1447 1448 1449 1450 1451 1452
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1453
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1466
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1467 1468 1469 1470 1471 1472 1473 1474
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1475 1476 1477 1478 1479
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1480
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1495
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1512
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1530
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1531 1532 1533 1534 1535 1536 1537
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
1538 1539
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
1540
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1541 1542
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
1543
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1544
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1545 1546 1547
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
1548 1549
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
1550 1551 1552
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `May ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1584
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1585 1586
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
1587
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
1588 1589 1590 1591 1592 1593
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
1594 1595 1596 1597 1598 1599 1600
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1601
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1615
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1616 1617 1618 1619 1620 1621
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
1622
                                        />
idlanirined's avatar
idlanirined committed
1623
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1624 1625 1626 1627 1628
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
1629 1630 1631 1632 1633 1634
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1635
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1648
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1649 1650 1651 1652 1653 1654 1655 1656
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1657 1658
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
1659 1660 1661 1662 1663 1664
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1665
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1678
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1679 1680 1681 1682 1683 1684 1685 1686
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1687 1688 1689 1690 1691
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1692
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1707
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1724
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1742
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1743 1744 1745 1746 1747 1748 1749
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
1750 1751
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
1752
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1753 1754
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
1755
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1756
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1757 1758 1759
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
1760 1761
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
1762 1763 1764
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Jun ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1796
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1797 1798
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
1799
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
1800 1801 1802 1803 1804 1805
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
1806 1807 1808 1809 1810 1811 1812
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1813
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1827
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1828 1829 1830 1831 1832 1833
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
1834
                                        />
idlanirined's avatar
idlanirined committed
1835
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1836 1837 1838 1839 1840
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
1841 1842 1843 1844 1845 1846
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1847
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1860
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1861 1862 1863 1864 1865 1866 1867 1868
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1869 1870
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
1871 1872 1873 1874 1875 1876
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1877
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1890
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1891 1892 1893 1894 1895 1896 1897 1898
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1899 1900 1901 1902 1903
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1904
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1919
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1936
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
1954
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
1955 1956 1957 1958 1959 1960 1961
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
1962 1963
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
1964
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1965 1966
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
1967
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1968
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
1969 1970 1971
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
1972 1973
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
1974 1975 1976
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Jul ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2008
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2009 2010
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
2011
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
2012 2013 2014 2015 2016 2017
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
2018 2019 2020 2021 2022 2023 2024
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2025
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2039
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2040 2041 2042 2043 2044 2045
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
2046
                                        />
idlanirined's avatar
idlanirined committed
2047
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2048 2049 2050 2051 2052
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
2053 2054 2055 2056 2057 2058
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2059
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2072
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2073 2074 2075 2076 2077 2078 2079 2080
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2081 2082
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
2083 2084 2085 2086 2087 2088
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2089
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2102
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2103 2104 2105 2106 2107 2108 2109 2110
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2111 2112 2113 2114 2115
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
2116
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2131
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2148
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2166
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2167 2168 2169 2170 2171 2172 2173
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
2174 2175
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
2176
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
2177 2178
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
2179
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2180
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2181 2182 2183
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
2184 2185
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
2186 2187 2188
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Aug ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2220
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2221 2222
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
2223
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
2224 2225 2226 2227 2228 2229
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
2230 2231 2232 2233 2234 2235 2236
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2237
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2251
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2252 2253 2254 2255 2256 2257
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
2258
                                        />
idlanirined's avatar
idlanirined committed
2259
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2260 2261 2262 2263 2264
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
2265 2266 2267 2268 2269 2270
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2271
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2284
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2285 2286 2287 2288 2289 2290 2291 2292
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2293 2294
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
2295 2296 2297 2298 2299 2300
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2301
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2314
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2315 2316 2317 2318 2319 2320 2321 2322
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2323 2324 2325 2326 2327
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
2328
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2343
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2360
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2378
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2379 2380 2381 2382 2383 2384 2385
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
2386 2387
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
2388
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
2389 2390
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
2391
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2392
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2393 2394 2395
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
2396 2397
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
2398 2399 2400
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Sep ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2432
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2433 2434
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
2435
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
2436 2437 2438 2439 2440 2441
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
2442 2443 2444 2445 2446 2447 2448
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2449
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2463
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2464 2465 2466 2467 2468 2469
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
2470
                                        />
idlanirined's avatar
idlanirined committed
2471
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2472 2473 2474 2475 2476
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
2477 2478 2479 2480 2481 2482
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2483
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2496
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2497 2498 2499 2500 2501 2502 2503 2504
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2505 2506
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
2507 2508 2509 2510 2511 2512
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2513
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2526
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2527 2528 2529 2530 2531 2532 2533 2534
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2535 2536 2537 2538 2539
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
2540
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2555
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2572
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2590
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2591 2592 2593 2594 2595 2596 2597
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
2598 2599
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
2600
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
2601 2602
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
2603
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2604
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2605 2606 2607
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
2608 2609
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
2610 2611 2612
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Oct ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2644
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2645 2646
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
2647
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
2648 2649 2650 2651 2652 2653
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
2654 2655 2656 2657 2658 2659 2660
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2661
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2675
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2676 2677 2678 2679 2680 2681
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
2682
                                        />
idlanirined's avatar
idlanirined committed
2683
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2684 2685 2686 2687 2688
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
2689 2690 2691 2692 2693 2694
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2695
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2708
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2709 2710 2711 2712 2713 2714 2715 2716
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2717 2718
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
2719 2720 2721 2722 2723 2724
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2725
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2738
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2739 2740 2741 2742 2743 2744 2745 2746
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2747 2748 2749 2750 2751
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
2752
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2767
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2784
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2802
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2803 2804 2805 2806 2807 2808 2809
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
2810 2811
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
2812
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
2813 2814
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
2815
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2816
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2817 2818 2819
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
2820 2821
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
2822 2823 2824
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Nov ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2856
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2857 2858
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
2859
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
2860 2861 2862 2863 2864 2865
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
2866 2867 2868 2869 2870 2871 2872
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2873
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2887
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2888 2889 2890 2891 2892 2893
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
2894
                                        />
idlanirined's avatar
idlanirined committed
2895
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2896 2897 2898 2899 2900
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
2901 2902 2903 2904 2905 2906
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2907
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2920
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2921 2922 2923 2924 2925 2926 2927 2928
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2929 2930
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
2931 2932 2933 2934 2935 2936
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2937
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
2950
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
2951 2952 2953 2954 2955 2956 2957 2958
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
2959 2960 2961 2962 2963
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
2964
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2979
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
2996
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3014
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3015 3016 3017 3018 3019 3020 3021
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
3022 3023
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
3024
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
3025 3026
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
3027
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3028
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
3029 3030 3031
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
3032 3033
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
3034 3035 3036
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Dec ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3068
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3069 3070
                                                onBlur={(event) => {
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
3071
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
3072 3073 3074 3075 3076 3077
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
3078 3079 3080 3081 3082 3083 3084
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3085
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3099
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
3100 3101 3102 3103 3104 3105
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
3106
                                        />
idlanirined's avatar
idlanirined committed
3107
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3108 3109 3110 3111 3112
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
3113 3114 3115 3116 3117 3118
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3119
                                            //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3132
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
3133 3134 3135 3136 3137 3138 3139 3140
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3141 3142
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
3143 3144 3145 3146 3147 3148
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3149
                                                //     value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3162
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
3163 3164 3165 3166 3167 3168 3169 3170
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3171 3172 3173 3174 3175
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
3176
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3191
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3208
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3226
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3227 3228 3229 3230 3231 3232 3233
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
3234 3235
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
3236
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
3237 3238
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
3239
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3240
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
3241 3242 3243
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
3244 3245
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
3246 3247 3248
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
        }, {
            name: "Current Total",
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
                        <Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 3 ?
                                <div style={{ flex: 1 }}>
                                    <FormControlLabel
                                        style={{ margin: 0 }}
                                        value={value}
                                        control={
                                            <NumberFormat
                                                thousandSeparator={true}
                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                type="text"
                                                placeholder=""
                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3280
                                                value={Number(value).toFixed(1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3281 3282 3283
                                                onBlur={(event) => {
                                                    // updateValue(event.target.value)
                                                    handleChange(event.target.value, tableMeta)
Deni Rinaldi's avatar
Deni Rinaldi committed
3284
                                                    // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
3285 3286 3287 3288 3289 3290
                                                }}
                                            />
                                        }
                                    />
                                </div> :
                                tableMeta.rowData[0] === 2 ?
idlanirined's avatar
idlanirined committed
3291 3292 3293 3294 3295 3296 3297
                                    // <span style={{ fontSize: 12, textAlign: 'right' }}>
                                    //     <NumberFormat
                                    //         thousandSeparator={true}
                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    //         type="text"
                                    //         placeholder=""
                                    //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3298
                                    //         value={Number(handleValue(tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311
                                    //     />
                                    // </span>
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3312
                                                    value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
3313 3314 3315 3316 3317 3318
                                                    onBlur={(event) => {
                                                        handleChange(event.target.value, tableMeta)
                                                        // console.log(dataTable2)
                                                    }}
                                                />
                                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
3319
                                        />
idlanirined's avatar
idlanirined committed
3320
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3321 3322 3323 3324 3325
                                    :
                                    tableMeta.rowData[0] === 4 ?
                                        null
                                        :
                                        tableMeta.rowData[0] === 6 ?
idlanirined's avatar
idlanirined committed
3326 3327 3328 3329 3330 3331
                                            // <NumberFormat
                                            //     thousandSeparator={true}
                                            //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                            //     type="text"
                                            //     placeholder=""
                                            //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3332
                                            //     value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344
                                            // />
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={value}
                                                    control={
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3345
                                                            value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
3346 3347 3348 3349 3350 3351 3352 3353
                                                            onBlur={(event) => {
                                                                handleChange(event.target.value, tableMeta)
                                                                // console.log(dataTable2)
                                                            }}
                                                        />
                                                    }
                                                />
                                            </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3354 3355
                                            :
                                            tableMeta.rowData[0] === 5 ?
idlanirined's avatar
idlanirined committed
3356 3357 3358 3359 3360 3361
                                                // <NumberFormat
                                                //     thousandSeparator={true}
                                                //     style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                //     type="text"
                                                //     placeholder=""
                                                //     disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3362
                                                //     value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374
                                                // />
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value}
                                                        control={
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3375
                                                                value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
3376 3377 3378 3379 3380 3381 3382 3383
                                                                onBlur={(event) => {
                                                                    handleChange(event.target.value, tableMeta)
                                                                    // console.log(dataTable2)
                                                                }}
                                                            />
                                                        }
                                                    />
                                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398
                                                :
                                                tableMeta.rowData[0] === 1 ?
                                                    // value === "" ?
                                                    //     null :
                                                    //     <NumberFormat
                                                    //         thousandSeparator={true}
                                                    //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    //         type="text"
                                                    //         placeholder=""
                                                    //         disabled={true}
                                                    //         value={Number(value)}
                                                    //     />
                                                    null
                                                    :
                                                    tableMeta.rowData[0] === 7 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
3399
                                                        // Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
idlanirined's avatar
idlanirined committed
3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413
                                                        //     <NumberFormat
                                                        //         thousandSeparator={true}
                                                        //         style={{
                                                        //             fontSize: 12,
                                                        //             textAlign: 'right',
                                                        //             borderColor: 'transparent',
                                                        //             margin: 0,
                                                        //             width: 96,
                                                        //             backgroundColor: 'transparent',
                                                        //             color: 'black'
                                                        //         }}
                                                        //         type="text"
                                                        //         placeholder=""
                                                        //         disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3414
                                                        //         value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430
                                                        //     /> : tableMeta.rowData[22] === "STOPPER" ?
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3431
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448
                                                        //             />
                                                        //         </LightTooltip> :
                                                        //         <LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
                                                        //             <NumberFormat
                                                        //                 thousandSeparator={true}
                                                        //                 style={{
                                                        //                     fontSize: 12,
                                                        //                     textAlign: 'right',
                                                        //                     borderColor: 'transparent',
                                                        //                     margin: 0,
                                                        //                     width: 96,
                                                        //                     backgroundColor: 'transparent',
                                                        //                     color: 'red'
                                                        //                 }}
                                                        //                 type="text"
                                                        //                 placeholder=""
                                                        //                 disabled={true}
Deni Rinaldi's avatar
Deni Rinaldi committed
3449
                                                        //                 value={Number(handleValidation(value, tableMeta)).toFixed(1)}
idlanirined's avatar
idlanirined committed
3450 3451 3452 3453 3454 3455 3456
                                                        //             />
                                                        //         </LightTooltip>
                                                        <div style={{ flex: 1 }}>
                                                            <FormControlLabel
                                                                style={{ margin: 0 }}
                                                                value={value}
                                                                control={
Deni Rinaldi's avatar
Deni Rinaldi committed
3457 3458
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
idlanirined's avatar
idlanirined committed
3459
                                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
3460 3461
                                                                        type="text"
                                                                        placeholder=""
idlanirined's avatar
idlanirined committed
3462
                                                                        disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
Deni Rinaldi's avatar
Deni Rinaldi committed
3463
                                                                        value={Number(value).toFixed(1)}
idlanirined's avatar
idlanirined committed
3464 3465 3466
                                                                        onBlur={(event) => {
                                                                            handleChange(event.target.value, tableMeta)
                                                                            // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
3467 3468
                                                                        }}
                                                                    />
idlanirined's avatar
idlanirined committed
3469 3470 3471
                                                                }
                                                            />
                                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3472 3473 3474 3475 3476 3477 3478
                                                        :
                                                        null
                            }
                        </div>
                    )
                }
            }
Deni Rinaldi's avatar
Deni Rinaldi committed
3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490
        },
        {
            name: "",
            options: {
                display: false
            }
        },
        {
            name: "",
            options: {
                display: false
            }
Deni Rinaldi's avatar
Deni Rinaldi committed
3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531
        }]

        const loadingComponent = (
            <div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
                <PropagateLoader
                    // css={override}
                    size={20}
                    color={"#274B80"}
                    loading={this.state.loading}
                />
            </div>
        );

        return (
            <div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
                <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
                    <Typography style={{ fontSize: '16px', color: 'white' }}>Outlook Performance Appraisal</Typography>
                </div>
                <Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
                    <Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
                        {this.state.messageAlert}
                    </Alert>
                </Snackbar>
                {/* {this.state.loading && loadingComponent} */}
                <div style={{ flex: 1, padding: 20, width: '100%' }}>
                    {this.state.visibleBalanceSheet === true ?
                        <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
                            <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
                                <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Outlook Performance Appraisal - Balance Sheet</Typography>
                            </div>
                            <div style={{ padding: 20 }}>
                                <div style={{ display: 'flex', justifyContent: 'space-between' }}>
                                    <div>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
                                    </div>
                                    <div style={{ width: '50%' }}>
                                        {this.props.isApprover == true || this.state.dataTable.length == 0 ? null :
                                            <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
                                                {((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted')) && (
Deni Rinaldi's avatar
Deni Rinaldi committed
3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547
                                                    <div>
                                                        <a data-tip={'Download Template'} data-for="template">
                                                            <button
                                                                style={{
                                                                    backgroundColor: 'transparent',
                                                                    cursor: 'pointer',
                                                                    borderColor: 'transparent',
                                                                    margin: 5
                                                                }}
                                                                onClick={() => this.downloadTemplate()}
                                                            >
                                                                <img src={Images.template} />
                                                            </button>
                                                        </a>
                                                        <ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
                                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3548 3549
                                                )}
                                                {((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted')) && (
Deni Rinaldi's avatar
Deni Rinaldi committed
3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565
                                                    <div>
                                                        <a data-tip={'Upload'} data-for="upload">
                                                            <button
                                                                style={{
                                                                    backgroundColor: 'transparent',
                                                                    cursor: 'pointer',
                                                                    borderColor: 'transparent',
                                                                    margin: 5
                                                                }}
                                                                onClick={() => this.setState({ visibleUpload: true })}
                                                            >
                                                                <img src={Images.upload} />
                                                            </button>
                                                        </a>
                                                        <ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
                                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625
                                                )}
                                                <a data-tip={'Download'} data-for="download">
                                                    <button
                                                        style={{
                                                            backgroundColor: 'transparent',
                                                            cursor: 'pointer',
                                                            borderColor: 'transparent',
                                                            margin: 5
                                                        }}
                                                        onClick={() =>
                                                            this.setState({ loading: true }, () => {
                                                                setTimeout(() => {
                                                                    this.downloadAllData()
                                                                }, 100);
                                                            })}
                                                    >
                                                        <img src={Images.download} />
                                                    </button>
                                                </a>
                                                <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
                                            </div>
                                        }
                                    </div>
                                </div>

                                <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
                                    {this.state.loading && loadingComponent}
                                    <MuiThemeProvider theme={getMuiTheme()}>
                                        <MUIDataTable
                                            data={dataTable2}
                                            columns={columns}
                                            options={options}
                                        />
                                    </MuiThemeProvider>
                                </div>
                                <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
                            </div>
                            <div className="grid grid-2x" style={{ marginTop: 20 }}>
                                <div className="col-1">
                                    <button
                                        type="button"
                                        onClick={() => this.setState({ loading: true }, () => {
                                            setTimeout(() => {
                                                this.props.onClickClose()
                                            }, 100);
                                        })}
                                        style={{
                                            backgroundColor: 'transparent',
                                            cursor: 'pointer',
                                            borderColor: 'transparent',
                                            outline: 'none'
                                        }}
                                    >
                                        <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                            <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Cancel</Typography>
                                        </div>
                                    </button>
                                </div>
                                {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
                                    (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ?
Deni Rinaldi's avatar
Deni Rinaldi committed
3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694
                                        <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
                                            <button
                                                className="button"
                                                type="button"
                                                style={{
                                                    backgroundColor: 'transparent',
                                                    cursor: 'pointer',
                                                    borderColor: 'transparent',
                                                    outline: 'none',
                                                    marginRight: 20
                                                }}
                                                onClick={() => {
                                                    this.setState({ loading: true }, () => {
                                                        setTimeout(() => {
                                                            this.handleValidate()
                                                        }, 100);
                                                    })
                                                }}
                                            >
                                                <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
                                                    <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
                                                </div>
                                            </button>
                                            <button
                                                className="button"
                                                type="button"
                                                style={{
                                                    backgroundColor: 'transparent',
                                                    cursor: this.state.editable !== true ? 'pointer' : 'default',
                                                    borderColor: 'transparent',
                                                    outline: 'none',
                                                    marginRight: 20
                                                }}
                                                onClick={() =>
                                                    this.state.editable === true ?
                                                        null :
                                                        this.state.handleTekTekTek == 1 ? null :
                                                            this.setState({ handleTekTekTek: 1 }, () => {
                                                                this.backToMasterBudget('draft')
                                                            })
                                                }
                                            >
                                                <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                                    <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
                                                </div>
                                            </button>
                                            <button
                                                type="button"
                                                disabled={this.state.buttonError}
                                                onClick={() =>
                                                    this.state.buttonError ?
                                                        this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
                                                        :
                                                        this.state.handleTekTekTek == 1 ? null :
                                                            this.setState({ handleTekTekTek: 1 }, () => {
                                                                this.backToMasterBudget('submitted')
                                                            })}
                                                style={{
                                                    backgroundColor: 'transparent',
                                                    cursor: this.state.buttonError === true ? 'default' : 'pointer',
                                                    borderColor: 'transparent',
                                                    outline: 'none',
                                                }}
                                            >
                                                <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                                    <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
                                                </div>
                                            </button>
                                        </div> : null
Deni Rinaldi's avatar
Deni Rinaldi committed
3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846
                                }
                            </div>
                        </Paper>
                        :
                        <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
                            <div>
                                <div style={{ padding: 25 }}>
                                    <div>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode}</Typography>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
                                    </div>
                                    {this.state.dataLoaded && (
                                        <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
                                            {this.state.loading && loadingComponent}
                                            <MuiThemeProvider theme={getMuiTheme()}>
                                                <MUIDataTable
                                                    data={dataTable2}
                                                    columns={columns}
                                                    options={options}
                                                />
                                            </MuiThemeProvider>
                                        </div>
                                    )}
                                </div>

                                <div className="grid grid-2x" style={{ marginTop: 20 }}>
                                    <div className="col-1">
                                        <button
                                            type="button"
                                            onClick={() => this.setState({ loading: true, visibleBalanceSheet: true }, () => {
                                                setTimeout(() => {
                                                    this.getItemHierarki()
                                                }, 100);
                                            })}
                                            style={{ marginRight: 20 }}
                                        >
                                            <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                                <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Cancel</Typography>
                                            </div>
                                        </button>
                                    </div>
                                    <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
                                        <button
                                            className="button"
                                            type="button"
                                            disabled={this.state.buttonError}
                                            style={{
                                                backgroundColor: 'transparent',
                                                cursor: this.state.buttonError === true ? 'default' : 'pointer',
                                                borderColor: 'transparent',
                                                outline: 'none',
                                                marginRight: 20
                                            }}
                                            onClick={() => {
                                                this.setState({ loading: true }, () => {
                                                    setTimeout(() => {
                                                        this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false, editable: false })
                                                    }, 100);
                                                })
                                            }}
                                        >
                                            <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
                                                <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
                                            </div>
                                        </button>
                                        <button
                                            type="button"
                                            style={{
                                                backgroundColor: 'transparent',
                                                cursor: this.state.editable !== true ? 'pointer' : 'default',
                                                borderColor: 'transparent',
                                                outline: 'none',
                                                marginRight: 20
                                            }}
                                            onClick={() =>
                                                this.state.editable === true ?
                                                    null :
                                                    this.setState({ loading: true }, () =>
                                                        this.state.handleTekTekTek == 1 ? null :
                                                            this.setState({ handleTekTekTek: 1 }, () => {
                                                                setTimeout(() => {
                                                                    this.uploadBalanceSheet('draft')
                                                                }, 100);
                                                            })
                                                    )
                                            }
                                        >
                                            <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                                <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
                                            </div>
                                        </button>
                                        <button
                                            type="button"
                                            style={{
                                                backgroundColor: 'transparent',
                                                cursor: this.state.editable !== true ? 'pointer' : 'default',
                                                borderColor: 'transparent',
                                                outline: 'none',
                                            }}
                                            onClick={() =>
                                                this.state.editable === true ?
                                                    null :
                                                    this.setState({ loading: true }, () =>
                                                        this.state.handleTekTekTek == 1 ? null :
                                                            this.setState({ handleTekTekTek: 1 }, () => {
                                                                setTimeout(() => {
                                                                    this.uploadBalanceSheet('submitted')
                                                                }, 100);
                                                            })
                                                    )
                                            }
                                        >
                                            <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                                <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
                                            </div>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </Paper>}
                </div>

                {this.state.visibleUpload && (
                    <div className="test app-popup-show">
                        <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
                            <div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
                                <div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
                                    <div className="popup-title">
                                        <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File</span>
                                    </div>
                                </div>
                                <div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
                                    <button
                                        type="button"
                                        className="btn btn-circle btn-white"
                                        onClick={() => this.setState({ visibleUpload: false })}
                                    >
                                        <img src={Images.close} />
                                    </button>
                                </div>
                            </div>
                            <UploadFile
                                type={this.state.uploadStatus}
                                percentage={this.state.percentage}
                                result={this.state.result}
                                acceptedFiles={["xlsx"]}
                                onHandle={(dt) => {
                                    this.fileHandler(dt)
                                    this.setState({ uploadStatus: 'idle', percentage: '0' })
                                }}
                                onUpload={() => {
r.kurnia's avatar
r.kurnia committed
3847
                                    String(this.state.judul).includes("OUTLOOK") && String(this.state.judul).includes("PA") && String(this.state.judul).includes("BALANCE") && String(this.state.judul).includes("SHEET") ?
Deni Rinaldi's avatar
Deni Rinaldi committed
3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858
                                        this.checkUpload() :
                                        this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
                                }}
                            />
                        </div>
                    </div>
                )}
            </div>
        )
    }
}