Commit f474e325 authored by faisalhamdi's avatar faisalhamdi

olpa bs!

parent e15ac065
......@@ -287,7 +287,7 @@ export default class BalanceSheetOLPA extends Component {
"status": type,
"balance_sheet": data
}
// console.log(data);
console.log(data);
this.setState({ loading: false })
this.props.saveToOLPA(payload)
this.props.onClickClose()
......@@ -348,7 +348,7 @@ export default class BalanceSheetOLPA extends Component {
report_id: this.props.report_id,
balance_sheet: payload
}
// console.log(body)
console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] })
}
});
......@@ -394,11 +394,11 @@ export default class BalanceSheetOLPA extends Component {
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.state.dataTable.map(item => {
if (item[24].length > 0) {
// console.log('masuk')
console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true })
}
})
// console.log(this.state.dataTable);
console.log(this.state.dataTable);
})
}
}
......@@ -436,7 +436,7 @@ export default class BalanceSheetOLPA extends Component {
}
// console.log(JSON.stringify(body));
api.create('UPLOAD').uploadOLPA(body).then(response => {
// console.log(response);
console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.props.onClickClose()
......@@ -516,6 +516,7 @@ export default class BalanceSheetOLPA extends Component {
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta, type) => {
console.log(dataTable2);
let val = String(value).split(",").join("")
if (type === "actual") {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
......@@ -1711,7 +1712,7 @@ export default class BalanceSheetOLPA extends Component {
}
}
}, {
name: "Current Total",
name: `31 Dec ${this.props.periode} Total`,
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
......@@ -1749,7 +1750,6 @@ export default class BalanceSheetOLPA extends Component {
disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
......@@ -1758,37 +1758,37 @@ export default class BalanceSheetOLPA extends Component {
/>
</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={Number(handleValue(tableMeta)).toFixed(1)}
// />
// </span>
<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=""
disabled={true}
// disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value={Number(value).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
<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={Number(handleValue(tableMeta)).toFixed(1)}
/>
</div>
</span>
// <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=""
// disabled={true}
// // disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
// value={Number(value).toFixed(1)}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// // console.log(dataTable2)
// }}
// />
// }
// />
// </div>
:
tableMeta.rowData[0] === 4 ?
null
......@@ -1800,7 +1800,8 @@ export default class BalanceSheetOLPA extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
// value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
/>
// <div style={{ flex: 1 }}>
// <FormControlLabel
......@@ -1830,7 +1831,8 @@ export default class BalanceSheetOLPA extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta)).toFixed(1)}
// value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
/>
// <div style={{ flex: 1 }}>
// <FormControlLabel
......
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