Commit 0e10329f authored by r.kurnia's avatar r.kurnia

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 7013a73f e7dddda3
......@@ -280,6 +280,7 @@ const create = (type = "") => {
const uploadRollingOutlookOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/import_rolling_outlook', body)
const submitRollingOutlook = (body) => api.post('transaction/rolling_outlook/submit_rolling_outlook', body)
const getRollingOutlookCompanySubmitted = (body) => api.post('transaction/rolling_outlook/get_company_submitted', body)
const getRollingOutlookCF = (body) => api.post('transaction/cash_flow/rolling_outlook/get_report_hierarki', body)
//REPORT NEW
const getAllReportBS = (body) => api.post('/transaction/db_balance_sheet/get_report_hierarki', body)
......@@ -780,7 +781,8 @@ const create = (type = "") => {
createPeriodeRevisionOLPA,
approvalRolling,
createPeriodeRevisionRO,
historyApprovalRO
historyApprovalRO,
getRollingOutlookCF
}
}
......
......@@ -296,7 +296,7 @@ export default class BudgetTahunan extends Component {
item.revision,
this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : status_approv,
item.report_id,
Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload),
item.revision
]
})
......
......@@ -797,7 +797,7 @@ export default class CashFlow extends Component {
}
},
{
name: `MB 2021`,
name: `MB ${this.props.periode}`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
......
......@@ -129,6 +129,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
// this.setState({ viewOnly: true })
}
getParameterGroup() {
......@@ -978,11 +979,20 @@ export default class CorporateAnnualTargetMR extends Component {
if (forecast == undefined) {
// console.log(formulaAwal)
// console.log(tableMeta.rowData[17])
let convertID = -1
if (tableMeta.rowData[10] == 'FORMULA') {
let indexIDReport = dataTable2.findIndex((val) => val[1] == formulaAwal)
convertID = dataTable2[indexIDReport][18]
let indexID = dataTable2.findIndex((val) => val[18] == (convertID == -1 ? item : convertID))
let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
anjay.push(valuezz == "" ? 0 : valuezz)
} else {
let indexID = tableMeta.rowData[17].findIndex((val) => val.item_formula == String(`@${formulaAwal}`) && val.periode == Number(this.props.periode))
if (indexID !== -1) {
let valuezz = tableMeta.rowData[17][indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
}
} else {
// // // console.log(dataTable2[tableMeta.rowIndex][30])
let array = dataTable2[tableMeta.rowIndex][18].filter((val) => val.periode == Number(column))
......@@ -1010,7 +1020,12 @@ export default class CorporateAnnualTargetMR extends Component {
}
} else {
let indexID = dataTable2.findIndex((val) => val[18] == item)
let convertID = -1
if (tableMeta.rowData[10] == 'FORMULA') {
let indexIDReport = dataTable2.findIndex((val) => val[1] == item)
convertID = dataTable2[indexIDReport][18]
}
let indexID = dataTable2.findIndex((val) => val[18] == (convertID == -1 ? item : convertID))
if (indexID !== -1) {
let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
if (item == dataTable2[tableMeta.rowIndex][18]) {
......@@ -1027,8 +1042,12 @@ export default class CorporateAnnualTargetMR extends Component {
}
})
// if (tableMeta.rowData[10] == 'FORMULA') {
// // let indexIDReport = dataTable2.findIndex((val) => val[1] == item)
// // convertID = dataTable2[indexIDReport][18]
// console.log(baru)
// console.log(anjay)
// }
let anjay2 = []
let kurung = false
......@@ -1148,12 +1167,12 @@ export default class CorporateAnnualTargetMR extends Component {
}
})
total = dataTable2[tableMeta.rowIndex][5] == "ROIC" ? "0" : R.equals(total, NaN) ? "0.0" : total
if (dataTable2[tableMeta.rowIndex][5] == "ROIC") {
dataTable2[tableMeta.rowIndex][column] = 0
} else {
total = R.equals(total, NaN) ? "0.0" : total
// if (dataTable2[tableMeta.rowIndex][5] == "ROIC") {
// dataTable2[tableMeta.rowIndex][column] = 0
// } else {
dataTable2[tableMeta.rowIndex][column] = Number(total).toFixed(1)
}
// }
return Number(total).toFixed(1)
}
......@@ -1644,7 +1663,7 @@ export default class CorporateAnnualTargetMR extends Component {
style={{ color: this.state.get_for == 'view' ? "black" : handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) ? "#5198ea" : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={tableMeta.rowData[5] === "ROIC" ? Number(value).toFixed(1) : tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)).toFixed(1) : Number(value).toFixed(1)}
value={tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)).toFixed(1) : Number(value).toFixed(1)}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
disabled={this.state.get_for == 'view' ? true : !handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta)}
decimalScale={1}
......
......@@ -260,18 +260,7 @@ export default class RollingOutlook extends Component {
if (response.data) {
if (response.data.status === "success") {
let dataTable = response.data.data.map((item, index) => {
if (item.report_name =='CAT') {
dataHardcode.push([
item.number,
'Cash Flow',
item.revision,
this.state.isSubmit === false ? "CLOSED" : item.current_status,
999,
Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
item.revision
])
}
dataHardcode.push([
return [
item.number,
item.report_name,
item.revision,
......@@ -279,16 +268,7 @@ export default class RollingOutlook extends Component {
item.report_id,
Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
item.revision
])
// return [
// item.number,
// item.report_name,
// item.revision,
// this.state.isSubmit === false ? "CLOSED" : item.current_status,
// item.report_id,
// Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
// item.revision
// ]
]
})
let dataTableRevision = response.data.data.map((item, index) => {
return [
......@@ -298,7 +278,7 @@ export default class RollingOutlook extends Component {
]
})
// console.log(dataTable);
this.setState({ dataTable: dataHardcode, loading: false, dataTableRevision, dataForRevision: response.data.data })
this.setState({ dataTable, loading: false, dataTableRevision, dataForRevision: response.data.data })
}
} else {
this.setState({ loading: false })
......
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