Commit 71f6d7fa authored by Deni Rinaldi's avatar Deni Rinaldi

bs++

parent 5ccd8333
import React, { Component } from 'react';
import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormControlLabel, TextField, Input } from '@material-ui/core';
import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormControlLabel, TextField, Input, Fab } from '@material-ui/core';
import MUIDataTable from 'mui-datatables';
import NumberFormat from 'react-number-format';
import api from '../../api';
import AddIcon from '@material-ui/icons/Add';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -106,7 +107,7 @@ export default class BalanceSheet extends Component {
itemss.formula,
itemss.level,
itemss.description
])
])
itemss.children.map(item1 => {
if (item1.children && item1.children.length > 0) {
dataTable.push([
......@@ -116,7 +117,7 @@ export default class BalanceSheet extends Component {
item1.formula,
item1.level,
item1.description
])
])
item1.children.map(item2 => {
if (item2.children && item2.children.length > 0) {
dataTable.push([
......@@ -126,7 +127,7 @@ export default class BalanceSheet extends Component {
item2.formula,
item2.level,
item2.description
])
])
item2.children.map(item3 => {
if (item3.children && item3.children.length > 0) {
dataTable.push([
......@@ -136,7 +137,7 @@ export default class BalanceSheet extends Component {
item3.formula,
item3.level,
item3.description
])
])
item3.children.map(item4 => {
if (item4.children && item4.children.length > 0) {
dataTable.push([
......@@ -146,7 +147,7 @@ export default class BalanceSheet extends Component {
item4.formula,
item4.level,
item4.description
])
])
} else {
dataTable.push([
item4.type_report_id,
......@@ -155,7 +156,7 @@ export default class BalanceSheet extends Component {
item4.formula,
item4.level,
item4.description
])
])
}
})
} else {
......@@ -166,7 +167,7 @@ export default class BalanceSheet extends Component {
item3.formula,
item3.level,
item3.description
])
])
}
})
} else {
......@@ -177,9 +178,9 @@ export default class BalanceSheet extends Component {
item2.formula,
item2.level,
item2.description
])
])
}
})
})
} else {
dataTable.push([
item1.type_report_id,
......@@ -188,7 +189,7 @@ export default class BalanceSheet extends Component {
item1.formula,
item1.level,
item1.description
])
])
}
})
} else {
......@@ -360,11 +361,11 @@ export default class BalanceSheet extends Component {
return (
<div style={{ width: 388 }}>
{tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(val).toUpperCase()}</span>
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ?"": val).toUpperCase()}</span>
:
tableMeta.rowData[4] === 1 ?
<span style={{ fontSize: 12, marginLeft: 20 * Number(tableMeta.rowData[4]) }}>{val}</span> :
<span style={{ fontSize: 12, marginLeft: 20 * Number(tableMeta.rowData[4]) }}>{val}</span>
<span style={{ fontSize: 12, marginLeft: 20 * Number(tableMeta.rowData[4])}}>{tableMeta.rowData[0] === 4 ? "" : val}</span> :
<span style={{ fontSize: 12, marginLeft: 20 * Number(tableMeta.rowData[4]) }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
}
</div>
)
......@@ -415,12 +416,12 @@ export default class BalanceSheet extends Component {
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
null
:
<span>validasi</span>
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div>
)
......@@ -437,7 +438,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -470,10 +471,13 @@ export default class BalanceSheet extends Component {
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
tableMeta.rowData[0] === 4 ?
null
:
<span>validasi</span>
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div>
)
......@@ -490,7 +494,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -523,10 +527,13 @@ export default class BalanceSheet extends Component {
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
tableMeta.rowData[0] === 4 ?
null
:
<span>validasi</span>
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div>
)
......@@ -576,10 +583,13 @@ export default class BalanceSheet extends Component {
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
tableMeta.rowData[0] === 4 ?
null
:
<span>validasi</span>
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div>
)
......@@ -596,7 +606,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -629,10 +639,13 @@ export default class BalanceSheet extends Component {
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
tableMeta.rowData[0] === 4 ?
null
:
<span>validasi</span>
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div>
)
......@@ -649,7 +662,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -682,10 +695,13 @@ export default class BalanceSheet extends Component {
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
tableMeta.rowData[0] === 4 ?
null
:
<span>validasi</span>
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div>
)
......@@ -702,7 +718,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -735,10 +751,13 @@ export default class BalanceSheet extends Component {
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
tableMeta.rowData[0] === 4 ?
null
:
<span>validasi</span>
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div>
)
......@@ -820,6 +839,11 @@ export default class BalanceSheet extends Component {
options={options}
/>
</MuiThemeProvider>
<Fab color="primary" aria-label="add" style={{ bottom: 0, right: 0, position: 'fixed' }} onClick={() => {
this.forceUpdate()
}}>
<AddIcon />
</Fab>
</div>
</div>
<div className="grid grid-2x">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment