TaxPlanningOLPA.js 320 KB
Newer Older
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1
import React, { Component } from 'react';
syadziy's avatar
syadziy committed
2
import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormControlLabel, Tooltip, withStyles, Snackbar } from '@material-ui/core';
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana 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 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';
import { Alert } from '@material-ui/lab';
import * as R from 'ramda';
r.kurnia's avatar
r.kurnia committed
13
import Constant from '../../library/Constant';
Riri Novita's avatar
Riri Novita committed
14
import { fixNumber, titleCase } from '../../library/Utils';
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

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

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

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

export default class TaxPlanningOLPA extends Component {
    constructor(props) {
        super(props)
        this.state = {
            dataTable: [],
            visibleTP: true,
            disabledSave: true,
            editable: false,
            buttonError: false,
            judulColumn: null,
Riri Novita's avatar
Riri Novita committed
52
            updateBy: [],
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
53
            buttonDraft: true,
54
            handleDoubleClick: 0,
rifkaki's avatar
rifkaki committed
55
            get_for: "view",
56 57 58
            viewOnly: true,
            defaultCurrencyUpload: this.props.defaultCurrency,
            visibleAlertSave: false
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
59 60 61 62 63 64 65

        }
        this.handleValue = this.handleValue.bind(this)
        this.fileHandler = this.fileHandler.bind(this);
    }

    componentDidMount() {
66 67
        // this.getItemHierarki()
        this.getSettingControl()
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
68
        this.lastUpdate()
rifkaki's avatar
rifkaki committed
69
        this.handleViewOnly()
r.kurnia's avatar
r.kurnia committed
70
        console.log(this.props)
rifkaki's avatar
rifkaki committed
71 72 73 74 75 76 77 78 79 80 81 82 83
    }

    handleViewOnly() {
        let checkApprover = false
        let checkLastStatus = false
        let checkStatus = false
        let checkPrevRev = false

        if (this.props.isApprover) {
            checkApprover = true
        } else {
            checkApprover = false
        }
qorri_di's avatar
qorri_di committed
84

rifkaki's avatar
rifkaki committed
85 86 87 88
        if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
            checkLastStatus = true
        } else {
            checkLastStatus = false
qorri_di's avatar
qorri_di committed
89 90
        }

rifkaki's avatar
rifkaki committed
91 92 93 94 95 96 97 98 99 100 101 102
        if (this.props.prevRevision) {
            checkPrevRev = true
        } else {
            checkPrevRev = false
        }

        if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') {
            checkStatus = true
        } else {
            checkStatus = false
        }

qorri_di's avatar
qorri_di committed
103
        this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
rifkaki's avatar
rifkaki committed
104 105 106 107
    }

    handleGetFor(type) {
        console.log(type)
qorri_di's avatar
qorri_di committed
108
        this.setState({ get_for: type }, () => {
109
            this.getSettingControl()
rifkaki's avatar
rifkaki committed
110 111
            this.lastUpdate()
        })
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
112 113
    }

114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
    getSettingControl() {
        let body = {
            group: 'THRESHOLD_CONTROL',
            company_id: this.props.company.company_id,
            type: 'TAX_PLANNING'
        }

        api.create().getAllSettingByType(body).then(response => {
            console.log(response)
            if (response.data) {
                if (response.data.status === 'success') {
                    this.setState({
                        minValue: response.data.data[0] ? response.data.data[0].min_value : null,
                        maxValue: response.data.data[0] ? response.data.data[0].max_value : null,
                    }, () => {
                        this.getItemHierarki()
                    })
                } else {
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
d.arizona's avatar
d.arizona committed
133
                        if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
134 135 136 137 138 139 140 141 142 143 144 145 146
                            setTimeout(() => {
                                localStorage.removeItem(Constant.TOKEN)
                                window.location.reload();
                            }, 1000);
                        }
                    })
                }
            } else {
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
            }
        })
    }

qorri_di's avatar
qorri_di committed
147
    lastUpdate() {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
148 149 150
        let payload = {
            "outlook_pa_id": this.props.outlook_pa_id,
            "report_id": this.props.report_id,
d.arizona's avatar
d.arizona committed
151
            "get_for": this.state.get_for,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
152 153
            "revision": this.props.revision,
            "periode": this.props.periode,
Riri Novita's avatar
Riri Novita committed
154
            "currency_id": this.props.defaultCurrency.id,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
155 156 157 158 159 160
            "company_id": this.props.company.company_id
        }
        api.create().getLastestUpdateOLPA(payload).then(response => {
            if (response.data) {
                if (response.data.status === "success") {
                    this.setState({
Riri Novita's avatar
Riri Novita committed
161
                        updateBy: response.data.data.detail === null ? '-' : response.data.data.detail
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
162 163 164 165 166 167 168 169 170 171 172 173
                    })
                }
            }
        })
    }

    getItemHierarki() {
        this.setState({ loading: true, judulColumn: null })
        let payload = {
            "outlook_pa_id": this.props.outlook_pa_id,
            "report_id": this.props.report_id,
            "revision": this.props.revision,
rifkaki's avatar
rifkaki committed
174 175
            "periode": this.props.periode,
            "company_id": this.props.company.company_id,
176 177
            "get_for": this.state.get_for,
            "currency_id": this.props.defaultCurrency.id
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
178 179
        }
        api.create().getDetailReportOLPA(payload).then(response => {
rifkaki's avatar
rifkaki committed
180 181
            console.log(payload);
            console.log(response);
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
182 183
            let dataTable = []
            if (response.data) {
r.kurnia's avatar
r.kurnia committed
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
                if (response.data.status == 'success') {
                    let res = response.data.data
                    const handlePushChild = (item) => {
                        let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
                        if (indexIDzz === -1) {
                            dataTable.push([
                                item.type_report_id,
                                item.type_report_tax.value_tbc.type_report_id,
                                item.type_report_tax.value_fc.type_report_id,
                                item.type_report_tax.value_tbf.type_report_id,
                                item.id,
                                item.parent,
                                { tbc: item.formula_tax.value_tbc, fcp: item.formula_tax.value_fc, tbf: item.formula_tax.value_tbf },
                                item.level,
                                item.description,
199
                                {
Riri Novita's avatar
Riri Novita committed
200 201
                                    tbc: item.tax_planning.january.tbc, fcp: item.tax_planning.january.fcp,
                                    tbf: item.tax_planning.january.tbf === null ? "0" : item.tax_planning.january.tbf === "" ? "0" : item.tax_planning.january.tbf
202
                                },
Riri Novita's avatar
Riri Novita committed
203 204 205 206 207 208
                                { tbc: item.tax_planning.february.tbc, fcp: item.tax_planning.february.fcp, tbf: item.tax_planning.february.tbf },
                                { tbc: item.tax_planning.march.tbc, fcp: item.tax_planning.march.fcp, tbf: item.tax_planning.march.tbf },
                                { tbc: item.tax_planning.april.tbc, fcp: item.tax_planning.april.fcp, tbf: item.tax_planning.april.tbf },
                                { tbc: item.tax_planning.may.tbc, fcp: item.tax_planning.may.fcp, tbf: item.tax_planning.may.tbf },
                                { tbc: item.tax_planning.june.tbc, fcp: item.tax_planning.june.fcp, tbf: item.tax_planning.june.tbf },
                                { tbc: item.tax_planning.july.tbc, fcp: item.tax_planning.july.fcp, tbf: item.tax_planning.july.tbf },
209
                                {
Riri Novita's avatar
Riri Novita committed
210 211
                                    tbc: item.tax_planning.august.tbc === null ? "0" : item.tax_planning.august.tbc === "" ? "0" : item.tax_planning.august.tbc,
                                    fcp: item.tax_planning.august.fcp, tbf: item.tax_planning.august.tbf
212
                                },
Riri Novita's avatar
Riri Novita committed
213 214
                                { tbc: item.tax_planning.september.tbc, fcp: item.tax_planning.september.fcp, tbf: item.tax_planning.september.tbf },
                                { tbc: item.tax_planning.october.tbc, fcp: item.tax_planning.october.fcp, tbf: item.tax_planning.october.tbf },
Riri Novita's avatar
Riri Novita committed
215 216
                                { tbc: this.props.status === 'CLOSED' ? item.tax_planning.november.tbc : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november.tbc, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbc, fcp: this.props.status === 'CLOSED' ? item.tax_planning.november.fcp : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.november.fcp, formula: item.tax_planning.november_formula } : item.tax_planning.november.fcp, tbf: this.props.status === 'CLOSED' ? item.tax_planning.november.tbf : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.november.tbf, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbf },
                                { tbc: this.props.status === 'CLOSED' ? item.tax_planning.december.tbc : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december.tbc, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbc, fcp: this.props.status === 'CLOSED' ? item.tax_planning.december.fcp : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.december.fcp, formula: item.tax_planning.december_formula } : item.tax_planning.december.fcp, tbf: this.props.status === 'CLOSED' ? item.tax_planning.december.tbf : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.december.tbf, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbf },
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 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
                                // {
                                //     tbc: item.tax_planning.january !== null ? item.tax_planning.january !== "" ? item.tax_planning.january.tbc !== null ? item.tax_planning.january.tbc !== "" ? item.tax_planning.january.tbc : "0" : "0" : "0" : "0",
                                //     fcp: item.tax_planning.january !== null ? item.tax_planning.january !== "" ? item.tax_planning.january.fcp !== null ? item.tax_planning.january.fcp !== "" ? item.tax_planning.january.fcp : "0" : "0" : "0" : "0",
                                //     tbf: item.tax_planning.january !== null ? item.tax_planning.january !== "" ? item.tax_planning.january.tbf !== null ? item.tax_planning.january.tbf !== "" ? item.tax_planning.january.tbf : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: item.tax_planning.february !== null ? item.tax_planning.february !== "" ? item.tax_planning.february.tbc !== null ? item.tax_planning.february.tbc !== "" ? item.tax_planning.february.tbc : "0" : "0" : "0" : "0",
                                //     fcp: item.tax_planning.february !== null ? item.tax_planning.february !== "" ? item.tax_planning.february.fcp !== null ? item.tax_planning.february.fcp !== "" ? item.tax_planning.february.fcp : "0" : "0" : "0" : "0",
                                //     tbf: item.tax_planning.february !== null ? item.tax_planning.february !== "" ? item.tax_planning.february.tbf !== null ? item.tax_planning.february.tbf !== "" ? item.tax_planning.february.tbf : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: item.tax_planning.march !== null ? item.tax_planning.march !== "" ? item.tax_planning.march.tbc !== null ? item.tax_planning.march.tbc !== "" ? item.tax_planning.march.tbc : "0" : "0" : "0" : "0",
                                //     fcp: item.tax_planning.march !== null ? item.tax_planning.march !== "" ? item.tax_planning.march.fcp !== null ? item.tax_planning.march.fcp !== "" ? item.tax_planning.march.fcp : "0" : "0" : "0" : "0",
                                //     tbf: item.tax_planning.march !== null ? item.tax_planning.march !== "" ? item.tax_planning.march.tbf !== null ? item.tax_planning.march.tbf !== "" ? item.tax_planning.march.tbf : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: item.tax_planning.april !== null ? item.tax_planning.april !== "" ? item.tax_planning.april.tbc !== null ? item.tax_planning.april.tbc !== "" ? item.tax_planning.april.tbc : "0" : "0" : "0" : "0",
                                //     fcp: item.tax_planning.april !== null ? item.tax_planning.april !== "" ? item.tax_planning.april.fcp !== null ? item.tax_planning.april.fcp !== "" ? item.tax_planning.april.fcp : "0" : "0" : "0" : "0",
                                //     tbf: item.tax_planning.april !== null ? item.tax_planning.april !== "" ? item.tax_planning.april.tbf !== null ? item.tax_planning.april.tbf !== "" ? item.tax_planning.april.tbf : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: item.tax_planning.may !== null ? item.tax_planning.may !== "" ? item.tax_planning.may.tbc !== null ? item.tax_planning.may.tbc !== "" ? item.tax_planning.may.tbc : "0" : "0" : "0" : "0",
                                //     fcp: item.tax_planning.may !== null ? item.tax_planning.may !== "" ? item.tax_planning.may.fcp !== null ? item.tax_planning.may.fcp !== "" ? item.tax_planning.may.fcp : "0" : "0" : "0" : "0",
                                //     tbf: item.tax_planning.may !== null ? item.tax_planning.may !== "" ? item.tax_planning.may.tbf !== null ? item.tax_planning.may.tbf !== "" ? item.tax_planning.may.tbf : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: item.tax_planning.june !== null ? item.tax_planning.june !== "" ? item.tax_planning.june.tbc !== null ? item.tax_planning.june.tbc !== "" ? item.tax_planning.june.tbc : "0" : "0" : "0" : "0",
                                //     fcp: item.tax_planning.june !== null ? item.tax_planning.june !== "" ? item.tax_planning.june.fcp !== null ? item.tax_planning.june.fcp !== "" ? item.tax_planning.june.fcp : "0" : "0" : "0" : "0",
                                //     tbf: item.tax_planning.june !== null ? item.tax_planning.june !== "" ? item.tax_planning.june.tbf !== null ? item.tax_planning.june.tbf !== "" ? item.tax_planning.june.tbf : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: item.tax_planning.july !== null ? item.tax_planning.july !== "" ? item.tax_planning.july.tbc !== null ? item.tax_planning.july.tbc !== "" ? item.tax_planning.july.tbc : "0" : "0" : "0" : "0",
                                //     fcp: item.tax_planning.july !== null ? item.tax_planning.july !== "" ? item.tax_planning.july.fcp !== null ? item.tax_planning.july.fcp !== "" ? item.tax_planning.july.fcp : "0" : "0" : "0" : "0",
                                //     tbf: item.tax_planning.july !== null ? item.tax_planning.july !== "" ? item.tax_planning.july.tbf !== null ? item.tax_planning.july.tbf !== "" ? item.tax_planning.july.tbf : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: item.tax_planning.august !== null ? item.tax_planning.august !== "" ? item.tax_planning.august.tbc !== null ? item.tax_planning.august.tbc !== "" ? item.tax_planning.august.tbc : "0" : "0" : "0" : "0",
                                //     fcp: item.tax_planning.august !== null ? item.tax_planning.august !== "" ? item.tax_planning.august.fcp !== null ? item.tax_planning.august.fcp !== "" ? item.tax_planning.august.fcp : "0" : "0" : "0" : "0",
                                //     tbf: item.tax_planning.august !== null ? item.tax_planning.august !== "" ? item.tax_planning.august.tbf !== null ? item.tax_planning.august.tbf !== "" ? item.tax_planning.august.tbf : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: item.tax_planning.september !== null ? item.tax_planning.september !== "" ? item.tax_planning.september.tbc !== null ? item.tax_planning.september.tbc !== "" ? item.tax_planning.september.tbc : "0" : "0" : "0" : "0",
                                //     fcp: item.tax_planning.september !== null ? item.tax_planning.september !== "" ? item.tax_planning.september.fcp !== null ? item.tax_planning.september.fcp !== "" ? item.tax_planning.september.fcp : "0" : "0" : "0" : "0",
                                //     tbf: item.tax_planning.september !== null ? item.tax_planning.september !== "" ? item.tax_planning.september.tbf !== null ? item.tax_planning.september.tbf !== "" ? item.tax_planning.september.tbf : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: item.tax_planning.october !== null ? item.tax_planning.october !== "" ? item.tax_planning.october.tbc !== null ? item.tax_planning.october.tbc !== "" ? item.tax_planning.october.tbc : "0" : "0" : "0" : "0",
                                //     fcp: item.tax_planning.october !== null ? item.tax_planning.october !== "" ? item.tax_planning.october.fcp !== null ? item.tax_planning.october.fcp !== "" ? item.tax_planning.october.fcp : "0" : "0" : "0" : "0",
                                //     tbf: item.tax_planning.october !== null ? item.tax_planning.october !== "" ? item.tax_planning.october.tbf !== null ? item.tax_planning.october.tbf !== "" ? item.tax_planning.october.tbf : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: this.props.status === 'CLOSED' ? item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbc !== null ? item.tax_planning.november.tbc !== "" ? Number(item.tax_planning.november.tbc).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbc !== null ? item.tax_planning.november.tbc !== "" ? Number(item.tax_planning.november.tbc).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.november_formula } : item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbc !== null ? item.tax_planning.november.tbc !== "" ? Number(item.tax_planning.november.tbc).toFixed(1) : "0" : "0" : "0" : "0",
                                //     fcp: this.props.status === 'CLOSED' ? item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.fcp !== null ? item.tax_planning.november.fcp !== "" ? Number(item.tax_planning.november.fcp).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.fcp !== null ? item.tax_planning.november.fcp !== "" ? Number(item.tax_planning.november.fcp).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.november_formula } : item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.fcp !== null ? item.tax_planning.november.fcp !== "" ? Number(item.tax_planning.november.fcp).toFixed(1) : "0" : "0" : "0" : "0",
                                //     tbf: this.props.status === 'CLOSED' ? item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbf !== null ? item.tax_planning.november.tbf !== "" ? Number(item.tax_planning.november.tbf).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbf !== null ? item.tax_planning.november.tbf !== "" ? Number(item.tax_planning.november.tbf).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.november_formula } : item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbf !== null ? item.tax_planning.november.tbf !== "" ? Number(item.tax_planning.november.tbf).toFixed(1) : "0" : "0" : "0" : "0"
                                // },
                                // {
                                //     tbc: this.props.status === 'CLOSED' ? item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbc !== null ? item.tax_planning.december.tbc !== "" ? Number(item.tax_planning.december.tbc).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbc !== null ? item.tax_planning.december.tbc !== "" ? Number(item.tax_planning.december.tbc).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.december_formula } : item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbc !== null ? item.tax_planning.december.tbc !== "" ? Number(item.tax_planning.december.tbc).toFixed(1) : "0" : "0" : "0" : "0",
                                //     fcp: this.props.status === 'CLOSED' ? item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.fcp !== null ? item.tax_planning.december.fcp !== "" ? Number(item.tax_planning.december.fcp).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.fcp !== null ? item.tax_planning.december.fcp !== "" ? Number(item.tax_planning.december.fcp).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.december_formula } : item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.fcp !== null ? item.tax_planning.december.fcp !== "" ? Number(item.tax_planning.december.fcp).toFixed(1) : "0" : "0" : "0" : "0",
                                //     tbf: this.props.status === 'CLOSED' ? item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbf !== null ? item.tax_planning.december.tbf !== "" ? Number(item.tax_planning.december.tbf).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbf !== null ? item.tax_planning.december.tbf !== "" ? Number(item.tax_planning.december.tbf).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.december_formula } : item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbf !== null ? item.tax_planning.december.tbf !== "" ? Number(item.tax_planning.december.tbf).toFixed(1) : "0" : "0" : "0" : "0"
                                // },
r.kurnia's avatar
r.kurnia committed
277
                                item.tax_planning.total_current_year,
rifkaki's avatar
rifkaki committed
278 279
                                0,
                                0,
r.kurnia's avatar
r.kurnia committed
280
                                item.order,
r.kurnia's avatar
r.kurnia committed
281 282
                                { tbc: item.condition_it_should_be, fcp: item.condition_it_should_be, tbf: item.condition_it_should_be },
                                { tbc: item.condition_if_wrong, fcp: item.condition_if_wrong, tbf: item.condition_if_wrong },
r.kurnia's avatar
r.kurnia committed
283 284 285 286 287 288 289 290
                            ])
                        }
                        if (item.children !== null) {
                            if (item.children.length > 0) {
                                item.children.map((items, indexs) => {
                                    handlePushChild(items)
                                })
                            }
qorri_di's avatar
qorri_di committed
291
                        }
r.kurnia's avatar
r.kurnia committed
292 293
                    }
                    res.map((item, index) => {
qorri_di's avatar
qorri_di committed
294
                        dataTable.push([
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
295 296 297 298 299 300
                            item.type_report_id,
                            item.type_report_tax.value_tbc.type_report_id,
                            item.type_report_tax.value_fc.type_report_id,
                            item.type_report_tax.value_tbf.type_report_id,
                            item.id,
                            item.parent,
r.kurnia's avatar
r.kurnia committed
301
                            { tbc: item.formula_tax.value_tbc, fcp: item.formula_tax.value_fc, tbf: item.formula_tax.value_tbf },
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
302 303
                            item.level,
                            item.description,
304
                            {
Riri Novita's avatar
Riri Novita committed
305 306
                                tbc: item.tax_planning.january.tbc, fcp: item.tax_planning.january.fcp,
                                tbf: item.tax_planning.january.tbf === null ? "0" : item.tax_planning.january.tbf === "" ? "0" : item.tax_planning.january.tbf
307
                            },
Riri Novita's avatar
Riri Novita committed
308 309 310 311 312 313
                            { tbc: item.tax_planning.february.tbc, fcp: item.tax_planning.february.fcp, tbf: item.tax_planning.february.tbf },
                            { tbc: item.tax_planning.march.tbc, fcp: item.tax_planning.march.fcp, tbf: item.tax_planning.march.tbf },
                            { tbc: item.tax_planning.april.tbc, fcp: item.tax_planning.april.fcp, tbf: item.tax_planning.april.tbf },
                            { tbc: item.tax_planning.may.tbc, fcp: item.tax_planning.may.fcp, tbf: item.tax_planning.may.tbf },
                            { tbc: item.tax_planning.june.tbc, fcp: item.tax_planning.june.fcp, tbf: item.tax_planning.june.tbf },
                            { tbc: item.tax_planning.july.tbc, fcp: item.tax_planning.july.fcp, tbf: item.tax_planning.july.tbf },
314
                            {
Riri Novita's avatar
Riri Novita committed
315 316
                                tbc: item.tax_planning.august.tbc === null ? "0" : item.tax_planning.august.tbc === "" ? "0" : item.tax_planning.august.tbc,
                                fcp: item.tax_planning.august.fcp, tbf: item.tax_planning.august.tbf
317
                            },
Riri Novita's avatar
Riri Novita committed
318 319
                            { tbc: item.tax_planning.september.tbc, fcp: item.tax_planning.september.fcp, tbf: item.tax_planning.september.tbf },
                            { tbc: item.tax_planning.october.tbc, fcp: item.tax_planning.october.fcp, tbf: item.tax_planning.october.tbf },
Riri Novita's avatar
Riri Novita committed
320 321
                            { tbc: this.props.status === 'CLOSED' ? item.tax_planning.november.tbc : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november.tbc, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbc, fcp: this.props.status === 'CLOSED' ? item.tax_planning.november.fcp : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.november.fcp, formula: item.tax_planning.november_formula } : item.tax_planning.november.fcp, tbf: this.props.status === 'CLOSED' ? item.tax_planning.november.tbf : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.november.tbf, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbf },
                            { tbc: this.props.status === 'CLOSED' ? item.tax_planning.december.tbc : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december.tbc, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbc, fcp: this.props.status === 'CLOSED' ? item.tax_planning.december.fcp : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.december.fcp, formula: item.tax_planning.december_formula } : item.tax_planning.december.fcp, tbf: this.props.status === 'CLOSED' ? item.tax_planning.december.tbf : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.december.tbf, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbf },
Riri Novita's avatar
Riri Novita committed
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381
                            // {
                            //     tbc: item.tax_planning.january !== null ? item.tax_planning.january !== "" ? item.tax_planning.january.tbc !== null ? item.tax_planning.january.tbc !== "" ? item.tax_planning.january.tbc : "0" : "0" : "0" : "0",
                            //     fcp: item.tax_planning.january !== null ? item.tax_planning.january !== "" ? item.tax_planning.january.fcp !== null ? item.tax_planning.january.fcp !== "" ? item.tax_planning.january.fcp : "0" : "0" : "0" : "0",
                            //     tbf: item.tax_planning.january !== null ? item.tax_planning.january !== "" ? item.tax_planning.january.tbf !== null ? item.tax_planning.january.tbf !== "" ? item.tax_planning.january.tbf : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: item.tax_planning.february !== null ? item.tax_planning.february !== "" ? item.tax_planning.february.tbc !== null ? item.tax_planning.february.tbc !== "" ? item.tax_planning.february.tbc : "0" : "0" : "0" : "0",
                            //     fcp: item.tax_planning.february !== null ? item.tax_planning.february !== "" ? item.tax_planning.february.fcp !== null ? item.tax_planning.february.fcp !== "" ? item.tax_planning.february.fcp : "0" : "0" : "0" : "0",
                            //     tbf: item.tax_planning.february !== null ? item.tax_planning.february !== "" ? item.tax_planning.february.tbf !== null ? item.tax_planning.february.tbf !== "" ? item.tax_planning.february.tbf : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: item.tax_planning.march !== null ? item.tax_planning.march !== "" ? item.tax_planning.march.tbc !== null ? item.tax_planning.march.tbc !== "" ? item.tax_planning.march.tbc : "0" : "0" : "0" : "0",
                            //     fcp: item.tax_planning.march !== null ? item.tax_planning.march !== "" ? item.tax_planning.march.fcp !== null ? item.tax_planning.march.fcp !== "" ? item.tax_planning.march.fcp : "0" : "0" : "0" : "0",
                            //     tbf: item.tax_planning.march !== null ? item.tax_planning.march !== "" ? item.tax_planning.march.tbf !== null ? item.tax_planning.march.tbf !== "" ? item.tax_planning.march.tbf : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: item.tax_planning.april !== null ? item.tax_planning.april !== "" ? item.tax_planning.april.tbc !== null ? item.tax_planning.april.tbc !== "" ? item.tax_planning.april.tbc : "0" : "0" : "0" : "0",
                            //     fcp: item.tax_planning.april !== null ? item.tax_planning.april !== "" ? item.tax_planning.april.fcp !== null ? item.tax_planning.april.fcp !== "" ? item.tax_planning.april.fcp : "0" : "0" : "0" : "0",
                            //     tbf: item.tax_planning.april !== null ? item.tax_planning.april !== "" ? item.tax_planning.april.tbf !== null ? item.tax_planning.april.tbf !== "" ? item.tax_planning.april.tbf : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: item.tax_planning.may !== null ? item.tax_planning.may !== "" ? item.tax_planning.may.tbc !== null ? item.tax_planning.may.tbc !== "" ? item.tax_planning.may.tbc : "0" : "0" : "0" : "0",
                            //     fcp: item.tax_planning.may !== null ? item.tax_planning.may !== "" ? item.tax_planning.may.fcp !== null ? item.tax_planning.may.fcp !== "" ? item.tax_planning.may.fcp : "0" : "0" : "0" : "0",
                            //     tbf: item.tax_planning.may !== null ? item.tax_planning.may !== "" ? item.tax_planning.may.tbf !== null ? item.tax_planning.may.tbf !== "" ? item.tax_planning.may.tbf : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: item.tax_planning.june !== null ? item.tax_planning.june !== "" ? item.tax_planning.june.tbc !== null ? item.tax_planning.june.tbc !== "" ? item.tax_planning.june.tbc : "0" : "0" : "0" : "0",
                            //     fcp: item.tax_planning.june !== null ? item.tax_planning.june !== "" ? item.tax_planning.june.fcp !== null ? item.tax_planning.june.fcp !== "" ? item.tax_planning.june.fcp : "0" : "0" : "0" : "0",
                            //     tbf: item.tax_planning.june !== null ? item.tax_planning.june !== "" ? item.tax_planning.june.tbf !== null ? item.tax_planning.june.tbf !== "" ? item.tax_planning.june.tbf : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: item.tax_planning.july !== null ? item.tax_planning.july !== "" ? item.tax_planning.july.tbc !== null ? item.tax_planning.july.tbc !== "" ? item.tax_planning.july.tbc : "0" : "0" : "0" : "0",
                            //     fcp: item.tax_planning.july !== null ? item.tax_planning.july !== "" ? item.tax_planning.july.fcp !== null ? item.tax_planning.july.fcp !== "" ? item.tax_planning.july.fcp : "0" : "0" : "0" : "0",
                            //     tbf: item.tax_planning.july !== null ? item.tax_planning.july !== "" ? item.tax_planning.july.tbf !== null ? item.tax_planning.july.tbf !== "" ? item.tax_planning.july.tbf : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: item.tax_planning.august !== null ? item.tax_planning.august !== "" ? item.tax_planning.august.tbc !== null ? item.tax_planning.august.tbc !== "" ? item.tax_planning.august.tbc : "0" : "0" : "0" : "0",
                            //     fcp: item.tax_planning.august !== null ? item.tax_planning.august !== "" ? item.tax_planning.august.fcp !== null ? item.tax_planning.august.fcp !== "" ? item.tax_planning.august.fcp : "0" : "0" : "0" : "0",
                            //     tbf: item.tax_planning.august !== null ? item.tax_planning.august !== "" ? item.tax_planning.august.tbf !== null ? item.tax_planning.august.tbf !== "" ? item.tax_planning.august.tbf : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: item.tax_planning.september !== null ? item.tax_planning.september !== "" ? item.tax_planning.september.tbc !== null ? item.tax_planning.september.tbc !== "" ? item.tax_planning.september.tbc : "0" : "0" : "0" : "0",
                            //     fcp: item.tax_planning.september !== null ? item.tax_planning.september !== "" ? item.tax_planning.september.fcp !== null ? item.tax_planning.september.fcp !== "" ? item.tax_planning.september.fcp : "0" : "0" : "0" : "0",
                            //     tbf: item.tax_planning.september !== null ? item.tax_planning.september !== "" ? item.tax_planning.september.tbf !== null ? item.tax_planning.september.tbf !== "" ? item.tax_planning.september.tbf : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: item.tax_planning.october !== null ? item.tax_planning.october !== "" ? item.tax_planning.october.tbc !== null ? item.tax_planning.october.tbc !== "" ? item.tax_planning.october.tbc : "0" : "0" : "0" : "0",
                            //     fcp: item.tax_planning.october !== null ? item.tax_planning.october !== "" ? item.tax_planning.october.fcp !== null ? item.tax_planning.october.fcp !== "" ? item.tax_planning.october.fcp : "0" : "0" : "0" : "0",
                            //     tbf: item.tax_planning.october !== null ? item.tax_planning.october !== "" ? item.tax_planning.october.tbf !== null ? item.tax_planning.october.tbf !== "" ? item.tax_planning.october.tbf : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: this.props.status === 'CLOSED' ? item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbc !== null ? item.tax_planning.november.tbc !== "" ? Number(item.tax_planning.november.tbc).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbc !== null ? item.tax_planning.november.tbc !== "" ? Number(item.tax_planning.november.tbc).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.november_formula } : item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbc !== null ? item.tax_planning.november.tbc !== "" ? Number(item.tax_planning.november.tbc).toFixed(1) : "0" : "0" : "0" : "0",
                            //     fcp: this.props.status === 'CLOSED' ? item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.fcp !== null ? item.tax_planning.november.fcp !== "" ? Number(item.tax_planning.november.fcp).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.fcp !== null ? item.tax_planning.november.fcp !== "" ? Number(item.tax_planning.november.fcp).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.november_formula } : item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.fcp !== null ? item.tax_planning.november.fcp !== "" ? Number(item.tax_planning.november.fcp).toFixed(1) : "0" : "0" : "0" : "0",
                            //     tbf: this.props.status === 'CLOSED' ? item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbf !== null ? item.tax_planning.november.tbf !== "" ? Number(item.tax_planning.november.tbf).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbf !== null ? item.tax_planning.november.tbf !== "" ? Number(item.tax_planning.november.tbf).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.november_formula } : item.tax_planning.november !== null ? item.tax_planning.november !== "" ? item.tax_planning.november.tbf !== null ? item.tax_planning.november.tbf !== "" ? Number(item.tax_planning.november.tbf).toFixed(1) : "0" : "0" : "0" : "0"
                            // },
                            // {
                            //     tbc: this.props.status === 'CLOSED' ? item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbc !== null ? item.tax_planning.december.tbc !== "" ? Number(item.tax_planning.december.tbc).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbc !== null ? item.tax_planning.december.tbc !== "" ? Number(item.tax_planning.december.tbc).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.december_formula } : item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbc !== null ? item.tax_planning.december.tbc !== "" ? Number(item.tax_planning.december.tbc).toFixed(1) : "0" : "0" : "0" : "0",
                            //     fcp: this.props.status === 'CLOSED' ? item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.fcp !== null ? item.tax_planning.december.fcp !== "" ? Number(item.tax_planning.december.fcp).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.fcp !== null ? item.tax_planning.december.fcp !== "" ? Number(item.tax_planning.december.fcp).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.december_formula } : item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.fcp !== null ? item.tax_planning.december.fcp !== "" ? Number(item.tax_planning.december.fcp).toFixed(1) : "0" : "0" : "0" : "0",
                            //     tbf: this.props.status === 'CLOSED' ? item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbf !== null ? item.tax_planning.december.tbf !== "" ? Number(item.tax_planning.december.tbf).toFixed(1) : "0" : "0" : "0" : "0" : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbf !== null ? item.tax_planning.december.tbf !== "" ? Number(item.tax_planning.december.tbf).toFixed(1) : "0" : "0" : "0" : "0", formula: item.tax_planning.december_formula } : item.tax_planning.december !== null ? item.tax_planning.december !== "" ? item.tax_planning.december.tbf !== null ? item.tax_planning.december.tbf !== "" ? Number(item.tax_planning.december.tbf).toFixed(1) : "0" : "0" : "0" : "0"
                            // },
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
382
                            item.tax_planning.total_current_year,
rifkaki's avatar
rifkaki committed
383 384
                            0,
                            0,
r.kurnia's avatar
r.kurnia committed
385
                            item.order,
r.kurnia's avatar
r.kurnia committed
386 387
                            { tbc: item.condition_it_should_be, fcp: item.condition_it_should_be, tbf: item.condition_it_should_be },
                            { tbc: item.condition_if_wrong, fcp: item.condition_if_wrong, tbf: item.condition_if_wrong },
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
388
                        ])
r.kurnia's avatar
r.kurnia committed
389 390 391 392 393 394
                        if (item.children !== null) {
                            if (item.children.length > 0) {
                                item.children.map((items, indexs) => {
                                    handlePushChild(items)
                                })
                            }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
395
                        }
r.kurnia's avatar
r.kurnia committed
396
                    })
r.kurnia's avatar
r.kurnia committed
397
                    this.setState({ dataTable, loading: false, buttonError: false, editable: true })
r.kurnia's avatar
r.kurnia committed
398 399
                } else {
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
d.arizona's avatar
d.arizona committed
400
                        if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
r.kurnia's avatar
r.kurnia committed
401 402 403 404
                            setTimeout(() => {
                                localStorage.removeItem(Constant.TOKEN)
                                window.location.reload();
                            }, 1000);
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
405
                        }
r.kurnia's avatar
r.kurnia committed
406 407
                    })
                }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
408
            } else {
qorri_di's avatar
qorri_di committed
409
                this.setState({ dataTable, loading: false, buttonError: true, editable: true })
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
410
            }
