Commit 45f53a0e authored by faisalhamdi's avatar faisalhamdi

update fam & cat

parent fbe62400
...@@ -584,11 +584,23 @@ export default class BudgetTahunan extends Component { ...@@ -584,11 +584,23 @@ export default class BudgetTahunan extends Component {
)} )}
{this.state.visibleFAM && ( {this.state.visibleFAM && (
<FixedAssetsMovement <FixedAssetsMovement
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}
onClickClose={() => this.setState({ visibleFAM: false, visibleBudgetTahunan: true })} onClickClose={() => this.setState({ visibleFAM: false, visibleBudgetTahunan: true })}
/> />
)} )}
{this.state.visibleCAT && ( {this.state.visibleCAT && (
<CorporateAnnualTarget <CorporateAnnualTarget
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}
onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })} onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })}
/> />
)} )}
......
...@@ -45,6 +45,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -45,6 +45,8 @@ export default class CorporateAnnualTarget extends Component {
getItemHierarki() { getItemHierarki() {
let payload = { let payload = {
"report_id": this.props.report_id, "report_id": this.props.report_id,
"revision": Number(this.props.revision),
"periode": this.props.periode,
"company_id": this.props.company.company_id "company_id": this.props.company.company_id
} }
api.create().getItemReportHierarki(payload).then(response => { api.create().getItemReportHierarki(payload).then(response => {
...@@ -148,7 +150,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -148,7 +150,7 @@ export default class CorporateAnnualTarget extends Component {
let total = 0 let total = 0
this.state.dataTable.map((item, index) => { this.state.dataTable.map((item, index) => {
if (data.rowData[1] == item[2]) { if (data.rowData[1] == item[2]) {
total = item[data.columnIndex] == undefined ? (total + 0) : (total + item[data.columnIndex]) total = item[data.columnIndex] == undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex]))
} }
}) })
let indexParent = this.state.dataTable.findIndex((val) => val[1] == this.state.dataTable[data.rowIndex][2]) let indexParent = this.state.dataTable.findIndex((val) => val[1] == this.state.dataTable[data.rowIndex][2])
...@@ -162,14 +164,14 @@ export default class CorporateAnnualTarget extends Component { ...@@ -162,14 +164,14 @@ export default class CorporateAnnualTarget extends Component {
let data = this.state.dataTable let data = this.state.dataTable
let indexParent = data.findIndex((val) => val[1] == data[tableMeta.rowIndex][2]) let indexParent = data.findIndex((val) => val[1] == data[tableMeta.rowIndex][2])
if (indexParent > 0) { if (indexParent > 0) {
console.log(indexParent) // console.log(indexParent)
let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
let jagain = data[indexParent][tableMeta.columnIndex] let jagain = data[indexParent][tableMeta.columnIndex]
a = data[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val)) a = data[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val))
} else { } else {
data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
} }
this.forceUpdate() // this.forceUpdate()
// console.log(this.state.dataTable) // console.log(this.state.dataTable)
// this.setState({ // this.setState({
// data: a, // data: a,
...@@ -177,6 +179,32 @@ export default class CorporateAnnualTarget extends Component { ...@@ -177,6 +179,32 @@ export default class CorporateAnnualTarget extends Component {
} }
render() { render() {
// let dataTable2 = this.state.dataTable
// const handleChange = (value, tableMeta) => {
// let val = String(value).split(",").join("")
// // let data = this.state.dataTable2
// let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
// if (indexParent > 0) {
// // console.log(indexParent)
// let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// let jagain = dataTable2[indexParent][tableMeta.columnIndex]
// a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val))
// } else {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// }
// }
// const handleValue = (data) => {
// let total = 0
// dataTable2.map((item, index) => {
// if (data.rowData[1] == item[2]) {
// total = item[data.columnIndex] == undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex]))
// }
// })
// let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[data.rowIndex][2])
// let a = dataTable2[data.rowIndex][data.columnIndex] = Number(total)
// // console.log(indexParent);
// return a
// }
const columns = [{ const columns = [{
name: "", name: "",
options: { options: {
...@@ -207,7 +235,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -207,7 +235,7 @@ export default class CorporateAnnualTarget extends Component {
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#354960', width: 388 }}> <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#354960', width: 388 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style }), setCellProps: () => ({ style }),
...@@ -229,7 +257,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -229,7 +257,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Weight", name: "Weight",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style2, top: 0, zIndex: 102, backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -260,19 +288,6 @@ export default class CorporateAnnualTarget extends Component { ...@@ -260,19 +288,6 @@ export default class CorporateAnnualTarget extends Component {
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
control={ control={
// <Input
// value={this.formatValue(value)}
// style={{}}
// inputProps={{
// style: {
// color: "#5198ea",
// fontSize: 12,
// textAlign: 'right'
// }
// }}
// disableUnderline={true}
// inputStyle={{ color: 'red' }}
// />
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -339,7 +354,23 @@ export default class CorporateAnnualTarget extends Component { ...@@ -339,7 +354,23 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "January 2021", name: "2020",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "Jan 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
...@@ -355,7 +386,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -355,7 +386,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "February 2021", name: "Feb 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
...@@ -371,7 +402,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -371,7 +402,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "March 2021", name: "Mar 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
...@@ -387,7 +418,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -387,7 +418,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "April 2021", name: "Apr 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
...@@ -419,7 +450,135 @@ export default class CorporateAnnualTarget extends Component { ...@@ -419,7 +450,135 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "June 2021", name: "Jun 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "Jul 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "Aug 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "Sep 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "Oct 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "Nop 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "Dec 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "2021 Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "2022 Total",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
...@@ -435,7 +594,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -435,7 +594,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "31 Dec 2021 Total", name: "2023 Total",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
...@@ -451,7 +610,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -451,7 +610,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "31 Dec 2022 Total", name: "Strategic Initiative",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
...@@ -467,7 +626,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -467,7 +626,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "31 Dec 2023 Total", name: "PIC",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
...@@ -493,12 +652,12 @@ export default class CorporateAnnualTarget extends Component { ...@@ -493,12 +652,12 @@ export default class CorporateAnnualTarget extends Component {
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}> <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} > <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget - Fixed Assets Movement</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget - Corporate Annual Target</Typography>
</div> </div>
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>PT. XYZ</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : 2021</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : {this.props.periode}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
...@@ -525,15 +684,15 @@ export default class CorporateAnnualTarget extends Component { ...@@ -525,15 +684,15 @@ export default class CorporateAnnualTarget extends Component {
onClick={() => this.props.onClickClose()} onClick={() => this.props.onClickClose()}
> >
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Kembali</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%'}}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960', marginRight: 20 }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography>
</div> </div>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography>
</div> </div>
</div> </div>
......
...@@ -45,6 +45,8 @@ export default class FixedAssetsMovement extends Component { ...@@ -45,6 +45,8 @@ export default class FixedAssetsMovement extends Component {
getItemHierarki() { getItemHierarki() {
let payload = { let payload = {
"report_id": this.props.report_id, "report_id": this.props.report_id,
"revision": Number(this.props.revision),
"periode": this.props.periode,
"company_id": this.props.company.company_id "company_id": this.props.company.company_id
} }
api.create().getItemReportHierarki(payload).then(response => { api.create().getItemReportHierarki(payload).then(response => {
...@@ -148,7 +150,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -148,7 +150,7 @@ export default class FixedAssetsMovement extends Component {
let total = 0 let total = 0
this.state.dataTable.map((item, index) => { this.state.dataTable.map((item, index) => {
if (data.rowData[1] == item[2]) { if (data.rowData[1] == item[2]) {
total = item[data.columnIndex] == undefined ? (total + 0) : (total + item[data.columnIndex]) total = item[data.columnIndex] == undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex]))
} }
}) })
let indexParent = this.state.dataTable.findIndex((val) => val[1] == this.state.dataTable[data.rowIndex][2]) let indexParent = this.state.dataTable.findIndex((val) => val[1] == this.state.dataTable[data.rowIndex][2])
...@@ -162,18 +164,44 @@ export default class FixedAssetsMovement extends Component { ...@@ -162,18 +164,44 @@ export default class FixedAssetsMovement extends Component {
let data = this.state.dataTable let data = this.state.dataTable
let indexParent = data.findIndex((val) => val[1] == data[tableMeta.rowIndex][2]) let indexParent = data.findIndex((val) => val[1] == data[tableMeta.rowIndex][2])
if (indexParent > 0) { if (indexParent > 0) {
console.log(indexParent) // console.log(indexParent)
let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
let jagain = data[indexParent][tableMeta.columnIndex] let jagain = data[indexParent][tableMeta.columnIndex]
a = data[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val)) a = data[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val))
} else { } else {
data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
} }
this.forceUpdate() // this.forceUpdate()
// console.log(this.state.dataTable) // console.log(this.state.dataTable)
} }
render() { render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta) => {
let val = String(value).split(",").join("")
// let data = this.state.dataTable2
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
if (indexParent > 0) {
// console.log(indexParent)
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
let jagain = dataTable2[indexParent][tableMeta.columnIndex]
a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val))
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
}
}
const handleValue = (data) => {
let total = 0
dataTable2.map((item, index) => {
if (data.rowData[1] == item[2]) {
total = item[data.columnIndex] == undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex]))
}
})
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[data.rowIndex][2])
let a = dataTable2[data.rowIndex][data.columnIndex] = Number(total)
// console.log(indexParent);
return a
}
const columns = [{ const columns = [{
name: "", name: "",
options: { options: {
...@@ -212,11 +240,11 @@ export default class FixedAssetsMovement extends Component { ...@@ -212,11 +240,11 @@ export default class FixedAssetsMovement extends Component {
return ( return (
<div style={{ width: 388 }}> <div style={{ width: 388 }}>
{tableMeta.rowData[4] == 0 ? {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 ? 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]) }}>{tableMeta.rowData[0] === 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>
} }
</div> </div>
) )
...@@ -230,10 +258,11 @@ export default class FixedAssetsMovement extends Component { ...@@ -230,10 +258,11 @@ export default class FixedAssetsMovement extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -245,10 +274,10 @@ export default class FixedAssetsMovement extends Component { ...@@ -245,10 +274,10 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
onChange={event => { onBlur={(event) => {
// console.log(event.target) // updateValue(event.target.value)
updateValue(event.target.value) handleChange(event.target.value, tableMeta)
this.handleChange(event.target.value, tableMeta) console.log(dataTable2)
}} }}
/> />
} }
...@@ -262,14 +291,32 @@ export default class FixedAssetsMovement extends Component { ...@@ -262,14 +291,32 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.handleValue(tableMeta)} value={handleValue(tableMeta)}
/> />
</span> </span>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 4 ?
<span>-</span> null
: :
<span>validasi</span> tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
} }
</div> </div>
) )
...@@ -283,11 +330,11 @@ export default class FixedAssetsMovement extends Component { ...@@ -283,11 +330,11 @@ export default class FixedAssetsMovement extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -299,10 +346,10 @@ export default class FixedAssetsMovement extends Component { ...@@ -299,10 +346,10 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
onChange={event => { onBlur={(event) => {
// console.log(event.target) // updateValue(event.target.value)
updateValue(event.target.value) handleChange(event.target.value, tableMeta)
this.handleChange(event.target.value, tableMeta) console.log(dataTable2)
}} }}
/> />
} }
...@@ -316,14 +363,32 @@ export default class FixedAssetsMovement extends Component { ...@@ -316,14 +363,32 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.handleValue(tableMeta)} value={handleValue(tableMeta)}
/> />
</span> </span>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 4 ?
<span>-</span> null
: :
<span>validasi</span> tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
} }
</div> </div>
) )
...@@ -337,10 +402,11 @@ export default class FixedAssetsMovement extends Component { ...@@ -337,10 +402,11 @@ export default class FixedAssetsMovement extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -352,10 +418,10 @@ export default class FixedAssetsMovement extends Component { ...@@ -352,10 +418,10 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
onChange={event => { onBlur={(event) => {
// console.log(event.target) // updateValue(event.target.value)
updateValue(event.target.value) handleChange(event.target.value, tableMeta)
this.handleChange(event.target.value, tableMeta) console.log(dataTable2)
}} }}
/> />
} }
...@@ -369,14 +435,32 @@ export default class FixedAssetsMovement extends Component { ...@@ -369,14 +435,32 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.handleValue(tableMeta)} value={handleValue(tableMeta)}
/> />
</span> </span>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 4 ?
<span>-</span> null
: :
<span>validasi</span> tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
} }
</div> </div>
) )
...@@ -390,10 +474,11 @@ export default class FixedAssetsMovement extends Component { ...@@ -390,10 +474,11 @@ export default class FixedAssetsMovement extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -405,10 +490,10 @@ export default class FixedAssetsMovement extends Component { ...@@ -405,10 +490,10 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
onChange={event => { onBlur={(event) => {
// console.log(event.target) // updateValue(event.target.value)
updateValue(event.target.value) handleChange(event.target.value, tableMeta)
this.handleChange(event.target.value, tableMeta) console.log(dataTable2)
}} }}
/> />
} }
...@@ -422,14 +507,32 @@ export default class FixedAssetsMovement extends Component { ...@@ -422,14 +507,32 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.handleValue(tableMeta)} value={handleValue(tableMeta)}
/> />
</span> </span>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 4 ?
<span>-</span> null
: :
<span>validasi</span> tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
} }
</div> </div>
) )
...@@ -443,10 +546,11 @@ export default class FixedAssetsMovement extends Component { ...@@ -443,10 +546,11 @@ export default class FixedAssetsMovement extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -458,10 +562,10 @@ export default class FixedAssetsMovement extends Component { ...@@ -458,10 +562,10 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
onChange={event => { onBlur={(event) => {
// console.log(event.target) // updateValue(event.target.value)
updateValue(event.target.value) handleChange(event.target.value, tableMeta)
this.handleChange(event.target.value, tableMeta) console.log(dataTable2)
}} }}
/> />
} }
...@@ -475,14 +579,32 @@ export default class FixedAssetsMovement extends Component { ...@@ -475,14 +579,32 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.handleValue(tableMeta)} value={handleValue(tableMeta)}
/> />
</span> </span>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 4 ?
<span>-</span> null
: :
<span>validasi</span> tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
} }
</div> </div>
) )
...@@ -496,10 +618,11 @@ export default class FixedAssetsMovement extends Component { ...@@ -496,10 +618,11 @@ export default class FixedAssetsMovement extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -511,10 +634,10 @@ export default class FixedAssetsMovement extends Component { ...@@ -511,10 +634,10 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
onChange={event => { onBlur={(event) => {
// console.log(event.target) // updateValue(event.target.value)
updateValue(event.target.value) handleChange(event.target.value, tableMeta)
this.handleChange(event.target.value, tableMeta) console.log(dataTable2)
}} }}
/> />
} }
...@@ -528,14 +651,32 @@ export default class FixedAssetsMovement extends Component { ...@@ -528,14 +651,32 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.handleValue(tableMeta)} value={handleValue(tableMeta)}
/> />
</span> </span>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 4 ?
<span>-</span> null
: :
<span>validasi</span> tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
} }
</div> </div>
) )
...@@ -549,10 +690,11 @@ export default class FixedAssetsMovement extends Component { ...@@ -549,10 +690,11 @@ export default class FixedAssetsMovement extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -564,10 +706,10 @@ export default class FixedAssetsMovement extends Component { ...@@ -564,10 +706,10 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
onChange={event => { onBlur={(event) => {
// console.log(event.target) // updateValue(event.target.value)
updateValue(event.target.value) handleChange(event.target.value, tableMeta)
this.handleChange(event.target.value, tableMeta) console.log(dataTable2)
}} }}
/> />
} }
...@@ -581,63 +723,681 @@ export default class FixedAssetsMovement extends Component { ...@@ -581,63 +723,681 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.handleValue(tableMeta)} value={handleValue(tableMeta)}
/> />
</span> </span>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 4 ?
<span>-</span> null
: :
<span>validasi</span> tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
} }
</div> </div>
) )
} }
} }
}, { }, {
name: "31 Dec 2021 Total", name: "July 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
customBodyRender: (val) => { setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 96 }}> <div style={{ textAlign: 'right' }}>
{val} {tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 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}
value={handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
}
</div> </div>
) )
} }
} }
}, { }, {
name: "31 Dec 2022 Total", name: "August 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
customBodyRender: (val) => { setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 96 }}> <div style={{ textAlign: 'right' }}>
{val} {tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 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}
value={handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
}
</div> </div>
) )
} }
} }
}, { }, {
name: "31 Dec 2023 Total", name: "September 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
customBodyRender: (val) => { setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 96 }}> <div style={{ textAlign: 'right' }}>
{val} {tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 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}
value={handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
}
</div>
)
}
}
}, {
name: "October 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 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}
value={handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
}
</div>
)
}
}
}, {
name: "November 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 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}
value={handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
}
</div>
)
}
}
}, {
name: "December 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 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}
value={handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
}
</div>
)
}
}
}, {
name: "Current Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 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}
value={handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
}
</div>
)
}
}
}, {
name: "31 Dec 2022 Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 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}
value={handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
}
</div>
)
}
}
}, {
name: "31 Dec 2023 Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 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}
value={handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
}
</div> </div>
) )
} }
...@@ -645,6 +1405,8 @@ export default class FixedAssetsMovement extends Component { ...@@ -645,6 +1405,8 @@ export default class FixedAssetsMovement extends Component {
} }
] ]
// console.log(this.props.width);
return ( return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}> <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 }}> <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
...@@ -658,14 +1420,14 @@ export default class FixedAssetsMovement extends Component { ...@@ -658,14 +1420,14 @@ export default class FixedAssetsMovement extends Component {
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : 2021</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : {this.props.periode}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ marginTop: 20, width: '100%' }}> <div style={{ marginTop: 20, width: this.props.width - 200, height: this.props.height-200 }}>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={this.state.dataTable} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
...@@ -693,9 +1455,23 @@ export default class FixedAssetsMovement extends Component { ...@@ -693,9 +1455,23 @@ export default class FixedAssetsMovement extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960', marginRight: 20 }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography>
</div> </div>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography>
</div> </div>
<button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
}}
onClick={() => this.forceUpdate()}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Calculate</Typography>
</div>
</button>
</div> </div>
</div> </div>
</Paper> </Paper>
......
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