OperatingIndicatorDetail.js 159 KB
Newer Older
d.arizona's avatar
d.arizona committed
1
import React, { Component } from 'react';
Deni Rinaldi's avatar
Deni Rinaldi committed
2
import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormControlLabel, TextField, Input, Snackbar, withStyles, Tooltip } from '@material-ui/core';
d.arizona's avatar
d.arizona committed
3 4 5 6 7 8 9 10 11 12
import MUIDataTable from 'mui-datatables';
import NumberFormat from 'react-number-format';
import api from '../../api';
import AddIcon from '@material-ui/icons/Add';
import { values } from 'ramda';
import PropagateLoader from "react-spinners/PropagateLoader"
import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
Riri Novita's avatar
Riri Novita committed
13
// import { Alert } from '@material-ui/lab';
Riri Novita's avatar
Riri Novita committed
14
import Constant from '../../library/Constant';
Riri Novita's avatar
Riri Novita committed
15
import MuiAlert from '@material-ui/lab/Alert';
Riri Novita's avatar
Riri Novita committed
16
import { fixNumber, titleCase } from '../../library/Utils';
d.arizona's avatar
d.arizona committed
17 18 19 20

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

Riri Novita's avatar
Riri Novita committed
21 22 23
const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);

d.arizona's avatar
d.arizona committed
24 25 26 27 28 29 30 31 32 33 34 35 36
const options = ct.customOptionsFixedColumn();
const style = {
    position: "sticky",
    left: 0,
    zIndex: 101,
    background: "white",
};
const style2 = {
    position: "sticky",
    background: "white",
    zIndex: 100
};

Deni Rinaldi's avatar
Deni Rinaldi committed
37 38 39 40 41 42 43 44 45
const LightTooltip = withStyles((theme) => ({
    tooltip: {
        backgroundColor: theme.palette.common.white,
        color: 'rgba(0, 0, 0, 0.87)',
        boxShadow: theme.shadows[1],
        fontSize: 11,
    },
}))(Tooltip);

d.arizona's avatar
d.arizona committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
export default class BalanceSheet extends Component {
    constructor(props) {
        super(props)
        this.state = {
            dataTable: [
                // ["TOTAL ASSETS", "11,247,249", "10,702,196"],
                // ["TOTAL CURRENT ASSETS", "2,647,647", "2,058,898"],
                // ["Cash & Cash Equivalent", "1,464,571", "729,743"],
                // ["Cash & Bank Balance", "938,707", "265,584"],
                // ["Time & Call Deposit", "525,864", "464,159"],
                // ["BI Deposit", "", ""],
                // ["Marketable Securities", "150,250", "154,500"],
                // ["Notes Receivable", "", ""],
                // ["Accounts Receivable", "172,031", "97,112"],
                // ["Trade Receivables - Third Party", "142,668", "77,480"],
            ],
d.arizona's avatar
d.arizona committed
62
            visibleOI: true,
d.arizona's avatar
d.arizona committed
63 64
            disabledSave: true,
            editable: true,
EKSAD's avatar
EKSAD committed
65
            emptyData: false,
Riri Novita's avatar
Riri Novita committed
66
            updateBy: [],
Riri Novita's avatar
Riri Novita committed
67
            notesUpdate: '-',
Riri Novita's avatar
Riri Novita committed
68 69 70 71 72 73
            templateNull: true,
            defaultCurrencyUpload: this.props.defaultCurrency,
            visibleAlertSave: false,
            alert: false,
            tipeAlert: '',
            messageAlert: '',
d.arizona's avatar
d.arizona committed
74 75 76 77 78
        }
        this.handleValue = this.handleValue.bind(this)
        this.fileHandler = this.fileHandler.bind(this);
    }

d.arizona's avatar
d.arizona committed
79 80 81 82 83 84 85 86
    getLatestUpdate() {
        let payload = {
            "operating_indicator_id": this.props.data.operatingIndID,
            "report_id": this.props.data.report_id,
            "company_id": this.props.data.company.company_id,
            "periode": this.props.data.periode,
        }
        api.create().getLastestUpdateOI(payload).then(response => {
Riri Novita's avatar
Riri Novita committed
87
            // console.log(response.data)
d.arizona's avatar
d.arizona committed
88 89 90
            if (response.data) {
                if (response.data.status === "success") {
                    this.setState({
Riri Novita's avatar
Riri Novita committed
91 92 93 94 95 96 97 98 99 100 101
                        updateBy: response.data.data.detail === null ? [] : response.data.data.detail,
                        notesUpdate: response.data.data.notes_update === null ? '-' : response.data.data.notes_update
                    })
                } else {
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
                        if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
                            setTimeout(() => {
                                localStorage.removeItem(Constant.TOKEN)
                                window.location.reload();
                            }, 1000);
                        }
d.arizona's avatar
d.arizona committed
102 103
                    })
                }
Riri Novita's avatar
Riri Novita committed
104 105
            } else {
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
d.arizona's avatar
d.arizona committed
106 107 108 109
            }
        })
    }

d.arizona's avatar
d.arizona committed
110 111 112
    componentDidMount() {
        // this.getItemHierarki()
        this.getDataDetail()
d.arizona's avatar
d.arizona committed
113
        this.getLatestUpdate()
d.arizona's avatar
d.arizona committed
114
        // // console.log(this.props);
d.arizona's avatar
d.arizona committed
115 116 117
    }

    getDataDetail() {
Riri Novita's avatar
Riri Novita committed
118
        // this.setState({ loading: true })
d.arizona's avatar
d.arizona committed
119
        let payload = {
d.arizona's avatar
d.arizona committed
120
            "operating_indicator_id": this.props.data.operatingIndID,
d.arizona's avatar
d.arizona committed
121 122
            "report_id": this.props.data.report_id,
            "company_id": this.props.data.company.company_id,
Riri Novita's avatar
Riri Novita committed
123 124
            "periode": this.props.data.periode,
            "currency_id": this.props.defaultCurrency.id,
d.arizona's avatar
d.arizona committed
125
        }
Riri Novita's avatar
Riri Novita committed
126
        console.log(payload)
d.arizona's avatar
d.arizona committed
127
        api.create().getOperatingIndDetail(payload).then(response => {
Riri Novita's avatar
Riri Novita committed
128
            console.log(response)
d.arizona's avatar
d.arizona committed
129 130
            let dataTable = []
            let res = response.data.data
d.arizona's avatar
d.arizona committed
131
            // // // console.log(res) 
d.arizona's avatar
d.arizona committed
132 133 134 135 136 137 138 139 140 141
            const handlePushChild = (item) => {
                let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
                if (indexIDzz === -1) {
                    dataTable.push([
                        item.type_report_id,
                        item.id,
                        item.parent,
                        item.formula,
                        item.level,
                        item.description,
d.arizona's avatar
d.arizona committed
142
                        item.uom,
Riri Novita's avatar
Riri Novita committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
                        item.master_budget.total_actual_before == "" ? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1 ? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before),
                        item.master_budget.january == "" ? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1 ? Number(item.master_budget.january) : Number(item.master_budget.january),
                        item.master_budget.february == "" ? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1 ? Number(item.master_budget.february) : Number(item.master_budget.february),
                        item.master_budget.march == "" ? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1 ? Number(item.master_budget.march) : Number(item.master_budget.march),
                        item.master_budget.april == "" ? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1 ? Number(item.master_budget.april) : Number(item.master_budget.april),
                        item.master_budget.may == "" ? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1 ? Number(item.master_budget.may) : Number(item.master_budget.may),
                        item.master_budget.june == "" ? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1 ? Number(item.master_budget.june) : Number(item.master_budget.june),
                        item.master_budget.july == "" ? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1 ? Number(item.master_budget.july) : Number(item.master_budget.july),
                        item.master_budget.august == "" ? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1 ? Number(item.master_budget.august) : Number(item.master_budget.august),
                        item.master_budget.september == "" ? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1 ? Number(item.master_budget.september) : Number(item.master_budget.september),
                        item.master_budget.october == "" ? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1 ? Number(item.master_budget.october) : Number(item.master_budget.october),
                        item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november),
                        item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december),
                        item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year),
                        item.master_budget.total_next_year == "" ? item.master_budget.total_next_year : String(item.master_budget.total_next_year).indexOf(".") == -1 ? Number(item.master_budget.total_next_year) : Number(item.master_budget.total_next_year),
                        item.master_budget.total_more_year == "" ? item.master_budget.total_more_year : String(item.master_budget.total_more_year).indexOf(".") == -1 ? Number(item.master_budget.total_more_year) : Number(item.master_budget.total_more_year),
159
                        item.order
d.arizona's avatar
d.arizona committed
160 161 162 163
                    ])
                }
                if (item.children !== null) {
                    if (item.children.length > 0) {
Deni Rinaldi's avatar
Deni Rinaldi committed
164
                        item.children.map((items, indexs) => {
d.arizona's avatar
d.arizona committed
165 166 167 168 169
                            handlePushChild(items)
                        })
                    }
                }
            }