rifkaki's avatar
rifkaki committed
411
            console.log(dataTable)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
        })
    }

    handleValue(data) {
        let total = 0
        this.state.dataTable.map((item, index) => {
            if (data.rowData[4] == item[5]) {
                total = item[data.columnIndex] == undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex]))
            }
        })
        let indexParent = this.state.dataTable.findIndex((val) => val[4] === this.state.dataTable[data.rowIndex][5])
        let a = this.state.dataTable[data.rowIndex][data.columnIndex] = total
        // console.log(indexParent);
        return a
    }

    handleChange(value, tableMeta) {
        let val = String(value).split(",").join("")
        let data = this.state.dataTable
        let indexParent = data.findIndex((val) => val[4] === data[tableMeta.rowIndex][5])
        if (indexParent > 0) {
            // console.log(indexParent)
            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)
        }
        // this.forceUpdate()
        // console.log(this.state.dataTable)
        // this.setState({
        //     data: a,
        // }, () => console.log(this.state.dataTable))
    }

    backToMasterBudget(type) {
        let data = []
Riri Novita's avatar
Riri Novita committed
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 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 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512
        if (this.props.defaultCurrency.id == 2) {
            this.state.dataTable.map(i => {
                data.push({
                    item_report_id: i[4],
                    january: {
                        tbf: String(Number(i[9].tbf))
                    },
                    february: {
                        // tbc: String(Number(i[10].tbc).toFixed(1)),
                        // fcp: String(Number(i[10].fcp).toFixed(1)),
                        tbf: String(Number(i[10].tbf))
                    },
                    march: {
                        // tbc: String(Number(i[11].tbc)),
                        // fcp: String(Number(i[11].fcp)),
                        tbf: String(Number(i[11].tbf))
                    },
                    april: {
                        // tbc: String(Number(i[12].tbc)),
                        // fcp: String(Number(i[12].fcp)),
                        tbf: String(Number(i[12].tbf))
                    },
                    may: {
                        // tbc: String(Number(i[13].tbc)),
                        // fcp: String(Number(i[13].fcp)),
                        tbf: String(Number(i[13].tbf))
                    },
                    june: {
                        // tbc: String(Number(i[14].tbc)),
                        // fcp: String(Number(i[14].fcp)),
                        tbf: String(Number(i[14].tbf))
                    },
                    july: {
                        // tbc: String(Number(i[15].tbc)),
                        // fcp: String(Number(i[15].fcp)),
                        tbf: String(Number(i[15].tbf))
                    },
                    august: {
                        // tbc: String(Number(i[16].tbc)),
                        // fcp: String(Number(i[16].fcp)),
                        tbf: String(Number(i[16].tbf))
                    },
                    september: {
                        // tbc: String(Number(i[17].tbc)),
                        // fcp: String(Number(i[17].fcp)),
                        tbf: String(Number(i[17].tbf))
                    },
                    october: {
                        // tbc: String(Number(i[18].tbc)),
                        // fcp: String(Number(i[18].fcp)),
                        tbf: String(Number(i[18].tbf))
                    },
                    november: {
                        tbc: i[1] === 3 && i[19].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[19].tbc.value) : String(i[19].tbc),
                        fcp: i[2] === 3 && i[19].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[19].fcp.value) : String(i[19].fcp),
                        tbf: i[3] === 3 && i[19].tbf === "" ? "0" : String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(i[19].tbf) : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[19].tbf.value) : String(i[19].tbf)
                    },
                    december: {
                        tbc: i[1] === 3 && i[20].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[20].tbc.value) : String(i[20].tbc),
                        fcp: i[2] === 3 && i[20].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[20].fcp.value) : String(i[20].fcp),
                        tbf: i[3] === 3 && i[20].tbf === "" ? "0" : String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(i[20].tbf) : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[20].tbf.value) : String(i[20].tbf)
                    },
                    total_current_year: String(Number(i[21])),
                })
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
513
            })
Riri Novita's avatar
Riri Novita committed
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581
        } else {
            this.state.dataTable.map(i => {
                data.push({
                    item_report_id: i[4],
                    january: {
                        // tbc: String(Number(i[9].tbc).toFixed(1)),
                        // fcp: String(Number(i[9].fcp).toFixed(1)),
                        tbf: String(fixNumber(Number(i[9].tbf), 1))
                    },
                    february: {
                        // tbc: String(Number(i[10].tbc).toFixed(1)),
                        // fcp: String(Number(i[10].fcp).toFixed(1)),
                        tbf: String(fixNumber(Number(i[10].tbf), 1))
                    },
                    march: {
                        // tbc: String(fixNumber(Number(i[11].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[11].fcp), 1)),
                        tbf: String(fixNumber(Number(i[11].tbf), 1))
                    },
                    april: {
                        // tbc: String(fixNumber(Number(i[12].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[12].fcp), 1)),
                        tbf: String(fixNumber(Number(i[12].tbf), 1))
                    },
                    may: {
                        // tbc: String(fixNumber(Number(i[13].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[13].fcp), 1)),
                        tbf: String(fixNumber(Number(i[13].tbf), 1))
                    },
                    june: {
                        // tbc: String(fixNumber(Number(i[14].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[14].fcp), 1)),
                        tbf: String(fixNumber(Number(i[14].tbf), 1))
                    },
                    july: {
                        // tbc: String(fixNumber(Number(i[15].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[15].fcp), 1)),
                        tbf: String(fixNumber(Number(i[15].tbf), 1))
                    },
                    august: {
                        // tbc: String(fixNumber(Number(i[16].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[16].fcp), 1)),
                        tbf: String(fixNumber(Number(i[16].tbf), 1))
                    },
                    september: {
                        // tbc: String(fixNumber(Number(i[17].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[17].fcp), 1)),
                        tbf: String(fixNumber(Number(i[17].tbf), 1))
                    },
                    october: {
                        // tbc: String(fixNumber(Number(i[18].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[18].fcp), 1)),
                        tbf: String(fixNumber(Number(i[18].tbf), 1))
                    },
                    november: {
                        tbc: i[1] === 3 && i[19].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[19].tbc.value) : String(i[19].tbc),
                        fcp: i[2] === 3 && i[19].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[19].fcp.value) : String(i[19].fcp),
                        tbf: i[3] === 3 && i[19].tbf === "" ? "0" : String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(i[19].tbf) : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[19].tbf.value) : String(i[19].tbf)
                    },
                    december: {
                        tbc: i[1] === 3 && i[20].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[20].tbc.value) : String(i[20].tbc),
                        fcp: i[2] === 3 && i[20].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[20].fcp.value) : String(i[20].fcp),
                        tbf: i[3] === 3 && i[20].tbf === "" ? "0" : String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(i[20].tbf) : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[20].tbf.value) : String(i[20].tbf)
                    },
                    total_current_year: String(fixNumber(Number(i[21]), 1)),
                })
            })
        }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
582 583 584 585 586 587
        let payload = {
            "outlook_pa_id": this.props.outlook_pa_id,
            "company_id": this.props.company.company_id,
            "periode": this.props.periode,
            "report_id": this.props.report_id,
            "status": type,
588
            "currency_id": this.props.defaultCurrency.id,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
589 590
            "tax_planning": data
        }
rifkaki's avatar
rifkaki committed
591
        console.log(payload);
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
592 593
        // console.log(JSON.stringify(payload));
        // this.setState({ loading: false })
Riri Novita's avatar
Riri Novita committed
594 595 596 597 598 599 600
        if (type == 'submitted') {
            this.props.saveToOLPA(payload, 'TP')
        } else {
            this.props.saveToOLPA(payload)
        }
        // this.props.saveToOLPA(payload)
        // this.props.onClickClose()
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
601 602 603 604 605
    }

    fileHandler = (event) => {
        let fileObj = event
        ExcelRenderer(fileObj, (err, resp) => {
rifkaki's avatar
rifkaki committed
606
            console.log(resp)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
607
            if (err) {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
608
                // console.log(err);
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
609 610 611
            }
            else {
                let isi = resp.rows.slice(4)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
612 613
                // console.log(resp.rows[2]);
                // console.log(resp.rows);
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
614 615 616 617 618 619 620 621
                let payload = []
                let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
                isi.map((i, index) => {
                    if (i.length > 0) {
                        payload.push({
                            item_report_id: i[0] === undefined ? "" : String(i[0]).trim(),
                            item_report: i[1] === undefined ? "" : String(i[1]).trim(),
                            january: {
rifkaki's avatar
rifkaki committed
622 623 624
                                // tbc: i[2] === undefined ? "0" : reg.test(String(i[2])) === false ? "0" : String(i[2]).trim(),
                                // fcp: i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(),
                                tbf: i[2] === undefined ? "0" : reg.test(String(i[2])) === false ? "0" : String(i[2]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
625 626
                            },
                            february: {
rifkaki's avatar
rifkaki committed
627 628 629
                                // tbc: i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(),
                                // fcp: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(),
                                tbf: i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
630 631
                            },
                            march: {
rifkaki's avatar
rifkaki committed
632 633 634
                                // tbc: i[8] === undefined ? "0" : reg.test(String(i[8])) === false ? "0" : String(i[8]).trim(),
                                // fcp: i[9] === undefined ? "0" : reg.test(String(i[9])) === false ? "0" : String(i[9]).trim(),
                                tbf: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
635 636
                            },
                            april: {
rifkaki's avatar
rifkaki committed
637 638 639
                                // tbc: i[11] === undefined ? "0" : reg.test(String(i[11])) === false ? "0" : String(i[11]).trim(),
                                // fcp: i[12] === undefined ? "0" : reg.test(String(i[12])) === false ? "0" : String(i[12]).trim(),
                                tbf: i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
640 641
                            },
                            may: {
rifkaki's avatar
rifkaki committed
642 643 644
                                // tbc: i[14] === undefined ? "0" : reg.test(String(i[14])) === false ? "0" : String(i[14]).trim(),
                                // fcp: i[15] === undefined ? "0" : reg.test(String(i[15])) === false ? "0" : String(i[15]).trim(),
                                tbf: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
645 646
                            },
                            june: {
rifkaki's avatar
rifkaki committed
647 648 649
                                // tbc: i[17] === undefined ? "0" : reg.test(String(i[17])) === false ? "0" : String(i[17]).trim(),
                                // fcp: i[18] === undefined ? "0" : reg.test(String(i[18])) === false ? "0" : String(i[18]).trim(),
                                tbf: i[7] === undefined ? "0" : reg.test(String(i[7])) === false ? "0" : String(i[7]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
650 651
                            },
                            july: {
rifkaki's avatar
rifkaki committed
652 653 654
                                // tbc: i[20] === undefined ? "0" : reg.test(String(i[20])) === false ? "0" : String(i[20]).trim(),
                                // fcp: i[21] === undefined ? "0" : reg.test(String(i[21])) === false ? "0" : String(i[21]).trim(),
                                tbf: i[8] === undefined ? "0" : reg.test(String(i[8])) === false ? "0" : String(i[8]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
655 656
                            },
                            august: {
rifkaki's avatar
rifkaki committed
657 658 659
                                // tbc: i[23] === undefined ? "0" : reg.test(String(i[23])) === false ? "0" : String(i[23]).trim(),
                                // fcp: i[24] === undefined ? "0" : reg.test(String(i[24])) === false ? "0" : String(i[24]).trim(),
                                tbf: i[9] === undefined ? "0" : reg.test(String(i[9])) === false ? "0" : String(i[9]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
660 661
                            },
                            september: {
rifkaki's avatar
rifkaki committed
662 663 664
                                // tbc: i[26] === undefined ? "0" : reg.test(String(i[26])) === false ? "0" : String(i[26]).trim(),
                                // fcp: i[27] === undefined ? "0" : reg.test(String(i[27])) === false ? "0" : String(i[27]).trim(),
                                tbf: i[10] === undefined ? "0" : reg.test(String(i[10])) === false ? "0" : String(i[10]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
665 666
                            },
                            october: {
rifkaki's avatar
rifkaki committed
667 668 669
                                // tbc: i[29] === undefined ? "0" : reg.test(String(i[29])) === false ? "0" : String(i[29]).trim(),
                                // fcp: i[30] === undefined ? "0" : reg.test(String(i[30])) === false ? "0" : String(i[30]).trim(),
                                tbf: i[11] === undefined ? "0" : reg.test(String(i[11])) === false ? "0" : String(i[11]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
670 671
                            },
                            november: {
rifkaki's avatar
rifkaki committed
672 673 674
                                tbc: i[12] === undefined ? "0" : reg.test(String(i[12])) === false ? "0" : String(i[12]).trim(),
                                fcp: i[13] === undefined ? "0" : reg.test(String(i[13])) === false ? "0" : String(i[13]).trim(),
                                tbf: i[14] === undefined ? "0" : reg.test(String(i[14])) === false ? "0" : String(i[14]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
675 676
                            },
                            december: {
rifkaki's avatar
rifkaki committed
677 678 679
                                tbc: i[15] === undefined ? "0" : reg.test(String(i[15])) === false ? "0" : String(i[15]).trim(),
                                fcp: i[16] === undefined ? "0" : reg.test(String(i[16])) === false ? "0" : String(i[16]).trim(),
                                tbf: i[17] === undefined ? "0" : reg.test(String(i[17])) === false ? "0" : String(i[17]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
680
                            },
rifkaki's avatar
rifkaki committed
681
                            total_current_year: i[18] === undefined ? "" : String(i[18]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
682
                            total_next_year: {
rifkaki's avatar
rifkaki committed
683 684 685
                                tbc: i[19] === undefined ? "0" : reg.test(String(i[19])) === false ? "0" : String(i[19]).trim(),
                                fcp: i[20] === undefined ? "0" : reg.test(String(i[20])) === false ? "0" : String(i[20]).trim(),
                                tbf: i[21] === undefined ? "0" : reg.test(String(i[21])) === false ? "0" : String(i[21]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
686 687
                            },
                            total_more_year: {
rifkaki's avatar
rifkaki committed
688 689 690
                                tbc: i[22] === undefined ? "0" : reg.test(String(i[22])) === false ? "0" : String(i[22]).trim(),
                                fcp: i[23] === undefined ? "0" : reg.test(String(i[23])) === false ? "0" : String(i[23]).trim(),
                                tbf: i[24] === undefined ? "0" : reg.test(String(i[24])) === false ? "0" : String(i[24]).trim(),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
691 692 693 694 695 696 697 698 699 700 701
                            }
                        })
                    }
                })
                let body = {
                    company_id: this.props.company.company_id,
                    periode: this.props.periode,
                    report_id: this.props.report_id,
                    tax_planning: payload
                }
                this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] })
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
702
                // console.log(this.state.judulColumn)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
703 704 705 706 707
            }
        });
    }

    checkUpload() {
708 709 710 711 712
        let payload = {
            ...this.state.payload,
            currency_id: this.state.defaultCurrencyUpload?.id
        }
        api.create().checkUploadOLPA(payload).then(response => {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
713
            // console.log(JSON.stringify(this.state.payload));
r.kurnia's avatar
r.kurnia committed
714
            console.log(response)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
715 716 717 718 719 720 721
            if (response.data) {
                if (response.data.status === 'success') {
                    this.setState({ visibleUpload: false, visibleTP: false, loading: true })
                    let dataTable = response.data.data.map((item, index) => {
                        return [
                            // item.type_report_id,
                            0,
qorri_di's avatar
qorri_di committed
722 723
                            Number(item.type_report_id.tbc),
                            Number(item.type_report_id.fcp),
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
724 725 726 727 728 729 730
                            Number(item.type_report_id.tbf),
                            item.item_report_id,
                            item.parent,
                            item.formula,
                            // {tbc: item.formula.tbc, fcp: item.formula.fcp, tbf: item.formula.tbf},
                            item.level,
                            item.item_report,
qorri_di's avatar
qorri_di committed
731 732 733
                            {
                                tbc: 0,
                                fcp: 0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
734 735
                                tbf: Number(item.type_report_id.tbf) === 3 && item.january.tbf === "" ? "0" : item.january.tbf
                            },
qorri_di's avatar
qorri_di committed
736 737
                            {
                                tbc: 0,
rifkaki's avatar
rifkaki committed
738
                                fcp: 0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
739 740
                                tbf: Number(item.type_report_id.tbf) === 3 && item.february.tbf === "" ? "0" : item.february.tbf
                            },
qorri_di's avatar
qorri_di committed
741 742 743
                            {
                                tbc: 0,
                                fcp: 0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
744 745
                                tbf: Number(item.type_report_id.tbf) === 3 && item.march.tbf === "" ? "0" : item.march.tbf
                            },
qorri_di's avatar
qorri_di committed
746 747 748
                            {
                                tbc: 0,
                                fcp: 0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
749 750
                                tbf: Number(item.type_report_id.tbf) === 3 && item.april.tbf === "" ? "0" : item.april.tbf
                            },
qorri_di's avatar
qorri_di committed
751 752 753
                            {
                                tbc: 0,
                                fcp: 0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
754 755
                                tbf: Number(item.type_report_id.tbf) === 3 && item.may.tbf === "" ? "0" : item.may.tbf
                            },
qorri_di's avatar
qorri_di committed
756 757 758
                            {
                                tbc: 0,
                                fcp: 0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
759 760
                                tbf: Number(item.type_report_id.tbf) === 3 && item.june.tbf === "" ? "0" : item.june.tbf
                            },
qorri_di's avatar
qorri_di committed
761 762 763
                            {
                                tbc: 0,
                                fcp: 0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
764 765
                                tbf: Number(item.type_report_id.tbf) === 3 && item.july.tbf === "" ? "0" : item.july.tbf
                            },
qorri_di's avatar
qorri_di committed
766 767 768
                            {
                                tbc: 0,
                                fcp: 0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
769 770
                                tbf: Number(item.type_report_id.tbf) === 3 && item.august.tbf === "" ? "0" : item.august.tbf
                            },
qorri_di's avatar
qorri_di committed
771 772 773
                            {
                                tbc: 0,
                                fcp: 0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
774 775
                                tbf: Number(item.type_report_id.tbf) === 3 && item.september.tbf === "" ? "0" : item.september.tbf
                            },
qorri_di's avatar
qorri_di committed
776 777 778
                            {
                                tbc: 0,
                                fcp: 0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
779 780
                                tbf: Number(item.type_report_id.tbf) === 3 && item.october.tbf === "" ? "0" : item.october.tbf
                            },
qorri_di's avatar
qorri_di committed
781 782 783
                            {
                                tbc: Number(item.type_report_id.tbc) === 3 && item.november.tbc === "" ? "0" : (Number(item.type_report_id.tbc) === 5 || Number(item.type_report_id.tbc) === 6 || Number(item.type_report_id.tbc) === 7 ? { value: item.november.tbc, formula: item.november_formula } : item.november.tbc),
                                fcp: Number(item.type_report_id.fcp) === 3 && item.november.fcp === "" ? "0" : (Number(item.type_report_id.fcp) === 5 || Number(item.type_report_id.fcp) === 6 || Number(item.type_report_id.fcp) === 7 ? { value: item.november.fcp, formula: item.november_formula } : item.november.fcp),
syadziy's avatar
syadziy committed
784
                                tbf: Number(item.type_report_id.tbf) === 3 && item.november.tbf === "" ? "0" : (Number(item.type_report_id.tbf) === 5 || Number(item.type_report_id.tbf) === 6 || Number(item.type_report_id.tbf) === 7 ? { value: item.november.tbf, formula: item.november_formula } : item.november.tbf)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
785
                            },
qorri_di's avatar
qorri_di committed
786 787 788
                            {
                                tbc: Number(item.type_report_id.tbc) === 3 && item.december.tbc === "" ? "0" : (Number(item.type_report_id.tbc) === 5 || Number(item.type_report_id.tbc) === 6 || Number(item.type_report_id.tbc) === 7 ? { value: item.december.tbc, formula: item.december_formula } : item.december.tbc),
                                fcp: Number(item.type_report_id.fcp) === 3 && item.december.fcp === "" ? "0" : (Number(item.type_report_id.fcp) === 5 || Number(item.type_report_id.fcp) === 6 || Number(item.type_report_id.fcp) === 7 ? { value: item.december.fcp, formula: item.december_formula } : item.december.fcp),
syadziy's avatar
syadziy committed
789
                                tbf: Number(item.type_report_id.tbf) === 3 && item.december.tbf === "" ? "0" : (Number(item.type_report_id.tbf) === 5 || Number(item.type_report_id.tbf) === 6 || Number(item.type_report_id.tbf) === 7 ? { value: item.december.tbf, formula: item.december_formula } : item.december.tbf)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
790 791
                            },
                            item.total_current_year,
rifkaki's avatar
rifkaki committed
792 793
                            0,
                            0,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
794 795 796 797 798
                            item.orders,
                            item.error
                        ]
                    })
                    this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
rifkaki's avatar
rifkaki committed
799 800 801 802 803 804
                        this.state.dataTable.map(item => {
                            if (item[25].length > 0) {
                                console.log('masuk')
                                this.setState({ buttonError: true, errorPreview: true, editable: true })
                            }
                        })
rifkaki's avatar
rifkaki committed
805
                        console.log(this.state.dataTable);
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
806
                    })
Riri Novita's avatar
Riri Novita committed
807 808
                } else {
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
d.arizona's avatar
d.arizona committed
809
                        if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
Riri Novita's avatar
Riri Novita committed
810 811 812 813 814 815
                            setTimeout(() => {
                                localStorage.removeItem(Constant.TOKEN)
                                window.location.reload();
                            }, 1000);
                        }
                    })
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
816 817 818 819 820 821 822
                }
            }
        })
    }

    uploadTP(type) {
        let data = []
Riri Novita's avatar
Riri Novita committed
823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868
        if (this.state.defaultCurrencyUpload?.id == 2) {
            this.state.dataTable.map(i => {
                data.push({
                    item_report_id: i[4],
                    january: {
                        tbf: String(Number(i[9].tbf))
                    },
                    february: {
                        tbf: String(Number(i[10].tbf))
                    },
                    march: {
                        tbf: String(Number(i[11].tbf))
                    },
                    april: {
                        tbf: String(Number(i[12].tbf))
                    },
                    may: {
                        tbf: String(Number(i[13].tbf))
                    },
                    june: {
                        tbf: String(Number(i[14].tbf))
                    },
                    july: {
                        tbf: String(Number(i[15].tbf))
                    },
                    august: {
                        tbf: String(Number(i[16].tbf))
                    },
                    september: {
                        tbf: String(Number(i[17].tbf))
                    },
                    october: {
                        tbf: String(Number(i[18].tbf))
                    },
                    november: {
                        tbc: String(Number(i[19].tbc)),
                        fcp: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[19].fcp)) : String(Number(i[19].fcp)),
                        tbf: String(Number(i[19].tbf))
                    },
                    december: {
                        tbc: String(Number(i[20].tbc)),
                        fcp: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[20].fcp)) : String(Number(i[20].fcp)),
                        tbf: String(Number(i[20].tbf))
                    },
                    total_current_year: String(Number(i[21]))
                })
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
869
            })
