CashFlowRO.js 174 KB
Newer Older
syadziy's avatar
syadziy committed
1
import { createMuiTheme, MuiThemeProvider, Paper, Snackbar, TableCell, Tooltip, Typography, withStyles } from '@material-ui/core'
r.kurnia's avatar
r.kurnia committed
2 3 4 5 6 7 8 9 10 11 12 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
import MUIDataTable from 'mui-datatables';
import React, { Component } from 'react'
import NumberFormat from 'react-number-format';
import ReactTooltip from 'react-tooltip';
import api from '../../api';
import Images from '../../assets/Images';
import * as R from 'ramda'
import { PropagateLoader } from 'react-spinners';
import Constant from '../../library/Constant';
import { Alert } from '@material-ui/lab';

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

const options = ct.customOptionsFixedColumn();
const style = {
    position: "sticky",
    left: 0,
    background: "white",
    zIndex: 101,
};
const style2 = {
    position: "sticky",
    background: "white",
    zIndex: 100
};

const LightTooltip = withStyles((theme) => ({
    tooltip: {
        backgroundColor: theme.palette.common.white,
        color: 'rgba(0, 0, 0, 0.87)',
        boxShadow: theme.shadows[1],
        fontSize: 11,
    },
}))(Tooltip);
export default class CashFlow extends Component {
    constructor(props) {
        super(props)
        this.state = {
            dataTable: [],
            loading: false,
            minValue: "0",
            maxValue: "0",
45
            handleDoubleClick: 0,
Riri Novita's avatar
Riri Novita committed
46
            viewOnly: true,
r.kurnia's avatar
r.kurnia committed
47 48 49
        }
    }

Riri Novita's avatar
Riri Novita committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
    handleViewOnly() {
        let checkApprover = false
        let checkLastStatus = false
        let checkStatus = false
        let checkPrevRev = false

        if (this.props.isApprover) {
            checkApprover = true
        } else {
            checkApprover = false
        }

        if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
            checkLastStatus = true
        } else {
            checkLastStatus = false
        }

        if (this.props.prevRevision) {
            checkPrevRev = true
        } else {
            checkPrevRev = false
        }

        if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') {
            checkStatus = true
        } else {
            checkStatus = false
        }
        // console.log(this.props.status)
        // console.log(this.props.lastStatus)
        // console.log(checkStatus)
        // console.log(checkLastStatus)
        // console.log(checkApprover)
        // console.log(checkPrevRev)
        this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
    }

r.kurnia's avatar
r.kurnia committed
88
    componentDidMount() {
Deni Rinaldi's avatar
Deni Rinaldi committed
89
        console.log(this.props);
r.kurnia's avatar
r.kurnia committed
90 91
        this.setState({ loading: true })
        this.getSettingControl()
Riri Novita's avatar
Riri Novita committed
92 93
        // console.log(this.props.PLBSFAMSubmitted)
        this.handleViewOnly()
r.kurnia's avatar
r.kurnia committed
94
    }
Riri Novita's avatar
Riri Novita committed
95 96 97 98 99 100 101
    handleGetFor(type) {
        this.setState({ get_for: type }, () => {
            // this.getLatestUpdate()
            this.getSettingControl()
            this.getItemHierarki()
        })
    }
r.kurnia's avatar
r.kurnia committed
102 103 104 105 106 107 108 109 110

    getSettingControl() {
        let body = {
            group: 'THRESHOLD_CONTROL',
            company_id: this.props.company.company_id,
            type: 'CASH_FLOW'
        }

        api.create().getAllSettingByType(body).then(response => {
Riri Novita's avatar
Riri Novita committed
111 112 113 114 115 116 117 118 119 120 121
            console.log(response)
            if (response.data) {
                if (response.data.status === 'success') {
                    this.setState({
                        minValue: response.data.data[0] ? response.data.data[0].min_value : null,
                        maxValue: response.data.data[0] ? response.data.data[0].max_value : null,
                    }, () => {
                        this.getItemHierarki()
                    })
                } else {
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
d.arizona's avatar
d.arizona committed
122
                        if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
Riri Novita's avatar
Riri Novita committed
123 124 125 126 127 128 129 130 131 132
                            setTimeout(() => {
                                localStorage.removeItem(Constant.TOKEN)
                                window.location.reload();
                            }, 1000);
                        }
                    })
                }
            } else {
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
            }
r.kurnia's avatar
r.kurnia committed
133 134 135 136 137 138
        })
    }

    getItemHierarki() {
        this.setState({ loading: true })
        let payload = {
Riri Novita's avatar
Riri Novita committed
139
            "company_id": this.props.company.company_id,
Riri Novita's avatar
Riri Novita committed
140
            "get_for": "edit",
Riri Novita's avatar
Riri Novita committed
141 142
            "quartal": this.props.quarter,
            "periode": this.props.periode,
r.kurnia's avatar
r.kurnia committed
143 144
            "report_id": this.props.report_id,
            "revision": Number(this.props.revision),
Riri Novita's avatar
Riri Novita committed
145
            "rolling_outlook_id": this.props.rollingOutlookID
r.kurnia's avatar
r.kurnia committed
146
        }
Riri Novita's avatar
Riri Novita committed
147
        api.create().getRollingOutlookCF(payload).then(response => {
r.kurnia's avatar
r.kurnia committed
148 149
            let dataTable = []
            console.log(response)
Riri Novita's avatar
Riri Novita committed
150
            console.log(payload);
Riri Novita's avatar
Riri Novita committed
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
            if (response.data) {
                if (response.ok) {
                    if (response.data.status == 'success') {
                        let res = response.data.data
                        const handlePushChild = (item) => {
                            dataTable.push([
                                item.type_report_id,
                                item.id,
                                item.parent,
                                item.formula,
                                item.level,
                                item.description,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.january, formula: item.cash_flow.january_formula } : item.cash_flow.january,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.february, formula: item.cash_flow.february_formula } : item.cash_flow.february,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.march, formula: item.cash_flow.march_formula } : item.cash_flow.march,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.april, formula: item.cash_flow.april_formula } : item.cash_flow.april,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.may, formula: item.cash_flow.may_formula } : item.cash_flow.may,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.june, formula: item.cash_flow.june_formula } : item.cash_flow.june,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.july, formula: item.cash_flow.july_formula } : item.cash_flow.july,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.august, formula: item.cash_flow.august_formula } : item.cash_flow.august,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.september, formula: item.cash_flow.september_formula } : item.cash_flow.september,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.october, formula: item.cash_flow.october_formula } : item.cash_flow.october,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.november, formula: item.cash_flow.november_formula } : item.cash_flow.november,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.december, formula: item.cash_flow.december_formula } : item.cash_flow.december,
175
                                item.cash_flow.current_total,
Riri Novita's avatar
Riri Novita committed
176 177 178 179
                                item.order,
                                item.condition_it_should_be,
                                item.condition_if_wrong,
                            ])
r.kurnia's avatar
r.kurnia committed
180

Riri Novita's avatar
Riri Novita committed
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
                            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.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.january, formula: item.cash_flow.january_formula } : item.cash_flow.january,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.february, formula: item.cash_flow.february_formula } : item.cash_flow.february,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.march, formula: item.cash_flow.march_formula } : item.cash_flow.march,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.april, formula: item.cash_flow.april_formula } : item.cash_flow.april,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.may, formula: item.cash_flow.may_formula } : item.cash_flow.may,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.june, formula: item.cash_flow.june_formula } : item.cash_flow.june,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.july, formula: item.cash_flow.july_formula } : item.cash_flow.july,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.august, formula: item.cash_flow.august_formula } : item.cash_flow.august,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.september, formula: item.cash_flow.september_formula } : item.cash_flow.september,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.october, formula: item.cash_flow.october_formula } : item.cash_flow.october,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.november, formula: item.cash_flow.november_formula } : item.cash_flow.november,
                                item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.december, formula: item.cash_flow.december_formula } : item.cash_flow.december,
209
                                item.cash_flow.current_total,
