Commit 016f707e authored by Riri Novita's avatar Riri Novita

RO simulasi

parent cf63463e
......@@ -606,7 +606,7 @@ export default class RollingOutlook extends Component {
})
}
getRollingOutlookID(type) {
getRollingOutlookID(type, trigger) {
this.setState({ loading: true })
let payload = {
"company_id": this.state.company.company_id,
......@@ -653,7 +653,7 @@ export default class RollingOutlook extends Component {
this.getLatestPeriodSubmit()
if (type != undefined && type == 'PL') {
// this.getCashFlow(type)
this.getPL(type)
this.getPL(type, trigger)
} else if (type != undefined && type == 'BS') {
let bodyRatioBs = {
"report": 'ratio',
......@@ -1017,7 +1017,7 @@ export default class RollingOutlook extends Component {
}
}
getPL(type) {
getPL(type, trigger) {
let PLID = null
let payloadID = {
"periode": this.state.periode.periode,
......@@ -1128,7 +1128,7 @@ export default class RollingOutlook extends Component {
})
// console.log(dataTable)
this.setState({ dbPL: dataTable }, () => {
this.olahDataPL(this.state.dbPL, type)
this.olahDataPL(this.state.dbPL, type, trigger)
})
} else {
this.setState({ dbPL: [], previewTable: false, previewDownload: false })
......@@ -1367,7 +1367,7 @@ export default class RollingOutlook extends Component {
return total
}
olahDataPL(dbPL, type) {
olahDataPL(dbPL, type, trigger) {
dbPL.map((item, index) => {
if (item[0] == 5 || item[0] == 6 || item[0] == 7) {
item[7].value = this.handleValueFormulaDBPL(index, item[7], item, 7)
......@@ -1387,11 +1387,11 @@ export default class RollingOutlook extends Component {
}
})
this.setState({ dbPL }, () => {
this.payloadPL(type)
this.payloadPL(type, trigger)
})
}
payloadPL(type) {
payloadPL(type, trigger) {
let listPL = []
// console.log(this.state.dbPL)
this.state.dbPL.map((item, index) => {
......@@ -1486,13 +1486,13 @@ export default class RollingOutlook extends Component {
if (type != undefined) {
if (type == 'PL') {
console.log('tarik sis')
this.createDBPL()
this.createDBPL(trigger)
}
}
})
}
createDBPL() {
createDBPL(trigger) {
let payload = {
// "submission_id": this.state.submissionID,
"company_id": this.state.company.company_id,
......@@ -1506,10 +1506,14 @@ export default class RollingOutlook extends Component {
}
console.log(this.state.dbPL)
// console.log(JSON.stringify(payload))
api.create().createDBPLRO(payload).then((res) => {
console.log(res)
this.setState({ loading: false })
})
if (trigger === 'simulasiPL') {
} else {
api.create().createDBPLRO(payload).then((res) => {
console.log(res)
this.setState({ loading: false })
})
}
}
handleApproveAdmin() {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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