Riri Novita's avatar
Riri Novita committed
870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 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 927 928 929 930 931 932 933 934 935 936 937 938
        } else {
            this.state.dataTable.map(i => {
                data.push({
                    item_report_id: i[4],
                    january: {
                        // tbc: String(Number(i[9].tbc).toFixed(1)),
                        // fcp: String(Number(i[9].fcp).toFixed(1)),
                        tbf: String(fixNumber(Number(i[9].tbf), 1))
                    },
                    february: {
                        // tbc: String(Number(i[10].tbc).toFixed(1)),
                        // fcp: String(Number(i[10].fcp).toFixed(1)),
                        tbf: String(fixNumber(Number(i[10].tbf), 1))
                    },
                    march: {
                        // tbc: String(fixNumber(Number(i[11].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[11].fcp), 1)),
                        tbf: String(fixNumber(Number(i[11].tbf), 1))
                    },
                    april: {
                        // tbc: String(fixNumber(Number(i[12].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[12].fcp), 1)),
                        tbf: String(fixNumber(Number(i[12].tbf), 1))
                    },
                    may: {
                        // tbc: String(fixNumber(Number(i[13].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[13].fcp), 1)),
                        tbf: String(fixNumber(Number(i[13].tbf), 1))
                    },
                    june: {
                        // tbc: String(fixNumber(Number(i[14].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[14].fcp), 1)),
                        tbf: String(fixNumber(Number(i[14].tbf), 1))
                    },
                    july: {
                        // tbc: String(fixNumber(Number(i[15].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[15].fcp), 1)),
                        tbf: String(fixNumber(Number(i[15].tbf), 1))
                    },
                    august: {
                        // tbc: String(fixNumber(Number(i[16].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[16].fcp), 1)),
                        tbf: String(fixNumber(Number(i[16].tbf), 1))
                    },
                    september: {
                        // tbc: String(fixNumber(Number(i[17].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[17].fcp), 1)),
                        tbf: String(fixNumber(Number(i[17].tbf), 1))
                    },
                    october: {
                        // tbc: String(fixNumber(Number(i[18].tbc), 1)),
                        // fcp: String(fixNumber(Number(i[18].fcp), 1)),
                        tbf: String(fixNumber(Number(i[18].tbf), 1))
                    },
                    november: {
                        tbc: String(fixNumber(Number(i[19].tbc), 1)),
                        fcp: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(fixNumber(Number(i[19].fcp), 2)) : String(fixNumber(Number(i[19].fcp), 1)),
                        tbf: String(fixNumber(Number(i[19].tbf), 1))
                    },
                    december: {
                        tbc: String(fixNumber(Number(i[20].tbc), 1)),
                        fcp: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(fixNumber(Number(i[20].fcp), 2)) : String(fixNumber(Number(i[20].fcp), 1)),
                        tbf: String(fixNumber(Number(i[20].tbf), 1))
                    },
                    total_current_year: String(fixNumber(Number(i[21]), 1))
                })
            })
        }

Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
939 940 941 942 943
        let body = {
            outlook_pa_id: this.props.outlook_pa_id,
            company_id: this.props.company.company_id,
            periode: this.props.periode,
            report_id: this.props.report_id,
944
            currency_id: this.state.defaultCurrencyUpload?.id,
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
945 946 947 948
            tax_planning: data,
            status: type
        }
        // console.log(data);
Riri Novita's avatar
Riri Novita committed
949
        api.create('UPLOAD').uploadOLPA(body).then(response => {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
950
            // console.log(response);
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
951 952 953 954 955
            if (response.data) {
                if (response.data.status === "success") {
                    this.props.onClickClose()
                    this.props.getReport()
                } else {
956 957 958 959 960 961 962 963 964 965 966 967 968
                    if (response.data?.message == "Please Set Up Rate Currency First") {
                        this.setState({ visibleAlertSave: true })
                    } else {
                        // this.setState({ alert: true, messageAlert: response.data.status, tipeAlert: 'error', loading: false })
                        this.setState({ visibleAlertSave: true, 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);
                            }
                        })
                    }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
969 970
                }
            } else {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
971
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
972 973 974 975 976 977
            }
        })
    }

    handleValidate() {
        let data = []
978 979
        let errorContrl = this.state.buttonError
        let editAble = this.state.editAble
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
980
        // console.log(this.state.dataTable)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
981
        this.state.dataTable.map(i => {
qorri_di's avatar
qorri_di committed
982
            // console.log(i[0])
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
983 984 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 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035
            data.push({
                item_report_id: i[4],
                january: {
                    tbc: i[1] === 3 && i[9].tbc === "" ? "0" : String(i[9].tbc),
                    fcp: i[2] === 3 && i[9].fcp === "" ? "0" : String(i[9].fcp),
                    tbf: i[3] === 3 && i[9].tbf === "" ? "0" : String(i[9].tbf)
                },
                february: {
                    tbc: i[1] === 3 && i[10].tbc === "" ? "0" : String(i[10].tbc),
                    fcp: i[2] === 3 && i[10].fcp === "" ? "0" : String(i[10].fcp),
                    tbf: i[3] === 3 && i[10].tbf === "" ? "0" : String(i[10].tbf)
                },
                march: {
                    tbc: i[1] === 3 && i[11].tbc === "" ? "0" : String(i[11].tbc),
                    fcp: i[2] === 3 && i[11].fcp === "" ? "0" : String(i[11].fcp),
                    tbf: i[3] === 3 && i[11].tbf === "" ? "0" : String(i[11].tbf)
                },
                april: {
                    tbc: i[1] === 3 && i[12].tbc === "" ? "0" : String(i[12].tbc),
                    fcp: i[2] === 3 && i[12].fcp === "" ? "0" : String(i[12].fcp),
                    tbf: i[3] === 3 && i[12].tbf === "" ? "0" : String(i[12].tbf)
                },
                may: {
                    tbc: i[1] === 3 && i[13].tbc === "" ? "0" : String(i[13].tbc),
                    fcp: i[2] === 3 && i[13].fcp === "" ? "0" : String(i[13].fcp),
                    tbf: i[3] === 3 && i[13].tbf === "" ? "0" : String(i[13].tbf)
                },
                june: {
                    tbc: i[1] === 3 && i[14].tbc === "" ? "0" : String(i[14].tbc),
                    fcp: i[2] === 3 && i[14].fcp === "" ? "0" : String(i[14].fcp),
                    tbf: i[3] === 3 && i[14].tbc === "" ? "0" : String(i[14].tbf)
                },
                july: {
                    tbc: i[1] === 3 && i[15].tbc === "" ? "0" : String(i[15].tbc),
                    fcp: i[2] === 3 && i[15].fcp === "" ? "0" : String(i[15].fcp),
                    tbf: i[3] === 3 && i[15].tbf === "" ? "0" : String(i[15].tbf)
                },
                august: {
                    tbc: i[1] === 3 && i[16].tbc === "" ? "0" : String(i[16].tbc),
                    fcp: i[2] === 3 && i[16].fcp === "" ? "0" : String(i[16].fcp),
                    tbf: i[3] === 3 && i[16].tbf === "" ? "0" : String(i[16].tbf)
                },
                september: {
                    tbc: i[1] === 3 && i[17].tbc === "" ? "0" : String(i[17].tbc),
                    fcp: i[2] === 3 && i[17].fcp === "" ? "0" : String(i[17].fcp),
                    tbf: i[3] === 3 && i[17].tbf === "" ? "0" : String(i[17].tbf)
                },
                october: {
                    tbc: i[1] === 3 && i[18].tbc === "" ? "0" : String(i[18].tbc),
                    fcp: i[2] === 3 && i[18].fcp === "" ? "0" : String(i[18].fcp),
                    tbf: i[3] === 3 && i[18].tbf === "" ? "0" : String(i[18].tbf)
                },
                november: {
r.kurnia's avatar
r.kurnia committed
1036 1037 1038
                    tbc: i[1] === 3 && i[19].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[19].tbc.value) : String(i[19].tbc),
                    fcp: i[2] === 3 && i[19].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[19].fcp.value) : String(i[19].fcp),
                    tbf: i[3] === 3 && i[19].tbf === "" ? "0" : String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(i[19].tbf) : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[19].tbf.value) : String(i[19].tbf)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1039 1040
                },
                december: {
r.kurnia's avatar
r.kurnia committed
1041 1042 1043
                    tbc: i[1] === 3 && i[20].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[20].tbc.value) : String(i[20].tbc),
                    fcp: i[2] === 3 && i[20].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[20].fcp.value) : String(i[20].fcp),
                    tbf: i[3] === 3 && i[20].tbf === "" ? "0" : String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(i[20].tbf) : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[20].tbf.value) : String(i[20].tbf)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1044 1045
                },
                total_current_year: i[2] === 3 && i[21] === "" ? "0" : String(i[21]),
r.kurnia's avatar
r.kurnia committed
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
                // total_next_year: {
                //     tbc: i[1] === 3 && i[22].tbc === "" ? "0" : String(i[22].tbc),
                //     fcp: i[2] === 3 && i[22].fcp === "" ? "0" : String(i[22].fcp),
                //     tbf: i[3] === 3 && i[22].tbf === "" ? "0" : String(i[22].tbf)
                // },
                // total_more_year: {
                //     tbc: i[1] === 3 && i[23].tbc === "" ? "0" : String(i[23].tbc),
                //     fcp: i[2] === 3 && i[23].fcp === "" ? "0" : String(i[23].fcp),
                //     tbf: i[3] === 3 && i[23].tbf === "" ? "0" : String(i[23].tbf)
                // }
rifkaki's avatar
rifkaki committed
1056

Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1057
            })
1058 1059 1060

            if (String(i[8]) == "Control (should be nil)") {
                this.setState({ loading: true })
r.kurnia's avatar
r.kurnia committed
1061
                if ((Number(i[19].tbf.value) < Number(this.state.minValue) || Number(i[19].tbf.value) > Number(this.state.maxValue)) || (Number(i[20].tbf.value) < Number(this.state.minValue) || Number(i[20].tbf.value) > Number(this.state.maxValue)) || (Number(i[21]) < Number(this.state.minValue) || Number(i[21]) > Number(this.state.maxValue))) {
1062 1063
                    errorContrl = true
                    editAble = true
qorri_di's avatar
qorri_di committed
1064
                }
1065 1066 1067 1068 1069
                else {
                    errorContrl = false
                    editAble = false
                }
            }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1070
        })
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1071
        // console.log(JSON.stringify(data))
r.kurnia's avatar
r.kurnia committed
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084
        // let payload = {
        //     "outlook_pa_id": this.props.outlook_pa_id,
        //     "company_id": this.props.company.company_id,
        //     "periode": this.props.periode,
        //     "report_id": this.props.report_id,
        //     "tax_planning": data,
        //     "status": "submitted"
        // }
        // api.create().validateSubmitReportOLPA(payload).then((response) => {
        //     console.log(payload)
        //     console.log(response)
        //     if (response.data) {
        //         if (response.data.status === "success") {
qorri_di's avatar
qorri_di committed
1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104
        // if (response.data.data.result && errorContrl === false && editAble === false ) {
        if (errorContrl === false && editAble === false) {
            this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
        } else {
            this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false })
            console.log("masuk button error")
        }
        //     } 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);
        //             }
        //         })
        //     }
        // } else {
        //     this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
        // }
