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

RO simulasi

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