Commit e8fffeb3 authored by EKSAD's avatar EKSAD

PL

parent fedb60a2
...@@ -44,7 +44,8 @@ export default class ProfitLoss extends Component { ...@@ -44,7 +44,8 @@ export default class ProfitLoss extends Component {
visibleProfitLoss: true, visibleProfitLoss: true,
disabledSave: true, disabledSave: true,
editable: false, editable: false,
buttonError: false buttonError: false,
judulColumn: null
} }
this.handleValue = this.handleValue.bind(this) this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -56,7 +57,7 @@ export default class ProfitLoss extends Component { ...@@ -56,7 +57,7 @@ export default class ProfitLoss extends Component {
} }
getItemHierarki() { getItemHierarki() {
this.setState({ loading: true }) this.setState({ loading: true, judulColumn: null })
let payload = { let payload = {
"report_id": this.props.report_id, "report_id": this.props.report_id,
"revision": Number(this.props.revision), "revision": Number(this.props.revision),
...@@ -67,6 +68,7 @@ export default class ProfitLoss extends Component { ...@@ -67,6 +68,7 @@ export default class ProfitLoss extends Component {
api.create().getDetailReportMB(payload).then(response => { api.create().getDetailReportMB(payload).then(response => {
console.log(response); console.log(response);
let dataTable = [] let dataTable = []
if (response.data) {
let res = response.data.data let res = response.data.data
console.log(res) console.log(res)
const handlePushChild = (item) => { const handlePushChild = (item) => {
...@@ -80,7 +82,7 @@ export default class ProfitLoss extends Component { ...@@ -80,7 +82,7 @@ export default class ProfitLoss extends Component {
item.level, item.level,
item.description, item.description,
item.profit_loss.notes === "" ? null : item.profit_loss.notes, item.profit_loss.notes === "" ? null : item.profit_loss.notes,
item.profit_loss.total_actual_before, item.profit_loss.total_actual_before === null ? "0" : item.balance_sheet.total_actual_before === "" ? "0" : item.balance_sheet.total_actual_before,
item.profit_loss.january, item.profit_loss.january,
item.profit_loss.february, item.profit_loss.february,
item.profit_loss.march, item.profit_loss.march,
...@@ -115,7 +117,7 @@ export default class ProfitLoss extends Component { ...@@ -115,7 +117,7 @@ export default class ProfitLoss extends Component {
item.level, item.level,
item.description, item.description,
item.profit_loss.notes === "" ? null : item.profit_loss.notes, item.profit_loss.notes === "" ? null : item.profit_loss.notes,
item.profit_loss.total_actual_before, item.profit_loss.total_actual_before === null ? "0" : item.balance_sheet.total_actual_before === "" ? "0" : item.balance_sheet.total_actual_before,
item.profit_loss.january, item.profit_loss.january,
item.profit_loss.february, item.profit_loss.february,
item.profit_loss.march, item.profit_loss.march,
...@@ -141,6 +143,9 @@ export default class ProfitLoss extends Component { ...@@ -141,6 +143,9 @@ export default class ProfitLoss extends Component {
} }
}) })
this.setState({ dataTable, loading: false, buttonError: true }) this.setState({ dataTable, loading: false, buttonError: true })
} else {
this.setState({ dataTable, loading: false, buttonError: true })
}
}) })
} }
......
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