CashFlow.js 31.7 KB
Newer Older
d.arizona's avatar
d.arizona committed
1
import { createMuiTheme, FormControlLabel, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles } from '@material-ui/core'
d.arizona's avatar
d.arizona committed
2
import MUIDataTable from 'mui-datatables';
Deni Rinaldi's avatar
Deni Rinaldi committed
3
import React, { Component } from 'react'
d.arizona's avatar
d.arizona committed
4
import NumberFormat from 'react-number-format';
Deni Rinaldi's avatar
Deni Rinaldi committed
5
import ReactTooltip from 'react-tooltip';
d.arizona's avatar
d.arizona committed
6
import api from '../../api';
Deni Rinaldi's avatar
Deni Rinaldi committed
7
import Images from '../../assets/Images';
d.arizona's avatar
d.arizona committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());

const options = ct.customOptionsFixedColumn();
const style = {
    position: "sticky",
    left: 0,
    background: "white",
    zIndex: 101,
};
const style2 = {
    position: "sticky",
    background: "white",
    zIndex: 100
};
Deni Rinaldi's avatar
Deni Rinaldi committed
23

d.arizona's avatar
d.arizona committed
24 25 26 27 28 29 30 31
const LightTooltip = withStyles((theme) => ({
    tooltip: {
        backgroundColor: theme.palette.common.white,
        color: 'rgba(0, 0, 0, 0.87)',
        boxShadow: theme.shadows[1],
        fontSize: 11,
    },
}))(Tooltip);
Deni Rinaldi's avatar
Deni Rinaldi committed
32
export default class CashFlow extends Component {
d.arizona's avatar
d.arizona committed
33 34 35
    constructor(props) {
        super(props)
        this.state = {
d.arizona's avatar
d.arizona committed
36
            dataTable: []
d.arizona's avatar
d.arizona committed
37 38 39 40 41
        }
    }

    componentDidMount() {
        this.setState({loading: true})
d.arizona's avatar
d.arizona committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 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 125 126 127 128 129
        this.getItemHierarki()
    }

    getItemHierarki() {
        this.setState({ loading: true })
        let payload = {
            "report_id": this.props.report_id,
            "revision": Number(this.props.revision),
            "periode": this.props.periode,
            "company_id": this.props.company.company_id,
            "submission_id": this.props.submissionID
        }
        // console.log(JSON.stringify(payload))
        api.create().getDetailReportMB(payload).then(response => {
            let dataTable = []
            console.log(response)
            let res = response.data.data
            const handlePushChild = (item) => {
                dataTable.push([
                    item.type_report_id,
                    item.id,
                    item.parent,
                    item.formula,
                    item.level,
                    item.description,
                    item.cash_flow.total_actual_before === null ? "0" : item.cash_flow.total_actual_before === "" ? "0" : item.cash_flow.total_actual_before,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.january, formula: item.cash_flow.january_formula } : item.cash_flow.january,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.february, formula: item.cash_flow.february_formula } : item.cash_flow.february,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.march, formula: item.cash_flow.march_formula } : item.cash_flow.march,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.april, formula: item.cash_flow.april_formula } : item.cash_flow.april,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.may, formula: item.cash_flow.may_formula } : item.cash_flow.may,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.june, formula: item.cash_flow.june_formula } : item.cash_flow.june,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.july, formula: item.cash_flow.july_formula } : item.cash_flow.july,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.august, formula: item.cash_flow.august_formula } : item.cash_flow.august,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.september, formula: item.cash_flow.september_formula } : item.cash_flow.september,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.october, formula: item.cash_flow.october_formula } : item.cash_flow.october,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.november, formula: item.cash_flow.november_formula } : item.cash_flow.november,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.december, formula: item.cash_flow.december_formula } : item.cash_flow.december,
                    item.cash_flow.total_current_year,
                    item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.cash_flow.total_next_year,
                    item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.cash_flow.total_more_year,
                    item.order
                ])
                
                if (item.children !== null) {
                    if (item.children.length > 0) {
                        item.children.map((items, indexs) => {
                            handlePushChild(items)
                        })
                    }
                }
            }
            res.map((item, index) => {
                dataTable.push([
                    item.type_report_id,
                    item.id,
                    item.parent,
                    item.formula,
                    item.level,
                    item.description,
                    item.cash_flow.total_actual_before === null ? "0" : item.cash_flow.total_actual_before === "" ? "0" : item.cash_flow.total_actual_before,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.january, formula: item.cash_flow.january_formula } : item.cash_flow.january,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.february, formula: item.cash_flow.february_formula } : item.cash_flow.february,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.march, formula: item.cash_flow.march_formula } : item.cash_flow.march,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.april, formula: item.cash_flow.april_formula } : item.cash_flow.april,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.may, formula: item.cash_flow.may_formula } : item.cash_flow.may,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.june, formula: item.cash_flow.june_formula } : item.cash_flow.june,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.july, formula: item.cash_flow.july_formula } : item.cash_flow.july,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.august, formula: item.cash_flow.august_formula } : item.cash_flow.august,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.september, formula: item.cash_flow.september_formula } : item.cash_flow.september,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.october, formula: item.cash_flow.october_formula } : item.cash_flow.october,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.november, formula: item.cash_flow.november_formula } : item.cash_flow.november,
                    item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.december, formula: item.cash_flow.december_formula } : item.cash_flow.december,
                    item.cash_flow.total_current_year,
                    item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.cash_flow.total_next_year,
                    item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.cash_flow.total_more_year,
                    item.order
                ])
                if (item.children !== null) {
                    if (item.children.length > 0) {
                        item.children.map((items, indexs) => {
                            handlePushChild(items)
                        })
                    }
                }
            })
            this.setState({ dataTable, loading: false, dataReal: res, editable: true }, () => console.log(dataTable))
        })