r.kurnia's avatar
r.kurnia committed
1105
        // })
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1106 1107 1108 1109
    }

    downloadTemplate = async () => {
        let res = await fetch(
1110
            `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/outlook_pa/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&currency_id=${this.props.defaultCurrency.id}`
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1111 1112
        )
        res = await res.blob()
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1113
        // console.log(res)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1114 1115 1116 1117 1118 1119 1120 1121 1122 1123
        if (res.size > 0) {
            let url = window.URL.createObjectURL(res);
            let a = document.createElement('a');
            a.href = url;
            a.download = 'Template Outlook Performance Appraisal Tax Planning.xlsx';
            a.click();
        }
    }

    async downloadAllData() {
faisalhamdi's avatar
faisalhamdi committed
1124 1125
        let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=${this.props.outlook_pa_id}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
        let sub_null = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
1126
        console.log(url);
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146
        let res = await fetch(
            this.props.outlook_pa_id == null ? sub_null : url
        )
        res = await res.blob()
        this.setState({ loading: false })
        if (res.size > 0) {
            let url = window.URL.createObjectURL(res);
            let a = document.createElement('a');
            a.href = url;
            a.download = 'Outlook Performance Appraisal Tax Planning.xlsx';
            a.click();
        }
    }

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

    render() {
        let dataTable2 = this.state.dataTable
r.kurnia's avatar
r.kurnia committed
1147 1148 1149
        let dataFormula = []
        let id = 0
        let double = false
qorri_di's avatar
qorri_di committed
1150

r.kurnia's avatar
r.kurnia committed
1151
        const handleValueFormula = (value, tableMeta, dex, xntd, forecast, periode) => {
r.kurnia's avatar
r.kurnia committed
1152
            // console.log(xntd)
r.kurnia's avatar
r.kurnia committed
1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170
            let form = dex === 1 ? tableMeta.rowData[6].tbc : dex === 2 ? tableMeta.rowData[6].fcp : tableMeta.rowData[6].tbf
            let splitFormula = String(form).split('@')
            let baru = []
            let anjay = []
            splitFormula.map((item, index) => {
                let items = String(item).substr(Number(String(item).length) - 1, 1)
                let re = /^[a-zA-Z0-9_]+$/;
                let asd = ''
                if (item !== "") {
                    if (!re.test(items)) {
                        baru.push(String(item).substr(0, Number(String(item).length) - 1))
                        baru.push(String(item).substr(Number(String(item).length) - 1, 1))
                    } else {
                        baru.push(String(item))
                    }
                }
            })

r.kurnia's avatar
r.kurnia committed
1171 1172 1173 1174 1175 1176
            // console.log(baru);

            // if (forecast !== undefined) {
            //     console.log(splitFormula)
            // }

r.kurnia's avatar
r.kurnia committed
1177
            if (tableMeta.rowData[8] == "Under payment  /(Over Payment ) Income Tax Art.  29" || forecast !== undefined) {
r.kurnia's avatar
r.kurnia committed
1178 1179
                // form.replace("(", "")
                // form.replace(")", "")
r.kurnia's avatar
r.kurnia committed
1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203
                let opgab = []
                baru.map((item, index) => {
                    if (item.length > 1 && (item.includes("+") || item.includes("-") || item.includes("*") || item.includes("/"))) {
                        opgab.push(String(item).substr(0, Number(String(item).length) - 1))
                        opgab.push(String(item).substr(Number(String(item).length) - 1, 1))
                    } else {
                        opgab.push(item)
                    }
                })
                if (opgab.length > 0) {
                    baru = opgab
                }
            }

            let totalShldBeNil = 0
            baru.map((item, index) => {
                if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
                    anjay.push(item)
                } else {
                    if (String(item).includes('#')) {
                        let splitform = String(item).split('#')
                        if (splitform[1] == 'TP1' || splitform[1] == 'TP2' || splitform[1] == 'TP3') {
                            let indexID = dataTable2.findIndex((val) => val[24] == splitform[0])
                            if (indexID !== -1) {
r.kurnia's avatar
r.kurnia committed
1204
                                // console.log(splitform)
r.kurnia's avatar
r.kurnia committed
1205
                                let data = splitform[1] == 'TP1' ? dataTable2[indexID][tableMeta.columnIndex].tbc : splitform[1] == 'TP2' ? dataTable2[indexID][tableMeta.columnIndex].fcp : dataTable2[indexID][tableMeta.columnIndex].tbf
r.kurnia's avatar
r.kurnia committed
1206 1207 1208 1209
                                // console.log(data)
                                // if(value == null){
                                //     console.log(tableMeta);
                                // }
r.kurnia's avatar
r.kurnia committed
1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230
                                let valuezz = data.value == undefined ? data : data.value
                                anjay.push(valuezz == "" ? 0 : valuezz)
                            }
                        } else {
                            if (forecast !== undefined) {
                                forecast.map((item, index) => {
                                    if (periode == item.periode) {
                                        totalShldBeNil += Number(item.value)
                                    }
                                })
                                anjay.push(totalShldBeNil)
                            } else if (String(item).includes('[M-1]')) {
                                let tst = String(item).replace('[M-1]', '')
                                let data = tableMeta.columnIndex == 9 ? 20 : tableMeta.columnIndex - 1
                                let dataSub = dex == 1 ? tableMeta.rowData[data].tbc : dex == 2 ? tableMeta.rowData[data].fcp : tableMeta.rowData[data].tbf
                                let period = data == 20 ? Number(this.props.periode) - 1 : this.props.periode
                                let indexID = dataSub.formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
                                if (indexID !== -1) {
                                    let valuezz = tableMeta.rowData[data].formula[indexID].value
                                    anjay.push(valuezz == "" ? 0 : valuezz)
                                }
r.kurnia's avatar
r.kurnia committed
1231 1232 1233 1234 1235 1236
                            } else {
                                // console.log(value);
                                // if(value == null){
                                //     console.log(tableMeta);
                                // }
                                let data = dex == 1 ? value.tbc : dex == 2 ? value.fcp : value.tbf
qorri_di's avatar
qorri_di committed
1237
                                console.log(data);
1238 1239 1240 1241 1242 1243
                                if (data.formula) {
                                    let indexID = data.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
                                    if (indexID !== -1) {
                                        let valuezz = data.formula[indexID].value
                                        anjay.push(valuezz == "" ? 0 : valuezz)
                                    }
r.kurnia's avatar
r.kurnia committed
1244 1245
                                }
                            }
r.kurnia's avatar
r.kurnia committed
1246 1247 1248 1249 1250 1251 1252
                        }
                    } else {
                        let indexID = dataTable2.findIndex((val) => val[24] == item)
                        if (indexID !== -1) {
                            if (dataTable2[indexID][24] == tableMeta.rowData[24]) {
                                anjay.push(0)
                            } else {
r.kurnia's avatar
r.kurnia committed
1253
                                let data = dex == 1 ? dataTable2[indexID][tableMeta.columnIndex].tbc : dex == 2 ? dataTable2[indexID][tableMeta.columnIndex].fcp : dataTable2[indexID][tableMeta.columnIndex].tbf
r.kurnia's avatar
r.kurnia committed
1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 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 1352 1353 1354 1355 1356
                                let valuezz = data.value == undefined ? data : data.value
                                anjay.push(valuezz == "" ? 0 : valuezz)
                            }

                        }
                    }
                }
            })

            let total = 0
            let total2 = 0
            let opt = ""
            let opt2 = ""
            let prio = false
            let simpen2 = ""
            anjay.map((item, index) => {
                if (item == "+") {
                    if (prio) {
                        opt2 = "tambah"
                    } else {
                        opt = "tambah"
                    }
                } else if (item == "-") {
                    if (prio) {
                        opt2 = "kurang"
                    } else {
                        opt = "kurang"
                    }
                } else if (item == "*") {
                    if (prio) {
                        opt2 = "kali"
                    } else {
                        opt = "kali"
                    }
                } else if (item == "/") {
                    if (prio) {
                        opt2 = "bagi"
                    } else {
                        opt = "bagi"
                    }
                } else if (item == "(") {
                    prio = true
                    simpen2 = "active"
                } else if (item == ")") {
                    prio = false
                }
                else {
                    if (prio) {
                        if (opt2 == "tambah") {
                            total2 = Number(total2) + Number(item)
                        } else if (opt2 == "kurang") {
                            total2 = Number(total2) - Number(item)
                        } else if (opt2 == "kali") {
                            total2 = Number(total2) * Number(item)
                        } else if (opt2 == "bagi") {
                            total2 = Number(total2) / Number(item) == NaN ? 0 : Number(total2) / Number(item)
                        } else {
                            total2 += Number(item)
                        }
                    } else {
                        if (opt == "tambah") {
                            total = Number(total) + Number(item)
                        } else if (opt == "kurang") {
                            total = Number(total) - Number(item)
                        } else if (opt == "kali") {
                            total = Number(total) * Number(item)
                        } else if (opt == "bagi") {
                            total = Number(total) / Number(item) == NaN ? 0 : Number(total) / Number(item)
                        } else {
                            total += Number(item)
                        }
                    }
                }
            })

            if (simpen2 == "active") {
                if (opt == "tambah") {
                    total = Number(total) + Number(total2)
                } else if (opt == "kurang") {
                    total = Number(total) - Number(total2)
                } else if (opt == "kali") {
                    total = Number(total) * Number(total2)
                } else if (opt == "bagi") {
                    total = Number(total) / Number(total2) == NaN ? 0 : Number(total) / Number(total2)
                }
            }

            total = R.equals(total, NaN) ? "0.0" : total
            // console.log(tableMeta.rowData[8])
            // if (xntd !== undefined && tableMeta.rowData[8] == "Under payment  /(Over Payment ) Income Tax Art.  29") {
            //     console.log(tableMeta.rowData[8])
            //     // console.log(splitFormula)
            //     console.log(xntd)
            //     console.log(baru)
            //     console.log(anjay)
            //     console.log(total)
            //     console.log(total2)
            //     console.log(opt)
            // }

            // let dataSub = dex == 1? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc : dex == 2? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp : dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf
            if (dex == 1) {
                if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value == undefined) {
Riri Novita's avatar
Riri Novita committed
1357
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total)
r.kurnia's avatar
r.kurnia committed
1358
                } else {
Riri Novita's avatar
Riri Novita committed
1359
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total)
r.kurnia's avatar
r.kurnia committed
1360 1361 1362
                }
            } else if (dex == 2) {
                if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value == undefined) {
Riri Novita's avatar
Riri Novita committed
1363
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total)
r.kurnia's avatar
r.kurnia committed
1364
                } else {
Riri Novita's avatar
Riri Novita committed
1365
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total)
r.kurnia's avatar
r.kurnia committed
1366
                }
r.kurnia's avatar
r.kurnia committed
1367 1368 1369 1370
            } else if (dex == 3) {
                if (tableMeta.rowData[8] == "Corporate Income Tax") {
                    if (total < 0) {
                        total = 0
Riri Novita's avatar
Riri Novita committed
1371
                        dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 2) : Number(total)
r.kurnia's avatar
r.kurnia committed
1372
                    } else {
Riri Novita's avatar
Riri Novita committed
1373
                        dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 2) : Number(total)
r.kurnia's avatar
r.kurnia committed
1374 1375
                    }
                } else if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) {
Riri Novita's avatar
Riri Novita committed
1376
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total)
r.kurnia's avatar
r.kurnia committed
1377
                } else {
Riri Novita's avatar
Riri Novita committed
1378
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total)
r.kurnia's avatar
r.kurnia committed
1379
                }
r.kurnia's avatar
r.kurnia committed
1380 1381
            } else {
                if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value == undefined) {
Riri Novita's avatar
Riri Novita committed
1382
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total)
r.kurnia's avatar
r.kurnia committed
1383
                } else {
Riri Novita's avatar
Riri Novita committed
1384
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total)
r.kurnia's avatar
r.kurnia committed
1385
                }
r.kurnia's avatar
r.kurnia committed
1386 1387
            }

Riri Novita's avatar
Riri Novita committed
1388
            return tableMeta.rowData[8] == "Corporate Income Tax" ? this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 2) : Number(total) : this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total)
r.kurnia's avatar
r.kurnia committed
1389 1390
        }

Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402
        const handleChange = (value, tableMeta, indexChilds) => {
            let val = String(value).split(",").join("")
            // let data = this.state.dataTable2
            let indexParent = dataTable2.findIndex((val) => val[4] === dataTable2[tableMeta.rowIndex][5])
            // ini buat input untuk perhitungan parent nya
            if (indexParent > 0) {
                if (indexChilds == 1) {
                    let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp = Number(val)
                    let jagain = dataTable2[indexParent][tableMeta.columnIndex].fcp
                    a = dataTable2[indexParent][tableMeta.columnIndex].fcp = jagain === undefined ? (0 + Number(val)) : (Number(jagain) + Number(val))
                }
            } else {
r.kurnia's avatar
r.kurnia committed
1403
                if (indexChilds == 0) {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1404 1405
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = Number(val)
                }
r.kurnia's avatar
r.kurnia committed
1406
                else if (indexChilds == 1) {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1407 1408
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp = Number(val)
                }
r.kurnia's avatar
r.kurnia committed
1409
                else if (indexChilds == 2) {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1410 1411 1412 1413
                    dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(val)
                }
            }
        }
r.kurnia's avatar
r.kurnia committed
1414

r.kurnia's avatar
r.kurnia committed
1415
        const handleTotal = (tableMeta, dex, periode) => {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1416
            let total = 0
r.kurnia's avatar
r.kurnia committed
1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432
            let totalfcp = 0
            if (String(tableMeta.rowData[8]).toLowerCase() === "fiscal correction positive / (negative) year to date") {
                dataTable2[tableMeta.rowIndex - 2].map((item, index) => {
                    if (index >= 9 && index <= 20) {
                        if (dataTable2[tableMeta.rowIndex - 2][2] === 5 || dataTable2[tableMeta.rowIndex - 2][2] === 6 || dataTable2[tableMeta.rowIndex - 2][2] === 7) {
                            let valItem = item.fcp.value == undefined || item.fcp.value == "" || item.fcp.value == "undefined" ? 0.0 : item.fcp.value
                            total += Number(valItem)
                        } else {
                            let valItem = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp
                            total += Number(valItem)
                        }
                    }
                })
            } else {
                dataTable2[tableMeta.rowIndex].map((item, index) => {
                    if (index >= 9 && index <= 20) {
r.kurnia's avatar
r.kurnia committed
1433 1434 1435 1436 1437 1438 1439 1440
                        if (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX") {
                            let valItem = item.tbf == undefined || item.tbf == "" || item.tbf == "undefined" ? 0.0 : item.tbf
                            total += Number(valItem)
                        }
                        else if (tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7) {
                            let valItem = item.tbf.value == undefined || item.tbf.value == "" || item.tbf.value == "undefined" ? 0.0 : item.tbf.value
                            total += Number(valItem)
                        } else {
r.kurnia's avatar
r.kurnia committed
1441 1442
                            let valItem = item.tbf == undefined || item.tbf == "" || item.tbf == "undefined" ? 0.0 : item.tbf
                            total += Number(valItem)
r.kurnia's avatar
r.kurnia committed
1443
                        }
r.kurnia's avatar
r.kurnia committed
1444 1445 1446
                    }
                })
            }
Riri Novita's avatar
Riri Novita committed
1447
            dataTable2[tableMeta.rowIndex][21] = String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 2) : Number(total) : this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total)
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1448 1449
            return total
        }
r.kurnia's avatar
r.kurnia committed
1450 1451 1452 1453 1454 1455 1456 1457 1458

        const handleParent = (tableMeta, type) => {
            let total = 0
            dataTable2.map((item, index) => {
                if (item[5] == tableMeta.rowData[4]) {
                    total += Number(type == 1 ?
                        item[tableMeta.columnIndex].tbc.value == undefined ? Number(item[tableMeta.columnIndex].tbc == "" || item[tableMeta.columnIndex].tbc == "0.0" ? 0 : item[tableMeta.columnIndex].tbc) : Number(item[tableMeta.columnIndex].tbc.value == "" || item[tableMeta.columnIndex].tbc.value == "0.0" ? 0 : item[tableMeta.columnIndex].tbc.value)
                        :
                        (type == 2 ?
qorri_di's avatar
qorri_di committed
1459 1460 1461
                            item[tableMeta.columnIndex].fcp.value == undefined ? Number(item[tableMeta.columnIndex].fcp == "" || item[tableMeta.columnIndex].fcp == "0.0" ? 0 : item[tableMeta.columnIndex].fcp) : Number(item[tableMeta.columnIndex].fcp.value == "" || item[tableMeta.columnIndex].fcp.value == "0.0" ? 0 : item[tableMeta.columnIndex].fcp.value)
                            :
                            item[tableMeta.columnIndex].tbf.value == undefined ? Number(item[tableMeta.columnIndex].tbf == "" || item[tableMeta.columnIndex].tbf == "0.0" ? 0 : item[tableMeta.columnIndex].tbf) : Number(item[tableMeta.columnIndex].tbf.value == "" || item[tableMeta.columnIndex].tbf.value == "0.0" ? 0 : item[tableMeta.columnIndex].tbf.value)
r.kurnia's avatar
r.kurnia committed
1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476
                        )
                    )
                }
            })

            if (type == 1) {
                dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = total
            } else if (type == 2) {
                dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp = total
            } else {
                dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = total
            }
            return total
        }

Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1477 1478 1479 1480 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 1522 1523 1524 1525 1526 1527 1528
        const columns = [{
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "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 }}>
r.kurnia's avatar
r.kurnia committed
1529 1530
                            {tableMeta.rowData[30] ?
                                tableMeta.rowData[30].length > 0 ?
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558
                                    <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
                                        <LightTooltip title={"Report Items Not Registered"} arrow>
                                            <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
                                        </LightTooltip>
                                    </div>
                                    :
                                    tableMeta.rowData[7] == 0 ?
                                        <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
                                        :
                                        <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[7]) }}>
                                            <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
                                        </div>
                                :
                                tableMeta.rowData[7] == 0 ?
                                    <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
                                    :
                                    <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[7]) }}>
                                        <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
                                    </div>
                            }
                        </div>
                    )
                }
            }
        }, {
            name: `Jan ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
1559
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="content-center">
r.kurnia's avatar
r.kurnia committed
1574
                                <div className="col-1">
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1575
                                    <div style={{ textAlign: 'right' }}>
qorri_di's avatar
qorri_di committed
1576
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
rifkaki's avatar
rifkaki committed
1577 1578
                                            null
                                            :
qorri_di's avatar
qorri_di committed
1579
                                            this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
1580 1581 1582 1583 1584
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value.tbf}
                                                        control={
r.kurnia's avatar
r.kurnia committed
1585 1586 1587 1588 1589
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
1590
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
1591
                                                                value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)}
r.kurnia's avatar
r.kurnia committed
1592
                                                            />
rifkaki's avatar
rifkaki committed
1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608
                                                        }
                                                    />
                                                </div>
                                                :
                                                tableMeta.rowData[3] === 3 || tableMeta.rowData[3] === 2 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
1609
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
1610 1611 1612 1613 1614 1615
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
        }, {
            name: `Feb ${this.props.periode}`,
            options: {
qorri_di's avatar
qorri_di committed
1627 1628
                customHeadRender: (columnMeta) => (
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
qorri_di's avatar
qorri_di committed
1645
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
rifkaki's avatar
rifkaki committed
1646 1647
                                            null
                                            :
qorri_di's avatar
qorri_di committed
1648
                                            this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
1649 1650 1651 1652 1653
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value.tbf}
                                                        control={
r.kurnia's avatar
r.kurnia committed
1654 1655 1656 1657 1658
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
1659
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
1660
                                                                value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)}
r.kurnia's avatar
r.kurnia committed
1661
                                                            />
rifkaki's avatar
rifkaki committed
1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677
                                                        }
                                                    />
                                                </div>
                                                :
                                                tableMeta.rowData[3] === 3 || tableMeta.rowData[3] === 2 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
1678
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
1679 1680 1681 1682 1683 1684
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1685 1686 1687 1688 1689 1690 1691 1692
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
r.kurnia's avatar
r.kurnia committed
1693
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1694 1695 1696
            name: `Mar ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
1697
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
qorri_di's avatar
qorri_di committed
1714
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
rifkaki's avatar
rifkaki committed
1715 1716
                                            null
                                            :
qorri_di's avatar
qorri_di committed
1717
                                            this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
1718 1719 1720 1721 1722
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value.tbf}
                                                        control={
r.kurnia's avatar
r.kurnia committed
1723 1724 1725 1726 1727
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
1728
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
1729
                                                                value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)}
r.kurnia's avatar
r.kurnia committed
1730
                                                            />
rifkaki's avatar
rifkaki committed
1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746
                                                        }
                                                    />
                                                </div>
                                                :
                                                tableMeta.rowData[3] === 3 || tableMeta.rowData[3] === 2 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
1747
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
1748 1749 1750 1751 1752 1753
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1754 1755 1756 1757 1758 1759 1760 1761
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
qorri_di's avatar
qorri_di committed
1762
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1763 1764 1765
            name: `Apr ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
1766
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
qorri_di's avatar
qorri_di committed
1783
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
rifkaki's avatar
rifkaki committed
1784 1785
                                            null
                                            :
qorri_di's avatar
qorri_di committed
1786
                                            this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
1787 1788 1789 1790 1791
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value.tbf}
                                                        control={
r.kurnia's avatar
r.kurnia committed
1792 1793 1794 1795 1796
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
1797
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
1798
                                                                value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)}
r.kurnia's avatar
r.kurnia committed
1799
                                                            />
rifkaki's avatar
rifkaki committed
1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815
                                                        }
                                                    />
                                                </div>
                                                :
                                                tableMeta.rowData[3] === 3 || tableMeta.rowData[3] === 2 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
1816
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
1817 1818 1819 1820 1821 1822
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1823 1824 1825 1826 1827 1828 1829 1830
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
qorri_di's avatar
qorri_di committed
1831
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1832 1833 1834
            name: `May ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
1835
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
qorri_di's avatar
qorri_di committed
1852
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
rifkaki's avatar
rifkaki committed
1853 1854
                                            null
                                            :
qorri_di's avatar
qorri_di committed
1855
                                            this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
1856 1857 1858 1859 1860
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value.tbf}
                                                        control={
r.kurnia's avatar
r.kurnia committed
1861 1862 1863 1864 1865
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
1866
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
1867
                                                                value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)}
r.kurnia's avatar
r.kurnia committed
1868
                                                            />