Deni Rinaldi's avatar
Deni Rinaldi committed
170
            res.map((item, index) => {
d.arizona's avatar
d.arizona committed
171 172 173 174 175 176 177 178
                dataTable.push([
                    item.type_report_id,
                    item.id,
                    item.parent,
                    item.formula,
                    item.level,
                    item.description,
                    item.uom,
Riri Novita's avatar
Riri Novita committed
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
                    item.master_budget.total_actual_before == "" ? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1 ? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before),
                    item.master_budget.january == "" ? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1 ? Number(item.master_budget.january) : Number(item.master_budget.january),
                    item.master_budget.february == "" ? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1 ? Number(item.master_budget.february) : Number(item.master_budget.february),
                    item.master_budget.march == "" ? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1 ? Number(item.master_budget.march) : Number(item.master_budget.march),
                    item.master_budget.april == "" ? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1 ? Number(item.master_budget.april) : Number(item.master_budget.april),
                    item.master_budget.may == "" ? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1 ? Number(item.master_budget.may) : Number(item.master_budget.may),
                    item.master_budget.june == "" ? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1 ? Number(item.master_budget.june) : Number(item.master_budget.june),
                    item.master_budget.july == "" ? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1 ? Number(item.master_budget.july) : Number(item.master_budget.july),
                    item.master_budget.august == "" ? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1 ? Number(item.master_budget.august) : Number(item.master_budget.august),
                    item.master_budget.september == "" ? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1 ? Number(item.master_budget.september) : Number(item.master_budget.september),
                    item.master_budget.october == "" ? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1 ? Number(item.master_budget.october) : Number(item.master_budget.october),
                    item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november),
                    item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december),
                    item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year),
                    item.master_budget.total_next_year == "" ? item.master_budget.total_next_year : String(item.master_budget.total_next_year).indexOf(".") == -1 ? Number(item.master_budget.total_next_year) : Number(item.master_budget.total_next_year),
                    item.master_budget.total_more_year == "" ? item.master_budget.total_more_year : String(item.master_budget.total_more_year).indexOf(".") == -1 ? Number(item.master_budget.total_more_year) : Number(item.master_budget.total_more_year),
195
                    item.order
d.arizona's avatar
d.arizona committed
196 197 198
                ])
                if (item.children !== null) {
                    if (item.children.length > 0) {
Deni Rinaldi's avatar
Deni Rinaldi committed
199
                        item.children.map((items, indexs) => {
d.arizona's avatar
d.arizona committed
200 201 202 203 204
                            handlePushChild(items)
                        })
                    }
                }
            })
Deni Rinaldi's avatar
Deni Rinaldi committed
205 206 207
            this.setState({ dataTable, loading: false }, () => {
                if (this.state.dataTable.length == 0) {
                    this.setState({ emptyData: true })
d.arizona's avatar
d.arizona committed
208 209
                }
            })
Riri Novita's avatar
Riri Novita committed
210
            console.log(dataTable);
d.arizona's avatar
d.arizona committed
211
        })
Deni Rinaldi's avatar
Deni Rinaldi committed
212

d.arizona's avatar
d.arizona committed
213 214
    }

d.arizona's avatar
d.arizona committed
215
    createData(type) {
d.arizona's avatar
d.arizona committed
216
        let payloadMB = []
Riri Novita's avatar
Riri Novita committed
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
        if (this.props.defaultCurrency.id == 2) {
            this.state.dataTable.map((item, index) => {
                payloadMB.push({
                    "item_report_id": item[1],
                    "total_actual_before": String(Number(item[7])),
                    "january": String(Number(item[8])),
                    "february": String(Number(item[9])),
                    "march": String(Number(item[10])),
                    "april": String(Number(item[11])),
                    "may": String(Number(item[12])),
                    "june": String(Number(item[13])),
                    "july": String(Number(item[14])),
                    "august": String(Number(item[15])),
                    "september": String(Number(item[16])),
                    "october": String(Number(item[17])),
                    "november": String(Number(item[18])),
                    "december": String(Number(item[19])),
                    "total_current_year": String(Number(item[20])),
                    "total_next_year": String(Number(item[21])),
                    "total_more_year": String(Number(item[22])),
                })
d.arizona's avatar
d.arizona committed
238
            })
Riri Novita's avatar
Riri Novita committed
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
        } else {
            this.state.dataTable.map((item, index) => {
                payloadMB.push({
                    "item_report_id": item[1],
                    "total_actual_before": String(fixNumber(Number(item[7]), 1)),
                    "january": String(fixNumber(Number(item[8]), 1)),
                    "february": String(fixNumber(Number(item[9]), 1)),
                    "march": String(fixNumber(Number(item[10]), 1)),
                    "april": String(fixNumber(Number(item[11]), 1)),
                    "may": String(fixNumber(Number(item[12]), 1)),
                    "june": String(fixNumber(Number(item[13]), 1)),
                    "july": String(fixNumber(Number(item[14]), 1)),
                    "august": String(fixNumber(Number(item[15]), 1)),
                    "september": String(fixNumber(Number(item[16]), 1)),
                    "october": String(fixNumber(Number(item[17]), 1)),
                    "november": String(fixNumber(Number(item[18]), 1)),
                    "december": String(fixNumber(Number(item[19]), 1)),
                    "total_current_year": String(fixNumber(Number(item[20]), 1)),
                    "total_next_year": String(fixNumber(Number(item[21]), 1)),
                    "total_more_year": String(fixNumber(Number(item[22]), 1)),
                })
            })
        }

d.arizona's avatar
d.arizona committed
263
        let payload = {
d.arizona's avatar
d.arizona committed
264
            "operating_indicator_id": this.props.data.operatingIndID,
d.arizona's avatar
d.arizona committed
265 266 267
            "report_id": this.props.data.report_id,
            "company_id": this.props.data.company.company_id,
            "periode": this.props.data.periode,
Riri Novita's avatar
Riri Novita committed
268
            "currency_id": this.props.defaultCurrency.id,
d.arizona's avatar
d.arizona committed
269
            "status": type,
d.arizona's avatar
d.arizona committed
270 271
            "master_budget": payloadMB
        }
Riri Novita's avatar
Riri Novita committed
272
        console.log(payload);
d.arizona's avatar
d.arizona committed
273
        // // console.log('=========================')
Riri Novita's avatar
Riri Novita committed
274
        // console.log(JSON.stringify(payload))
d.arizona's avatar
d.arizona committed
275
        this.props.saveOperatingInd(payload)
Riri Novita's avatar
Riri Novita committed
276 277
        this.setState({ loading: false })
        // this.props.onClickClose()
d.arizona's avatar
d.arizona committed
278 279 280 281 282 283 284 285 286 287 288
    }

    handleValue(data) {
        let total = 0
        this.state.dataTable.map((item, index) => {
            if (data.rowData[1] == item[2]) {
                total = item[data.columnIndex] == undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex]))
            }
        })
        let indexParent = this.state.dataTable.findIndex((val) => val[1] == this.state.dataTable[data.rowIndex][2])
        let a = this.state.dataTable[data.rowIndex][data.columnIndex] = total
d.arizona's avatar
d.arizona committed
289
        // // // console.log(indexParent);
