BudgetTahunan.js 29.3 KB
Newer Older
Deni Rinaldi's avatar
Deni Rinaldi committed
1
import React, { Component } from 'react';
Deni Rinaldi's avatar
Deni Rinaldi committed
2
import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel, Snackbar, withStyles } from '@material-ui/core';
Deni Rinaldi's avatar
Deni Rinaldi committed
3 4
import MUIDataTable from 'mui-datatables';
import Images from '../assets/Images';
5
import BalanceSheet from './BudgetTahunan/BalanceSheet';
Deni Rinaldi's avatar
Deni Rinaldi committed
6 7
import api from '../api';
import Autocomplete from '@material-ui/lab/Autocomplete';
Deni Rinaldi's avatar
Deni Rinaldi committed
8
import MuiAlert from '@material-ui/lab/Alert';
Deni Rinaldi's avatar
Deni Rinaldi committed
9
import { titleCase } from '../library/Utils';
10
import ProfitLoss from './BudgetTahunan/ProfitLoss';
11
import TaxPlanning from './BudgetTahunan/TaxPlanning';
faisalhamdi's avatar
faisalhamdi committed
12
import FixedAssetsMovement from './BudgetTahunan/FixedAssetsMovement';
13
import CorporateAnnualTarget from './BudgetTahunan/CorporateAnnualTarget';
14 15 16
import { ExcelRenderer } from 'react-excel-renderer';
import UploadFile from "../library/Upload";
import { format } from 'date-fns';
Deni Rinaldi's avatar
Deni Rinaldi committed
17 18 19 20
import Constant from '../library/Constant';

const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
Deni Rinaldi's avatar
Deni Rinaldi committed
21 22 23 24 25 26

export default class BudgetTahunan extends Component {
    constructor(props) {
        super(props)
        this.state = {
            perusahaan: 'TAP Group',
27 28
            listRevision: null,
            revision: null,
29
            visibleBudgetTahunan: true,
Deni Rinaldi's avatar
Deni Rinaldi committed
30
            visibleBS: false,
Deni Rinaldi's avatar
Deni Rinaldi committed
31 32
            listPeriode: null,
            periode: null,
Deni Rinaldi's avatar
Deni Rinaldi committed
33 34
            listCompany: null,
            company: null,
35
            report_id: null,
faisalhamdi's avatar
faisalhamdi committed
36
            visiblePL: false,
37
            visibleFAM: false,
38 39
            visibleCAT: false,
            listAttachment: [],
Deni Rinaldi's avatar
Deni Rinaldi committed
40
            visibleUpload: false,
Deni Rinaldi's avatar
Deni Rinaldi committed
41 42 43 44
            revisionTable: null,
            alert: false,
            tipeAlert: '',
            messageAlert: '',
Deni Rinaldi's avatar
Deni Rinaldi committed
45
        }
46
        this.fileHandler = this.fileHandler.bind(this);
Deni Rinaldi's avatar
Deni Rinaldi committed
47
    }
Deni Rinaldi's avatar
Deni Rinaldi committed
48

Deni Rinaldi's avatar
Deni Rinaldi committed
49 50 51 52
    componentDidMount() {
        this.getCompanyActive()
    }

53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
    getReportAttachment() {
        let payload = {
            "company_id": this.state.company.company_id,
            "periode": this.state.periode.periode,
            "revision": this.state.revision.revision,
        }
        api.create().getMasterBudgetAtt(payload).then(response => {
            if (response.data) {
                if (response.data.status === "success") {
                    this.setState({ listAttachment: response.data.data })
                }
            }
            // console.log(response);
        })
    }

Deni Rinaldi's avatar
Deni Rinaldi committed
69
    getReport() {
Deni Rinaldi's avatar
Deni Rinaldi committed
70 71
        let payload = {
            "company_id": this.state.company.company_id,
Deni Rinaldi's avatar
Deni Rinaldi committed
72
            "periode": this.state.periode.periode,
d.arizona's avatar
d.arizona committed
73
            "report_type": "Master Budget",
Deni Rinaldi's avatar
Deni Rinaldi committed
74 75
        }
        api.create().getReportTypeBody(payload).then(response => {
76
            // console.log(response);
Deni Rinaldi's avatar
Deni Rinaldi committed
77 78 79 80
            if (response.data) {
                if (response.data.status === "success") {
                    let dataTable = response.data.data.map((item, index) => {
                        return [
81
                            item.number,
Deni Rinaldi's avatar
Deni Rinaldi committed
82
                            item.report_name,
83
                            item.revision,
84 85 86
                            item.current_status,
                            item.report_id,
                            item.is_can_upload,
87
                            item.revision
Deni Rinaldi's avatar
Deni Rinaldi committed
88 89
                        ]
                    })
90
                    // console.log(dataTable);
Deni Rinaldi's avatar
Deni Rinaldi committed
91 92 93 94 95 96 97 98
                    this.setState({ dataTable })
                }
            }
        })
    }