Riri Novita's avatar
Riri Novita committed
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
                                item.order,
                                item.condition_it_should_be,
                                item.condition_if_wrong,
                            ])
                            if (item.children !== null) {
                                if (item.children.length > 0) {
                                    item.children.map((items, indexs) => {
                                        handlePushChild(items)
                                    })
                                }
                            }
                        })
                        console.log(dataTable);
                        this.setState({ dataTable, loading: false, dataReal: res, editable: true }, () => {
                            this.setState({ loading: true }, () => {
                                setTimeout(() => {
                                    this.setState({ loading: false }, () => {
                                        this.setState({ loading: true }, () => {
                                            setTimeout(() => {
                                                this.setState({ loading: false }, () => {
                                                    this.setState({ loading: true }, () => {
                                                        setTimeout(() => {
                                                            this.setState({ loading: false })
                                                        }, 500);
                                                    })
                                                })
                                            }, 500);
                                        })
                                    })
                                }, 500);
                            })
                        })
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
d.arizona's avatar
d.arizona committed
244
                            if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
Riri Novita's avatar
Riri Novita committed
245 246 247 248 249 250 251 252 253 254 255 256 257
                                setTimeout(() => {
                                    localStorage.removeItem(Constant.TOKEN)
                                    window.location.reload();
                                }, 1000);
                            }
                        })
                    }
                } else {
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
                }
            } else {
                this.setState({ alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error', loading: false })
            }
r.kurnia's avatar
r.kurnia committed
258 259 260 261
        })
    }

    async downloadAllData() {
Deni Rinaldi's avatar
Deni Rinaldi committed
262 263 264
        // alert('Coming Soon ...')
        let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${this.props.rollingOutlookID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&quartal=${this.props.quarter}`
        console.log(url);
r.kurnia's avatar
r.kurnia committed
265
        let res = await fetch(
Deni Rinaldi's avatar
Deni Rinaldi committed
266
            `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${this.props.rollingOutlookID === null ? "" : this.props.rollingOutlookID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&quartal=${this.props.quarter}`
r.kurnia's avatar
r.kurnia committed
267 268 269 270 271 272
        )
        res = await res.blob()
        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
273
            a.download = 'Rolling Outlook Cash Flow.xlsx';
r.kurnia's avatar
r.kurnia committed
274 275
            a.click();
        }
Deni Rinaldi's avatar
Deni Rinaldi committed
276 277 278
        setTimeout(() => {
            this.setState({ loading: false })
        }, 500);
r.kurnia's avatar
r.kurnia committed
279 280 281 282 283 284 285 286 287 288 289
    }

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

    olahDataCashFlow(dataTable2) {
        console.log(dataTable2)
        let listCF = []
        dataTable2.map((item, index) => {
            listCF.push(
Deni Rinaldi's avatar
Deni Rinaldi committed
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
                // {
                //     "item_report_id": item[1],
                //     "parent": item[2],
                //     "formula": String(item[3]),
                //     "item_name": item[5],
                //     "january": String(item[7].value == undefined ? item[7] : Number(item[7].value).toFixed(1)),
                //     "february": String(item[8].value == undefined ? item[8] : Number(item[8].value).toFixed(1)),
                //     "march": String(item[9].value == undefined ? item[9] : Number(item[9].value).toFixed(1)),
                //     "april": String(item[10].value == undefined ? item[10] : Number(item[10].value).toFixed(1)),
                //     "may": String(item[11].value == undefined ? item[11] : Number(item[11].value).toFixed(1)),
                //     "june": String(item[12].value == undefined ? item[12] : Number(item[12].value).toFixed(1)),
                //     "july": String(item[13].value == undefined ? item[13] : Number(item[13].value).toFixed(1)),
                //     "august": String(item[14].value == undefined ? item[14] : Number(item[14].value).toFixed(1)),
                //     "september": String(item[15].value == undefined ? item[15] : Number(item[15].value).toFixed(1)),
                //     "october": String(item[16].value == undefined ? item[16] : Number(item[16].value).toFixed(1)),
                //     "november": String(item[17].value == undefined ? item[17] : Number(item[17].value).toFixed(1)),
                //     "december": String(item[18].value == undefined ? item[18] : Number(item[18].value).toFixed(1)),
                //     "total_current_year": String(item[19] != '' ? Number(item[19]).toFixed(1) : item[19]),
                //     "total_next_year": String(item[20] != '' ? Number(item[20]).toFixed(1) : item[20]),
                //     "total_more_year": String(item[21] != '' ? Number(item[21]).toFixed(1) : item[21]),
                //     "kpi_type": "",
                //     "max_ach": "",
                //     "pic": "",
                //     "strategic": "",
                //     "total_actual_before": "",
                //     "uom": "",
                //     "weight": ""
                // }
r.kurnia's avatar
r.kurnia committed
318 319
                {
                    "item_report_id": item[1],
Deni Rinaldi's avatar
Deni Rinaldi committed
320 321 322 323 324 325 326 327 328 329 330 331
                    "january": String(item[6].value == undefined ? item[6] : Number(item[6].value).toFixed(1)),
                    "february": String(item[7].value == undefined ? item[7] : Number(item[7].value).toFixed(1)),
                    "march": String(item[8].value == undefined ? item[8] : Number(item[8].value).toFixed(1)),
                    "april": String(item[9].value == undefined ? item[9] : Number(item[9].value).toFixed(1)),
                    "may": String(item[10].value == undefined ? item[10] : Number(item[10].value).toFixed(1)),
                    "june": String(item[11].value == undefined ? item[11] : Number(item[11].value).toFixed(1)),
                    "july": String(item[12].value == undefined ? item[12] : Number(item[12].value).toFixed(1)),
                    "august": String(item[13].value == undefined ? item[13] : Number(item[13].value).toFixed(1)),
                    "september": String(item[14].value == undefined ? item[14] : Number(item[14].value).toFixed(1)),
                    "october": String(item[15].value == undefined ? item[15] : Number(item[15].value).toFixed(1)),
                    "november": String(item[16].value == undefined ? item[16] : Number(item[16].value).toFixed(1)),
                    "december": String(item[17].value == undefined ? item[17] : Number(item[17].value).toFixed(1)),
332
                    "current_total": String(item[18] != '' ? Number(item[18]).toFixed(1) : item[18]),
r.kurnia's avatar
r.kurnia committed
333 334 335 336 337 338 339 340 341 342
                }
            )
        })

        console.log(listCF)
        this.createCashFlow(listCF)
    }

    createCashFlow(dbcf) {
        let payload = {
Deni Rinaldi's avatar
Deni Rinaldi committed
343
            "rolling_outlook_id": this.props.rollingOutlookID,
r.kurnia's avatar
r.kurnia committed
344 345
            "company_id": this.props.company.company_id,
            "periode": this.props.periode,
Deni Rinaldi's avatar
Deni Rinaldi committed
346
            "report_id": this.props.report_id,
r.kurnia's avatar
r.kurnia committed
347
            "status": "submitted",
Deni Rinaldi's avatar
Deni Rinaldi committed
348
            "quartal": this.props.quarter,
r.kurnia's avatar
r.kurnia committed
349 350 351 352
            "cash_flow": dbcf
        }
        console.log(dbcf)
        console.log(JSON.stringify(payload))
Deni Rinaldi's avatar
Deni Rinaldi committed
353 354 355 356 357 358 359 360 361
        api.create().createRollingOutlookCF(payload).then(response => {
            console.log(payload);
            console.log(response);
            // console.log(JSON.stringify(payload))
            if (response.data) {
                if (response.data.status === "success") {
                    this.props.onClickClose()
                    this.props.refresh()
                } else {
362
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleDoubleClick: 0 }, () => {
Riri Novita's avatar
Riri Novita committed
363
                        document.body.style.overflow = 'unset';
d.arizona's avatar
d.arizona committed
364
                        if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
Riri Novita's avatar
Riri Novita committed
365 366 367 368 369
                            setTimeout(() => {
                                localStorage.removeItem(Constant.TOKEN)
                                window.location.reload();
                            }, 1000);
                        }
Deni Rinaldi's avatar
Deni Rinaldi committed
370 371 372 373
                        this.props.onClickClose()
                        this.props.refresh()
                    })
                }
Riri Novita's avatar
Riri Novita committed
374
                // else {
375
                //     this.setState({ loading: false, handleDoubleClick: 0 }, () => {
Riri Novita's avatar
Riri Novita committed
376 377 378 379
                //         this.props.onClickClose()
                //         this.props.refresh()
                //     })
                // }
Deni Rinaldi's avatar
Deni Rinaldi committed
380
            } else {
381
                this.setState({ loading: false, handleDoubleClick: 0 })
Deni Rinaldi's avatar
Deni Rinaldi committed
382 383
            }
        })
r.kurnia's avatar
r.kurnia committed
384
        this.props.onClickClose()
Deni Rinaldi's avatar
Deni Rinaldi committed
385
        this.props.refresh()
r.kurnia's avatar
r.kurnia committed
386 387 388 389 390
    }

    render() {
        let dataTable2 = this.state.dataTable
        let loading = false
391 392


r.kurnia's avatar
r.kurnia committed
393
        const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
Deni Rinaldi's avatar
Deni Rinaldi committed
394 395
            // console.log(tableMeta.rowData[5])
            // console.log(column)
396

r.kurnia's avatar
r.kurnia committed
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
            loading = true
            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 subForm = String(item).substr(0, Number(String(item).length) - 1)
                let re = /^[a-zA-Z0-9_]+$/;
                if (item !== "") {
                    if (!re.test(items)) {
                        baru.push(subForm)
                        baru.push(items)
                    } else {
                        baru.push(String(item))
                    }
                }
            })

            baru.map((item, index) => {
                if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
                    anjay.push(item)
                } else {
                    if (String(item).includes('#')) {
                        if (String(item).includes('[M-1]')) {
                            if (forecast !== undefined) {
                                let forecastt = 0
424
                                if (column == 20) {
r.kurnia's avatar
r.kurnia committed
425
                                    let tst = String(item).replace('[M-1]', '')
426
                                    let data = 19
r.kurnia's avatar
r.kurnia committed
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441
                                    let period = this.props.periode - 1
                                    let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
                                    if (indexID !== -1) {
                                        let valuezz = tableMeta.rowData[data].formula[indexID].value
                                        if (tableMeta.rowData[5] == "Cash at the beginning period") {
                                            // console.log(dataTable2[tableMeta.rowIndex+1])
                                            // console.log(dataTable2[tableMeta.rowIndex+1][data].value)
                                            let valuezzz = dataTable2[tableMeta.rowIndex][7].value
                                            forecastt += Number(valuezzz == "" ? 0 : valuezzz)
                                        } else {
                                            forecastt += Number(valuezz == "" ? 0 : valuezz)
                                        }
                                    }
                                }

442
                                if (column == 21) {
r.kurnia's avatar
r.kurnia committed
443
                                    let tst = String(item).replace('[M-1]', '')
444
                                    let data = 19
r.kurnia's avatar
r.kurnia committed
445 446 447 448 449
                                    let period = this.props.periode
                                    let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
                                    if (indexID !== -1) {
                                        let valuezz = tableMeta.rowData[data].formula[indexID].value
                                        if (tableMeta.rowData[5] == "Cash at the beginning period") {
Riri Novita's avatar
Riri Novita committed
450
                                            let valuezzz = dataTable2[tableMeta.rowIndex + 1][20]
r.kurnia's avatar
r.kurnia committed
451 452 453 454 455 456 457
                                            forecastt += Number(valuezzz == "" ? 0 : valuezzz)
                                        } else {
                                            forecastt += Number(valuezz == "" ? 0 : valuezz)
                                        }
                                    }
                                }

458
                                if (column == 22) {
r.kurnia's avatar
r.kurnia committed
459 460 461 462 463 464
                                    let tst = String(item).replace('[M-1]', '')
                                    let period = Number(this.props.periode) + 1
                                    let indexID = forecast.findIndex((val) => String(val.item_formula).replace('forecast_', '') == String(`@${tst}`) && val.periode == period)
                                    if (indexID !== -1) {
                                        let valuezz = forecast[indexID].value
                                        if (tableMeta.rowData[5] == "Cash at the beginning period") {
Riri Novita's avatar
Riri Novita committed
465
                                            let valuezzz = dataTable2[tableMeta.rowIndex + 1][21]
r.kurnia's avatar
r.kurnia committed
466 467 468 469 470 471 472 473 474
                                            forecastt += Number(valuezzz == "" ? 0 : valuezzz)
                                        } else {
                                            forecastt += Number(valuezz == "" ? 0 : valuezz)
                                        }
                                    }
                                }

                                anjay.push(forecastt)
                            } else {
d.arizona's avatar
d.arizona committed
475 476 477 478 479
                                let tst = String(item).replace('[M-1]', '[M1]')
                                // let data = column == 7 ? 18 : column - 1
                                // let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode
                                // console.log(tst)
                                let indexID = tableMeta.rowData[column].formula.findIndex((val) => val.item_formula == String(`@${tst}`))
r.kurnia's avatar
r.kurnia committed
480 481

                                if (indexID !== -1) {
d.arizona's avatar
d.arizona committed
482 483 484 485 486 487 488 489 490
                                    let valuezz = tableMeta.rowData[column].formula[indexID].value
                                    // if (tableMeta.rowData[5] == "Cash at the beginning period" && column == 9) {
                                    //     console.log(data)
                                    //     console.log(dataTable2[tableMeta.rowIndex+1][5])
                                    //     console.log(dataTable2[tableMeta.rowIndex+1][data])
                                    //     console.log(dataTable2[tableMeta.rowIndex-1][data].value)
                                    //     console.log(dataTable2[tableMeta.rowIndex][data].value)
                                    //     console.log(dataTable2[tableMeta.rowIndex+1][data].value)
                                    //     let valuezzz = dataTable2[tableMeta.rowIndex + 1][data].value
491
                                    anjay.push(valuezz == "" ? 0 : valuezz)
d.arizona's avatar
d.arizona committed
492 493 494
                                    // } else {
                                    //     anjay.push(valuezz == "" ? 0 : valuezz)
                                    // }
r.kurnia's avatar
r.kurnia committed
495 496 497 498 499 500 501 502 503 504
                                }
                            }
                        } else {
                            if (forecast !== undefined) {
                                let indexID = forecast.findIndex((val) => String(val.item_formula).replace('forecast_', '') == String(`@${item}`) && val.periode == Number(periode))
                                if (indexID !== -1) {
                                    let valuezz = forecast[indexID].value
                                    anjay.push(valuezz == "" ? 0 : Number(valuezz))
                                }
                            } else {
Deni Rinaldi's avatar
Deni Rinaldi committed
505
                                // console.log(value)
r.kurnia's avatar
r.kurnia committed
506 507 508 509 510 511 512 513
                                let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
                                if (indexID !== -1) {
                                    let valuezz = value.formula[indexID].value
                                    anjay.push(valuezz == "" ? 0 : valuezz)
                                }
                            }
                        }
                    } else {
514
                        let indexID = dataTable2.findIndex((val) => val[19] == item)
r.kurnia's avatar
r.kurnia committed
515 516
                        if (indexID !== -1) {
                            let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
517
                            if (item == dataTable2[tableMeta.rowIndex][19]) {
r.kurnia's avatar
r.kurnia committed
518 519 520 521 522 523 524 525 526
                                anjay.push(0)
                            } else {
                                anjay.push(valuezz == "" ? 0 : valuezz)
                            }
                        } else {
                            if (item === '(-1)') {
                                anjay.push(-1)
                            }
                        }
527

r.kurnia's avatar
r.kurnia committed
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 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 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687
                    }
                }
            })

            let anjay2 = []
            let kurung = false
            let item1 = []
            anjay.map((item, index) => {
                if (item == "(") {
                    kurung = true
                } else if (item == ")") {
                    kurung = false
                    anjay2.push(item1)
                    item1 = []
                } else {
                    if (kurung) {
                        item1.push(item)
                    } else {
                        anjay2.push(item)
                    }
                }
            })

            let total = 0
            let opt = ""
            let totalPrio = 0
            let optPrio = ""
            let prio = false
            let optPrev = ""
            anjay2.map((item, index) => {
                if (Array.isArray(item)) {
                    prio = true
                    optPrev = opt
                    item.map((items, indexs) => {
                        if (items == "+") {
                            optPrio = "tambah"
                        } else if (items == "-") {
                            optPrio = "kurang"
                        } else if (items == "*") {
                            optPrio = "kali"
                        } else if (items == "/") {
                            optPrio = "bagi"
                        } else {
                            if (optPrio == "tambah") {
                                totalPrio = Number(totalPrio) + Number(items)
                            } else if (optPrio == "kurang") {
                                totalPrio = Number(totalPrio) - Number(items)
                            } else if (optPrio == "kali") {
                                totalPrio = Number(totalPrio) * Number(items)
                            } else if (optPrio == "bagi") {
                                totalPrio = Number(totalPrio) / Number(items) == NaN ? 0 : Number(totalPrio) / Number(items)
                            } else {
                                totalPrio += Number(items)
                            }
                        }
                    })

                    if (index == anjay2.length - 1) {
                        if (opt == "tambah") {
                            total = Number(total) + Number(totalPrio)
                        } else if (opt == "kurang") {
                            total = Number(total) - Number(totalPrio)
                        } else if (opt == "kali") {
                            total = Number(total) * Number(totalPrio)
                        } else if (opt == "bagi") {
                            total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
                        } else {
                            total += Number(totalPrio)
                        }
                    }
                } else {
                    if (item == "+") {
                        opt = "tambah"
                        if (prio) {
                            if (optPrev == "tambah") {
                                total = Number(total) + Number(totalPrio)
                            } else if (optPrev == "kurang") {
                                total = Number(total) - Number(totalPrio)
                            } else if (optPrev == "kali") {
                                total = Number(total) * Number(totalPrio)
                            } else if (optPrev == "bagi") {
                                total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
                            } else {
                                total += Number(totalPrio)
                            }
                            prio = false
                            totalPrio = 0
                            optPrio = ""
                        }
                    } else if (item == "-") {
                        opt = "kurang"
                        if (prio) {
                            if (optPrev == "tambah") {
                                total = Number(total) + Number(totalPrio)
                            } else if (optPrev == "kurang") {
                                total = Number(total) - Number(totalPrio)
                            } else if (optPrev == "kali") {
                                total = Number(total) * Number(totalPrio)
                            } else if (optPrev == "bagi") {
                                total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
                            } else {
                                total += Number(totalPrio)
                            }
                            prio = false
                            totalPrio = 0
                            optPrio = ""
                        }
                    } else if (item == "*") {
                        opt = "kali"
                        if (prio) {
                            if (optPrev == "tambah") {
                                total = Number(total) + Number(totalPrio)
                            } else if (optPrev == "kurang") {
                                total = Number(total) - Number(totalPrio)
                            } else if (optPrev == "kali") {
                                total = Number(total) * Number(totalPrio)
                            } else if (optPrev == "bagi") {
                                total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
                            } else {
                                total += Number(totalPrio)
                            }
                            prio = false
                            totalPrio = 0
                            optPrio = ""
                        }
                    } else if (item == "/") {
                        opt = "bagi"
                        if (prio) {
                            if (optPrev == "tambah") {
                                total = Number(total) + Number(totalPrio)
                            } else if (optPrev == "kurang") {
                                total = Number(total) - Number(totalPrio)
                            } else if (optPrev == "kali") {
                                total = Number(total) * Number(totalPrio)
                            } else if (optPrev == "bagi") {
                                total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
                            } else {
                                total += Number(totalPrio)
                            }
                            prio = false
                            totalPrio = 0
                            optPrio = ""
                        }
                    } else {
                        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") {
                            total = Number(total) / Number(item) == NaN ? 0 : Number(total) / Number(item)
                        } else {
                            total += Number(item)
                        }
                    }
                }
            })

            total = R.equals(total, NaN) ? "0.0" : total
Riri Novita's avatar
Riri Novita committed
688

d.arizona's avatar
d.arizona committed
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705
            // if (column == 9 && tableMeta.rowData[1] == 3243762) {
            //     console.log(tableMeta.rowData)
            //     console.log(splitFormula)
            //     console.log(baru)
            //     console.log(anjay)
            //     console.log(anjay2)
            //     console.log(total)
            // }

            // if (tableMeta.rowData[5] == '2.1 Additional fixed assets and CIP' && column == 7) {
            //     console.log(tableMeta.rowData)
            //     console.log(splitFormula)
            //     console.log(baru)
            //     console.log(anjay)
            //     console.log(anjay2)
            //     console.log(total)
            // }
r.kurnia's avatar
r.kurnia committed
706 707 708 709 710 711 712 713 714

            if (dataTable2[tableMeta.rowIndex][column].value == undefined) {
                dataTable2[tableMeta.rowIndex][column] = total
            } else {
                dataTable2[tableMeta.rowIndex][column].value = total
            }
            loading = false
            return total
        }
Riri Novita's avatar
Riri Novita committed
715
        const handleTotal = (val, tableMeta, column) => {
716
            let total = 0
717

718 719 720 721 722 723
            dataTable2[tableMeta.rowIndex].map((item, index) => {
                if (index >= 6 && index <= 17) {
                    let valItem = item.value == undefined || item.value == "" ? 0 : item.value
                    total += Number(valItem)
                }
            })
r.kurnia's avatar
r.kurnia committed
724

725 726 727
            if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "cash at the beginning period") {
                let totalBeginning = dataTable2[tableMeta.rowIndex][18] = dataTable2[tableMeta.rowIndex][6].value
                return totalBeginning
Riri Novita's avatar
Riri Novita committed
728
            } else if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "cash at the end of the period") {
Riri Novita's avatar
Riri Novita committed
729 730 731
                let value = Number(dataTable2[tableMeta.rowIndex - 1][18]) + Number(dataTable2[tableMeta.rowIndex - 2][18])
                return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
            } else if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "control (should be nil)") {
Riri Novita's avatar
Riri Novita committed
732
                // console.log(dataTable2[tableMeta.rowIndex - 2][tableMeta.columnIndex + 11].value);
Riri Novita's avatar
Riri Novita committed
733
                let cashOfTheEndFy = Number(dataTable2[tableMeta.rowIndex - 3][18]) + Number(dataTable2[tableMeta.rowIndex - 4][18])
Riri Novita's avatar
Riri Novita committed
734
                let cahsOfTheEndDec = Number(dataTable2[tableMeta.rowIndex - 2][tableMeta.columnIndex + 11].value)
Riri Novita's avatar
Riri Novita committed
735 736 737
                // console.log(cashOfTheEndFy);
                // console.log(cahsOfTheEndDec);
                let value = Number(cashOfTheEndFy) - Number(cahsOfTheEndDec);
738
                // console.log(value);
Riri Novita's avatar
Riri Novita committed
739
                return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
740 741 742 743 744
            } else {
                dataTable2[tableMeta.rowIndex][18] = total
                return total
            }

Riri Novita's avatar
Riri Novita committed
745 746 747 748 749 750 751 752 753 754 755
            // if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "cash at the beginning period") {
            //     let totalBeginning = dataTable2[tableMeta.rowIndex][18] = dataTable2[tableMeta.rowIndex][6].value
            //     return totalBeginning
            // } else if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "cash at the end of the period") {
            //     let totalEnd = dataTable2[tableMeta.rowIndex][18] = dataTable2[tableMeta.rowIndex][17].value
            //     return totalEnd
            // } else {
            //     dataTable2[tableMeta.rowIndex][18] = total
            //     return total
            // }

756 757
            // console.log(total);
        }
r.kurnia's avatar
r.kurnia committed
758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795
        let columns = [
            {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "(In Rupiah million)",
                options: {
                    customHeadRender: (columnMeta) => (
                        <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 103, 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 }}>
796 797
                                {tableMeta.rowData[27] ?
                                    tableMeta.rowData[27].length > 0 ?
r.kurnia's avatar
r.kurnia committed
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823
                                        <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
                                            <LightTooltip title={"Report Items Not Registered"} arrow>
                                                <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
                                            </LightTooltip>
                                        </div>
                                        :
                                        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>
                                    :
                                    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>
                        )
                    }
                }
            },
            {
Riri Novita's avatar
Riri Novita committed
824
                name: `Rolling Outlook ${String(this.props.quarter).toLocaleUpperCase()} ${this.props.periode}`,
r.kurnia's avatar
r.kurnia committed
825 826 827 828
                options: {
                    customHeadRender: (columnMeta) => (
                        <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
                            <div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
829
                            <div className="grid grid-3x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
r.kurnia's avatar
r.kurnia committed
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857
                                <div className="column-1 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
                                    <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"1"}</span>
                                    </div>
                                    <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"2"}</span>
                                    </div>
                                    <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"3"}</span>
                                    </div>
                                    <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"4"}</span>
                                    </div>
                                </div>
                                <div className="column-2 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
                                    <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"5"}</span>
                                    </div>
                                    <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"6"}</span>
                                    </div>
                                    <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"7"}</span>
                                    </div>
                                    <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"8"}</span>
                                    </div>
                                </div>
ardyardyaaan's avatar
ardyardyaaan committed
858
                                <div className="column-3 grid grid-5x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
r.kurnia's avatar
r.kurnia committed
859 860 861 862 863 864 865 866 867
                                    <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"9"}</span>
                                    </div>
                                    <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"10"}</span>
                                    </div>
                                    <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
                                        <span>{"11"}</span>
                                    </div>
868
                                    <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
r.kurnia's avatar
r.kurnia committed
869 870
                                        <span>{"12"}</span>
                                    </div>
Riri Novita's avatar
Riri Novita committed
871
                                    <div className="column-5" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0', width: 110 }}>
872 873 874
                                        <span>{"Current Total"}</span>
                                    </div>
                                </div>
r.kurnia's avatar
r.kurnia committed
875 876 877 878 879 880 881
                            </div>
                        </th>
                    ),
                    setCellProps: () => ({ style2 }),
                    customBodyRender: (val, tableMeta, updateValue) => {
                        return (
                            <div>
ardyardyaaan's avatar
ardyardyaaan committed
882
                                <div className="grid grid-3x content-center">
r.kurnia's avatar
r.kurnia committed
883 884 885
                                    <div className="grid grid-4x content-center">
                                        <div className="col-1">
                                            {
Riri Novita's avatar
Riri Novita committed
886
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
887
                                                    null
d.arizona's avatar
d.arizona committed
888 889 890 891 892 893 894 895 896
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        <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}
897
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[6], tableMeta, 6)).toFixed(1)}
qorri_di's avatar
qorri_di committed
898
                                                            // pengambilan dari monthly report:  value={Number(tableMeta.rowData[6].value).toFixed(1)}
899

d.arizona's avatar
d.arizona committed
900 901 902 903 904 905 906 907 908 909
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
910
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[6], tableMeta, 6)).toFixed(1)}
qorri_di's avatar
qorri_di committed
911
                                                            //pengambilan dari monthly report:  value={Number(tableMeta.rowData[6].value).toFixed(1)}
d.arizona's avatar
d.arizona committed
912 913 914
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
Riri Novita's avatar
Riri Novita committed
915
                                                                // this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[6], tableMeta, 6)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[6], tableMeta, 6)).toFixed(1)) <= Number(this.state.maxValue)) ?
                                                                    //pengambilan dari monthly report: (Number(tableMeta.rowData[6].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[6].value).toFixed(1) <= Number(this.state.maxValue)) ?
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[6], tableMeta, 6)).toFixed(1)}
qorri_di's avatar
qorri_di committed
933
                                                                    // pengambilan dari monthly report: value={Number(tableMeta.rowData[6].value).toFixed(1)}
934 935 936
                                                                    />
                                                                    :
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
937 938 939 940 941 942 943 944 945
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
946
                                                                                color: 'red'
d.arizona's avatar
d.arizona committed
947 948 949 950
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
951
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[6], tableMeta, 6)).toFixed(1)}
qorri_di's avatar
qorri_di committed
952
                                                                        //pengambilan dari monthly report: value={Number(tableMeta.rowData[6].value).toFixed(1)}
d.arizona's avatar
d.arizona committed
953
                                                                        />
954
                                                                    </LightTooltip>
Riri Novita's avatar
Riri Novita committed
955
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
956
                                                                null
r.kurnia's avatar
r.kurnia committed
957 958
                                            }
                                        </div>
959
                                        <div className="col-2" style={{ left: 14 }}>
r.kurnia's avatar
r.kurnia committed
960
                                            {
Riri Novita's avatar
Riri Novita committed
961
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
962
                                                    null
d.arizona's avatar
d.arizona committed
963 964 965 966 967 968 969 970 971 972
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        // null
                                                        <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}
973
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[7].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[7], tableMeta, 7)).toFixed(1)}
qorri_di's avatar
qorri_di committed
974
                                                            // pengambilan dari monthly report: value={Number(tableMeta.rowData[7].value).toFixed(1)}
975
                                                            />
d.arizona's avatar
d.arizona committed
976 977 978 979 980 981 982 983 984 985
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
986
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[7].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[7], tableMeta, 7)).toFixed(1)}
qorri_di's avatar
qorri_di committed
987
                                                            //pengambilan dari monthly report: value={Number(tableMeta.rowData[7].value).toFixed(1)}
d.arizona's avatar
d.arizona committed
988 989 990
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
Riri Novita's avatar
Riri Novita committed
991
                                                                // this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[7].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[7], tableMeta, 7)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[7], tableMeta, 7)).toFixed(1)) <= Number(this.state.maxValue)) ?
                                                                    //validasi jika pengambilan dari monthly report: (Number(tableMeta.rowData[7].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[7].value).toFixed(1) <= Number(this.state.maxValue)) ?
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[7].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[7], tableMeta, 7)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1009
                                                                    //pengambilan dari monthly report:  value={Number(tableMeta.rowData[7].value).toFixed(1)}
1010 1011 1012
                                                                    /> :
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                        <NumberFormat
d.arizona's avatar
d.arizona committed
1013 1014 1015 1016 1017 1018 1019 1020
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
1021
                                                                                color: 'red'
d.arizona's avatar
d.arizona committed
1022 1023 1024 1025
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1026
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[7].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[7], tableMeta, 7)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1027
                                                                        //pengambilan dari monthly report: value={Number(tableMeta.rowData[7].value).toFixed(1)}
1028 1029
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1030
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
1031
                                                                null
r.kurnia's avatar
r.kurnia committed
1032 1033
                                            }
                                        </div>
1034
                                        <div className="col-3" style={{ left: 26 }}>
r.kurnia's avatar
r.kurnia committed
1035
                                            {
Riri Novita's avatar
Riri Novita committed
1036
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
1037
                                                    null
d.arizona's avatar
d.arizona committed
1038 1039 1040 1041 1042 1043 1044 1045 1046
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        <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}
1047
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[8].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[8], tableMeta, 8)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1048
                                                            //pengambilan dari monthly report: value={Number(tableMeta.rowData[8].value).toFixed(1)}
d.arizona's avatar
d.arizona committed
1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
1060
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[8].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[8], tableMeta, 8)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1061
                                                            //pengambilan dari monthly report:  value={Number(tableMeta.rowData[8].value).toFixed(1)}
d.arizona's avatar
d.arizona committed
1062 1063 1064
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
Riri Novita's avatar
Riri Novita committed
1065
                                                                // this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
1066
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[8].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[8], tableMeta, 8)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[8], tableMeta, 8)).toFixed(1)) <= Number(this.state.maxValue)) ?
1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082
                                                                    //pengambilan dari monthly report:   (Number(tableMeta.rowData[8].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[8].value).toFixed(1) <= Number(this.state.maxValue)) ?
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[8].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[8], tableMeta, 8)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1083
                                                                    //pengambilan dari monthly report: value={Number(tableMeta.rowData[8].value).toFixed(1)}
1084 1085
                                                                    /> :
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
1086 1087 1088 1089 1090 1091 1092 1093 1094
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
1095
                                                                                color: 'red'
d.arizona's avatar
d.arizona committed
1096 1097 1098 1099
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1100
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[8].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[8], tableMeta, 8)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1101
                                                                        //pengambilan dari monthly report: value={Number(tableMeta.rowData[8].value).toFixed(1)}
1102 1103
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1104
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
1105
                                                                null
r.kurnia's avatar
r.kurnia committed
1106 1107
                                            }
                                        </div>
1108
                                        <div className="col-4" style={{ left: 42 }}>
r.kurnia's avatar
r.kurnia committed
1109
                                            {
Riri Novita's avatar
Riri Novita committed
1110
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
1111
                                                    null
d.arizona's avatar
d.arizona committed
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        // null
                                                        <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}
1122
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1123
                                                            //sebelumnya: value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
1135
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1136
                                                            //sebelumnya: value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1137 1138 1139
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
Riri Novita's avatar
Riri Novita committed
1140
                                                                // this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) <= Number(this.state.maxValue)) ?
                                                                    //sebelumnya: ((this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) <= Number(this.state.maxValue)) ?
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1158
                                                                    // sebelumnya: value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
1159 1160
                                                                    /> :
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
1161 1162 1163 1164 1165 1166 1167 1168 1169
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
1170
                                                                                color: 'red'
d.arizona's avatar
d.arizona committed
1171 1172 1173 1174
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1175
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1176
                                                                        // sebelumnya:  value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
1177 1178
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1179
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
1180
                                                                null
r.kurnia's avatar
r.kurnia committed
1181 1182 1183 1184
                                            }
                                        </div>
                                    </div>
                                    <div className="grid grid-4x content-center">
1185
                                        <div className="col-1" style={{ left: 54 }}>
r.kurnia's avatar
r.kurnia committed
1186
                                            {
Riri Novita's avatar
Riri Novita committed
1187
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
1188
                                                    null
d.arizona's avatar
d.arizona committed
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        // null
                                                        <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}
1199
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1200
                                                            // value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
1212
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1213
                                                            // value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1214 1215 1216
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
Riri Novita's avatar
Riri Novita committed
1217
                                                                // this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
1218
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) <= Number(this.state.maxValue)) ?
1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234
                                                                    // ((this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) <= Number(this.state.maxValue)) ?
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1235
                                                                    // value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
1236 1237
                                                                    /> :
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
1238 1239 1240 1241 1242 1243 1244 1245 1246
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
1247
                                                                                color: 'red'
d.arizona's avatar
d.arizona committed
1248 1249 1250 1251
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1252
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1253
                                                                        // value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
1254 1255
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1256
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
1257
                                                                null
r.kurnia's avatar
r.kurnia committed
1258 1259
                                            }
                                        </div>
1260
                                        <div className="col-2" style={{ left: 70 }}>
r.kurnia's avatar
r.kurnia committed
1261
                                            {
Riri Novita's avatar
Riri Novita committed
1262
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
1263
                                                    null
d.arizona's avatar
d.arizona committed
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        // null
                                                        <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}
1274
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1275
                                                            //sebelumnya: value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
1287
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1288
                                                            //sebelumnya: value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1289 1290 1291
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
Riri Novita's avatar
Riri Novita committed
1292 1293
                                                                // this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
                                                                //     // ((this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) <= Number(this.state.maxValue)) ?
1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) <= Number(this.state.maxValue)) ?
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1310
                                                                    // value={this.props.quarter != 'q1' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
1311 1312
                                                                    /> :
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
1313 1314 1315 1316 1317 1318 1319 1320 1321
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
1322
                                                                                color: 'red'
d.arizona's avatar
d.arizona committed
1323 1324 1325 1326
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1327
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1328
                                                                        // value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
1329 1330
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1331
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
1332
                                                                null
r.kurnia's avatar
r.kurnia committed
1333 1334
                                            }
                                        </div>
1335
                                        <div className="col-3" style={{ left: 70 }}>
r.kurnia's avatar
r.kurnia committed
1336
                                            {
Riri Novita's avatar
Riri Novita committed
1337
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
1338
                                                    null
d.arizona's avatar
d.arizona committed
1339 1340 1341 1342 1343 1344 1345 1346 1347 1348
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        // null
                                                        <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}
1349
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1350
                                                            // value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
1362
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1363
                                                            // value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1364 1365 1366
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
Riri Novita's avatar
Riri Novita committed
1367 1368
                                                                // this.props.quarter === 'q3' ? null :
                                                                //     // ((this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)) <= Number(this.state.maxValue)) ?
1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)) <= Number(this.state.maxValue)) ?
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1385
                                                                    // value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
1386 1387
                                                                    /> :
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
1388 1389 1390 1391 1392 1393 1394 1395 1396
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
1397
                                                                                color: 'red'
d.arizona's avatar
d.arizona committed
1398 1399 1400 1401
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1402
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1403
                                                                        // value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
1404 1405
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1406
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
1407
                                                                null
r.kurnia's avatar
r.kurnia committed
1408 1409
                                            }
                                        </div>
1410
                                        <div className="col-4" style={{ left: 70 }}>
r.kurnia's avatar
r.kurnia committed
1411
                                            {
Riri Novita's avatar
Riri Novita committed
1412
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
1413
                                                    null
d.arizona's avatar
d.arizona committed
1414 1415 1416 1417 1418 1419 1420 1421 1422 1423
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        // null
                                                        <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}
1424
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1425
                                                            // value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
1437
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1438
                                                            // value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1439 1440 1441
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
Riri Novita's avatar
Riri Novita committed
1442 1443
                                                                // this.props.quarter === 'q3' ? null :
                                                                //    // ((this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)) <= Number(this.state.maxValue)) ?
1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)) <= Number(this.state.maxValue)) ?
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1460
                                                                    //sebelumnya: value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
1461 1462
                                                                    /> :
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
1463 1464 1465 1466 1467 1468 1469 1470 1471
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
1472
                                                                                color: 'red'
d.arizona's avatar
d.arizona committed
1473 1474 1475 1476
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1477
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1478
                                                                        // value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
1479 1480
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1481
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
1482
                                                                null
r.kurnia's avatar
r.kurnia committed
1483 1484 1485
                                            }
                                        </div>
                                    </div>
ardyardyaaan's avatar
ardyardyaaan committed
1486
                                    <div className="grid grid-5x content-center">
1487
                                        <div className="col-1" style={{ left: 70 }}>
r.kurnia's avatar
r.kurnia committed
1488
                                            {
Riri Novita's avatar
Riri Novita committed
1489
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
1490
                                                    null
d.arizona's avatar
d.arizona committed
1491 1492 1493 1494 1495 1496 1497 1498 1499 1500
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        // null
                                                        <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}
1501
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1502
                                                            //sebelumnnya: value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
1514
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1515
                                                            // value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1516 1517 1518
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
Riri Novita's avatar
Riri Novita committed
1519
                                                                // this.props.quarter === 'q3' ? null :
1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)) <= Number(this.state.maxValue)) ?
                                                                    // ((this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)) <= Number(this.state.maxValue)) ?
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1537
                                                                    //sebelumnya: value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
1538 1539
                                                                    /> :
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
1540 1541 1542 1543 1544 1545 1546 1547 1548
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
1549
                                                                                color: 'red'
d.arizona's avatar
d.arizona committed
1550 1551 1552 1553
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1554
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
qorri_di's avatar
qorri_di committed
1555
                                                                        //sebelumnya: value={this.props.quarter == 'q3' || this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
1556 1557
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1558
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
1559
                                                                null
r.kurnia's avatar
r.kurnia committed
1560 1561
                                            }
                                        </div>
1562
                                        <div className="col-2" style={{ left: 70 }}>
r.kurnia's avatar
r.kurnia committed
1563
                                            {
Riri Novita's avatar
Riri Novita committed
1564
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
1565
                                                    null
d.arizona's avatar
d.arizona committed
1566 1567 1568 1569 1570 1571 1572 1573 1574 1575
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        // null
                                                        <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}
1576
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[15].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
1588
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[15].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1589 1590 1591
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
1592
                                                                (this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[15].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1) <= Number(this.state.maxValue)) ?
d.arizona's avatar
d.arizona committed
1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
1607
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[15].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1608
                                                                    /> :
1609
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
                                                                                color: 'red'
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1624
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[15].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1625 1626
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1627
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
1628
                                                                null
r.kurnia's avatar
r.kurnia committed
1629 1630
                                            }
                                        </div>
1631
                                        <div className="col-3" style={{ left: 50 }}>
r.kurnia's avatar
r.kurnia committed
1632
                                            {
Riri Novita's avatar
Riri Novita committed
1633
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
1634
                                                    null
d.arizona's avatar
d.arizona committed
1635 1636 1637 1638 1639 1640 1641 1642 1643 1644
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        // null
                                                        <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}
1645
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[16].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
1657
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[16].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1658 1659 1660
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
1661
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[16].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)) <= Number(this.state.maxValue)) ?
d.arizona's avatar
d.arizona committed
1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
1676
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[16].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1677
                                                                    /> :
1678
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
                                                                                color: 'red'
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1693
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[16].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1694 1695
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1696
                                                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
1697
                                                                null
r.kurnia's avatar
r.kurnia committed
1698 1699
                                            }
                                        </div>
1700
                                        <div className="col-4" style={{ left: 40 }}>
r.kurnia's avatar
r.kurnia committed
1701
                                            {
Riri Novita's avatar
Riri Novita committed
1702
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
r.kurnia's avatar
r.kurnia committed
1703
                                                    null
d.arizona's avatar
d.arizona committed
1704 1705 1706 1707 1708 1709 1710 1711 1712 1713
                                                    :
                                                    tableMeta.rowData[0] === 5 ?
                                                        // null
                                                        <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}
1714
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[17].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725
                                                            />
                                                        </span>
                                                        :
                                                        tableMeta.rowData[0] === 6 ?
                                                            // null
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
1726
                                                                value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[17].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1727 1728 1729
                                                            />
                                                            :
                                                            tableMeta.rowData[0] === 7 ?
1730
                                                                ((this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[17].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)) <= Number(this.state.maxValue)) ?
d.arizona's avatar
d.arizona committed
1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744
                                                                    <NumberFormat
                                                                        thousandSeparator={true}
                                                                        style={{
                                                                            fontSize: 12,
                                                                            textAlign: 'right',
                                                                            borderColor: 'transparent',
                                                                            margin: 0,
                                                                            width: 96,
                                                                            backgroundColor: 'transparent',
                                                                            color: 'black'
                                                                        }}
                                                                        type="text"
                                                                        placeholder=""
                                                                        disabled={true}
1745
                                                                        value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[17].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1746
                                                                    /> :
1747
                                                                    <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[24]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
d.arizona's avatar
d.arizona committed
1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761
                                                                        <NumberFormat
                                                                            thousandSeparator={true}
                                                                            style={{
                                                                                fontSize: 12,
                                                                                textAlign: 'right',
                                                                                borderColor: 'transparent',
                                                                                margin: 0,
                                                                                width: 96,
                                                                                backgroundColor: 'transparent',
                                                                                color: 'red'
                                                                            }}
                                                                            type="text"
                                                                            placeholder=""
                                                                            disabled={true}
1762
                                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[17].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)}
d.arizona's avatar
d.arizona committed
1763 1764
                                                                        />
                                                                    </LightTooltip>
r.kurnia's avatar
r.kurnia committed
1765
                                                                :
Riri Novita's avatar
Riri Novita committed
1766
                                                                null
r.kurnia's avatar
r.kurnia committed
1767 1768
                                            }
                                        </div>
ardyardyaaan's avatar
ardyardyaaan committed
1769
                                        <div className="col-5">
1770 1771 1772 1773
                                            {
                                                tableMeta.rowData[0] === 3 || tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
                                                    null
                                                    :
1774 1775 1776 1777 1778 1779 1780 1781
                                                    <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}
                                                            // value={Number(tableMeta.rowData[18]).toFixed(1)}
Riri Novita's avatar
Riri Novita committed
1782
                                                            value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[18]).toFixed(1) : Number(handleTotal(tableMeta.rowData[18], tableMeta, 18)).toFixed(1)}
1783 1784 1785
                                                        />
                                                    </span>

1786 1787 1788
                                            }
                                        </div>
                                    </div>
r.kurnia's avatar
r.kurnia committed
1789 1790 1791 1792 1793
                                </div>
                            </div>
                        )
                    }
                }
ardyardyaaan's avatar
ardyardyaaan committed
1794
            },
1795
            {
r.kurnia's avatar
r.kurnia committed
1796 1797 1798 1799
                name: "",
                options: {
                    display: false
                }
ardyardyaaan's avatar
ardyardyaaan committed
1800
            },
1801
            {
r.kurnia's avatar
r.kurnia committed
1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
1856
            }, {
r.kurnia's avatar
r.kurnia committed
1857 1858 1859 1860
                name: "",
                options: {
                    display: false
                }
ardyardyaaan's avatar
ardyardyaaan committed
1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871
            }, {
                name: "",
                options: {
                    display: false
                }
            }, {
                name: "",
                options: {
                    display: false
                }
            }
Riri Novita's avatar
Riri Novita committed
1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 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 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115
            // {
            //     name: "",
            //     options: {
            //         display: false,
            //         customHeadRender: (columnMeta) => (
            //             <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
            //                 {/* <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> */}
            //                 <div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
            //                 <div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
            //                     <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0' }}>
            //                         <span>{"ForeCast"}</span>
            //                     </div>
            //                 </div>
            //             </th>
            //         ),
            //         setCellProps: () => ({ style2 }),
            //         customBodyRender: (value, tableMeta, updateValue) => {
            //             return (
            //                 <div style={{ textAlign: 'right' }}>
            //                     {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
            //                         null
            //                         :
            //                         tableMeta.rowData[0] === 7 ?
            //                             (Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1) >= Number(this.state.minValue) && Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1) <= Number(this.state.maxValue)) ?
            //                                 <NumberFormat
            //                                     thousandSeparator={true}
            //                                     style={{
            //                                         fontSize: 12,
            //                                         textAlign: 'right',
            //                                         borderColor: 'transparent',
            //                                         margin: 0,
            //                                         width: 96,
            //                                         backgroundColor: 'transparent',
            //                                         color: 'black'
            //                                     }}
            //                                     type="text"
            //                                     placeholder=""
            //                                     disabled={true}
            //                                     value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
            //                                 /> :
            //                                 <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
            //                                     <NumberFormat
            //                                         thousandSeparator={true}
            //                                         style={{
            //                                             fontSize: 12,
            //                                             textAlign: 'right',
            //                                             borderColor: 'transparent',
            //                                             margin: 0,
            //                                             width: 96,
            //                                             backgroundColor: 'transparent',
            //                                             color: 'red'
            //                                         }}
            //                                         type="text"
            //                                         placeholder=""
            //                                         disabled={true}
            //                                         value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
            //                                     />
            //                                 </LightTooltip>
            //                             :
            //                             <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}
            //                                             value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
            //                                         />
            //                                     }
            //                                 />
            //                             </div>}
            //                 </div>
            //             )
            //         }
            //     }
            // }, 
            // {
            //     name: `${Number(this.props.periode) + 1}`,
            //     options: {
            //         customHeadRender: (columnMeta) => (
            //             <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
            //                 {/* <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> */}
            //                 <div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
            //                 <div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
            //                     <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0' }}>
            //                         <span>{"ForeCast"}</span>
            //                     </div>
            //                 </div>
            //             </th>
            //         ),
            //         setCellProps: () => ({ style2 }),
            //         customBodyRender: (value, tableMeta, updateValue) => {
            //             return (
            //                 <div style={{ textAlign: 'right' }}>
            //                     {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
            //                         null
            //                         :
            //                         tableMeta.rowData[0] === 7 ?
            //                             (Number(handleForecast(tableMeta, `${Number(this.props.periode) + 1}`, 20)).toFixed(1) >= Number(this.state.minValue) && Number(handleForecast(tableMeta, `${Number(this.props.periode) + 1}`, 20)).toFixed(1) <= Number(this.state.maxValue)) ?
            //                                 <NumberFormat
            //                                     thousandSeparator={true}
            //                                     style={{
            //                                         fontSize: 12,
            //                                         textAlign: 'right',
            //                                         borderColor: 'transparent',
            //                                         margin: 0,
            //                                         width: 96,
            //                                         backgroundColor: 'transparent',
            //                                         color: 'black'
            //                                     }}
            //                                     type="text"
            //                                     placeholder=""
            //                                     disabled={true}
            //                                     value={Number(handleForecast(tableMeta, `${Number(this.props.periode) + 1}`, 20)).toFixed(1)}
            //                                 /> :
            //                                 <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
            //                                     <NumberFormat
            //                                         thousandSeparator={true}
            //                                         style={{
            //                                             fontSize: 12,
            //                                             textAlign: 'right',
            //                                             borderColor: 'transparent',
            //                                             margin: 0,
            //                                             width: 96,
            //                                             backgroundColor: 'transparent',
            //                                             color: 'red'
            //                                         }}
            //                                         type="text"
            //                                         placeholder=""
            //                                         disabled={true}
            //                                         value={Number(handleForecast(tableMeta, `${Number(this.props.periode) + 1}`, 20)).toFixed(1)}
            //                                     />
            //                                 </LightTooltip>
            //                             :
            //                             <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}
            //                                             value={Number(handleForecast(tableMeta, `${Number(this.props.periode) + 1}`, 20)).toFixed(1)}
            //                                         />
            //                                     }
            //                                 />
            //                             </div>}
            //                 </div>
            //             )
            //         }
            //     }
            // }, 
            // {
            //     name: `${Number(this.props.periode) + 2}`,
            //     options: {
            //         customHeadRender: (columnMeta) => (
            //             <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, top: 0, zIndex: 102, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
            //                 {/* <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> */}
            //                 <div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
            //                 <div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
            //                     <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0' }}>
            //                         <span>{"ForeCast"}</span>
            //                     </div>
            //                 </div>
            //             </th>
            //         ),
            //         setCellProps: () => ({ style2 }),
            //         customBodyRender: (value, tableMeta, updateValue) => {
            //             return (
            //                 <div style={{ textAlign: 'right' }}>
            //                     {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
            //                         null
            //                         :
            //                         tableMeta.rowData[0] === 7 ?
            //                             (Number(handleForecast(tableMeta, `${Number(this.props.periode) + 2}`, 21)).toFixed(1) >= Number(this.state.minValue) && Number(handleForecast(tableMeta, `${Number(this.props.periode) + 2}`, 21)).toFixed(1) <= Number(this.state.maxValue)) ?
            //                                 <NumberFormat
            //                                     thousandSeparator={true}
            //                                     style={{
            //                                         fontSize: 12,
            //                                         textAlign: 'right',
            //                                         borderColor: 'transparent',
            //                                         margin: 0,
            //                                         width: 96,
            //                                         backgroundColor: 'transparent',
            //                                         color: 'black'
            //                                     }}
            //                                     type="text"
            //                                     placeholder=""
            //                                     disabled={true}
            //                                     value={Number(handleForecast(tableMeta, `${Number(this.props.periode) + 2}`, 21)).toFixed(1)}
            //                                 /> :
            //                                 <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
            //                                     <NumberFormat
            //                                         thousandSeparator={true}
            //                                         style={{
            //                                             fontSize: 12,
            //                                             textAlign: 'right',
            //                                             borderColor: 'transparent',
            //                                             margin: 0,
            //                                             width: 96,
            //                                             backgroundColor: 'transparent',
            //                                             color: 'red'
            //                                         }}
            //                                         type="text"
            //                                         placeholder=""
            //                                         disabled={true}
            //                                         value={Number(handleForecast(tableMeta, `${Number(this.props.periode) + 2}`, 21)).toFixed(1)}
            //                                     />
            //                                 </LightTooltip>
            //                             :
            //                             <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}
            //                                             value={Number(handleForecast(tableMeta, `${Number(this.props.periode) + 2}`, 21)).toFixed(1)}
            //                                         />
            //                                     }
            //                                 />
            //                             </div>}
            //                 </div>
            //             )
            //         }
            //     }
            // }
r.kurnia's avatar
r.kurnia committed
2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131
        ]

        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 }}>
Riri Novita's avatar
Riri Novita committed
2132
                    <Typography style={{ fontSize: '16px', color: 'white' }}>Rolling Outlook & Revision CAT</Typography>
r.kurnia's avatar
r.kurnia committed
2133 2134 2135 2136 2137 2138 2139 2140 2141
                </div>
                <Snackbar open={this.state.alert} autoHideDuration={3000} onClose={() => this.closeAlert()}>
                    <Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
                        {this.state.messageAlert}
                    </Alert>
                </Snackbar>
                <div style={{ flex: 1, padding: 20, width: '100%' }}>
                    <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
                        <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
Riri Novita's avatar
Riri Novita committed
2142
                            <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Rolling Outlook - Cash Flow</Typography>
r.kurnia's avatar
r.kurnia committed
2143 2144 2145 2146 2147
                        </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>
Deni Rinaldi's avatar
Deni Rinaldi committed
2148
                                    <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} {String(this.props.quarter).toLocaleUpperCase()} (rev.{this.props.revision})</Typography>
r.kurnia's avatar
r.kurnia committed
2149 2150
                                    <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
                                </div>
Riri Novita's avatar
Riri Novita committed
2151
                                {/* <div style={{ width: '50%' }}>
r.kurnia's avatar
r.kurnia committed
2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172
                                    <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
                                        <a data-tip={'Download'} data-for="download">
                                            <button
                                                style={{
                                                    backgroundColor: 'transparent',
                                                    cursor: 'pointer',
                                                    borderColor: 'transparent',
                                                    margin: 5
                                                }}
                                                onClick={() => this.setState({ loading: true }, () => {
                                                    this.downloadAllData()
                                                    // setTimeout(() => {
                                                    //     this.setState({loading: false})
                                                    // }, 500);
                                                })}
                                            >
                                                <img src={Images.download} />
                                            </button>
                                        </a>
                                        <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
                                    </div>
Riri Novita's avatar
Riri Novita committed
2173
                                </div> */}
r.kurnia's avatar
r.kurnia committed
2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206
                            </div>

                            <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
                                {loading || (this.state.loading && loadingComponent)}
                                {!loading && <MuiThemeProvider theme={getMuiTheme()}>
                                    <MUIDataTable
                                        data={dataTable2}
                                        columns={columns}
                                        options={options}
                                    />
                                </MuiThemeProvider>}
                            </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' }}>Back</Typography>
                                        </div>
                                    </button>
                                </div>
Riri Novita's avatar
Riri Novita committed
2207 2208 2209 2210 2211 2212 2213 2214 2215
                                {this.state.viewOnly &&
                                    <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
                                        <button
                                            type="button"
                                            // disabled={this.state.buttonError}
                                            onClick={() =>
                                                // this.state.buttonError ?
                                                //     this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
                                                //     :
2216 2217
                                                this.state.handleDoubleClick == 1 ? null :
                                                    this.setState({ handleDoubleClick: 1 }, () => {
Riri Novita's avatar
Riri Novita committed
2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232
                                                        this.olahDataCashFlow(dataTable2)
                                                    })}
                                            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>
                                }
r.kurnia's avatar
r.kurnia committed
2233 2234 2235 2236 2237 2238 2239
                            </div>
                        </div>
                    </Paper>
                </div>
            </div>
        )
    }
Riri Novita's avatar
Riri Novita committed
2240
}