d.arizona's avatar
d.arizona committed
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
        return a
    }

    handleChange(value, tableMeta) {
        let val = String(value).split(",").join("")
        let data = this.state.dataTable
        let indexParent = data.findIndex((val) => val[1] == data[tableMeta.rowIndex][2])
        if (indexParent > 0) {
            let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
            let jagain = data[indexParent][tableMeta.columnIndex]
            a = data[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val))
        } else {
            data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
        }
    }


    downloadTemplate = async () => {
        let res = await fetch(
309
            `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/master_budget/download_template?report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}&&currency_id=${this.props.defaultCurrency.id}`
d.arizona's avatar
d.arizona committed
310 311
        )
        res = await res.blob()
d.arizona's avatar
d.arizona committed
312
        // // console.log(res)
d.arizona's avatar
d.arizona committed
313 314 315 316 317 318 319 320 321 322
        if (res.size > 0) {
            let url = window.URL.createObjectURL(res);
            let a = document.createElement('a');
            a.href = url;
            a.download = 'Template Master Budget Operating Indicator.xlsx';
            a.click();
        }
    }

    async downloadAllData() {
d.arizona's avatar
d.arizona committed
323
        // // // console.log('masuk')
Deni Rinaldi's avatar
Deni Rinaldi committed
324
        let bram = [this.props.data.operatingIndID, this.props.report_id, this.props.data.company.company_id, this.props.data.periode]
d.arizona's avatar
d.arizona committed
325
        // // console.log(bram)
d.arizona's avatar
d.arizona committed
326
        let res = await fetch(
Riri Novita's avatar
Riri Novita committed
327
            `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/master_budget/export_master_budget?operating_indicator_id=${this.props.data.operatingIndID == null ? "" : this.props.data.operatingIndID}&&report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}`
d.arizona's avatar
d.arizona committed
328
        )
Deni Rinaldi's avatar
Deni Rinaldi committed
329

d.arizona's avatar
d.arizona committed
330
        res = await res.blob()
d.arizona's avatar
d.arizona committed
331
        // // console.log(res)
d.arizona's avatar
d.arizona committed
332
        this.setState({ loading: false })
d.arizona's avatar
d.arizona committed
333 334 335 336
        if (res.size > 0) {
            let url = window.URL.createObjectURL(res);
            let a = document.createElement('a');
            a.href = url;
d.arizona's avatar
d.arizona committed
337
            a.download = 'Master Budget Operating Indicator.xlsx';
d.arizona's avatar
d.arizona committed
338 339 340 341 342 343 344
            a.click();
        }
    }

    fileHandler = (event) => {
        let fileObj = event
        ExcelRenderer(fileObj, (err, resp) => {
d.arizona's avatar
d.arizona committed
345
            // // // console.log(resp)
d.arizona's avatar
d.arizona committed
346
            if (err) {
d.arizona's avatar
d.arizona committed
347
                // // console.log(err);
d.arizona's avatar
d.arizona committed
348 349 350
            }
            else {
                let isi = resp.rows.slice(3)
d.arizona's avatar
d.arizona committed
351
                // // console.log(isi);
d.arizona's avatar
d.arizona committed
352
                let payload = []
d.arizona's avatar
d.arizona committed
353
                let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
d.arizona's avatar
d.arizona committed
354 355 356
                isi.map((i, index) => {
                    if (i.length > 0) {
                        payload.push({
d.arizona's avatar
d.arizona committed
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
                            order: i[0] === undefined ? "0" : String(i[0]).trim(),
                            item_report_id: i[1] === undefined ? "0" : String(i[1]).trim(),
                            item_report: i[2] === undefined ? "0" : String(i[2]).trim(),
                            uom: i[3] === undefined ? "" : String(i[3]).trim(),
                            // total_actual_before: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
                            january: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
                            february: i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(),
                            march: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(),
                            april: i[7] === undefined ? "0" : reg.test(String(i[7])) === false ? "0" : String(i[7]).trim(),
                            may: i[8] === undefined ? "0" : reg.test(String(i[8])) === false ? "0" : String(i[8]).trim(),
                            june: i[9] === undefined ? "0" : reg.test(String(i[9])) === false ? "0" : String(i[9]).trim(),
                            july: i[10] === undefined ? "0" : reg.test(String(i[10])) === false ? "0" : String(i[10]).trim(),
                            august: i[11] === undefined ? "0" : reg.test(String(i[11])) === false ? "0" : String(i[11]).trim(),
                            september: i[12] === undefined ? "0" : reg.test(String(i[12])) === false ? "0" : String(i[12]).trim(),
                            october: i[13] === undefined ? "0" : reg.test(String(i[13])) === false ? "0" : String(i[13]).trim(),
                            november: i[14] === undefined ? "0" : reg.test(String(i[14])) === false ? "0" : String(i[14]).trim(),
                            december: i[15] === undefined ? "0" : reg.test(String(i[15])) === false ? "0" : String(i[15]).trim(),
                            total_current_year: i[16] === undefined ? "0" : reg.test(String(i[16])) === false ? "0" : String(i[16]).trim(),
qorri_di's avatar
qorri_di committed
375 376
                            total_next_year: i[17] === undefined ? "0" : reg.test(String(i[17])) === false ? "0" : String(i[17]).trim(),
                            total_more_year: i[18] === undefined ? "0" : reg.test(String(i[18])) === false ? "0" : String(i[18]).trim(),
d.arizona's avatar
d.arizona committed
377 378 379 380
                        })
                    }
                })
                let body = {
d.arizona's avatar
d.arizona committed
381 382 383
                    company_id: this.props.data.company.company_id,
                    periode: this.props.data.periode,
                    report_id: this.props.data.report_id,
Riri Novita's avatar
Riri Novita committed
384 385
                    master_budget: payload,
                    status: 'submitted'
d.arizona's avatar
d.arizona committed
386
                }
Riri Novita's avatar
Riri Novita committed
387
                console.log(body)
d.arizona's avatar
d.arizona committed
388 389 390 391 392 393
                this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
            }
        });
    }

    checkUpload() {
Riri Novita's avatar
Riri Novita committed
394 395 396 397
        let payload = {
            ...this.state.payload,
            currency_id: this.state.defaultCurrencyUpload?.id
        }
d.arizona's avatar
d.arizona committed
398
        // // console.log(JSON.stringify(this.state.payload))
Riri Novita's avatar
Riri Novita committed
399
        api.create().checkUploadOperatingInd(payload).then(response => {
d.arizona's avatar
d.arizona committed
400 401
            // // // console.log(JSON.stringify(this.state.payload));
            // // console.log('===============')
Riri Novita's avatar
Riri Novita committed
402
            console.log(response)
d.arizona's avatar
d.arizona committed
403 404
            if (response.data) {
                if (response.data.status === 'success') {
d.arizona's avatar
d.arizona committed
405
                    this.setState({ visibleUpload: false, visibleOI: false, loading: true })
EKSAD's avatar
EKSAD committed
406
                    let total = 0
d.arizona's avatar
d.arizona committed
407
                    let dataTable = response.data.data.map((item, index) => {
EKSAD's avatar
EKSAD committed
408 409 410
                        if (item.type_report_id != null) {
                            total += 1
                        }
d.arizona's avatar
d.arizona committed
411 412 413 414 415 416 417
                        return [
                            item.type_report_id,
                            item.item_report_id,
                            item.parent,
                            item.formula,
                            item.level,
                            item.item_report,
d.arizona's avatar
d.arizona committed
418
                            item.uom,
d.arizona's avatar
d.arizona committed
419 420 421 422 423 424 425 426 427 428 429 430 431 432
                            item.total_actual_before,
                            item.january,
                            item.february,
                            item.march,
                            item.april,
                            item.may,
                            item.june,
                            item.july,
                            item.august,
                            item.september,
                            item.october,
                            item.november,
                            item.december,
                            item.total_current_year,
qorri_di's avatar
qorri_di committed
433 434
                            item.total_next_year,
                            item.total_more_year,
435
                            item.order,
d.arizona's avatar
d.arizona committed
436 437 438
                            item.error
                        ]
                    })
Riri Novita's avatar
Riri Novita committed
439
                    this.setState({ dataTable, dataLoaded: true, loading: false, templateNull: total > 0 ? true : false })
d.arizona's avatar
d.arizona committed
440 441 442 443 444
                }
            }
        })
    }

d.arizona's avatar
d.arizona committed
445 446
    uploadOI(type) {
        let data = []
d.arizona's avatar
d.arizona committed
447
        // // console.log(this.state.dataTable)
Riri Novita's avatar
Riri Novita committed
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469
        if (this.props.defaultCurrency.id == 2) {
            this.state.dataTable.map(i => {
                data.push({
                    "item_report_id": i[1],
                    "item_report": String(i[5]),
                    "total_actual_before": String(Number(i[7] == null ? "0" : i[7])),
                    "january": String(Number(i[8])),
                    "february": String(Number(i[9])),
                    "march": String(Number(i[10])),
                    "april": String(Number(i[11])),
                    "may": String(Number(i[12])),
                    "june": String(Number(i[13])),
                    "july": String(Number(i[14])),
                    "august": String(Number(i[15])),
                    "september": String(Number(i[16])),
                    "october": String(Number(i[17])),
                    "november": String(Number(i[18])),
                    "december": String(Number(i[19])),
                    "total_current_year": String(Number(i[20])),
                    "total_next_year": String(Number(i[21])),
                    "total_more_year": String(Number(i[22])),
                })
d.arizona's avatar
d.arizona committed
470
            })
Riri Novita's avatar
Riri Novita committed
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
        } else {
            this.state.dataTable.map(i => {
                data.push({
                    "item_report_id": i[1],
                    "item_report": String(i[5]),
                    "total_actual_before": String(fixNumber(Number(i[7] == null ? "0" : i[7]), 1)),
                    "january": String(fixNumber(Number(i[8]), 1)),
                    "february": String(fixNumber(Number(i[9]), 1)),
                    "march": String(fixNumber(Number(i[10]), 1)),
                    "april": String(fixNumber(Number(i[11]), 1)),
                    "may": String(fixNumber(Number(i[12]), 1)),
                    "june": String(fixNumber(Number(i[13]), 1)),
                    "july": String(fixNumber(Number(i[14]), 1)),
                    "august": String(fixNumber(Number(i[15]), 1)),
                    "september": String(fixNumber(Number(i[16]), 1)),
                    "october": String(fixNumber(Number(i[17]), 1)),
                    "november": String(fixNumber(Number(i[18]), 1)),
                    "december": String(fixNumber(Number(i[19]), 1)),
                    "total_current_year": String(fixNumber(Number(i[20]), 1)),
                    "total_next_year": String(fixNumber(Number(i[21]), 1)),
                    "total_more_year": String(fixNumber(Number(i[22]), 1)),
                })
            })
        }

d.arizona's avatar
d.arizona committed
496 497
        let body = {
            company_id: this.props.data.company.company_id,
d.arizona's avatar
d.arizona committed
498
            operating_indicator_id: this.props.data.operatingIndID,
d.arizona's avatar
d.arizona committed
499 500
            periode: this.props.data.periode,
            report_id: this.props.data.report_id,
Riri Novita's avatar
Riri Novita committed
501
            currency_id: this.props.defaultCurrency.id,
d.arizona's avatar
d.arizona committed
502 503 504
            status: type,
            master_budget: data
        }
d.arizona's avatar
d.arizona committed
505 506
        // // console.log(data);
        // // console.log(JSON.stringify(body))
d.arizona's avatar
d.arizona committed
507
        api.create('UPLOAD').uploadOperatingInd(body).then(response => {
Riri Novita's avatar
Riri Novita committed
508
            console.log(response);
Deni Rinaldi's avatar
Deni Rinaldi committed
509
            this.setState({ loading: false })
d.arizona's avatar
d.arizona committed
510 511 512 513 514
            if (response.data) {
                if (response.data.status === "success") {
                    this.props.onClickClose()
                    this.props.getReport()
                } else {
Riri Novita's avatar
Riri Novita committed
515 516 517 518 519 520 521
                    console.log(response.data.message);
                    if (response.data.message == "Please Set Up Rate Currency First") {
                        this.setState({ visibleAlertSave: true, loading: false })
                    } else {
                        this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
                    }
                    // alert(response.data.status)
d.arizona's avatar
d.arizona committed
522 523 524 525 526 527 528
                }
            } else {
                alert(response.problem)
            }
        })
    }

d.arizona's avatar
d.arizona committed
529 530 531
    closeAlert() {
        this.setState({ alert: false })
    }
Deni Rinaldi's avatar
Deni Rinaldi committed
532

d.arizona's avatar
d.arizona committed
533 534 535 536
    render() {
        let dataTable2 = this.state.dataTable
        const handleChange = (value, tableMeta) => {
            let val = String(value).split(",").join("")
d.arizona's avatar
d.arizona committed
537 538
            let total = 0
            dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
d.arizona's avatar
d.arizona committed
539 540 541 542 543 544
            // dataTable2[tableMeta.rowIndex].map((item,index) => {
            //     if (index >= 8 && index <= 19) {
            //         let valItem = item == undefined || item == ""? 0 : item
            //         total += Number(valItem)
            //     }
            // })
qorri_di's avatar
qorri_di committed
545
            // dataTable2[tableMeta.rowIndex][20] = total 
d.arizona's avatar
d.arizona committed
546
            // // console.log(dataTable2[tableMeta.rowIndex])
d.arizona's avatar
d.arizona committed
547
        }
d.arizona's avatar
d.arizona committed
548 549 550

        const handleValue = (value, tableMeta) => {
            let val = String(value).split(",").join("")
d.arizona's avatar
d.arizona committed
551
            let total = 0
d.arizona's avatar
d.arizona committed
552
            dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
Deni Rinaldi's avatar
Deni Rinaldi committed
553
            dataTable2[tableMeta.rowIndex].map((item, index) => {
d.arizona's avatar
d.arizona committed
554
                if (index >= 8 && index <= 19) {
Deni Rinaldi's avatar
Deni Rinaldi committed
555
                    let valItem = item == undefined || item == "" ? 0 : item
d.arizona's avatar
d.arizona committed
556
                    total += Number(valItem)
d.arizona's avatar
d.arizona committed
557 558
                }
            })
Deni Rinaldi's avatar
Deni Rinaldi committed
559
            dataTable2[tableMeta.rowIndex][20] = total
d.arizona's avatar
d.arizona committed
560
            return total
d.arizona's avatar
d.arizona committed
561
        }
d.arizona's avatar
d.arizona committed
562

d.arizona's avatar
d.arizona committed
563
        const handleParent = (tableMeta) => {
d.arizona's avatar
d.arizona committed
564
            // // console.log(tableMeta)
d.arizona's avatar
d.arizona committed
565
            let total = 0
d.arizona's avatar
d.arizona committed
566 567 568

            dataTable2.map((item, index) => {
                if (item[2] == tableMeta.rowData[1]) {
d.arizona's avatar
d.arizona committed
569 570
                    // // console.log(total)
                    // // console.log(item[tableMeta.columnIndex])
d.arizona's avatar
d.arizona committed
571 572 573 574 575 576 577
                    total += Number(item[tableMeta.columnIndex])
                }
            })

            dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
            return total
        }
Deni Rinaldi's avatar
Deni Rinaldi committed
578

579
        const handleFormula = (tableMeta) => {
d.arizona's avatar
d.arizona committed
580
            let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
581
            let arrayFormulaConvert = []
d.arizona's avatar
d.arizona committed
582 583 584
            // // // console.log(arrayFormula)
            let opet = ""
            let tambahan = false
d.arizona's avatar
d.arizona committed
585
            arrayFormula.map((item, indexs) => {
d.arizona's avatar
d.arizona committed
586 587 588
                if (item == 'X') {
                    tambahan = true
                } else if (item == '-' || item == '+' || item == '/' || item == '*') {
589
                    arrayFormulaConvert.push(item)
d.arizona's avatar
d.arizona committed
590
                } else {
qorri_di's avatar
qorri_di committed
591
                    let indexID = dataTable2.findIndex((val) => val[23] == item)
d.arizona's avatar
d.arizona committed
592 593 594 595
                    if (tambahan) {
                        if (item == '-' || item == '+' || item == '/' || item == '*') {
                            opet = item
                        } else {
Riri Novita's avatar
Riri Novita committed
596
                            arrayFormulaConvert.push(opet == '' ? Number(item) : Number(String(opet + String(item))))
d.arizona's avatar
d.arizona committed
597 598 599
                            tambahan = false
                            opet = ""
                        }
Riri Novita's avatar
Riri Novita committed
600
                    } else {
d.arizona's avatar
d.arizona committed
601 602 603 604 605
                        if (indexID !== -1) {
                            let valuezz = dataTable2[indexID][tableMeta.columnIndex]
                            // // // console.log(dataTable2[indexID])
                            arrayFormulaConvert.push(valuezz == "" ? 0 : valuezz)
                        }
606
                    }
d.arizona's avatar
d.arizona committed
607 608
                }
            })
d.arizona's avatar
d.arizona committed
609 610
            // // console.log(arrayFormula)
            // // console.log(arrayFormulaConvert)
611
            let array = arrayFormulaConvert
d.arizona's avatar
d.arizona committed
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
            let total = 0
            let opt = ""
            array.map((item, index) => {
                if (item == "+") {
                    opt = "tambah"
                } else if (item == "-") {
                    opt = "kurang"
                } else if (item == "*") {
                    opt = "kali"
                } else if (item == "/") {
                    opt = "bagi"
                } 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)
                    } else {
d.arizona's avatar
d.arizona committed
633
                        total += Number(item)
d.arizona's avatar
d.arizona committed
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
                    }
                }
            })
            let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total)
            return a

        }
        const columns = [{
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "Account",
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 300 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style }),
                customBodyRender: (val, tableMeta) => {
                    return (
                        <div style={{ width: 300 }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
678 679
                            {tableMeta.rowData[0] === null ?
                                tableMeta.rowData[1] !== null ?
d.arizona's avatar
d.arizona committed
680 681 682 683 684
                                    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>
Deni Rinaldi's avatar
Deni Rinaldi committed
685 686 687 688 689 690 691 692 693
                                        </div> :
                                    tableMeta.rowData[4] == 0 ?
                                        <LightTooltip title={"Report Items Not Registered"} arrow>
                                            <span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(val).toUpperCase()}</span>
                                        </LightTooltip> :
                                        <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>
d.arizona's avatar
d.arizona committed
694
                                        </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739
                                :
                                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[0] === 4 || tableMeta.rowData[0] === null ?
                                //     null
                                //     :
                                //     tableMeta.rowData[22] ?
                                //         tableMeta.rowData[22].length > 0 ?
                                //             tableMeta.rowData[22][0].field === 'item' ?
                                //                 tableMeta.rowData[4] == 0 ?
                                //                     <a data-tip={tableMeta.rowData[22][0].message} data-for="account">
                                //                         <span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
                                //                     </a>
                                //                     :
                                //                     <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
                                //                         <a data-tip={tableMeta.rowData[22][0].message} data-for="account">
                                //                             <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
                                //                         </a>
                                //                     </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>
                                //         :
                                //         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>
d.arizona's avatar
d.arizona committed
740
                            }
Deni Rinaldi's avatar
Deni Rinaldi committed
741
                            {/* <ReactTooltip border={true} id="account" place="bottom" type="light" effect="solid" /> */}
d.arizona's avatar
d.arizona committed
742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757
                        </div>
                    )
                }
            }
        }, {
            name: "UOM",
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
                        <Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
758
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === null ?
d.arizona's avatar
d.arizona committed
759 760
                                null
                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
761
                                <FormControlLabel
d.arizona's avatar
d.arizona committed
762 763 764 765 766 767 768 769 770
                                    style={{ margin: 0 }}
                                    // value={value}
                                    control={
                                        <Input
                                            disableUnderline={true}
                                            style={{ fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginTop: -10 }}
                                            type="text"
                                            placeholder=""
                                            defaultValue={value}
d.arizona's avatar
d.arizona committed
771
                                            // color={"#5198ea"}
d.arizona's avatar
d.arizona committed
772 773
                                            value={value}
                                            disabled={true}
qorri_di's avatar
qorri_di committed
774 775 776 777 778 779
                                        // onBlur={(event) => {
                                        //     // // console.log(event.target.value)
                                        //     // updateValue(event.target.value)
                                        //     handleChangeText(event.target.value, tableMeta)
                                        //     // // console.log(dataTable2)
                                        // }}
d.arizona's avatar
d.arizona committed
780
                                        />
Deni Rinaldi's avatar
Deni Rinaldi committed
781 782
                                    }
                                />}