d.arizona's avatar
d.arizona committed
130 131
    }

Deni Rinaldi's avatar
Deni Rinaldi committed
132
    render() {
d.arizona's avatar
d.arizona committed
133
        let dataTable2 = this.state.dataTable
d.arizona's avatar
d.arizona committed
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
        let columns = [{
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        }, {
            name: "",
            options: {
                display: false
            }
        },
d.arizona's avatar
d.arizona committed
160 161 162 163 164 165 166 167 168 169 170 171
            {
                name: "(In Rupiah million)",
                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 }}>
d.arizona's avatar
d.arizona committed
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
                                {tableMeta.rowData[24] ?
                                    tableMeta.rowData[24].length > 0 ?
                                        <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
                                            <LightTooltip title={"Report Items Not Registered"} arrow>
                                                <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
                                            </LightTooltip>
                                        </div>
                                        :
                                        tableMeta.rowData[4] == 0 ?
                                            <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
                                            :
                                            <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
                                                <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
                                            </div>
                                    :
                                    tableMeta.rowData[4] == 0 ?
                                        <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
                                        :
                                        <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
                                            <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
                                        </div>
                                }
d.arizona's avatar
d.arizona committed
194 195 196 197 198
                            </div>
                        )
                    }
                }
            },
d.arizona's avatar
d.arizona committed
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 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 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
            // {
            //     name: `MB 2021`,
            //     options: {
            //         customHeadRender: (columnMeta) => (
            //             <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
            //                 {/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
            //                     <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
            //                 </TableCell> */}
            //                 <div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
            //                 <div className="grid grid-3x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
            //                     <div className="column-1 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
            //                         <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"1"}</span>
            //                         </div>
            //                         <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"2"}</span>
            //                         </div>
            //                         <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"3"}</span>
            //                         </div>
            //                         <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"4"}</span>
            //                         </div>
            //                     </div>
            //                     <div className="column-2 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
            //                         <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"5"}</span>
            //                         </div>
            //                         <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"6"}</span>
            //                         </div>
            //                         <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"7"}</span>
            //                         </div>
            //                         <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"8"}</span>
            //                         </div>
                                    
            //                     </div>
            //                     <div className="column-3 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
            //                         <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"9"}</span>
            //                         </div>
            //                         <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"10"}</span>
            //                         </div>
            //                         <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
            //                             <span>{"11"}</span>
            //                         </div>
            //                         <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0' }}>
            //                             <span>{"12"}</span>
            //                         </div>
            //                     </div>
                                
            //                 </div>
            //             </th>
            //         ),
            //         setCellProps: () => ({ style2 }),
            //         customBodyRender: (val, tableMeta, updateValue) => {
            //             return (
            //                 <div>
            //                     <div className="grid grid-3x content-center">
            //                         <div className="grid grid-4x content-center">
            //                             <div className="col-1">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.a} */}
            //                                 </div>
            //                             </div>
            //                             <div className="col-2">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.b} */}
            //                                 </div>
            //                             </div>
            //                             <div className="col-3">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.c} */}
            //                                 </div>
            //                             </div>
            //                             <div className="col-4">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.c} */}
            //                                 </div>
            //                             </div>
            //                         </div>
            //                         <div className="grid grid-4x content-center">
            //                             <div className="col-1">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.a} */}
            //                                 </div>
            //                             </div>
            //                             <div className="col-2">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.b} */}
            //                                 </div>
            //                             </div>
            //                             <div className="col-3">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.c} */}
            //                                 </div>
            //                             </div>
            //                             <div className="col-4">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.c} */}
            //                                 </div>
            //                             </div>
            //                          </div>
            //                         <div className="grid grid-4x content-center">
            //                             <div className="col-1">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.a} */}
            //                                 </div>
            //                             </div>
            //                             <div className="col-2">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.b} */}
            //                                 </div>
            //                             </div>
            //                             <div className="col-3">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.c} */}
            //                                 </div>
            //                             </div>
            //                             <div className="col-4">
            //                                 <div style={{ textAlign: 'right', width: 90 }}>
            //                                     {/* {val.c} */}
            //                                 </div>
            //                             </div>
            //                         </div>
            //                     </div>
            //                 </div>
            //             )
            //         }
            //     }
            // },
d.arizona's avatar
d.arizona committed
333
            {
d.arizona's avatar
d.arizona committed
334
                name: `${Number(this.props.periode) + 1}`,
d.arizona's avatar
d.arizona committed
335 336
                options: {
                    customHeadRender: (columnMeta) => (
d.arizona's avatar
d.arizona committed
337
                        <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
d.arizona's avatar
d.arizona committed
338 339 340 341
                            {/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                                <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                            </TableCell> */}
                            <div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
d.arizona's avatar
d.arizona committed
342 343 344
                            <div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
                                <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0' }}>
                                    <span>{"ForeCast"}</span>
d.arizona's avatar
d.arizona committed
345 346 347 348 349
                                </div>
                            </div>
                        </th>
                    ),
                    setCellProps: () => ({ style2 }),
d.arizona's avatar
d.arizona committed
350
                    customBodyRender: (value, tableMeta, updateValue) => {
d.arizona's avatar
d.arizona committed
351
                        return (
d.arizona's avatar
d.arizona committed
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
                            <div style={{ textAlign: 'right' }}>
                                {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
                                    null
                                    :
                                    <div style={{ flex: 1 }}>
                                        <FormControlLabel
                                            style={{ margin: 0 }}
                                            value={value}
                                            control={
                                                <NumberFormat
                                                    thousandSeparator={true}
                                                    style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
                                                    type="text"
                                                    placeholder=""
                                                    value={Number(tableMeta[22]).toFixed(1)}
                                                    disabled={true}
                                                    decimalScale={1}
                                                    onBlur={(event) => {
                                                        // updateValue(event.target.value)
                                                        // handleChange(event.target.value, tableMeta)
                                                        console.log(dataTable2)
                                                    }}
                                                />
                                            }
                                        />
                                    </div>}
d.arizona's avatar
d.arizona committed
378 379 380 381 382 383
                            </div>
                        )
                    }
                }
            },
            {
d.arizona's avatar
d.arizona committed
384
                name: `${Number(this.props.periode) + 2}`,
d.arizona's avatar
d.arizona committed
385 386
                options: {
                    customHeadRender: (columnMeta) => (
d.arizona's avatar
d.arizona committed
387
                        <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, top: 0, zIndex: 102, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
d.arizona's avatar
d.arizona committed
388 389 390 391
                            {/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
                                <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
                            </TableCell> */}
                            <div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
d.arizona's avatar
d.arizona committed
392 393 394 395
                            <div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
                                <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0' }}>
                                    <span>{"ForeCast"}</span>
                                </div>
d.arizona's avatar
d.arizona committed
396
                            </div>
d.arizona's avatar
d.arizona committed
397
                        </th>
d.arizona's avatar
d.arizona committed
398 399 400 401
                    ),
                    setCellProps: () => ({ style2 }),
                    customBodyRender: (val, tableMeta, updateValue) => {
                        return (
d.arizona's avatar
d.arizona committed
402 403
                            <div>
                                {/* {val} */}
d.arizona's avatar
d.arizona committed
404 405 406 407 408 409
                            </div>
                        )
                    }
                }
            },
        ]
Deni Rinaldi's avatar
Deni Rinaldi committed
410 411 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 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
        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' }}>Pengajuan Budget Tahunan</Typography>
                </div>
                <div style={{ flex: 1, padding: 20, width: '100%' }}>
                    <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
                        <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
                            <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan - Cash Flow</Typography>
                        </div>
                        <div style={{ padding: 20 }}>
                                <div style={{ display: 'flex', justifyContent: 'space-between' }}>
                                    <div>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography>
                                        <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
                                    </div>
                                    <div style={{ width: '50%' }}>
                                        <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={() => null}
                                                >
                                                    <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={() => null}
                                                >
                                                    <img src={Images.upload} />
                                                </button>
                                            </a>
                                            <ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
                                            <a data-tip={'Download'} data-for="download">
                                                <button
                                                    style={{
                                                        backgroundColor: 'transparent',
                                                        cursor: 'pointer',
                                                        borderColor: 'transparent',
                                                        margin: 5
                                                    }}
                                                    onClick={() => null}
                                                >
                                                    <img src={Images.download} />
                                                </button>
                                            </a>
                                            <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
                                        </div>
                                    </div>
                                </div>

d.arizona's avatar
d.arizona committed
475
                                <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
476 477 478 479 480 481 482
                                    {!this.state.loading && <MuiThemeProvider theme={getMuiTheme()}>
                                        <MUIDataTable
                                            data={dataTable2}
                                            columns={columns}
                                            options={options}
                                        />
                                    </MuiThemeProvider>}
d.arizona's avatar
d.arizona committed
483
                                </div>
Deni Rinaldi's avatar
Deni Rinaldi committed
484 485 486 487 488 489 490
                            </div>
                    </Paper>
                </div>
            </div>
        )
    }
}