Commit a81d9c62 authored by EKSAD's avatar EKSAD

apdet pl

parent babf96c2
......@@ -668,7 +668,6 @@ export default class BudgetTahunan extends Component {
saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visiblePL: false, visibleBudgetTahunan: true })}
getReport={this.getReport.bind(this)}
getReportAttachment={this.getReportAttachment.bind(this)}
/>
)}
......
......@@ -33,7 +33,8 @@ export default class ProfitLoss extends Component {
this.state = {
dataTable: [],
visibleProfitLoss: true,
disabledSave: true
disabledSave: true,
editable: false
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -193,7 +194,7 @@ export default class ProfitLoss extends Component {
"status": type,
"profit_loss": data
}
console.log(payload);
console.log(data);
this.props.saveToMasterBudget(payload)
this.props.onClickClose()
}
......@@ -245,7 +246,7 @@ export default class ProfitLoss extends Component {
december: i[15] === undefined ? "" : String(i[15]).trim(),
total_current_year: i[16] === undefined ? "" : String(i[16]).trim(),
total_next_year: i[17] === undefined ? "" : String(i[17]).trim(),
total_more_year: i[18] === undefined ? "" : String(i[18]).trim()
total_more_year: i[17] === undefined ? "" : String(i[18]).trim()
})
}
})
......@@ -2066,7 +2067,7 @@ export default class ProfitLoss extends Component {
</div>
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150), height: this.props.height - 400 }}>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150)}}>
{!this.state.loading && <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
......@@ -2080,7 +2081,7 @@ export default class ProfitLoss extends Component {
<div className="col-1">
<button
type="button"
onClick={() => this.backToMasterBudget('draft')}
onClick={() => this.state.editable === true ? this.backToMasterBudget('draft') : this.props.onClickClose()}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
......@@ -2140,7 +2141,7 @@ export default class ProfitLoss extends Component {
onClick={() => {
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false, disabledSave: false })
this.setState({ loading: false, disabledSave: false, editable: true })
}, 100);
})
}}
......
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