d.arizona's avatar
d.arizona committed
783 784 785 786 787
                        </div>
                    )
                }
            }
        }, {
d.arizona's avatar
d.arizona committed
788
            name: `31 Dec ${Number(this.props.data.periode) - 1} Actual`,
d.arizona's avatar
d.arizona committed
789 790 791 792 793 794 795 796 797 798
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
                        <Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
799
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
d.arizona's avatar
d.arizona committed
800 801
                                null
                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
802 803 804 805 806 807
                                <NumberFormat
                                    thousandSeparator={true}
                                    style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                    type="text"
                                    placeholder=""
                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
808 809
                                    // decimalScale={1}
                                    value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
810
                                />}
d.arizona's avatar
d.arizona committed
811 812 813 814 815
                        </div>
                    )
                }
            }
        }, {
d.arizona's avatar
d.arizona committed
816
            name: `Jan ${this.props.data.periode}`,
d.arizona's avatar
d.arizona committed
817 818 819 820 821 822 823 824 825 826
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
827
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
d.arizona's avatar
d.arizona committed
828 829
                                null
                                :
Deni Rinaldi's avatar
Deni Rinaldi committed
830 831 832 833 834 835 836 837 838 839 840
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
841
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
842
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
843
                                                // decimalScale={1}
Deni Rinaldi's avatar
Deni Rinaldi committed
844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859
                                                />
                                            }
                                        />
                                    </div>
                                    :
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
                                        <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=""
Riri Novita's avatar
Riri Novita committed
860
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
861
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
862
                                                        // decimalScale={1}
Deni Rinaldi's avatar
Deni Rinaldi committed
863 864 865
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
d.arizona's avatar
d.arizona committed
866
                                                            // // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
867 868 869
                                                        }}
                                                    />
                                                }
870
                                            />
Deni Rinaldi's avatar
Deni Rinaldi committed
871 872 873 874 875 876 877 878 879 880 881 882
                                        </div>
                                        :
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
883 884
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
Deni Rinaldi's avatar
Deni Rinaldi committed
885 886 887 888
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
d.arizona's avatar
d.arizona committed
889
                                                            // // console.log(dataTable2)
Deni Rinaldi's avatar
Deni Rinaldi committed
890 891 892
                                                        }}
                                                    />
                                                }
d.arizona's avatar
d.arizona committed
893
                                            />
Deni Rinaldi's avatar
Deni Rinaldi committed
894
                                        </div>)
d.arizona's avatar
d.arizona committed
895 896 897 898 899 900
                            }
                        </div>
                    )
                }
            }
        }
Deni Rinaldi's avatar
Deni Rinaldi committed
901
            , {
qorri_di's avatar
qorri_di committed
902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926
            name: `Feb ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
927
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
928
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
929
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
930 931 932 933
                                                />
                                            }
                                        />
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
934
                                    :
qorri_di's avatar
qorri_di committed
935
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
936 937 938 939 940 941 942 943 944 945
                                        <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=""
Riri Novita's avatar
Riri Novita committed
946
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
947
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
948
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
949 950 951 952 953
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
954 955
                                                    />
                                                }
956
                                            />
Deni Rinaldi's avatar
Deni Rinaldi committed
957 958 959 960 961 962 963 964 965
                                        </div>
                                        :
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
qorri_di's avatar
qorri_di committed
966
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
967 968
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
969 970
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
971 972 973 974 975 976
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
977 978
                                                    />
                                                }
d.arizona's avatar
d.arizona committed
979
                                            />
qorri_di's avatar
qorri_di committed
980 981 982 983
                                        </div>)
                            }
                        </div>
                    )
qorri_di's avatar
qorri_di committed
984
                }
qorri_di's avatar
qorri_di committed
985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011
            }
        }, {
            name: `Mar ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1012
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1013
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1014
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1015 1016 1017 1018
                                                />
                                            }
                                        />
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1019
                                    :
qorri_di's avatar
qorri_di committed
1020
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1031
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1032
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1033
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1034 1035 1036 1037 1038
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1039 1040
                                                    />
                                                }
d.arizona's avatar
d.arizona committed
1041
                                            />
Deni Rinaldi's avatar
Deni Rinaldi committed
1042 1043 1044 1045 1046 1047 1048 1049 1050
                                        </div>
                                        :
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
qorri_di's avatar
qorri_di committed
1051
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1052 1053
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1054 1055
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1056 1057 1058 1059 1060 1061
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1062 1063
                                                    />
                                                }
1064
                                            />
qorri_di's avatar
qorri_di committed
1065 1066 1067 1068
                                        </div>)
                            }
                        </div>
                    )
qorri_di's avatar
qorri_di committed
1069
                }
qorri_di's avatar
qorri_di committed
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096
            }
        }, {
            name: `Apr ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1097
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1098
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1099
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1100 1101 1102 1103
                                                />
                                            }
                                        />
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1104
                                    :
qorri_di's avatar
qorri_di committed
1105
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1116
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1117
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1118
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1119 1120 1121 1122 1123
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1124 1125
                                                    />
                                                }
1126
                                            />
Deni Rinaldi's avatar
Deni Rinaldi committed
1127 1128 1129 1130 1131 1132 1133
                                        </div>
                                        :
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
qorri_di's avatar
qorri_di committed
1134 1135
                                                    <NumberFormat
                                                        thousandSeparator={true}
qorri_di's avatar
qorri_di committed
1136
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
qorri_di's avatar
qorri_di committed
1137 1138
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1139 1140
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1141 1142 1143 1144 1145 1146
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
qorri_di's avatar
qorri_di committed
1147 1148 1149
                                                    />
                                                }
                                            />
qorri_di's avatar
qorri_di committed
1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181
                                        </div>)
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `May ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1182
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1183
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1184
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1185
                                                />
qorri_di's avatar
qorri_di committed
1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200
                                            }
                                        />
                                    </div>
                                    :
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1201
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1202
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1203
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>
                                        :
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1224 1225
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>)
                            }
                        </div>
                    )
qorri_di's avatar
qorri_di committed
1239
                }
qorri_di's avatar
qorri_di committed
1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266
            }
        }, {
            name: `Jun ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1267
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1268
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1269
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285
                                                />
                                            }
                                        />
                                    </div>
                                    :
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1286
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1287
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1288
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>
                                        :
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1309 1310
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>)
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Jul ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1352
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1353
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1354
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370
                                                />
                                            }
                                        />
                                    </div>
                                    :
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1371
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1372
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1373
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>
                                        :
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1394 1395
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>)
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Aug ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1437
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1438
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1439
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455
                                                />
                                            }
                                        />
                                    </div>
                                    :
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1456
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1457
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1458
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>
                                        :
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1479 1480
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>)
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Sep ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1522
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1523
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1524
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1525 1526 1527 1528
                                                />
                                            }
                                        />
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1529
                                    :
qorri_di's avatar
qorri_di committed
1530
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1531 1532 1533 1534 1535 1536 1537 1538 1539 1540
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1541
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1542
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1543
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1544 1545 1546 1547 1548
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1549 1550
                                                    />
                                                }
1551
                                            />
Deni Rinaldi's avatar
Deni Rinaldi committed
1552 1553
                                        </div>
                                        :
qorri_di's avatar
qorri_di committed
1554 1555 1556 1557 1558 1559 1560 1561 1562 1563
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1564 1565
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>)
                            }
                        </div>
                    )
qorri_di's avatar
qorri_di committed
1579
                }
qorri_di's avatar
qorri_di committed
1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606
            }
        }, {
            name: `Oct ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1607
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1608
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1609
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1610 1611 1612 1613
                                                />
                                            }
                                        />
                                    </div>
qorri_di's avatar
qorri_di committed
1614
                                    :
qorri_di's avatar
qorri_di committed
1615
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1616 1617 1618 1619 1620 1621 1622
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
qorri_di's avatar
qorri_di committed
1623
                                                        style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1624 1625
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1626
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1627
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1628
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1629 1630 1631 1632 1633
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1634 1635
                                                    />
                                                }
d.arizona's avatar
d.arizona committed
1636
                                            />
qorri_di's avatar
qorri_di committed
1637 1638
                                        </div>
                                        :