    getCompanyActive() {
        api.create().getPerusahaanActive().then((response) => {
Deni Rinaldi's avatar
Deni Rinaldi committed
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
            if (response.data) {
                if (response.data.status === 'success') {
                    let data = response.data.data
                    let companyData = data.map((item) => {
                        return {
                            company_id: item.company_id,
                            company_name: item.company_name,
                        }
                    })
                    let defaultProps = {
                        options: companyData,
                        getOptionLabel: (option) => titleCase(option.company_name),
                    };
                    this.setState({ listCompany: defaultProps, company: companyData[0] }, () => {
                        this.getPeriode()
                    })
                } else {
                    this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
                        if (response.data.message.includes("Token")) {
                            setTimeout(() => {
                                localStorage.removeItem(Constant.TOKEN)
                                window.location.reload();
                            }, 1000);
                        }
                    })
                }
Deni Rinaldi's avatar
Deni Rinaldi committed
125
            } else {
Deni Rinaldi's avatar
Deni Rinaldi committed
126
                this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', listCompany: null, company: null })
Deni Rinaldi's avatar
Deni Rinaldi committed
127
            }
Deni Rinaldi's avatar
Deni Rinaldi committed
128

Deni Rinaldi's avatar
Deni Rinaldi committed
129 130 131
        })
    }

Deni Rinaldi's avatar
Deni Rinaldi committed
132
    getPeriode() {
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
        api.create().getPeriodeTransaction().then(response => {
            let dateNow = new Date
            let year = format(dateNow, 'yyyy')
            if (response.data) {
                if (response.data.status === "success") {
                    let data = response.data.data
                    let periodeData = data.map((item) => {
                        return {
                            periode: item,
                        }
                    })
                    let defaultProps = {
                        options: periodeData,
                        getOptionLabel: (option) => option.periode,
                    };
                    let index = data.sort((a, b) => a - b).findIndex((val) => val == year)
                    this.setState({ listPeriode: defaultProps, periode: index == -1 ? periodeData[0] : periodeData[index] }, () => {
                        this.getRevision()
                    })
                }
            }
        })
    }

    getRevision() {
        let payload = {
            "company_id": this.state.company.company_id,
            "periode": this.state.periode.periode
        }
        api.create().getRevision(payload).then(response => {
            console.log(response);
            if (response.data) {
                if (response.data.status === "success") {
                    let data = response.data.data
                    let revisionData = data.map((item) => {
                        return {
                            revision: item,
                        }
                    })
                    let defaultProps = {
                        options: revisionData,
                        getOptionLabel: (option) => option.revision,
                    };
                    this.setState({ listRevision: defaultProps, revision: revisionData[0] }, () => {
                        this.getReport()
                        this.getReportAttachment()
                    })
                }
Deni Rinaldi's avatar
Deni Rinaldi committed
181 182 183 184
            }
        })
    }