rifkaki's avatar
rifkaki committed
1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884
                                                        }
                                                    />
                                                </div>
                                                :
                                                tableMeta.rowData[3] === 3 || tableMeta.rowData[3] === 2 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
1885
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
1886 1887 1888 1889 1890 1891
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1892 1893 1894 1895 1896 1897 1898 1899
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
qorri_di's avatar
qorri_di committed
1900
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1901 1902 1903
            name: `Jun ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
1904
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
qorri_di's avatar
qorri_di committed
1921
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
rifkaki's avatar
rifkaki committed
1922 1923
                                            null
                                            :
qorri_di's avatar
qorri_di committed
1924
                                            this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
1925 1926 1927 1928 1929
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value.tbf}
                                                        control={
r.kurnia's avatar
r.kurnia committed
1930 1931 1932 1933 1934
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
1935
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
1936
                                                                value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)}
r.kurnia's avatar
r.kurnia committed
1937
                                                            />
rifkaki's avatar
rifkaki committed
1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953
                                                        }
                                                    />
                                                </div>
                                                :
                                                tableMeta.rowData[3] === 3 || tableMeta.rowData[3] === 2 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
1954
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
1955 1956 1957 1958 1959 1960
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1961 1962 1963 1964 1965 1966 1967 1968
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
qorri_di's avatar
qorri_di committed
1969
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1970 1971 1972
            name: `Jul ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
1973
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
qorri_di's avatar
qorri_di committed
1990
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
rifkaki's avatar
rifkaki committed
1991 1992
                                            null
                                            :
qorri_di's avatar
qorri_di committed
1993
                                            this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
1994 1995 1996 1997 1998
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value.tbf}
                                                        control={
r.kurnia's avatar
r.kurnia committed
1999 2000 2001 2002 2003
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
2004
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2005
                                                                value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)}
r.kurnia's avatar
r.kurnia committed
2006
                                                            />
rifkaki's avatar
rifkaki committed
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022
                                                        }
                                                    />
                                                </div>
                                                :
                                                tableMeta.rowData[3] === 3 || tableMeta.rowData[3] === 2 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
2023
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
2024 2025 2026 2027 2028 2029
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2030 2031 2032 2033 2034 2035 2036 2037
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
qorri_di's avatar
qorri_di committed
2038
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2039 2040 2041
            name: `Aug ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
2042
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
rifkaki's avatar
rifkaki committed
2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
qorri_di's avatar
qorri_di committed
2059
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
rifkaki's avatar
rifkaki committed
2060 2061
                                            null
                                            :
qorri_di's avatar
qorri_di committed
2062
                                            this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
2063 2064 2065 2066 2067
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value.tbf}
                                                        control={
r.kurnia's avatar
r.kurnia committed
2068 2069 2070 2071 2072
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
2073
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2074
                                                                value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)}
r.kurnia's avatar
r.kurnia committed
2075
                                                            />
rifkaki's avatar
rifkaki committed
2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091
                                                        }
                                                    />
                                                </div>
                                                :
                                                tableMeta.rowData[3] === 3 || tableMeta.rowData[3] === 2 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
2092
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
2093 2094 2095 2096 2097 2098
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2099 2100 2101 2102 2103 2104 2105 2106
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
qorri_di's avatar
qorri_di committed
2107
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2108 2109 2110
            name: `Sep ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
2111
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
qorri_di's avatar
qorri_di committed
2128
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
rifkaki's avatar
rifkaki committed
2129 2130
                                            null
                                            :
qorri_di's avatar
qorri_di committed
2131
                                            this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
2132 2133 2134 2135 2136
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value.tbf}
                                                        control={
r.kurnia's avatar
r.kurnia committed
2137 2138 2139 2140 2141
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
2142
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2143
                                                                value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)}
r.kurnia's avatar
r.kurnia committed
2144
                                                            />
rifkaki's avatar
rifkaki committed
2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160
                                                        }
                                                    />
                                                </div>
                                                :
                                                tableMeta.rowData[3] === 3 || tableMeta.rowData[3] === 2 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
2161
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
2162 2163 2164 2165 2166 2167
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2168 2169 2170 2171 2172 2173 2174 2175
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
qorri_di's avatar
qorri_di committed
2176
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2177 2178 2179
            name: `Oct ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
2180
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
qorri_di's avatar
qorri_di committed
2197
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
rifkaki's avatar
rifkaki committed
2198 2199
                                            null
                                            :
qorri_di's avatar
qorri_di committed
2200
                                            this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
2201 2202 2203 2204 2205
                                                <div style={{ flex: 1 }}>
                                                    <FormControlLabel
                                                        style={{ margin: 0 }}
                                                        value={value.tbf}
                                                        control={
r.kurnia's avatar
r.kurnia committed
2206 2207 2208 2209 2210
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
2211
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2212
                                                                value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)}
r.kurnia's avatar
r.kurnia committed
2213
                                                            />
rifkaki's avatar
rifkaki committed
2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229
                                                        }
                                                    />
                                                </div>
                                                :
                                                tableMeta.rowData[3] === 3 || tableMeta.rowData[3] === 2 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
2230
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
2231 2232 2233 2234 2235 2236
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2237 2238 2239 2240 2241 2242 2243 2244
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
qorri_di's avatar
qorri_di committed
2245
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2246 2247 2248
            name: `Nov ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
2249
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274
                        {/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                            <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                        </TableCell> */}
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
                        <div className="grid grid-3x" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Commercial) MTD"}</span>
                            </div>
                            <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Fiscal Correction Positive /(Negative)"}</span>
                            </div>
                            <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="grid grid-3x content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
rifkaki's avatar
rifkaki committed
2275 2276 2277
                                        {tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 ?
                                            null
                                            :
qorri_di's avatar
qorri_di committed
2278
                                            this.state.get_for == 'view' ?
r.kurnia's avatar
r.kurnia committed
2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290
                                                tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbc}
                                                            control={
                                                                <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
2291
                                                                    value={Number(value.tbc.value) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbc.value), 2) : fixNumber(Number(value.tbc.value), 1)}
r.kurnia's avatar
r.kurnia committed
2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbc}
                                                            control={
                                                                <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
2308
                                                                    value={Number(value.tbc.value) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbc), 2) : fixNumber(Number(value.tbc), 1)}
r.kurnia's avatar
r.kurnia committed
2309 2310 2311 2312
                                                                />
                                                            }
                                                        />
                                                    </div>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2313
                                                :
rifkaki's avatar
rifkaki committed
2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324
                                                tableMeta.rowData[1] === 3 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbc}
                                                            control={
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    decimalSeparator={"."}
                                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
2325
                                                                    // placeholder="input"
r.kurnia's avatar
r.kurnia committed
2326
                                                                    disabled={this.props.isApprover == true ? true : false}
Riri Novita's avatar
Riri Novita committed
2327
                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value.tbc), 1) : Number(value.tbc) == 0 ? "0.0" : Number(value.tbc)}
rifkaki's avatar
rifkaki committed
2328 2329 2330 2331 2332 2333 2334
                                                                    onBlur={(event) => {
                                                                        // updateValue(event.target.value)
                                                                        handleChange(event.target.value, tableMeta, 0)
                                                                        // console.log(dataTable2)
                                                                    }}
                                                                />
                                                            }
r.kurnia's avatar
r.kurnia committed
2335
                                                        />
rifkaki's avatar
rifkaki committed
2336 2337 2338 2339 2340 2341 2342 2343 2344
                                                    </div> :
                                                    tableMeta.rowData[1] === 2 ?
                                                        <span style={{ fontSize: 12, textAlign: 'right' }}>
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2345
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 1)), 1) : Number(handleParent(tableMeta, 1)) == 0 ? "0.0" : Number(handleParent(tableMeta, 1))}
rifkaki's avatar
rifkaki committed
2346 2347
                                                            />
                                                        </span>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2348
                                                        :
rifkaki's avatar
rifkaki committed
2349
                                                        tableMeta.rowData[1] === 6 ?
r.kurnia's avatar
r.kurnia committed
2350 2351 2352 2353 2354 2355
                                                            <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
2356
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
r.kurnia's avatar
r.kurnia committed
2357
                                                            />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2358
                                                            :
rifkaki's avatar
rifkaki committed
2359 2360 2361 2362 2363 2364 2365
                                                            tableMeta.rowData[1] === 5 ?
                                                                <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
2366
                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
rifkaki's avatar
rifkaki committed
2367
                                                                />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2368
                                                                :
r.kurnia's avatar
r.kurnia committed
2369
                                                                tableMeta.rowData[1] === 7 ?
Riri Novita's avatar
Riri Novita committed
2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407
                                                                    this.props.defaultCurrency.id == 1 ?
                                                                        (fixNumber(Number(handleValueFormula(value, tableMeta, 0)), 1) >= Number(this.state.minValue) && fixNumber(Number(handleValueFormula(value, tableMeta, 0)), 1) <= Number(this.state.maxValue)) ?
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
                                                                                    color: 'black'
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
                                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
                                                                                />
                                                                            </LightTooltip>
                                                                        :
                                                                        (Number(handleValueFormula(value, tableMeta, 0)) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 0)) <= Number(this.state.maxValue)) ?
r.kurnia's avatar
r.kurnia committed
2408 2409 2410 2411 2412 2413 2414 2415 2416
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
Riri Novita's avatar
Riri Novita committed
2417
                                                                                    color: 'black'
r.kurnia's avatar
r.kurnia committed
2418 2419 2420 2421
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441
                                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
                                                                                />
                                                                            </LightTooltip>
r.kurnia's avatar
r.kurnia committed
2442 2443
                                                                    :
                                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2444 2445 2446 2447 2448
                                        }
                                    </div>
                                </div>
                                <div className="col-2">
                                    <div style={{ textAlign: 'right' }}>
rifkaki's avatar
rifkaki committed
2449 2450 2451
                                        {tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 ?
                                            null
                                            :
qorri_di's avatar
qorri_di committed
2452
                                            this.state.get_for == 'view' ?
r.kurnia's avatar
r.kurnia committed
2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464
                                                tableMeta.rowData[2] === 5 || tableMeta.rowData[2] === 6 || tableMeta.rowData[2] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.fcp}
                                                            control={
                                                                <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
2465
                                                                    value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.fcp.value), 2) : fixNumber(Number(value.fcp.value), 1)}
r.kurnia's avatar
r.kurnia committed
2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.fcp}
                                                            control={
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
                                                                    placeholder=""
                                                                    disabled={true}
                                                                    value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
                                                                />
                                                            }
                                                        />
                                                    </div>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2487
                                                :
rifkaki's avatar
rifkaki committed
2488 2489 2490 2491 2492 2493 2494 2495 2496 2497
                                                tableMeta.rowData[2] === 3 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.fcp}
                                                            control={
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
2498
                                                                    // placeholder="input"
r.kurnia's avatar
r.kurnia committed
2499
                                                                    // disabled={this.props.isApprover == true ? true : false}
Riri Novita's avatar
Riri Novita committed
2500
                                                                    value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.fcp), 2) : fixNumber(Number(value.fcp), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (Number(value.fcp) == 0 ? "0.0" : Number(value.fcp)) : (Number(value.fcp) == 0 ? "0.0" : Number(value.fcp)))}
rifkaki's avatar
rifkaki committed
2501 2502 2503 2504 2505 2506
                                                                    onBlur={(event) => {
                                                                        handleChange(event.target.value, tableMeta, 1)
                                                                        // console.log(dataTable2)
                                                                    }}
                                                                />
                                                            }
r.kurnia's avatar
r.kurnia committed
2507
                                                        />
rifkaki's avatar
rifkaki committed
2508 2509 2510 2511 2512 2513 2514 2515 2516
                                                    </div> :
                                                    tableMeta.rowData[2] === 2 ?
                                                        <span style={{ fontSize: 12, textAlign: 'right' }}>
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2517
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 2)), 1) : Number(handleParent(tableMeta, 2)) == 0 ? "0.0" : Number(handleParent(tableMeta, 2))}
rifkaki's avatar
rifkaki committed
2518 2519
                                                            />
                                                        </span>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2520
                                                        :
rifkaki's avatar
rifkaki committed
2521
                                                        tableMeta.rowData[2] === 6 ?
r.kurnia's avatar
r.kurnia committed
2522 2523 2524 2525 2526 2527
                                                            <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
2528
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
r.kurnia's avatar
r.kurnia committed
2529
                                                            />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2530
                                                            :
rifkaki's avatar
rifkaki committed
2531 2532 2533 2534 2535 2536 2537
                                                            tableMeta.rowData[2] === 5 ?
                                                                <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
2538
                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
rifkaki's avatar
rifkaki committed
2539
                                                                />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2540
                                                                :
r.kurnia's avatar
r.kurnia committed
2541
                                                                tableMeta.rowData[2] === 7 ?
Riri Novita's avatar
Riri Novita committed
2542 2543
                                                                    this.props.defaultCurrency.id == 1 ?
                                                                        (fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) >= Number(this.state.minValue) && fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) <= Number(this.state.maxValue)) ?
r.kurnia's avatar
r.kurnia committed
2544 2545 2546 2547 2548 2549 2550 2551 2552
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
Riri Novita's avatar
Riri Novita committed
2553
                                                                                    color: 'black'
r.kurnia's avatar
r.kurnia committed
2554 2555 2556 2557
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613
                                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
                                                                                />
                                                                            </LightTooltip>
                                                                        :
                                                                        (Number(handleValueFormula(value, tableMeta, 2)) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 2)) <= Number(this.state.maxValue)) ?
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
                                                                                    color: 'black'
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
                                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
                                                                                />
                                                                            </LightTooltip>
r.kurnia's avatar
r.kurnia committed
2614 2615
                                                                    :
                                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2616 2617 2618 2619 2620
                                        }
                                    </div>
                                </div>
                                <div className="col-3">
                                    <div style={{ textAlign: 'right' }}>
rifkaki's avatar
rifkaki committed
2621 2622 2623
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
                                            null
                                            :
qorri_di's avatar
qorri_di committed
2624
                                            this.state.get_for == 'view' ?
r.kurnia's avatar
r.kurnia committed
2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636
                                                tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
2637
                                                                    value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf.value), 2) : fixNumber(Number(value.tbf.value), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (Number(value.tbf.value) == 0 ? "0.0" : Number(value.tbf.value)) : (Number(value.tbf.value) == 0 ? "0.0" : Number(value.tbf.value)))}
r.kurnia's avatar
r.kurnia committed
2638 2639 2640 2641 2642 2643
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    <div style={{ flex: 1 }}>
qorri_di's avatar
qorri_di committed
2644 2645 2646 2647 2648 2649 2650 2651 2652 2653
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
2654
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
qorri_di's avatar
qorri_di committed
2655 2656 2657 2658
                                                                />
                                                            }
                                                        />
                                                    </div>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2659
                                                :
rifkaki's avatar
rifkaki committed
2660 2661 2662 2663 2664 2665 2666 2667 2668 2669
                                                tableMeta.rowData[3] === 3 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
2670
                                                                    // placeholder="input"
r.kurnia's avatar
r.kurnia committed
2671
                                                                    disabled={this.props.isApprover == true ? true : false}
Riri Novita's avatar
Riri Novita committed
2672
                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value.tbf), 1) : Number(value.tbf) == 0 ? "0.0" : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
2673 2674 2675 2676 2677 2678 2679
                                                                    onBlur={(event) => {
                                                                        // updateValue(event.target.value)
                                                                        handleChange(event.target.value, tableMeta, 2)
                                                                        // console.log(dataTable2)
                                                                    }}
                                                                />
                                                            }
r.kurnia's avatar
r.kurnia committed
2680
                                                        />
rifkaki's avatar
rifkaki committed
2681 2682 2683 2684 2685 2686 2687 2688 2689
                                                    </div> :
                                                    tableMeta.rowData[3] === 2 ?
                                                        <span style={{ fontSize: 12, textAlign: 'right' }}>
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2690
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 3)), 1) : Number(handleParent(tableMeta, 3)) == 0 ? "0.0" : Number(handleParent(tableMeta, 3))}
rifkaki's avatar
rifkaki committed
2691 2692
                                                            />
                                                        </span>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2693
                                                        :
rifkaki's avatar
rifkaki committed
2694
                                                        tableMeta.rowData[3] === 6 ?
r.kurnia's avatar
r.kurnia committed
2695 2696 2697 2698 2699
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
2700
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2701
                                                                value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 2) : fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleValueFormula(value, tableMeta, 3)) : Number(handleValueFormula(value, tableMeta, 3))}
r.kurnia's avatar
r.kurnia committed
2702
                                                            />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2703
                                                            :
rifkaki's avatar
rifkaki committed
2704 2705 2706 2707 2708 2709 2710
                                                            tableMeta.rowData[3] === 5 ?
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
                                                                    placeholder=""
                                                                    disabled={false}
Riri Novita's avatar
Riri Novita committed
2711
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 2) : fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleValueFormula(value, tableMeta, 3)) : Number(handleValueFormula(value, tableMeta, 3))}
rifkaki's avatar
rifkaki committed
2712
                                                                />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2713
                                                                :
r.kurnia's avatar
r.kurnia committed
2714
                                                                tableMeta.rowData[3] === 7 ?
Riri Novita's avatar
Riri Novita committed
2715 2716
                                                                    this.props.defaultCurrency.id == 1 ?
                                                                        (fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) >= Number(this.state.minValue) && fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) <= Number(this.state.maxValue)) ?
r.kurnia's avatar
r.kurnia committed
2717 2718 2719 2720 2721 2722 2723 2724 2725
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
Riri Novita's avatar
Riri Novita committed
2726
                                                                                    color: 'black'
r.kurnia's avatar
r.kurnia committed
2727 2728 2729 2730
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786
                                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 3))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 3))}
                                                                                />
                                                                            </LightTooltip>
                                                                        :
                                                                        (Number(handleValueFormula(value, tableMeta, 3)) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)) <= Number(this.state.maxValue)) ?
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
                                                                                    color: 'black'
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
                                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 3))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 3))}
                                                                                />
                                                                            </LightTooltip>
r.kurnia's avatar
r.kurnia committed
2787 2788
                                                                    :
                                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2789 2790 2791 2792 2793 2794 2795 2796
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
qorri_di's avatar
qorri_di committed
2797
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2798 2799 2800
            name: `Dec ${this.props.periode}`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
