Commit 9f1486a0 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'riri' into 'master'

apdet pl

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