qorri_di's avatar
qorri_di committed
1639 1640 1641 1642 1643 1644 1645 1646 1647 1648
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1649 1650
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>)
                            }
                        </div>
                    )
qorri_di's avatar
qorri_di committed
1664
                }
qorri_di's avatar
qorri_di committed
1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691
            }
        }, {
            name: `Nov ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1692
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1693
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1694
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1695 1696 1697 1698
                                                />
                                            }
                                        />
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1699
                                    :
qorri_di's avatar
qorri_di committed
1700
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1701 1702 1703 1704 1705 1706 1707 1708 1709 1710
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1711
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1712
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1713
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1714 1715 1716 1717 1718
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1719 1720
                                                    />
                                                }
1721
                                            />
Deni Rinaldi's avatar
Deni Rinaldi committed
1722 1723 1724 1725 1726 1727 1728 1729 1730
                                        </div>
                                        :
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
qorri_di's avatar
qorri_di committed
1731
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1732 1733
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1734 1735
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1736 1737 1738 1739 1740 1741
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1742 1743
                                                    />
                                                }
d.arizona's avatar
d.arizona committed
1744
                                            />
qorri_di's avatar
qorri_di committed
1745 1746 1747 1748
                                        </div>)
                            }
                        </div>
                    )
qorri_di's avatar
qorri_di committed
1749
                }
qorri_di's avatar
qorri_di committed
1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776
            }
        }, {
            name: `Dec ${this.props.data.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                        <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1777
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1778
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1779
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1780 1781 1782 1783
                                                />
                                            }
                                        />
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
1784
                                    :
qorri_di's avatar
qorri_di committed
1785
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1786 1787 1788 1789 1790 1791 1792 1793 1794 1795
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1796
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1797
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1798
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1799 1800 1801 1802 1803 1804 1805 1806 1807 1808
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>
                                        :
Deni Rinaldi's avatar
Deni Rinaldi committed
1809 1810 1811 1812 1813 1814 1815
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
qorri_di's avatar
qorri_di committed
1816
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1817 1818
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1819 1820
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1821 1822 1823 1824 1825 1826
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1827 1828
                                                    />
                                                }
d.arizona's avatar
d.arizona committed
1829
                                            />
qorri_di's avatar
qorri_di committed
1830 1831 1832 1833
                                        </div>)
                            }
                        </div>
                    )
qorri_di's avatar
qorri_di committed
1834
                }
qorri_di's avatar
qorri_di committed
1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861
            }
        }, {
            name: `31 Dec ${this.props.data.periode}\nTotal`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
                        <Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1862
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1863
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1864
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1865 1866 1867 1868
                                                />
                                            }
                                        />
                                    </div>
d.arizona's avatar
d.arizona committed
1869
                                    :
qorri_di's avatar
qorri_di committed
1870
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
1871 1872 1873 1874 1875 1876 1877 1878 1879 1880
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1881
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
Deni Rinaldi's avatar
Deni Rinaldi committed
1882
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1883
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1884 1885 1886 1887 1888
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
1889 1890 1891 1892 1893
                                                    />
                                                }
                                            />
                                        </div>
                                        :
qorri_di's avatar
qorri_di committed
1894 1895 1896 1897 1898 1899 1900 1901 1902 1903
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1904 1905
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
qorri_di's avatar
qorri_di committed
1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>)
                            }
                        </div>
                    )
                }
            }
Riri Novita's avatar
Riri Novita committed
1921 1922
        }, {
            name: `31 Dec ${Number(this.props.data.periode) + 1}\nTotal`,
qorri_di's avatar
qorri_di committed
1923 1924
            // name: `31 Dec 2023\nTotal`,
            options: {
Riri Novita's avatar
Riri Novita committed
1925 1926 1927 1928 1929
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
                        <Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
qorri_di's avatar
qorri_di committed
1930 1931
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
Riri Novita's avatar
Riri Novita committed
1932 1933 1934 1935
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
qorri_di's avatar
qorri_di committed
1936
                                :
Riri Novita's avatar
Riri Novita committed
1937
                                tableMeta.rowData[0] == 2 ?
qorri_di's avatar
qorri_di committed
1938 1939 1940 1941 1942 1943 1944 1945 1946 1947
                                    <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=""
Riri Novita's avatar
Riri Novita committed
1948
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
1949
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
1950
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
1951
                                                />
qorri_di's avatar
qorri_di committed
1952 1953 1954 1955
                                            }
                                        />
                                    </div>
                                    :
Riri Novita's avatar
Riri Novita committed
1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
                                        <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=""
Riri Novita's avatar
Riri Novita committed
1967
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
Riri Novita's avatar
Riri Novita committed
1968
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
1969
                                                        // decimalScale={1}
Riri Novita's avatar
Riri Novita committed
1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>
                                        :
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
1990 1991
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
Riri Novita's avatar
Riri Novita committed
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
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>)
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `31 Dec ${Number(this.props.data.periode) + 2}\nTotal`,
            // name: `31 Dec 2024\nTotal`,
            options: {
                customHeadRender: (columnMeta) => (
                    <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
                        <Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                    </TableCell>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div style={{ textAlign: 'right' }}>
                            {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === null ?
                                null
                                :
                                tableMeta.rowData[0] == 2 ?
qorri_di's avatar
qorri_di committed
2024 2025 2026 2027 2028 2029 2030
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
Riri Novita's avatar
Riri Novita committed
2031
                                                    style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
qorri_di's avatar
qorri_di committed
2032 2033
                                                    type="text"
                                                    placeholder=""
Riri Novita's avatar
Riri Novita committed
2034
                                                    value={fixNumber(Number(handleParent(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleParent(tableMeta)), 1)}
Riri Novita's avatar
Riri Novita committed
2035
                                                    disabled={true}
Riri Novita's avatar
Riri Novita committed
2036
                                                // decimalScale={1}
qorri_di's avatar
qorri_di committed
2037
                                                />
qorri_di's avatar
qorri_di committed
2038 2039
                                            }
                                        />
Riri Novita's avatar
Riri Novita committed
2040
                                    </div>
qorri_di's avatar
qorri_di committed
2041
                                    :
Riri Novita's avatar
Riri Novita committed
2042
                                    (tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6 ?
Deni Rinaldi's avatar
Deni Rinaldi committed
2043 2044 2045 2046 2047 2048 2049
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
qorri_di's avatar
qorri_di committed
2050
                                                        style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
Deni Rinaldi's avatar
Deni Rinaldi committed
2051 2052
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
2053
                                                        value={fixNumber(Number(handleFormula(tableMeta)), 1) == 0 ? "0.0" : fixNumber(Number(handleFormula(tableMeta)), 1)}
qorri_di's avatar
qorri_di committed
2054
                                                        disabled={true}
Riri Novita's avatar
Riri Novita committed
2055
                                                        // decimalScale={1}
Riri Novita's avatar
Riri Novita committed
2056 2057 2058 2059 2060
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
2061 2062 2063
                                                    />
                                                }
                                            />
qorri_di's avatar
qorri_di committed
2064 2065
                                        </div>
                                        :
Riri Novita's avatar
Riri Novita committed
2066 2067 2068 2069 2070 2071 2072 2073 2074 2075
                                        <div style={{ flex: 1 }}>
                                            <FormControlLabel
                                                style={{ margin: 0 }}
                                                value={value}
                                                control={
                                                    <NumberFormat
                                                        thousandSeparator={true}
                                                        style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                        type="text"
                                                        placeholder=""
Riri Novita's avatar
Riri Novita committed
2076 2077
                                                        value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
                                                        // decimalScale={1}
Riri Novita's avatar
Riri Novita committed
2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090
                                                        disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
                                                        onBlur={(event) => {
                                                            // updateValue(event.target.value)
                                                            handleChange(event.target.value, tableMeta)
                                                            // // console.log(dataTable2)
                                                        }}
                                                    />
                                                }
                                            />
                                        </div>)
                            }
                        </div>
                    )
qorri_di's avatar
qorri_di committed
2091
                }
Riri Novita's avatar
Riri Novita committed
2092 2093
            }
        },
qorri_di's avatar
qorri_di committed
2094 2095 2096 2097
        {
            name: "",
            options: {
                display: false
d.arizona's avatar
d.arizona committed
2098
            }
qorri_di's avatar
qorri_di committed
2099
        }
d.arizona's avatar
d.arizona committed
2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114
        ]
        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 }}>
d.arizona's avatar
d.arizona committed
2115
                    <Typography style={{ fontSize: '16px', color: 'white' }}>Master Budget Submission</Typography>
d.arizona's avatar
d.arizona committed
2116
                </div>
d.arizona's avatar
d.arizona committed
2117 2118 2119 2120 2121
                <Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
                    <Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
                        {this.state.messageAlert}
                    </Alert>
                </Snackbar>
d.arizona's avatar
d.arizona committed
2122
                <div style={{ flex: 1, padding: 20, width: '100%' }}>