2801
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826
                        {/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                            <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                        </TableCell> */}
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
                        <div className="grid grid-3x" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Commercial) MTD"}</span>
                            </div>
                            <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Fiscal Correction Positive /(Negative)"}</span>
                            </div>
                            <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                                <span>{"Trial Balance (Fiscal) MTD"}</span>
                            </div>
                        </div>
                    </th>
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    // console.log(value)
                    return (
                        <div>
                            <div className="grid grid-3x content-center">
                                <div className="col-1">
                                    <div style={{ textAlign: 'right' }}>
rifkaki's avatar
rifkaki committed
2827 2828 2829
                                        {tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 ?
                                            null
                                            :
qorri_di's avatar
qorri_di committed
2830
                                            this.state.get_for == 'view' ?
r.kurnia's avatar
r.kurnia committed
2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842
                                                tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbc}
                                                            control={
                                                                <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
2843
                                                                    value={Number(value.tbc.value) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbc.value), 2) : fixNumber(Number(value.tbc.value), 1)}
r.kurnia's avatar
r.kurnia committed
2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbc}
                                                            control={
                                                                <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
2860
                                                                    value={Number(value.tbc.value) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbc), 2) : fixNumber(Number(value.tbc), 1)}
r.kurnia's avatar
r.kurnia committed
2861 2862 2863 2864
                                                                />
                                                            }
                                                        />
                                                    </div>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2865
                                                :
rifkaki's avatar
rifkaki committed
2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876
                                                tableMeta.rowData[1] === 3 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbc}
                                                            control={
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    decimalSeparator={"."}
                                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
2877
                                                                    // placeholder="input"
r.kurnia's avatar
r.kurnia committed
2878
                                                                    disabled={this.props.isApprover == true ? true : false}
Riri Novita's avatar
Riri Novita committed
2879
                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value.tbc), 1) : Number(value.tbc) == 0 ? "0.0" : Number(value.tbc)}
rifkaki's avatar
rifkaki committed
2880 2881 2882 2883 2884 2885 2886
                                                                    onBlur={(event) => {
                                                                        // updateValue(event.target.value)
                                                                        handleChange(event.target.value, tableMeta, 0)
                                                                        // console.log(dataTable2)
                                                                    }}
                                                                />
                                                            }
r.kurnia's avatar
r.kurnia committed
2887
                                                        />
rifkaki's avatar
rifkaki committed
2888 2889 2890 2891 2892 2893 2894 2895 2896
                                                    </div> :
                                                    tableMeta.rowData[1] === 2 ?
                                                        <span style={{ fontSize: 12, textAlign: 'right' }}>
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2897
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 1)), 1) : Number(handleParent(tableMeta, 1)) == 0 ? "0.0" : Number(handleParent(tableMeta, 1))}
rifkaki's avatar
rifkaki committed
2898 2899
                                                            />
                                                        </span>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2900
                                                        :
rifkaki's avatar
rifkaki committed
2901
                                                        tableMeta.rowData[1] === 6 ?
r.kurnia's avatar
r.kurnia committed
2902 2903 2904 2905 2906 2907
                                                            <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
2908
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
r.kurnia's avatar
r.kurnia committed
2909
                                                            />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2910
                                                            :
rifkaki's avatar
rifkaki committed
2911 2912 2913 2914 2915 2916 2917
                                                            tableMeta.rowData[1] === 5 ?
                                                                <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
2918
                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
rifkaki's avatar
rifkaki committed
2919
                                                                />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2920
                                                                :
r.kurnia's avatar
r.kurnia committed
2921
                                                                tableMeta.rowData[1] === 7 ?
Riri Novita's avatar
Riri Novita committed
2922 2923
                                                                    this.props.defaultCurrency.id == 1 ?
                                                                        (fixNumber(Number(handleValueFormula(value, tableMeta, 0)), 1) >= Number(this.state.minValue) && fixNumber(Number(handleValueFormula(value, tableMeta, 0)), 1) <= Number(this.state.maxValue)) ?
r.kurnia's avatar
r.kurnia committed
2924 2925 2926 2927 2928 2929 2930 2931 2932
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
Riri Novita's avatar
Riri Novita committed
2933
                                                                                    color: 'black'
r.kurnia's avatar
r.kurnia committed
2934 2935 2936 2937
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993
                                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
                                                                                />
                                                                            </LightTooltip>
                                                                        :
                                                                        (Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) <= Number(this.state.maxValue)) ?
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
                                                                                    color: 'black'
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
                                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
                                                                                />
                                                                            </LightTooltip>
r.kurnia's avatar
r.kurnia committed
2994 2995
                                                                    :
                                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
2996 2997 2998 2999 3000
                                        }
                                    </div>
                                </div>
                                <div className="col-2">
                                    <div style={{ textAlign: 'right' }}>
rifkaki's avatar
rifkaki committed
3001 3002 3003
                                        {tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 ?
                                            null
                                            :
qorri_di's avatar
qorri_di committed
3004
                                            this.state.get_for == 'view' ?
r.kurnia's avatar
r.kurnia committed
3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016
                                                tableMeta.rowData[2] === 5 || tableMeta.rowData[2] === 6 || tableMeta.rowData[2] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.fcp}
                                                            control={
                                                                <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
3017
                                                                    value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.fcp.value), 2) : fixNumber(Number(value.fcp.value), 1)}
r.kurnia's avatar
r.kurnia committed
3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.fcp}
                                                            control={
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
                                                                    placeholder=""
                                                                    disabled={true}
                                                                    value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
                                                                />
                                                            }
                                                        />
                                                    </div>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3039
                                                :
rifkaki's avatar
rifkaki committed
3040 3041 3042 3043 3044 3045 3046 3047 3048 3049
                                                tableMeta.rowData[2] === 3 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.fcp}
                                                            control={
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
3050
                                                                    // placeholder="input"
r.kurnia's avatar
r.kurnia committed
3051
                                                                    // disabled={this.props.isApprover == true ? true : false}
Riri Novita's avatar
Riri Novita committed
3052
                                                                    value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (Number(value.fcp) == 0 ? "0.0" : Number(value.fcp)) : (Number(value.fcp) == 0 ? "0.0" : Number(value.fcp)))}
rifkaki's avatar
rifkaki committed
3053 3054 3055 3056 3057 3058
                                                                    onBlur={(event) => {
                                                                        handleChange(event.target.value, tableMeta, 1)
                                                                        // console.log(dataTable2)
                                                                    }}
                                                                />
                                                            }
r.kurnia's avatar
r.kurnia committed
3059
                                                        />
rifkaki's avatar
rifkaki committed
3060 3061 3062 3063 3064 3065 3066 3067 3068
                                                    </div> :
                                                    tableMeta.rowData[2] === 2 ?
                                                        <span style={{ fontSize: 12, textAlign: 'right' }}>
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
3069
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 2)), 1) : Number(handleParent(tableMeta, 2)) == 0 ? "0.0" : Number(handleParent(tableMeta, 2))}
rifkaki's avatar
rifkaki committed
3070 3071
                                                            />
                                                        </span>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3072
                                                        :
rifkaki's avatar
rifkaki committed
3073
                                                        tableMeta.rowData[2] === 6 ?
r.kurnia's avatar
r.kurnia committed
3074 3075 3076 3077 3078 3079
                                                            <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
3080
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
r.kurnia's avatar
r.kurnia committed
3081
                                                            />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3082
                                                            :
rifkaki's avatar
rifkaki committed
3083 3084 3085 3086 3087 3088 3089
                                                            tableMeta.rowData[2] === 5 ?
                                                                <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
3090
                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
rifkaki's avatar
rifkaki committed
3091
                                                                />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3092
                                                                :
r.kurnia's avatar
r.kurnia committed
3093
                                                                tableMeta.rowData[2] === 7 ?
Riri Novita's avatar
Riri Novita committed
3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131
                                                                    this.props.defaultCurrency.id == 1 ?
                                                                        (fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) >= Number(this.state.minValue) && fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) <= Number(this.state.maxValue)) ?
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
                                                                                    color: 'black'
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
                                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
                                                                                />
                                                                            </LightTooltip>
                                                                        :
                                                                        (Number(handleValueFormula(value, tableMeta, 2)) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 2)) <= Number(this.state.maxValue)) ?
r.kurnia's avatar
r.kurnia committed
3132 3133 3134 3135 3136 3137 3138 3139 3140
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
Riri Novita's avatar
Riri Novita committed
3141
                                                                                    color: 'black'
r.kurnia's avatar
r.kurnia committed
3142 3143 3144 3145
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165
                                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
                                                                                />
                                                                            </LightTooltip>
r.kurnia's avatar
r.kurnia committed
3166 3167
                                                                    :
                                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3168 3169 3170 3171
                                        }
                                    </div>
                                </div>
                                <div className="col-3">
rifkaki's avatar
rifkaki committed
3172 3173 3174 3175
                                    <div style={{ textAlign: 'right' }}>
                                        {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
                                            null
                                            :
qorri_di's avatar
qorri_di committed
3176
                                            this.state.get_for == 'view' ?
r.kurnia's avatar
r.kurnia committed
3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195
                                                tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
                                                                    placeholder=""
                                                                    disabled={true}
                                                                    value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf.value).toFixed(2) : Number(value.tbf.value).toFixed(1)}
                                                                />
                                                            }
                                                        />
                                                    </div>
                                                    :
                                                    <div style={{ flex: 1 }}>
qorri_di's avatar
qorri_di committed
3196 3197 3198 3199 3200 3201 3202 3203 3204 3205
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <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
3206
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf)}
qorri_di's avatar
qorri_di committed
3207 3208 3209 3210
                                                                />
                                                            }
                                                        />
                                                    </div>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3211
                                                :
rifkaki's avatar
rifkaki committed
3212 3213 3214 3215 3216 3217 3218 3219 3220 3221
                                                tableMeta.rowData[3] === 3 ?
                                                    <div style={{ flex: 1 }}>
                                                        <FormControlLabel
                                                            style={{ margin: 0 }}
                                                            value={value.tbf}
                                                            control={
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
3222
                                                                    // placeholder="input"
r.kurnia's avatar
r.kurnia committed
3223
                                                                    disabled={this.props.isApprover == true ? true : false}
Riri Novita's avatar
Riri Novita committed
3224
                                                                    value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value.tbf), 1) : Number(value.tbf) == 0 ? "0.0" : Number(value.tbf)}
rifkaki's avatar
rifkaki committed
3225 3226 3227 3228 3229 3230 3231
                                                                    onBlur={(event) => {
                                                                        // updateValue(event.target.value)
                                                                        handleChange(event.target.value, tableMeta, 2)
                                                                        // console.log(dataTable2)
                                                                    }}
                                                                />
                                                            }
r.kurnia's avatar
r.kurnia committed
3232
                                                        />
rifkaki's avatar
rifkaki committed
3233 3234 3235 3236 3237 3238 3239 3240 3241
                                                    </div> :
                                                    tableMeta.rowData[3] === 2 ?
                                                        <span style={{ fontSize: 12, textAlign: 'right' }}>
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
3242
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 3)), 1) : Number(handleParent(tableMeta, 3)) == 0 ? "0.0" : Number(handleParent(tableMeta, 3))}
rifkaki's avatar
rifkaki committed
3243 3244
                                                            />
                                                        </span>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3245
                                                        :
rifkaki's avatar
rifkaki committed
3246
                                                        tableMeta.rowData[3] === 6 ?
r.kurnia's avatar
r.kurnia committed
3247 3248 3249 3250 3251
                                                            <NumberFormat
                                                                thousandSeparator={true}
                                                                style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                type="text"
                                                                placeholder=""
rifkaki's avatar
rifkaki committed
3252
                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
3253
                                                                value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 2) : fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleValueFormula(value, tableMeta, 3)) : Number(handleValueFormula(value, tableMeta, 3))}
r.kurnia's avatar
r.kurnia committed
3254
                                                            />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3255
                                                            :
rifkaki's avatar
rifkaki committed
3256 3257 3258 3259 3260 3261 3262
                                                            tableMeta.rowData[3] === 5 ?
                                                                <NumberFormat
                                                                    thousandSeparator={true}
                                                                    style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                    type="text"
                                                                    placeholder=""
                                                                    disabled={false}
Riri Novita's avatar
Riri Novita committed
3263
                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 2) : fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1)) : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleValueFormula(value, tableMeta, 3)) : Number(handleValueFormula(value, tableMeta, 3))}
rifkaki's avatar
rifkaki committed
3264
                                                                />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3265
                                                                :
r.kurnia's avatar
r.kurnia committed
3266
                                                                tableMeta.rowData[3] === 7 ?
Riri Novita's avatar
Riri Novita committed
3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304
                                                                    this.props.defaultCurrency.id == 1 ?
                                                                        (fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) >= Number(this.state.minValue) && fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) <= Number(this.state.maxValue)) ?
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
                                                                                    color: 'black'
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
                                                                                value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3))}
                                                                                />
                                                                            </LightTooltip>
                                                                        :
                                                                        (Number(handleValueFormula(value, tableMeta, 3)) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)) <= Number(this.state.maxValue)) ?
r.kurnia's avatar
r.kurnia committed
3305 3306 3307 3308 3309 3310 3311 3312 3313
                                                                            <NumberFormat
                                                                                thousandSeparator={true}
                                                                                style={{
                                                                                    fontSize: 12,
                                                                                    textAlign: 'right',
                                                                                    borderColor: 'transparent',
                                                                                    margin: 0,
                                                                                    width: 96,
                                                                                    backgroundColor: 'transparent',
Riri Novita's avatar
Riri Novita committed
3314
                                                                                    color: 'black'
r.kurnia's avatar
r.kurnia committed
3315 3316 3317 3318
                                                                                }}
                                                                                type="text"
                                                                                placeholder=""
                                                                                disabled={true}
Riri Novita's avatar
Riri Novita committed
3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338
                                                                                value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3))}
                                                                            /> :
                                                                            <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                                                                <NumberFormat
                                                                                    thousandSeparator={true}
                                                                                    style={{
                                                                                        fontSize: 12,
                                                                                        textAlign: 'right',
                                                                                        borderColor: 'transparent',
                                                                                        margin: 0,
                                                                                        width: 96,
                                                                                        backgroundColor: 'transparent',
                                                                                        color: 'red'
                                                                                    }}
                                                                                    type="text"
                                                                                    placeholder=""
                                                                                    disabled={true}
                                                                                    value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3))}
                                                                                />
                                                                            </LightTooltip>
r.kurnia's avatar
r.kurnia committed
3339 3340
                                                                    :
                                                                    null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3341 3342 3343 3344 3345 3346 3347 3348
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    )
                }
            }
qorri_di's avatar
qorri_di committed
3349
        }, {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3350 3351 3352
            name: `${this.props.periode} Trial Balance (Fiscal)`,
            options: {
                customHeadRender: (columnMeta) => (
qorri_di's avatar
qorri_di committed
3353 3354 3355 3356
                    <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
                        <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', width: 200, padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                        <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                            <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3357 3358 3359
                                <span>{"Trial Balance (Fiscal)"}</span>
                            </div>
                        </div>
qorri_di's avatar
qorri_di committed
3360 3361 3362 3363
                    </th>
                    // <div  style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 200, borderRight: "1px solid rgb(255, 255, 255)" }} >
                    // <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                    // <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
qorri_di's avatar
qorri_di committed
3364
                    // </TableCell> 
qorri_di's avatar
qorri_di committed
3365 3366 3367 3368 3369 3370 3371 3372
                    // <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
                    // <div style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
                    // <div style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
                    // <span>{"Trial Balance (Fiscal)"}</span>
                    // </div>
                    // </div>
                    // </div>

Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3373 3374 3375 3376 3377 3378 3379
                ),
                setCellProps: () => ({ style2 }),
                customBodyRender: (value, tableMeta, updateValue) => {
                    return (
                        <div>
                            <div className="content-center">
                                <div style={{ textAlign: 'right' }}>
rifkaki's avatar
rifkaki committed
3380 3381 3382
                                    {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
                                        null
                                        :
r.kurnia's avatar
r.kurnia committed
3383
                                        this.state.get_for == 'view' ?
rifkaki's avatar
rifkaki committed
3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394
                                            <div style={{ flex: 1 }}>
                                                <FormControlLabel
                                                    style={{ margin: 0 }}
                                                    value={tableMeta.rowData[21]}
                                                    control={
                                                        <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
3395
                                                            value={Number(tableMeta.rowData[21]) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(tableMeta.rowData[21]), 1) : fixNumber(Number(tableMeta.rowData[21]), 1)}
rifkaki's avatar
rifkaki committed
3396 3397
                                                        />
                                                    }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3398
                                                />
rifkaki's avatar
rifkaki committed
3399
                                            </div>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3400
                                            :
rifkaki's avatar
rifkaki committed
3401 3402 3403 3404 3405 3406 3407 3408 3409 3410
                                            tableMeta.rowData[3] === 3 ?
                                                <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"
3411
                                                                // placeholder="input"
r.kurnia's avatar
r.kurnia committed
3412
                                                                disabled={this.props.isApprover == true ? true : false}
Riri Novita's avatar
Riri Novita committed
3413
                                                                value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleTotal(tableMeta, 3)), 1) : Number(handleTotal(tableMeta, 3)) == 0 ? "0.0" : Number(handleTotal(tableMeta, 3))}
rifkaki's avatar
rifkaki committed
3414 3415
                                                            />
                                                        }
r.kurnia's avatar
r.kurnia committed
3416
                                                    />
rifkaki's avatar
rifkaki committed
3417 3418 3419 3420 3421 3422 3423 3424 3425
                                                </div> :
                                                tableMeta.rowData[3] === 2 ?
                                                    <span style={{ fontSize: 12, textAlign: 'right' }}>
                                                        <NumberFormat
                                                            thousandSeparator={true}
                                                            style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                            type="text"
                                                            placeholder=""
                                                            disabled={true}
Riri Novita's avatar
Riri Novita committed
3426
                                                            value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleTotal(tableMeta, 2)), 1) : Number(handleTotal(tableMeta, 2)) == 0 ? "0.0" : Number(handleTotal(tableMeta, 2))}
rifkaki's avatar
rifkaki committed
3427 3428
                                                        />
                                                    </span>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3429
                                                    :
rifkaki's avatar
rifkaki committed
3430
                                                    tableMeta.rowData[3] === 6 ?
r.kurnia's avatar
r.kurnia committed
3431 3432 3433 3434 3435 3436
                                                        <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