Deni Rinaldi's avatar
Deni Rinaldi committed
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
    clickDetail(item, id, revision) {
        console.log(item);
        this.setState({
            report_id: id,
            revisionTable: revision,
        }, () => {
            if (item === 'Balance Sheet') {
                this.setState({
                    visibleBudgetTahunan: false,
                    visibleBS: true,
                    visiblePL: false,
                    visibleCAT: false,
                    visibleFAM: false,
                    visibleTP: false,
                })
            } else if (item === 'Profit Loss') {
                this.setState({
                    visibleBudgetTahunan: false,
                    visibleBS: false,
                    visiblePL: true,
                    visibleCAT: false,
                    visibleFAM: false,
                    visibleTP: false
                })
            } else if (item === 'Tax Planning') {
                this.setState({
                    visibleBudgetTahunan: false,
                    visibleBS: false,
                    visiblePL: false,
                    visibleCAT: false,
                    visibleFAM: false,
                    visibleTP: true
                })
            } else if (item === 'Fixed Assets Movement') {
                this.setState({
                    visibleBudgetTahunan: false,
                    visibleBS: false,
                    visiblePL: false,
                    visibleCAT: false,
                    visibleFAM: true,
                    visibleTP: false
                })
            } else if (item === 'CAT') {
                this.setState({
                    visibleBudgetTahunan: false,
                    visibleBS: false,
                    visiblePL: false,
                    visibleCAT: true,
                    visibleFAM: false,
                    visibleTP: false
                })
            }
        })
Deni Rinaldi's avatar
Deni Rinaldi committed
238 239
    }

240 241 242 243 244
    handleChange(value, tableMeta) {
        let data = this.state.dataTable
        data[tableMeta.rowIndex][tableMeta.columnIndex] = value
    }

245 246 247 248 249 250 251 252 253
    fileHandler = (event) => {
        let fileObj = event
        ExcelRenderer(fileObj, (err, resp) => {
            // console.log(resp)
            if (err) {
                console.log(err);
            }
            else {
                const formData = new FormData();
254
                formData.append("revision", Number(this.state.revision.revision));
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
                formData.append("companyId", this.state.company.company_id);
                formData.append("periode", Number(this.state.periode.periode));
                formData.append("file", event);
                this.setState({ formData })
            }
        })
    }

    uploadAttachment(formData) {
        api.create().uploadAttachment(formData).then(response => {
            if (response.data) {
                if (response.data.status === "success") {
                    this.setState({ visibleUpload: false }, () => {
                        this.getReport()
                        this.getReportAttachment()
                    })
                }
            }
Deni Rinaldi's avatar
Deni Rinaldi committed
273 274 275 276 277 278 279 280 281 282 283
        })
    }

    deleteAttachment(item) {
        api.create().deleteAttachment(item.attachment_id).then(response => {
            if (response.data) {
                if (response.data.status === "success") {
                    this.getReport()
                    this.getReportAttachment()
                }
            }
284 285
        })
    }
Deni Rinaldi's avatar
Deni Rinaldi committed
286

Deni Rinaldi's avatar
Deni Rinaldi committed
287 288 289 290
    closeAlert() {
        this.setState({ alert: false })
    }

Deni Rinaldi's avatar
Deni Rinaldi committed
291 292 293
    render() {
        const columns = ["#", "Jenis Laporan",
            {
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
                name: "Revision",
                options: {
                    customBodyRender: (val, tableMeta, updateValue) => {
                        var list = [];
                        for (var i = 0; i <= tableMeta.rowData[6]; i++) {
                            list.push(i);
                        }
                        return (
                            <div style={{ display: 'flex' }}>
                                <FormControlLabel
                                    style={{ margin: 0 }}
                                    value={val}
                                    control={
                                        <Select
                                            value={val}
                                            onChange={event => {
                                                // console.log(event.target)
                                                updateValue(event.target.value)
                                                this.handleChange(event.target.value, tableMeta)
                                            }}
                                            autoWidth
                                        >
                                            {list.map((item, index) =>
                                                <MenuItem key={index} value={item}>{item}</MenuItem>
                                            )}
                                        </Select>
                                    }
                                />
                            </div >
                        );
                    }
                }
            }, {
Deni Rinaldi's avatar
Deni Rinaldi committed
327 328 329 330 331
                name: "Status",
                options: {
                    customBodyRender: (val, tableMeta) => {
                        return (
                            <div style={{ display: 'flex' }}>
332
                                {val === "submitted" || val === "approved" ?
Deni Rinaldi's avatar
Deni Rinaldi committed
333
                                    <img src={Images.ceklis} style={{ width: 31, height: 24 }} /> :
Deni Rinaldi's avatar
Deni Rinaldi committed
334 335 336
                                    val === "revision" ?
                                        <span>Revisi</span> :
                                        null
Deni Rinaldi's avatar
Deni Rinaldi committed
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
                                }
                            </div >
                        );
                    }
                }
            },
            {
                name: "Action",
                options: {
                    customBodyRender: (val, tableMeta) => {
                        return (
                            <div style={{ display: 'flex' }}>
                                <button
                                    style={{
                                        backgroundColor: 'transparent',
352
                                        cursor: tableMeta.rowData[5] ? 'pointer' : null,
Deni Rinaldi's avatar
Deni Rinaldi committed
353 354
                                        borderColor: 'transparent'
                                    }}
Deni Rinaldi's avatar
Deni Rinaldi committed
355
                                    onClick={() =>
Deni Rinaldi's avatar
Deni Rinaldi committed
356
                                        tableMeta.rowData[5] ? this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2]) : null
357
                                    }
Deni Rinaldi's avatar
Deni Rinaldi committed
358
                                >
359
                                    <Typography style={{ color: tableMeta.rowData[5] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography>
Deni Rinaldi's avatar
Deni Rinaldi committed
360 361 362 363 364
                                </button>
                            </div >
                        );
                    }
                }
365 366 367 368 369 370
            }, {
                name: "",
                options: { display: false }
            }, {
                name: "",
                options: { display: false }
Deni Rinaldi's avatar
Deni Rinaldi committed
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401
            }]
        const dataTable = [
            ["1", "Balance Sheet", "done"],
            ["2", "Profit & Loss", ""],
            ["3", "CAT", "done"],
            ["4", "Fixed Assets Movement", ""],
            ["5", "Tax Planning", "done"],
            ["6", "Balance Sheet", "done"],
            ["7", "Profit & Loss", ""],
            ["8", "CAT", "done"],
            ["9", "Fixed Assets Movement", ""],
            ["10", "Tax Planning", "done"],
            ["11", "Balance Sheet", "done"],
            ["12", "Profit & Loss", "done"],
            ["13", "CAT", "done"],
            ["14", "Fixed Assets Movement", "done"],
            ["15", "Tax Planning", "done"],
        ]
        const options = {
            filter: false,
            sort: false,
            responsive: "scroll",
            print: false,
            download: false,
            selectableRows: false,
            viewColumns: false,
            rowsPerPage: 5,
            rowsPerPageOptions: [5, 25, 100],
            search: false
        }
        const periode = [
402
            { value: '2021', label: '2021' },
Deni Rinaldi's avatar
Deni Rinaldi committed
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421
            { value: '2020', label: '2020' },
            { value: '2019', label: '2019' },
            { value: '2018', label: '2018' },
            { value: '2017', label: '2017' },
            { value: '2016', label: '2016' },
        ]
        const perusahaan = [
            { value: 'TAP Group', label: 'TAP Group' },
            { value: '2019', label: '2019' },
            { value: '2018', label: '2018' },
            { value: '2017', label: '2017' },
            { value: '2016', label: '2016' },
        ]
        const revisi = [
            { value: '0', label: '0' },
            { value: '1', label: '1' },
        ]
        return (
            <div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
422 423 424 425 426
                <Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
                    <Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
                        {this.state.messageAlert}
                    </Alert>
                </Snackbar>
427 428 429 430
                {this.state.visibleBudgetTahunan && (
                    <div>
                        <div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
                            <Typography style={{ fontSize: '16px', color: 'white' }}>Pengajuan Budget Tahunan</Typography>
Deni Rinaldi's avatar
Deni Rinaldi committed
431
                        </div>
432 433 434 435
                        <div style={{ padding: 20, width: '100%' }}>
                            <Paper style={{ paddingTop: 10 }}>
                                <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
                                    <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan</Typography>
Deni Rinaldi's avatar
Deni Rinaldi committed
436
                                </div>
437 438
                                <div style={{ padding: 20 }}>
                                    <div>
Deni Rinaldi's avatar
Deni Rinaldi committed
439 440
                                        <Autocomplete
                                            {...this.state.listPeriode}
441
                                            id="periode"
442 443 444 445
                                            onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => {
                                                this.getReport()
                                                this.getReportAttachment()
                                            })}
Deni Rinaldi's avatar
Deni Rinaldi committed
446 447 448 449
                                            debug
                                            disableClearable
                                            style={{ width: 250 }}
                                            renderInput={(params) => <TextField {...params} label="Periode" margin="normal" style={{ marginTop: 7 }} />}
450
                                            value={this.state.periode}
Deni Rinaldi's avatar
Deni Rinaldi committed
451
                                        />
452 453
                                    </div>
                                    <div style={{ marginTop: 20 }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
454 455 456
                                        <Autocomplete
                                            {...this.state.listCompany}
                                            id="company"
457 458 459 460
                                            onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => {
                                                this.getReport()
                                                this.getReportAttachment()
                                            })}
Deni Rinaldi's avatar
Deni Rinaldi committed
461 462 463 464 465 466
                                            debug
                                            disableClearable
                                            style={{ width: 250 }}
                                            renderInput={(params) => <TextField {...params} label="Company" margin="normal" style={{ marginTop: 7 }} />}
                                            value={this.state.company}
                                        />
467 468
                                    </div>
                                    <div style={{ marginTop: 20 }}>
469 470 471 472 473 474 475 476 477 478 479 480 481
                                        <Autocomplete
                                            {...this.state.listRevision}
                                            id="revision"
                                            onChange={(event, newInputValue) => this.setState({ revision: newInputValue }, () => {
                                                this.getReport()
                                                this.getReportAttachment()
                                            })}
                                            debug
                                            disableClearable
                                            style={{ width: 250 }}
                                            renderInput={(params) => <TextField {...params} label="Revision" margin="normal" style={{ marginTop: 7 }} />}
                                            value={this.state.revision}
                                        />
482 483 484 485
                                    </div>

                                    <div style={{ marginTop: 20 }}>
                                        <MUIDataTable
Deni Rinaldi's avatar
Deni Rinaldi committed
486
                                            data={this.state.dataTable}
487 488 489 490 491 492 493 494 495
                                            columns={columns}
                                            options={options}
                                        />
                                    </div>
                                    <div style={{ display: 'flex', marginTop: 20 }}>
                                        <div style={{ width: '50%' }}>
                                            <Typography style={{ fontSize: '16px', color: '#4b4b4b', fontWeight: 'bold' }}>Attachment: </Typography>
                                        </div>
                                        <div style={{ width: '50%' }}>
496 497 498 499 500 501 502 503 504 505 506
                                            <button
                                                style={{
                                                    backgroundColor: 'transparent',
                                                    cursor: 'pointer',
                                                    borderColor: 'transparent',
                                                    outline: 'none'
                                                }}
                                                onClick={() => this.setState({ visibleUpload: true })}
                                            >
                                                <Typography style={{ fontSize: '16px', color: '#5198ea' }}>Upload File</Typography>
                                            </button>
507 508 509 510
                                        </div>
                                    </div>
                                    <div style={{ display: 'flex', marginTop: 10 }}>
                                        <div style={{ width: '50%', paddingLeft: 20 }}>
511 512 513 514 515 516 517 518
                                            {this.state.listAttachment.length > 0 ?
                                                this.state.listAttachment.map((item) => {
                                                    return (
                                                        <Typography style={{ fontSize: '16px', color: '#4b4b4b' }}>{item.attachment_name}</Typography>
                                                    )
                                                })
                                                : null
                                            }
519 520
                                        </div>
                                        <div style={{ width: '50%' }}>
521 522 523
                                            {this.state.listAttachment.length > 0 ?
                                                this.state.listAttachment.map((item) => {
                                                    return (
Deni Rinaldi's avatar
Deni Rinaldi committed
524 525 526 527 528 529 530 531 532 533 534 535
                                                        <button
                                                            style={{
                                                                backgroundColor: 'transparent',
                                                                cursor: 'pointer',
                                                                borderColor: 'transparent',
                                                                outline: 'none',
                                                                display: 'grid'
                                                            }}
                                                            onClick={() => this.deleteAttachment(item)}
                                                        >
                                                            <Typography style={{ fontSize: '16px', color: '#ff3939' }}>Delete</Typography>
                                                        </button>
536 537 538 539
                                                    )
                                                })
                                                : null
                                            }
540 541
                                        </div>
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
542
                                </div>
543 544 545 546
                                <div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
                                    <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
                                        <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Submit</Typography>
                                    </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
547
                                </div>
548 549
                            </Paper>

Deni Rinaldi's avatar
Deni Rinaldi committed
550
                        </div>
551 552
                    </div>
                )}