d.arizona's avatar
d.arizona committed
2123
                    {this.state.visibleOI === true ?
d.arizona's avatar
d.arizona committed
2124 2125
                        <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
                            <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
d.arizona's avatar
d.arizona committed
2126
                                <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget - Operating Indicator</Typography>
d.arizona's avatar
d.arizona committed
2127 2128
                            </div>
                            <div style={{ padding: 20 }}>
d.arizona's avatar
d.arizona committed
2129
                                {!this.state.emptyData && <div style={{ display: 'flex', justifyContent: 'space-between' }}>
d.arizona's avatar
d.arizona committed
2130 2131
                                    <div>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography>
d.arizona's avatar
d.arizona committed
2132
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode}</Typography>
Riri Novita's avatar
Riri Novita committed
2133 2134 2135 2136 2137 2138
                                        {/* <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> */}
                                        {this.props.defaultCurrency.id === 1 ?
                                            <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
                                            :
                                            <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in USD thousand</Typography>
                                        }
d.arizona's avatar
d.arizona committed
2139 2140 2141
                                    </div>
                                    <div style={{ width: '50%' }}>
                                        <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
d.arizona's avatar
d.arizona committed
2142
                                            {(this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <a data-tip={'Download Template'} data-for="template">
d.arizona's avatar
d.arizona committed
2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153
                                                <button
                                                    style={{
                                                        backgroundColor: 'transparent',
                                                        cursor: 'pointer',
                                                        borderColor: 'transparent',
                                                        margin: 5
                                                    }}
                                                    onClick={() => this.downloadTemplate()}
                                                >
                                                    <img src={Images.template} />
                                                </button>
d.arizona's avatar
d.arizona committed
2154
                                            </a>}
d.arizona's avatar
d.arizona committed
2155
                                            <ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
d.arizona's avatar
d.arizona committed
2156
                                            {(this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <a data-tip={'Upload'} data-for="upload">
d.arizona's avatar
d.arizona committed
2157 2158 2159 2160 2161 2162 2163
                                                <button
                                                    style={{
                                                        backgroundColor: 'transparent',
                                                        cursor: 'pointer',
                                                        borderColor: 'transparent',
                                                        margin: 5
                                                    }}
d.arizona's avatar
d.arizona committed
2164
                                                    onClick={() => this.setState({ visibleUpload: true, editable: true })}
d.arizona's avatar
d.arizona committed
2165 2166 2167
                                                >
                                                    <img src={Images.upload} />
                                                </button>
d.arizona's avatar
d.arizona committed
2168
                                            </a>}
d.arizona's avatar
d.arizona committed
2169
                                            <ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
qorri_di's avatar
qorri_di committed
2170
                                            {/* <a data-tip={'Download'} data-for="download">
d.arizona's avatar
d.arizona committed
2171 2172 2173 2174 2175 2176 2177
                                                <button
                                                    style={{
                                                        backgroundColor: 'transparent',
                                                        cursor: 'pointer',
                                                        borderColor: 'transparent',
                                                        margin: 5
                                                    }}
d.arizona's avatar
d.arizona committed
2178
                                                    onClick={() => this.downloadAllData()}
d.arizona's avatar
d.arizona committed
2179 2180 2181 2182
                                                >
                                                    <img src={Images.download} />
                                                </button>
                                            </a>
qorri_di's avatar
qorri_di committed
2183
                                            <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> */}
d.arizona's avatar
d.arizona committed
2184 2185
                                        </div>
                                    </div>
d.arizona's avatar
d.arizona committed
2186
                                </div>}
d.arizona's avatar
d.arizona committed
2187

d.arizona's avatar
d.arizona committed
2188
                                <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
d.arizona's avatar
d.arizona committed
2189 2190
                                    {this.state.loading && loadingComponent}
                                    <MuiThemeProvider theme={getMuiTheme()}>
d.arizona's avatar
d.arizona committed
2191 2192 2193 2194 2195
                                        <MUIDataTable
                                            data={dataTable2}
                                            columns={columns}
                                            options={options}
                                        />
d.arizona's avatar
d.arizona committed
2196
                                    </MuiThemeProvider>
Riri Novita's avatar
Riri Novita committed
2197
                                    <div style={{ color: '#000', marginTop: 10, fontSize: 12 }}>(*) There may be discrepancies in amount due to rounding</div>
d.arizona's avatar
d.arizona committed
2198
                                </div>
Riri Novita's avatar
Riri Novita committed
2199 2200 2201 2202 2203
                                <div style={{ display: 'flex' }}>
                                    <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : </Typography>
                                    <div style={{ marginLeft: 10, overflowY: 'scroll', height: this.state.updateBy.length < 2 ? 25 : 75, marginTop: 10 }}>
                                        {
                                            this.state.updateBy.length > 0 ? this.state.updateBy.reverse().map((item, index) => {
qorri_di's avatar
qorri_di committed
2204 2205 2206 2207
                                                return (
                                                    <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography>
                                                )
                                            }) :
Riri Novita's avatar
Riri Novita committed
2208
                                                <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>-</Typography>
Riri Novita's avatar
Riri Novita committed
2209 2210 2211
                                        }
                                    </div>
                                </div>
Riri Novita's avatar
Riri Novita committed
2212
                                <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10 }}>Notes : {this.state.notesUpdate}</Typography>
d.arizona's avatar
d.arizona committed
2213
                            </div>
d.arizona's avatar
d.arizona committed
2214
                            <div className="grid grid-2x">
d.arizona's avatar
d.arizona committed
2215 2216
                                <div className="col-1">
                                    <button
d.arizona's avatar
d.arizona committed
2217
                                        className="button"
d.arizona's avatar
d.arizona committed
2218 2219 2220 2221 2222 2223
                                        type="button"
                                        style={{
                                            backgroundColor: 'transparent',
                                            cursor: 'pointer',
                                            borderColor: 'transparent',
                                        }}
Deni Rinaldi's avatar
Deni Rinaldi committed
2224 2225 2226 2227
                                        onClick={() => {
                                            this.props.onClickClose()
                                            this.props.getReport()
                                        }
d.arizona's avatar
d.arizona committed
2228
                                        }
d.arizona's avatar
d.arizona committed
2229 2230
                                    >
                                        <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
d.arizona's avatar
d.arizona committed
2231
                                            <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
d.arizona's avatar
d.arizona committed
2232 2233 2234
                                        </div>
                                    </button>
                                </div>
d.arizona's avatar
d.arizona committed
2235
                                {!this.state.emptyData && (this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
d.arizona's avatar
d.arizona committed
2236 2237
                                    <button
                                        type="button"
Deni Rinaldi's avatar
Deni Rinaldi committed
2238
                                        onClick={() =>
d.arizona's avatar
d.arizona committed
2239
                                            this.setState({ loading: true, editable: false }, () => {
d.arizona's avatar
d.arizona committed
2240 2241 2242 2243 2244 2245
                                                setTimeout(() => {
                                                    this.setState({ loading: false, buttonError: false })
                                                }, 100);
                                            })
                                        }
                                        style={{ marginRight: 20 }}
d.arizona's avatar
d.arizona committed
2246 2247
                                    >
                                        <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
d.arizona's avatar
d.arizona committed
2248
                                            <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
d.arizona's avatar
d.arizona committed
2249 2250 2251 2252 2253
                                        </div>
                                    </button>
                                    <button
                                        className="button"
                                        type="button"
d.arizona's avatar
d.arizona committed
2254
                                        disabled={this.state.editable}
d.arizona's avatar
d.arizona committed
2255 2256
                                        style={{
                                            backgroundColor: 'transparent',
d.arizona's avatar
d.arizona committed
2257
                                            cursor: this.state.editable === true ? 'default' : 'pointer',
d.arizona's avatar
d.arizona committed
2258
                                            borderColor: 'transparent',
d.arizona's avatar
d.arizona committed
2259 2260
                                            outline: 'none',
                                            marginRight: 20
d.arizona's avatar
d.arizona committed
2261
                                        }}
d.arizona's avatar
d.arizona committed
2262 2263 2264 2265 2266
                                        onClick={() => this.setState({ loading: true }, () => {
                                            setTimeout(() => {
                                                this.createData("draft")
                                            }, 100);
                                        })}
d.arizona's avatar
d.arizona committed
2267 2268
                                    >
                                        <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
d.arizona's avatar
d.arizona committed
2269
                                            <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
d.arizona's avatar
d.arizona committed
2270 2271
                                        </div>
                                    </button>
d.arizona's avatar
d.arizona committed
2272 2273
                                    <button
                                        type="button"
d.arizona's avatar
d.arizona committed
2274
                                        disabled={this.state.editable}
d.arizona's avatar
d.arizona committed
2275 2276 2277 2278 2279
                                        onClick={() => this.setState({ loading: true }, () => {
                                            setTimeout(() => {
                                                this.createData("submitted")
                                            }, 100);
                                        })}
d.arizona's avatar
d.arizona committed
2280 2281 2282 2283 2284 2285 2286
                                        style={{
                                            backgroundColor: 'transparent',
                                            cursor: this.state.editable === true ? 'default' : 'pointer',
                                            borderColor: 'transparent',
                                            outline: 'none',
                                            marginRight: 20
                                        }}
d.arizona's avatar
d.arizona committed
2287
                                    >
d.arizona's avatar
d.arizona committed
2288 2289
                                        <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>
d.arizona's avatar
d.arizona committed
2290 2291
                                        </div>
                                    </button>
d.arizona's avatar
d.arizona committed
2292
                                </div>}
d.arizona's avatar
d.arizona committed
2293 2294 2295 2296 2297 2298 2299
                            </div>
                        </Paper>
                        :
                        <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
                            <div>
                                <div style={{ padding: 25 }}>
                                    <div>
d.arizona's avatar
d.arizona committed
2300 2301
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode}</Typography>
Riri Novita's avatar
Riri Novita committed
2302 2303 2304 2305 2306 2307
                                        {/* <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> */}
                                        {this.props.defaultCurrency.id === 1 ?
                                            <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
                                            :
                                            <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in USD thousand</Typography>
                                        }
