Commit f474e325 authored by faisalhamdi's avatar faisalhamdi

olpa bs!

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