Deni Rinaldi's avatar
Deni Rinaldi committed
553

554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587
                {this.state.visibleUpload && (
                    <div className="test app-popup-show">
                        <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
                            <div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
                                <div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
                                    <div className="popup-title">
                                        <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File</span>
                                    </div>
                                </div>
                                <div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
                                    <button
                                        type="button"
                                        className="btn btn-circle btn-white"
                                        onClick={() => this.setState({ visibleUpload: false })}
                                    >
                                        <img src={Images.close} />
                                    </button>
                                </div>
                            </div>
                            <UploadFile
                                type={this.state.uploadStatus}
                                percentage={this.state.percentage}
                                result={this.state.result}
                                acceptedFiles={["xlsx"]}
                                onHandle={(dt) => {
                                    this.fileHandler(dt)
                                    this.setState({ uploadStatus: 'idle', percentage: '0' })
                                }}
                                onUpload={() => this.uploadAttachment(this.state.formData)}
                            />
                        </div>
                    </div>
                )}

Deni Rinaldi's avatar
Deni Rinaldi committed
588
                {this.state.visibleBS && (
Deni Rinaldi's avatar
Deni Rinaldi committed
589
                    <BalanceSheet
Deni Rinaldi's avatar
Deni Rinaldi committed
590
                        open={this.props.open}
Deni Rinaldi's avatar
Deni Rinaldi committed
591
                        report_id={this.state.report_id}
Deni Rinaldi's avatar
Deni Rinaldi committed
592 593
                        height={this.props.height}
                        width={this.props.width}
Deni Rinaldi's avatar
Deni Rinaldi committed
594
                        company={this.state.company}
Deni Rinaldi's avatar
Deni Rinaldi committed
595 596
                        revision={this.state.revisionTable}
                        periode={this.state.periode.periode}
597
                        onClickClose={() => this.setState({ visibleBS: false, visibleBudgetTahunan: true })}
Deni Rinaldi's avatar
Deni Rinaldi committed
598
                    />
599
                )}
600
                {this.state.visiblePL && (
601
                    <ProfitLoss
EKSAD's avatar
EKSAD committed
602
                        report_id={this.state.report_id}
EKSAD's avatar
EKSAD committed
603 604
                        height={this.props.height}
                        width={this.props.width}
EKSAD's avatar
EKSAD committed
605
                        company={this.state.company}
EKSAD's avatar
EKSAD committed
606 607
                        revision={this.state.revisionTable}
                        periode={this.state.periode.periode}
608
                        onClickClose={() => this.setState({ visiblePL: false, visibleBudgetTahunan: true })}
EKSAD's avatar
EKSAD committed
609
                    />
610

611
                )}
612
                {this.state.visibleTP && (
613
                    <TaxPlanning
614 615
                        report_id={this.state.report_id}
                        company={this.state.company}
Rifka Kurnia Irfiana's avatar
Rifka Kurnia Irfiana committed
616 617
                        onClickClose={() => this.setState({ visibleTP: false, visibleBudgetTahunan: true })}
                    />
618
                )}
faisalhamdi's avatar
faisalhamdi committed
619
                {this.state.visibleFAM && (
620
                    <FixedAssetsMovement
faisalhamdi's avatar
faisalhamdi committed
621 622 623 624 625 626
                        report_id={this.state.report_id}
                        height={this.props.height}
                        width={this.props.width}
                        company={this.state.company}
                        revision={this.state.revisionTable}
                        periode={this.state.periode.periode}
627
                        onClickClose={() => this.setState({ visibleFAM: false, visibleBudgetTahunan: true })}
628 629 630
                    />
                )}
                {this.state.visibleCAT && (
631
                    <CorporateAnnualTarget
faisalhamdi's avatar
faisalhamdi committed
632 633 634 635 636 637
                        report_id={this.state.report_id}
                        height={this.props.height}
                        width={this.props.width}
                        company={this.state.company}
                        revision={this.state.revisionTable}
                        periode={this.state.periode.periode}
638
                        onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })}
639
                    />
faisalhamdi's avatar
faisalhamdi committed
640
                )}
Deni Rinaldi's avatar
Deni Rinaldi committed
641 642 643 644
            </div >
        );
    }
}