d.arizona's avatar
d.arizona committed
2308 2309
                                    </div>
                                    {this.state.dataLoaded && (
Deni Rinaldi's avatar
Deni Rinaldi committed
2310
                                        <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
d.arizona's avatar
d.arizona committed
2311 2312
                                            {this.state.loading && loadingComponent}
                                            <MuiThemeProvider theme={getMuiTheme()}>
d.arizona's avatar
d.arizona committed
2313 2314 2315 2316 2317
                                                <MUIDataTable
                                                    data={dataTable2}
                                                    columns={columns}
                                                    options={options}
                                                />
d.arizona's avatar
d.arizona committed
2318
                                            </MuiThemeProvider>
d.arizona's avatar
d.arizona committed
2319 2320 2321
                                        </div>
                                    )}
                                </div>
d.arizona's avatar
d.arizona committed
2322 2323 2324 2325 2326 2327 2328 2329 2330 2331
                                <div className="grid grid-2x">
                                    <div className="col-1">
                                        <button
                                            className="button"
                                            type="button"
                                            style={{
                                                backgroundColor: 'transparent',
                                                cursor: 'pointer',
                                                borderColor: 'transparent',
                                            }}
Deni Rinaldi's avatar
Deni Rinaldi committed
2332
                                            onClick={() =>
d.arizona's avatar
d.arizona committed
2333
                                                this.setState({ loading: true, visibleOI: true }, () => {
Deni Rinaldi's avatar
Deni Rinaldi committed
2334 2335 2336 2337
                                                    setTimeout(() => {
                                                        this.getDataDetail()
                                                    }, 100)
                                                })}
d.arizona's avatar
d.arizona committed
2338 2339
                                        >
                                            <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
d.arizona's avatar
d.arizona committed
2340
                                                <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
d.arizona's avatar
d.arizona committed
2341 2342 2343
                                            </div>
                                        </button>
                                    </div>
EKSAD's avatar
EKSAD committed
2344
                                    {!this.state.emptyData && this.state.templateNull && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
d.arizona's avatar
d.arizona committed
2345 2346
                                        <button
                                            type="button"
Deni Rinaldi's avatar
Deni Rinaldi committed
2347
                                            onClick={() =>
d.arizona's avatar
d.arizona committed
2348
                                                this.setState({ loading: true, editable: false }, () => {
d.arizona's avatar
d.arizona committed
2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364
                                                    setTimeout(() => {
                                                        this.setState({ loading: false, buttonError: false })
                                                    }, 100);
                                                })
                                            }
                                            style={{ marginRight: 20 }}
                                        >
                                            <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
                                                <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
                                            </div>
                                        </button>
                                        <button
                                            className="button"
                                            type="button"
                                            style={{
                                                backgroundColor: 'transparent',
d.arizona's avatar
d.arizona committed
2365
                                                cursor: this.state.editable === true ? 'default' : 'pointer',
d.arizona's avatar
d.arizona committed
2366 2367 2368 2369
                                                borderColor: 'transparent',
                                                outline: 'none',
                                                marginRight: 20
                                            }}
d.arizona's avatar
d.arizona committed
2370
                                            disabled={this.state.editable}
Deni Rinaldi's avatar
Deni Rinaldi committed
2371 2372 2373 2374 2375 2376 2377
                                            onClick={() =>
                                                this.state.editable === true ?
                                                    null : this.setState({ loading: true }, () => {
                                                        setTimeout(() => {
                                                            this.uploadOI("draft")
                                                        }, 100);
                                                    })}
d.arizona's avatar
d.arizona committed
2378 2379 2380 2381 2382 2383 2384
                                        >
                                            <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                                <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
                                            </div>
                                        </button>
                                        <button
                                            type="button"
Deni Rinaldi's avatar
Deni Rinaldi committed
2385 2386 2387 2388 2389 2390 2391 2392
                                            onClick={() =>
                                                this.state.editable === true ?
                                                    null :
                                                    this.setState({ loading: true }, () => {
                                                        setTimeout(() => {
                                                            this.uploadOI("submitted")
                                                        }, 100);
                                                    })}
d.arizona's avatar
d.arizona committed
2393
                                            disabled={this.state.editable}
d.arizona's avatar
d.arizona committed
2394 2395 2396 2397 2398 2399 2400
                                            style={{
                                                backgroundColor: 'transparent',
                                                cursor: this.state.editable === true ? 'default' : 'pointer',
                                                borderColor: 'transparent',
                                                outline: 'none',
                                                marginRight: 20
                                            }}
d.arizona's avatar
d.arizona committed
2401 2402 2403 2404 2405
                                        >
                                            <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>
d.arizona's avatar
d.arizona committed
2406
                                    </div>}
d.arizona's avatar
d.arizona committed
2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430
                                </div>
                            </div>
                        </Paper>}
                </div>

                {this.state.visibleUpload && (
                    <div className="test app-popup-show">
                        <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
                            <div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
                                <div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
                                    <div className="popup-title">
                                        <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File</span>
                                    </div>
                                </div>
                                <div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
                                    <button
                                        type="button"
                                        className="btn btn-circle btn-white"
                                        onClick={() => this.setState({ visibleUpload: false })}
                                    >
                                        <img src={Images.close} />
                                    </button>
                                </div>
                            </div>
Riri Novita's avatar
Riri Novita committed
2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447
                            <div style={{ padding: '25px 30px' }}>
                                <UploadFile
                                    type={this.state.uploadStatus}
                                    percentage={this.state.percentage}
                                    result={this.state.result}
                                    acceptedFiles={["xlsx"]}
                                    onHandle={(dt) => {
                                        this.fileHandler(dt)
                                        this.setState({ uploadStatus: 'idle', percentage: '0' })
                                    }}
                                    onUpload={() => {
                                        this.state.judul === "MASTER BUDGET - OPERATING INDICATOR" ?
                                            this.checkUpload() :
                                            this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
                                    }}
                                />
                            </div>
2448
                            <div style={{ padding: '0px 30px 29px', fontSize: 17, color: 'red' }}><b>Warning:</b> Valid currency for uploading data in <b>{this.props.defaultCurrency.id == 1 ? "IDR mn" : "thousand USD"}</b></div>
Riri Novita's avatar
Riri Novita committed
2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476
                        </div>
                    </div>
                )}

                {this.state.visibleAlertSave && (
                    <div className="test app-popup-show">
                        <div className="popup-content border-radius" style={{ background: '#FFF27D', borderRadius: 10, width: 715, height: 238 }}>
                            <div style={{ margin: 30 }}>
                                <div style={{ display: 'flex', marginTop: 76, marginBottom: 43 }}>
                                    <div style={{ alignSelf: 'center', marginRight: 25 }}>
                                        <img src={Images.warning} />
                                    </div>
                                    <div style={{ justifyContent: 'center', fontSize: 20, color: '#1D2995', marginTop: 10 }}>
                                        <b>Rate Currency USD</b> pada periode yang dipilih <b>belum</b> diatur.<br /> Silahkan menghubungi Superadmin
                                    </div>
                                </div>
                                <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
                                    <button
                                        className="button"
                                        type="button"
                                        style={{
                                            background: '#F6F7F9',
                                            cursor: 'pointer',
                                            border: '1px solid #3549609e',
                                            outline: 'none',
                                            marginRight: 20,
                                            borderRadius: 9
                                        }}
2477
                                        onClick={() => this.setState({ visibleAlertSave: false, loading: false })}
Riri Novita's avatar
Riri Novita committed
2478 2479 2480 2481 2482 2483 2484
                                    >
                                        <div style={{ backgroundColor: '#fff', width: 105, height: 30, borderRadius: 9, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #3549609e' }}>
                                            <Typography style={{ fontSize: '15px', color: '#354960', textAlign: 'center' }}>Close</Typography>
                                        </div>
                                    </button>
                                </div>
                            </div>
d.arizona's avatar
d.arizona committed
2485 2486 2487 2488 2489 2490
                        </div>
                    </div>
                )}
            </div>
        );
    }
Riri Novita's avatar
Riri Novita committed
2491
}