3437
                                                            value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleTotal(tableMeta, 6)).toFixed(2) : Number(handleTotal(tableMeta, 6)).toFixed(1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (Number(handleTotal(tableMeta, 6)) == 0 ? "0.0" : Number(handleTotal(tableMeta, 6))) : (Number(handleTotal(tableMeta, 6)) == 0 ? "0.0" : Number(handleTotal(tableMeta, 6))))}
r.kurnia's avatar
r.kurnia committed
3438
                                                        />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3439
                                                        :
rifkaki's avatar
rifkaki committed
3440
                                                        tableMeta.rowData[3] === 5 ?
r.kurnia's avatar
r.kurnia committed
3441 3442 3443 3444 3445 3446
                                                            <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
3447
                                                                value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleTotal(tableMeta, 5)).toFixed(2) : Number(handleTotal(tableMeta, 5)).toFixed(1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (Number(handleTotal(tableMeta, 5)) == 0 ? "0.0" : Number(handleTotal(tableMeta, 5))) : (Number(handleTotal(tableMeta, 5)) == 0 ? "0.0" : Number(handleTotal(tableMeta, 5))))}
r.kurnia's avatar
r.kurnia committed
3448
                                                            />
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3449
                                                            :
r.kurnia's avatar
r.kurnia committed
3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460
                                                            tableMeta.rowData[3] === 7 ? null
                                                                // (Number(handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ?
                                                                //     <NumberFormat
                                                                //         thousandSeparator={true}
                                                                //         style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                                //         type="text"
                                                                //         placeholder=""
                                                                //         disabled={true}
                                                                //         value={Number(handleTotal(tableMeta, 7)).toFixed(1)}
                                                                //     /> :
                                                                //     <LightTooltip title={this.state.minValue === null ? `Value Should be 0` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
3461 3462
                                                                //         <NumberFormat
                                                                //             thousandSeparator={true}
r.kurnia's avatar
r.kurnia committed
3463
                                                                //             style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', color: 'red' }}
3464 3465 3466
                                                                //             type="text"
                                                                //             placeholder=""
                                                                //             disabled={true}
r.kurnia's avatar
r.kurnia committed
3467 3468
                                                                //             value={Number(handleTotal(tableMeta, 7)).toFixed(1)}
                                                                //         />
qorri_di's avatar
qorri_di committed
3469
                                                                //     </LightTooltip> 
r.kurnia's avatar
r.kurnia committed
3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509
                                                                :
                                                                null
                                        // tableMeta.rowData[3] === 7 ?
                                        //     (Number(handleValueFormula(value, tableMeta, 7)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
                                        //         <NumberFormat
                                        //             thousandSeparator={true}
                                        //             style={{
                                        //                 fontSize: 12,
                                        //                 textAlign: 'right',
                                        //                 borderColor: 'transparent',
                                        //                 margin: 0,
                                        //                 width: 96,
                                        //                 backgroundColor: 'transparent',
                                        //                 color: 'black'
                                        //             }}
                                        //             type="text"
                                        //             placeholder=""
                                        //             disabled={true}
                                        //             value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
                                        //         /> :
                                        //         <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
                                        //             <NumberFormat
                                        //                 thousandSeparator={true}
                                        //                 style={{
                                        //                     fontSize: 12,
                                        //                     textAlign: 'right',
                                        //                     borderColor: 'transparent',
                                        //                     margin: 0,
                                        //                     width: 96,
                                        //                     backgroundColor: 'transparent',
                                        //                     color: 'red'
                                        //                 }}
                                        //                 type="text"
                                        //                 placeholder=""
                                        //                 disabled={true}
                                        //                 value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
                                        //             />
                                        //         </LightTooltip>
                                        //     :
                                        //     null
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3510 3511 3512 3513 3514 3515 3516
                                    }
                                </div>
                            </div>
                        </div>
                    )
                }
            }
r.kurnia's avatar
r.kurnia committed
3517 3518 3519 3520 3521 3522 3523 3524 3525 3526
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561
        }
        ]
        const loadingComponent = (
            <div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
                <PropagateLoader
                    // css={override}
                    size={20}
                    color={"#274B80"}
                    loading={this.state.loading}
                />
            </div>
        );

        return (
            <div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
                <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
                    <Typography style={{ fontSize: '16px', color: 'white' }}>Outlook Performance Appraisal Submission</Typography>
                </div>
                <Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
                    <Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
                        {this.state.messageAlert}
                    </Alert>
                </Snackbar>
                {/* {this.state.loading && loadingComponent} */}
                <div style={{ flex: 1, padding: 20, width: '100%' }}>
                    {this.state.visibleTP === true ?
                        <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
                            <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
                                <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Outlook Performance Appraisal - Tax Planning</Typography>
                            </div>
                            <div style={{ padding: 20 }}>
                                <div style={{ display: 'flex', justifyContent: 'space-between' }}>
                                    <div>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography>
Riri Novita's avatar
Riri Novita committed
3562 3563 3564 3565 3566
                                        {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>
                                        }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3567 3568
                                    </div>
                                    <div style={{ width: '50%' }}>
Riri Novita's avatar
Riri Novita committed
3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622
                                        {this.props.isApprover === true || this.state.get_for == 'view' ?
                                            null
                                            // <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
                                            //     <a data-tip={'Download'} data-for="download">
                                            //         <button
                                            //             style={{
                                            //                 backgroundColor: 'transparent',
                                            //                 cursor: 'pointer',
                                            //                 borderColor: 'transparent',
                                            //                 margin: 5
                                            //             }}
                                            //             onClick={() =>
                                            //                 this.setState({ loading: true }, () => {
                                            //                     setTimeout(() => {
                                            //                         this.downloadAllData()
                                            //                     }, 100);
                                            //                 })}
                                            //         >
                                            //             <img src={Images.download} />
                                            //         </button>
                                            //     </a>
                                            //     <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
                                            // </div> 
                                            :
                                            <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
                                                <a data-tip={'Download Template'} data-for="template">
                                                    <button
                                                        style={{
                                                            backgroundColor: 'transparent',
                                                            cursor: 'pointer',
                                                            borderColor: 'transparent',
                                                            margin: 5
                                                        }}
                                                        onClick={() => this.downloadTemplate()}
                                                    >
                                                        <img src={Images.template} />
                                                    </button>
                                                </a>
                                                <ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
                                                <a data-tip={'Upload'} data-for="upload">
                                                    <button
                                                        style={{
                                                            backgroundColor: 'transparent',
                                                            cursor: 'pointer',
                                                            borderColor: 'transparent',
                                                            margin: 5
                                                        }}
                                                        onClick={() => this.setState({ visibleUpload: true })}
                                                    >
                                                        <img src={Images.upload} />
                                                    </button>
                                                </a>
                                                <ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
                                                {/* <a data-tip={'Download'} data-for="download">
qorri_di's avatar
qorri_di committed
3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640
                                            <button
                                                style={{
                                                    backgroundColor: 'transparent',
                                                    cursor: 'pointer',
                                                    borderColor: 'transparent',
                                                    margin: 5
                                                }}
                                                onClick={() =>
                                                    this.setState({ loading: true }, () => {
                                                        setTimeout(() => {
                                                            this.downloadAllData()
                                                        }, 100);
                                                    })}
                                            >
                                                <img src={Images.download} />
                                            </button>
                                        </a>
                                        <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> */}
Riri Novita's avatar
Riri Novita committed
3641 3642
                                            </div>
                                        }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3643 3644 3645 3646
                                    </div>
                                </div>

                                <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
rifkaki's avatar
rifkaki committed
3647
                                    {this.state.loading && loadingComponent}
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3648 3649 3650 3651 3652 3653 3654 3655
                                    <MuiThemeProvider theme={getMuiTheme()}>
                                        <MUIDataTable
                                            data={dataTable2}
                                            columns={columns}
                                            options={options}
                                        />
                                    </MuiThemeProvider>
                                </div>
Riri Novita's avatar
Riri Novita committed
3656 3657 3658 3659 3660
                                <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
3661 3662 3663 3664
                                                return (
                                                    <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography>
                                                )
                                            }) :
qorri_di's avatar
qorri_di committed
3665
                                                <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>-</Typography>
Riri Novita's avatar
Riri Novita committed
3666 3667 3668
                                        }
                                    </div>
                                </div>
3669
                                <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 5 }}>Notes : {this.state.notesUpdate}</Typography>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687
                            </div>
                            <div className="grid grid-2x" style={{ marginTop: 20 }}>
                                <div className="col-1">
                                    <button
                                        type="button"
                                        onClick={() => this.setState({ loading: true }, () => {
                                            setTimeout(() => {
                                                this.props.onClickClose()
                                            }, 100);
                                        })}
                                        style={{
                                            backgroundColor: 'transparent',
                                            cursor: 'pointer',
                                            borderColor: 'transparent',
                                            outline: 'none'
                                        }}
                                    >
                                        <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
r.kurnia's avatar
r.kurnia committed
3688
                                            <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3689 3690 3691
                                        </div>
                                    </button>
                                </div>
r.kurnia's avatar
r.kurnia committed
3692 3693 3694
                                {this.props.isApprover === true ?
                                    <div className="col-2">
                                    </div> :
rifkaki's avatar
rifkaki committed
3695
                                    <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
qorri_di's avatar
qorri_di committed
3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716
                                        {this.state.get_for == 'view' && this.state.viewOnly &&
                                            <button
                                                className="button"
                                                type="button"
                                                style={{
                                                    backgroundColor: 'transparent',
                                                    cursor: 'pointer',
                                                    borderColor: 'transparent',
                                                    outline: 'none',
                                                    marginRight: 20
                                                }}
                                                onClick={() => {
                                                    this.setState({ loading: true }, () => {
                                                        this.handleGetFor('edit')
                                                    })
                                                }}
                                            >
                                                <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' }}>Edit</Typography>
                                                </div>
                                            </button>
r.kurnia's avatar
r.kurnia committed
3717
                                        }
qorri_di's avatar
qorri_di committed
3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742
                                        {this.state.get_for == 'edit' &&
                                            <button
                                                className="button"
                                                type="button"
                                                style={{
                                                    backgroundColor: 'transparent',
                                                    cursor: 'pointer',
                                                    borderColor: 'transparent',
                                                    outline: 'none',
                                                    marginRight: 20
                                                }}
                                                onClick={() => {
                                                    // this.forceUpdate()
                                                    this.setState({ loading: true, buttonDraft: false }, () => {
                                                        setTimeout(() => {
                                                            // this.setState({ loading: false, buttonError: false, editable: true })
                                                            this.handleValidate()
                                                        }, 100);
                                                    })
                                                }}
                                            >
                                                <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
                                                    <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
                                                </div>
                                            </button>
rifkaki's avatar
rifkaki committed
3743 3744
                                        }
                                        {this.state.get_for == 'edit' && <button
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3745 3746
                                            className="button"
                                            type="button"
qorri_di's avatar
qorri_di committed
3747
                                            onClick={() =>
rifkaki's avatar
rifkaki committed
3748
                                                this.state.saveDraft === true ?
qorri_di's avatar
qorri_di committed
3749 3750 3751 3752 3753 3754 3755 3756
                                                    this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'error' })
                                                    :
                                                    this.state.handleDoubleClick == 1 ? null :
                                                        this.setState({ handleDoubleClick: 1, loading: true }, () => {
                                                            setTimeout(() => {
                                                                this.backToMasterBudget('draft')
                                                            }, 100);
                                                        })
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3757 3758 3759
                                            }
                                            style={{
                                                backgroundColor: 'transparent',
rifkaki's avatar
rifkaki committed
3760
                                                cursor: 'pointer',
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3761 3762 3763 3764 3765 3766 3767 3768
                                                borderColor: 'transparent',
                                                outline: 'none',
                                                marginRight: 20
                                            }}
                                        >
                                            <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>
rifkaki's avatar
rifkaki committed
3769 3770
                                        </button>}
                                        {this.state.get_for == 'edit' && <button
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3771
                                            type="button"
rifkaki's avatar
rifkaki committed
3772
                                            // disabled={this.state.buttonError}
qorri_di's avatar
qorri_di committed
3773
                                            onClick={() =>
rifkaki's avatar
rifkaki committed
3774 3775 3776
                                                this.state.buttonError ?
                                                    this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'error' })
                                                    :
3777
                                                    this.state.handleDoubleClick == 1 ? null :
Riri Novita's avatar
Riri Novita committed
3778
                                                        this.setState({ handleDoubleClick: 1 }, () => {
rifkaki's avatar
rifkaki committed
3779 3780 3781 3782 3783
                                                            setTimeout(() => {
                                                                this.backToMasterBudget('submitted')
                                                            }, 100);
                                                        })
                                            }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3784 3785
                                            style={{
                                                backgroundColor: 'transparent',
rifkaki's avatar
rifkaki committed
3786
                                                cursor: 'pointer',
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3787 3788 3789 3790
                                                borderColor: 'transparent',
                                                outline: 'none'
                                            }}
                                        >
rifkaki's avatar
rifkaki committed
3791
                                            <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 10 }}>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3792 3793
                                                <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
                                            </div>
rifkaki's avatar
rifkaki committed
3794
                                        </button>}
qorri_di's avatar
qorri_di committed
3795
                                    </div>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3796 3797 3798
                                }
                            </div>
                        </Paper>
qorri_di's avatar
qorri_di committed
3799
                        :
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3800 3801 3802 3803 3804 3805
                        <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
                            <div>
                                <div style={{ padding: 25 }}>
                                    <div>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography>
Riri Novita's avatar
Riri Novita committed
3806 3807 3808 3809 3810
                                        {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>
                                        }
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836
                                    </div>
                                    {this.state.dataLoaded && (
                                        <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
                                            {this.state.loading && loadingComponent}
                                            <MuiThemeProvider theme={getMuiTheme()}>
                                                <MUIDataTable
                                                    data={dataTable2}
                                                    columns={columns}
                                                    options={options}
                                                />
                                            </MuiThemeProvider>
                                        </div>
                                    )}
                                </div>
                                <div className="grid grid-2x" style={{ marginTop: 20 }}>
                                    <div className="col-1">
                                        <button
                                            type="button"
                                            onClick={() => this.setState({ loading: true, visibleTP: true }, () => {
                                                setTimeout(() => {
                                                    this.getItemHierarki()
                                                }, 100);
                                            })}
                                            style={{ marginRight: 20 }}
                                        >
                                            <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
r.kurnia's avatar
r.kurnia committed
3837
                                                <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3838 3839 3840 3841 3842 3843 3844
                                            </div>
                                        </button>
                                    </div>
                                    <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
                                        <button
                                            className="button"
                                            type="button"
syadziy's avatar
syadziy committed
3845
                                            // disabled={this.state.buttonError}
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3846 3847
                                            style={{
                                                backgroundColor: 'transparent',
syadziy's avatar
syadziy committed
3848
                                                cursor: 'pointer',
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3849 3850 3851 3852 3853
                                                borderColor: 'transparent',
                                                outline: 'none',
                                                marginRight: 20
                                            }}
                                            onClick={() => {
syadziy's avatar
syadziy committed
3854
                                                this.setState({ loading: true, buttonDraft: false }, () => {
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3855
                                                    setTimeout(() => {
r.kurnia's avatar
r.kurnia committed
3856 3857
                                                        // this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false, editable: false })
                                                        this.handleValidate()
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875
                                                    }, 100);
                                                })
                                            }}
                                        >
                                            <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
                                                <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
                                            </div>
                                        </button>
                                        <button
                                            type="button"
                                            // disabled={this.state.buttonError}
                                            style={{
                                                backgroundColor: 'transparent',
                                                cursor: this.state.editable !== true ? 'pointer' : 'default',
                                                borderColor: 'transparent',
                                                outline: 'none',
                                                marginRight: 20
                                            }}
qorri_di's avatar
qorri_di committed
3876
                                            onClick={() => this.state.editable === true ?
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3877
                                                null
qorri_di's avatar
qorri_di committed
3878
                                                :
3879
                                                this.state.handleDoubleClick == 1 ? null :
qorri_di's avatar
qorri_di committed
3880 3881 3882 3883 3884
                                                    this.setState({ handleDoubleClick: 1, loading: true }, () => {
                                                        setTimeout(() => {
                                                            this.uploadTP('draft')
                                                        }, 100);
                                                    })}
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898
                                        >
                                            <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                                <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
                                            </div>
                                        </button>
                                        <button
                                            type="button"
                                            // disabled={this.state.buttonError}
                                            style={{
                                                backgroundColor: 'transparent',
                                                cursor: this.state.editable !== true ? 'pointer' : 'default',
                                                borderColor: 'transparent',
                                                outline: 'none',
                                            }}
qorri_di's avatar
qorri_di committed
3899
                                            onClick={() =>
r.kurnia's avatar
r.kurnia committed
3900 3901
                                                this.state.editable === true ?
                                                    this.setState({ alert: true, messageAlert: 'Data Incomplete', tipeAlert: 'error' })
qorri_di's avatar
qorri_di committed
3902 3903 3904 3905 3906 3907 3908
                                                    :
                                                    this.state.handleDoubleClick == 1 ? null :
                                                        this.setState({ handleDoubleClick: 1, loading: true }, () => {
                                                            setTimeout(() => {
                                                                this.uploadTP('submitted')
                                                            }, 100);
                                                        })}
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938
                                        >
                                            <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                                <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
                                            </div>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </Paper>
                    }
                </div>
                {this.state.visibleUpload && (
                    <div className="test app-popup-show">
                        <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
                            <div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
                                <div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
                                    <div className="popup-title">
                                        <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File</span>
                                    </div>
                                </div>
                                <div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
                                    <button
                                        type="button"
                                        className="btn btn-circle btn-white"
                                        onClick={() => this.setState({ visibleUpload: false })}
                                    >
                                        <img src={Images.close} />
                                    </button>
                                </div>
                            </div>
3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955
                            <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={() => {
                                        String(this.state.judul).includes("OUTLOOK") && String(this.state.judul).includes("PA") && String(this.state.judul).includes("TAX") && String(this.state.judul).includes("PLANNING") ?
                                            this.checkUpload() :
                                            this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
                                    }}
                                />
                            </div>
3956
                            <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>
3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984
                        </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
                                        }}
3985
                                        onClick={() => this.setState({ visibleAlertSave: false, loading: false })}
3986 3987 3988 3989 3990 3991 3992
                                    >
                                        <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>
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
3993 3994 3995 3996 3997 3998 3999
                        </div>
                    </div>
                )}
            </div>
        );
    }
}