Commit a66410f6 authored by Deni Rinaldi's avatar Deni Rinaldi

createCF+quartal+CAT

parent 4bedd07a
......@@ -282,6 +282,7 @@ const create = (type = "") => {
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)
const createRollingOutlookCF = (body) => api.post('transaction/cash_flow/rolling_outlook/create_rolling_outlook', body)
//REPORT NEW
const getAllReportBS = (body) => api.post('/transaction/db_balance_sheet/get_report_hierarki', body)
......@@ -784,7 +785,8 @@ const create = (type = "") => {
approvalRolling,
createPeriodeRevisionRO,
historyApprovalRO,
getRollingOutlookCF
getRollingOutlookCF,
createRollingOutlookCF
}
}
......
......@@ -62,6 +62,7 @@ export default class BalanceSheetRO extends Component {
}
componentDidMount() {
console.log(this.props);
// this.getItemHierarki()
this.getLatestUpdate()
this.getSettingControl()
......@@ -1065,6 +1066,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 6)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 6)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1196,6 +1198,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 7)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 7)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1327,6 +1330,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 8)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 8)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1458,6 +1462,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 9)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 9)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1589,6 +1594,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 10)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 10)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1720,6 +1726,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 11)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 11)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1851,6 +1858,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 12)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 12)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1982,6 +1990,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 13)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 13)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -2113,6 +2122,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 14)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 14)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -2244,6 +2254,7 @@ export default class BalanceSheetRO extends Component {
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(tableMeta, 15)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 15)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......
......@@ -86,6 +86,7 @@ export default class CashFlow extends Component {
}
componentDidMount() {
console.log(this.props);
this.setState({ loading: true })
this.getSettingControl()
// console.log(this.props.PLBSFAMSubmitted)
......@@ -256,27 +257,23 @@ export default class CashFlow extends Component {
}
async downloadAllData() {
// let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
// console.log(url);
let resReal = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&report_id=${this.props.report_id}`
let resNull = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&report_id=${this.props.report_id}`
// alert('Coming Soon ...')
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${this.props.rollingOutlookID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&quartal=${this.props.quarter}`
console.log(url);
let res = await fetch(
this.props.submissionID == null ? resNull : resReal
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${this.props.rollingOutlookID === null ? "" : this.props.rollingOutlookID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&quartal=${this.props.quarter}`
)
console.log(this.props.submissionID);
console.log(resReal)
console.log(resNull)
res = await res.blob()
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Master Budget Cash Flow.xlsx';
a.download = 'Rolling Outlook Cash Flow.xlsx';
a.click();
this.setState({ loading: false })
} else {
this.setState({ loading: false })
}
setTimeout(() => {
this.setState({ loading: false })
}, 500);
}
closeAlert() {
......@@ -288,33 +285,48 @@ export default class CashFlow extends Component {
let listCF = []
dataTable2.map((item, index) => {
listCF.push(
// {
// "item_report_id": item[1],
// "parent": item[2],
// "formula": String(item[3]),
// "item_name": item[5],
// "january": String(item[7].value == undefined ? item[7] : Number(item[7].value).toFixed(1)),
// "february": String(item[8].value == undefined ? item[8] : Number(item[8].value).toFixed(1)),
// "march": String(item[9].value == undefined ? item[9] : Number(item[9].value).toFixed(1)),
// "april": String(item[10].value == undefined ? item[10] : Number(item[10].value).toFixed(1)),
// "may": String(item[11].value == undefined ? item[11] : Number(item[11].value).toFixed(1)),
// "june": String(item[12].value == undefined ? item[12] : Number(item[12].value).toFixed(1)),
// "july": String(item[13].value == undefined ? item[13] : Number(item[13].value).toFixed(1)),
// "august": String(item[14].value == undefined ? item[14] : Number(item[14].value).toFixed(1)),
// "september": String(item[15].value == undefined ? item[15] : Number(item[15].value).toFixed(1)),
// "october": String(item[16].value == undefined ? item[16] : Number(item[16].value).toFixed(1)),
// "november": String(item[17].value == undefined ? item[17] : Number(item[17].value).toFixed(1)),
// "december": String(item[18].value == undefined ? item[18] : Number(item[18].value).toFixed(1)),
// "total_current_year": String(item[19] != '' ? Number(item[19]).toFixed(1) : item[19]),
// "total_next_year": String(item[20] != '' ? Number(item[20]).toFixed(1) : item[20]),
// "total_more_year": String(item[21] != '' ? Number(item[21]).toFixed(1) : item[21]),
// "kpi_type": "",
// "max_ach": "",
// "pic": "",
// "strategic": "",
// "total_actual_before": "",
// "uom": "",
// "weight": ""
// }
{
"item_report_id": item[1],
"parent": item[2],
"formula": String(item[3]),
"item_name": item[5],
"january": String(item[7].value == undefined ? item[7] : Number(item[7].value).toFixed(1)),
"february": String(item[8].value == undefined ? item[8] : Number(item[8].value).toFixed(1)),
"march": String(item[9].value == undefined ? item[9] : Number(item[9].value).toFixed(1)),
"april": String(item[10].value == undefined ? item[10] : Number(item[10].value).toFixed(1)),
"may": String(item[11].value == undefined ? item[11] : Number(item[11].value).toFixed(1)),
"june": String(item[12].value == undefined ? item[12] : Number(item[12].value).toFixed(1)),
"july": String(item[13].value == undefined ? item[13] : Number(item[13].value).toFixed(1)),
"august": String(item[14].value == undefined ? item[14] : Number(item[14].value).toFixed(1)),
"september": String(item[15].value == undefined ? item[15] : Number(item[15].value).toFixed(1)),
"october": String(item[16].value == undefined ? item[16] : Number(item[16].value).toFixed(1)),
"november": String(item[17].value == undefined ? item[17] : Number(item[17].value).toFixed(1)),
"december": String(item[18].value == undefined ? item[18] : Number(item[18].value).toFixed(1)),
"total_current_year": String(item[19] != '' ? Number(item[19]).toFixed(1) : item[19]),
"total_next_year": String(item[20] != '' ? Number(item[20]).toFixed(1) : item[20]),
"total_more_year": String(item[21] != '' ? Number(item[21]).toFixed(1) : item[21]),
"kpi_type": "",
"max_ach": "",
"pic": "",
"strategic": "",
"total_actual_before": "",
"uom": "",
"weight": ""
"january": String(item[6].value == undefined ? item[6] : Number(item[6].value).toFixed(1)),
"february": String(item[7].value == undefined ? item[7] : Number(item[7].value).toFixed(1)),
"march": String(item[8].value == undefined ? item[8] : Number(item[8].value).toFixed(1)),
"april": String(item[9].value == undefined ? item[9] : Number(item[9].value).toFixed(1)),
"may": String(item[10].value == undefined ? item[10] : Number(item[10].value).toFixed(1)),
"june": String(item[11].value == undefined ? item[11] : Number(item[11].value).toFixed(1)),
"july": String(item[12].value == undefined ? item[12] : Number(item[12].value).toFixed(1)),
"august": String(item[13].value == undefined ? item[13] : Number(item[13].value).toFixed(1)),
"september": String(item[14].value == undefined ? item[14] : Number(item[14].value).toFixed(1)),
"october": String(item[15].value == undefined ? item[15] : Number(item[15].value).toFixed(1)),
"november": String(item[16].value == undefined ? item[16] : Number(item[16].value).toFixed(1)),
"december": String(item[17].value == undefined ? item[17] : Number(item[17].value).toFixed(1)),
}
)
})
......@@ -325,25 +337,44 @@ export default class CashFlow extends Component {
createCashFlow(dbcf) {
let payload = {
"submission_id": this.props.submissionID,
"rolling_outlook_id": this.props.rollingOutlookID,
"company_id": this.props.company.company_id,
"periode": this.props.periode,
"report_id": 6,
"report_id": this.props.report_id,
"status": "submitted",
"quartal": this.props.quarter,
"cash_flow": dbcf
}
console.log(dbcf)
console.log(JSON.stringify(payload))
this.props.createCashFlow(payload)
api.create().createRollingOutlookCF(payload).then(response => {
console.log(payload);
console.log(response);
// console.log(JSON.stringify(payload))
if (response.data) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.refresh()
} else {
this.setState({ loading: false, handleTekTekTek: 0 }, () => {
this.props.onClickClose()
this.props.refresh()
})
}
} else {
this.setState({ loading: false, handleTekTekTek: 0 })
}
})
this.props.onClickClose()
this.props.refresh()
}
render() {
let dataTable2 = this.state.dataTable
let loading = false
const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
console.log(tableMeta.rowData[5])
console.log(column)
// console.log(tableMeta.rowData[5])
// console.log(column)
loading = true
let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/)
let baru = []
......@@ -451,7 +482,7 @@ export default class CashFlow extends Component {
anjay.push(valuezz == "" ? 0 : Number(valuezz))
}
} else {
console.log(value)
// console.log(value)
let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
if (indexID !== -1) {
let valuezz = value.formula[indexID].value
......@@ -809,6 +840,7 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(tableMeta.rowData[6].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[6].value).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -881,6 +913,7 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(tableMeta.rowData[7].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[7].value).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -949,6 +982,7 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(tableMeta.rowData[8].value).toFixed(1) >= Number(this.state.minValue) && Number(tableMeta.rowData[8].value).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1004,7 +1038,7 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
/>
</span>
:
......@@ -1017,11 +1051,12 @@ export default class CashFlow extends Component {
placeholder=""
disabled={true}
// value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
/>
:
tableMeta.rowData[0] === 7 ?
((this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) <= Number(this.state.maxValue)) ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
((this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1036,7 +1071,7 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
......@@ -1053,7 +1088,7 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[9].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
/>
</LightTooltip>
:
......@@ -1077,7 +1112,7 @@ export default class CashFlow extends Component {
placeholder=""
disabled={true}
// value={Number(tableMeta.rowData[10].value).toFixed(1)}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
/>
</span>
:
......@@ -1093,7 +1128,8 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
((this.props.quarter != 'q1'? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1'? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) <= Number(this.state.maxValue)) ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
((this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1108,7 +1144,7 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
......@@ -1125,7 +1161,7 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[10].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
/>
</LightTooltip>
:
......@@ -1146,7 +1182,7 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
/>
</span>
:
......@@ -1158,11 +1194,12 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
/>
:
tableMeta.rowData[0] === 7 ?
((this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) <= Number(this.state.maxValue)) ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
((this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1177,7 +1214,7 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
......@@ -1194,7 +1231,7 @@ export default class CashFlow extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter != 'q1'? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
value={this.props.quarter != 'q1' ? Number(tableMeta.rowData[11].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
/>
</LightTooltip>
:
......@@ -1231,6 +1268,7 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q3' ? null :
((this.props.quarter == 'q3' ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[12].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1300,6 +1338,7 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q3' ? null :
((this.props.quarter == 'q3' ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[13].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1371,6 +1410,7 @@ export default class CashFlow extends Component {
/>
:
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q3' ? null :
((this.props.quarter == 'q3' ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)) >= Number(this.state.minValue) && (this.props.quarter == 'q3' ? Number(tableMeta.rowData[14].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1981,7 +2021,7 @@ export default class CashFlow extends Component {
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} {String(this.props.quarter).toLocaleUpperCase()} (rev.{this.props.revision})</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
......
......@@ -57,7 +57,7 @@ export default class CatRevision extends Component {
loading: true,
uomList: [],
formulaYtdList: {
options: [{ value: 'SUM' }, { value: 'AVG' }, { value: 'LAST' }],
options: [{ value: 'SUM' }, { value: 'AVG' }, { value: 'LAST' }, { value: 'FORMULA' }],
getOptionLabel: (option) => titleCase(option.value),
},
kpiTypeList: [],
......@@ -81,7 +81,7 @@ export default class CatRevision extends Component {
this.getKPIType()
this.getMaxAch()
this.getLatestUpdate()
this.getItemHierarki()
// this.getItemHierarki()
this.handleViewOnly()
}
......@@ -426,19 +426,19 @@ export default class CatRevision extends Component {
"kpi_type": i[8] == null ? "" : i[8].value,
"max_ach": i[9] == null ? "" : i[9].value,
"formula": i[10] == null ? "" : i[10].value,
"january": i[5] === 'ROIC' ? String(Number(i[11]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[11]) : String(Number(i[11].value).toFixed(1)) : String(i[11]),
"february": i[5] === 'ROIC' ? String(Number(i[12]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[12]) : String(Number(i[12].value).toFixed(1)) : String(i[12]),
"march": i[5] === 'ROIC' ? String(Number(i[13]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[13]) : String(Number(i[13].value).toFixed(1)) : String(i[13]),
"april": i[5] === 'ROIC' ? String(Number(i[14]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[14]) : String(Number(i[14].value).toFixed(1)) : String(i[14]),
"may": i[5] === 'ROIC' ? String(Number(i[15]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[15]) : String(Number(i[15].value).toFixed(1)) : String(i[15]),
"june": i[5] === 'ROIC' ? String(Number(i[16]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[16]) : String(Number(i[16].value).toFixed(1)) : String(i[16]),
"july": i[5] === 'ROIC' ? String(Number(i[17]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[17]) : String(Number(i[17].value).toFixed(1)) : String(i[17]),
"august": i[5] === 'ROIC' ? String(Number(i[18]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[18]) : String(Number(i[18].value).toFixed(1)) : String(i[18]),
"september": i[5] === 'ROIC' ? String(Number(i[19]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[19]) : String(Number(i[19].value).toFixed(1)) : String(i[19]),
"october": i[5] === 'ROIC' ? String(Number(i[20]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[20]) : String(Number(i[20].value).toFixed(1)) : String(i[20]),
"november": i[5] === 'ROIC' ? String(Number(i[21]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[21]) : String(Number(i[21].value).toFixed(1)) : String(i[21]),
"december": i[5] === 'ROIC' ? String(Number(i[22]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[22]) : String(Number(i[22].value).toFixed(1)) : String(i[22]),
"current_year_total": i[6] === 'ROIC' ? String(Number(i[23]).toFixed(1)) : String(Number(i[23]).toFixed(1)) == "" ? "0.0" : String(Number(i[23]).toFixed(1)),
"january": stateFR ? i[0] == 3 ? String(i[11]) : String(Number(i[11].value).toFixed(1)) : String(i[11]),
"february": stateFR ? i[0] == 3 ? String(i[12]) : String(Number(i[12].value).toFixed(1)) : String(i[12]),
"march": stateFR ? i[0] == 3 ? String(i[13]) : String(Number(i[13].value).toFixed(1)) : String(i[13]),
"april": stateFR ? i[0] == 3 ? String(i[14]) : String(Number(i[14].value).toFixed(1)) : String(i[14]),
"may": stateFR ? i[0] == 3 ? String(i[15]) : String(Number(i[15].value).toFixed(1)) : String(i[15]),
"june": stateFR ? i[0] == 3 ? String(i[16]) : String(Number(i[16].value).toFixed(1)) : String(i[16]),
"july": stateFR ? i[0] == 3 ? String(i[17]) : String(Number(i[17].value).toFixed(1)) : String(i[17]),
"august": stateFR ? i[0] == 3 ? String(i[18]) : String(Number(i[18].value).toFixed(1)) : String(i[18]),
"september": stateFR ? i[0] == 3 ? String(i[19]) : String(Number(i[19].value).toFixed(1)) : String(i[19]),
"october": stateFR ? i[0] == 3 ? String(i[20]) : String(Number(i[20].value).toFixed(1)) : String(i[20]),
"november": stateFR ? i[0] == 3 ? String(i[21]) : String(Number(i[21].value).toFixed(1)) : String(i[21]),
"december": stateFR ? i[0] == 3 ? String(i[22]) : String(Number(i[22].value).toFixed(1)) : String(i[22]),
"current_year_total": String(Number(i[23]).toFixed(1)) == "" ? "0.0" : String(Number(i[23]).toFixed(1)),
"strategic_initiative": String(i[24]),
"pic": String(i[25])
})
......@@ -551,18 +551,18 @@ export default class CatRevision extends Component {
item.kpi == "" || item.kpi == null ? null : { value: item.kpi },
item.max_ach == "" || item.max_ach == null ? null : { value: titleCase(item.max_ach) },
item.formula_ytd == "" || item.formula_ytd == null ? null : { value: item.formula_ytd },
item.item_report === 'ROIC' ? Number(item.january).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.january).toFixed(1) : { value: item.january, formula: item.january_formula } : item.january == "" ? item.january : String(item.january).indexOf(".") == -1 ? Number(item.january) : Number(item.january).toFixed(1),
item.item_report === 'ROIC' ? Number(item.february).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.february).toFixed(1) : { value: item.february, formula: item.february_formula } : item.february == "" ? item.february : String(item.february).indexOf(".") == -1 ? Number(item.february) : Number(item.february).toFixed(1),
item.item_report === 'ROIC' ? Number(item.march).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.march).toFixed(1) : { value: item.march, formula: item.march_formula } : item.march == "" ? item.march : String(item.march).indexOf(".") == -1 ? Number(item.march) : Number(item.march).toFixed(1),
item.item_report === 'ROIC' ? Number(item.april).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.april).toFixed(1) : { value: item.april, formula: item.april_formula } : item.april == "" ? item.april : String(item.april).indexOf(".") == -1 ? Number(item.april) : Number(item.april).toFixed(1),
item.item_report === 'ROIC' ? Number(item.may).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.may).toFixed(1) : { value: item.may, formula: item.may_formula } : item.may == "" ? item.may : String(item.may).indexOf(".") == -1 ? Number(item.may) : Number(item.may).toFixed(1),
item.item_report === 'ROIC' ? Number(item.june).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.june).toFixed(1) : { value: item.june, formula: item.june_formula } : item.june == "" ? item.june : String(item.june).indexOf(".") == -1 ? Number(item.june) : Number(item.june).toFixed(1),
item.item_report === 'ROIC' ? Number(item.july).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.july).toFixed(1) : { value: item.july, formula: item.july_formula } : item.july == "" ? item.july : String(item.july).indexOf(".") == -1 ? Number(item.july) : Number(item.july).toFixed(1),
item.item_report === 'ROIC' ? Number(item.august).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.august).toFixed(1) : { value: item.august, formula: item.august_formula } : item.august == "" ? item.august : String(item.august).indexOf(".") == -1 ? Number(item.august) : Number(item.august).toFixed(1),
item.item_report === 'ROIC' ? Number(item.september).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.september).toFixed(1) : { value: item.september, formula: item.september_formula } : item.september == "" ? item.september : String(item.september).indexOf(".") == -1 ? Number(item.september) : Number(item.september).toFixed(1),
item.item_report === 'ROIC' ? Number(item.october).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.october).toFixed(1) : { value: item.october, formula: item.october_formula } : item.october == "" ? item.october : String(item.october).indexOf(".") == -1 ? Number(item.october) : Number(item.october).toFixed(1),
item.item_report === 'ROIC' ? Number(item.november).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.november).toFixed(1) : { value: item.november, formula: item.november_formula } : item.november == "" ? item.november : String(item.november).indexOf(".") == -1 ? Number(item.november) : Number(item.november).toFixed(1),
item.item_report === 'ROIC' ? Number(item.december).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.december).toFixed(1) : { value: item.december, formula: item.december_formula } : item.december == "" ? item.december : String(item.december).indexOf(".") == -1 ? Number(item.december) : Number(item.december).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.january).toFixed(1) : { value: item.january, formula: item.january_formula } : item.january == "" ? item.january : String(item.january).indexOf(".") == -1 ? Number(item.january) : Number(item.january).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.february).toFixed(1) : { value: item.february, formula: item.february_formula } : item.february == "" ? item.february : String(item.february).indexOf(".") == -1 ? Number(item.february) : Number(item.february).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.march).toFixed(1) : { value: item.march, formula: item.march_formula } : item.march == "" ? item.march : String(item.march).indexOf(".") == -1 ? Number(item.march) : Number(item.march).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.april).toFixed(1) : { value: item.april, formula: item.april_formula } : item.april == "" ? item.april : String(item.april).indexOf(".") == -1 ? Number(item.april) : Number(item.april).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.may).toFixed(1) : { value: item.may, formula: item.may_formula } : item.may == "" ? item.may : String(item.may).indexOf(".") == -1 ? Number(item.may) : Number(item.may).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.june).toFixed(1) : { value: item.june, formula: item.june_formula } : item.june == "" ? item.june : String(item.june).indexOf(".") == -1 ? Number(item.june) : Number(item.june).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.july).toFixed(1) : { value: item.july, formula: item.july_formula } : item.july == "" ? item.july : String(item.july).indexOf(".") == -1 ? Number(item.july) : Number(item.july).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.august).toFixed(1) : { value: item.august, formula: item.august_formula } : item.august == "" ? item.august : String(item.august).indexOf(".") == -1 ? Number(item.august) : Number(item.august).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.september).toFixed(1) : { value: item.september, formula: item.september_formula } : item.september == "" ? item.september : String(item.september).indexOf(".") == -1 ? Number(item.september) : Number(item.september).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.october).toFixed(1) : { value: item.october, formula: item.october_formula } : item.october == "" ? item.october : String(item.october).indexOf(".") == -1 ? Number(item.october) : Number(item.october).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.november).toFixed(1) : { value: item.november, formula: item.november_formula } : item.november == "" ? item.november : String(item.november).indexOf(".") == -1 ? Number(item.november) : Number(item.november).toFixed(1),
item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? Number(item.december).toFixed(1) : { value: item.december, formula: item.december_formula } : item.december == "" ? item.december : String(item.december).indexOf(".") == -1 ? Number(item.december) : Number(item.december).toFixed(1),
item.current_year_total == "" ? item.current_year_total : String(item.current_year_total).indexOf(".") == -1 ? Number(item.current_year_total) : Number(item.total_current_year).toFixed(1),
item.strategic_initiative,
item.pic,
......@@ -626,19 +626,19 @@ export default class CatRevision extends Component {
"kpi_type": i[8] == null ? "" : i[8].value,
"max_ach": i[9] == null ? "" : i[9].value,
"formula": i[10] == null ? "" : i[10].value,
"january": i[5] === 'ROIC' ? String(Number(i[11]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[11]) : String(Number(i[11].value).toFixed(1)) : String(i[11]),
"february": i[5] === 'ROIC' ? String(Number(i[12]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[12]) : String(Number(i[12].value).toFixed(1)) : String(i[12]),
"march": i[5] === 'ROIC' ? String(Number(i[13]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[13]) : String(Number(i[13].value).toFixed(1)) : String(i[13]),
"april": i[5] === 'ROIC' ? String(Number(i[14]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[14]) : String(Number(i[14].value).toFixed(1)) : String(i[14]),
"may": i[5] === 'ROIC' ? String(Number(i[15]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[15]) : String(Number(i[15].value).toFixed(1)) : String(i[15]),
"june": i[5] === 'ROIC' ? String(Number(i[16]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[16]) : String(Number(i[16].value).toFixed(1)) : String(i[16]),
"july": i[5] === 'ROIC' ? String(Number(i[17]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[17]) : String(Number(i[17].value).toFixed(1)) : String(i[17]),
"august": i[5] === 'ROIC' ? String(Number(i[18]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[18]) : String(Number(i[18].value).toFixed(1)) : String(i[18]),
"september": i[5] === 'ROIC' ? String(Number(i[19]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[19]) : String(Number(i[19].value).toFixed(1)) : String(i[19]),
"october": i[5] === 'ROIC' ? String(Number(i[20]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[20]) : String(Number(i[20].value).toFixed(1)) : String(i[20]),
"november": i[5] === 'ROIC' ? String(Number(i[21]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[21]) : String(Number(i[21].value).toFixed(1)) : String(i[21]),
"december": i[5] === 'ROIC' ? String(Number(i[22]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[22]) : String(Number(i[22].value).toFixed(1)) : String(i[22]),
"total_current_year": i[5] === 'ROIC' ? String(Number(i[23]).toFixed(1)) : String(Number(i[23]).toFixed(1)) == "" ? "0.0" : String(Number(i[23]).toFixed(1)),
"january": stateFR ? i[0] == 3 ? String(i[11]) : String(Number(i[11].value).toFixed(1)) : String(i[11]),
"february": stateFR ? i[0] == 3 ? String(i[12]) : String(Number(i[12].value).toFixed(1)) : String(i[12]),
"march": stateFR ? i[0] == 3 ? String(i[13]) : String(Number(i[13].value).toFixed(1)) : String(i[13]),
"april": stateFR ? i[0] == 3 ? String(i[14]) : String(Number(i[14].value).toFixed(1)) : String(i[14]),
"may": stateFR ? i[0] == 3 ? String(i[15]) : String(Number(i[15].value).toFixed(1)) : String(i[15]),
"june": stateFR ? i[0] == 3 ? String(i[16]) : String(Number(i[16].value).toFixed(1)) : String(i[16]),
"july": stateFR ? i[0] == 3 ? String(i[17]) : String(Number(i[17].value).toFixed(1)) : String(i[17]),
"august": stateFR ? i[0] == 3 ? String(i[18]) : String(Number(i[18].value).toFixed(1)) : String(i[18]),
"september": stateFR ? i[0] == 3 ? String(i[19]) : String(Number(i[19].value).toFixed(1)) : String(i[19]),
"october": stateFR ? i[0] == 3 ? String(i[20]) : String(Number(i[20].value).toFixed(1)) : String(i[20]),
"november": stateFR ? i[0] == 3 ? String(i[21]) : String(Number(i[21].value).toFixed(1)) : String(i[21]),
"december": stateFR ? i[0] == 3 ? String(i[22]) : String(Number(i[22].value).toFixed(1)) : String(i[22]),
"total_current_year": String(Number(i[23]).toFixed(1)) == "" ? "0.0" : String(Number(i[23]).toFixed(1)),
"strategic": String(i[24]),
"pic": String(i[25])
})
......@@ -749,6 +749,8 @@ export default class CatRevision extends Component {
}
}
})
// console.log(tableMeta.rowData);
// console.log(baru);
baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
......@@ -764,7 +766,7 @@ export default class CatRevision extends Component {
let columnEnd = 22
let month = column - 1
let total = 0
// // // console.log(formulaAwal)
console.log(formulaAwal)
// if (forecast == undefined) {
// dataTable2[tableMeta.rowIndex].map((itemz, indexz) => {
// if (indexz >= columnStart && indexz <= columnStart + month) {
......@@ -794,7 +796,16 @@ export default class CatRevision extends Component {
let operatorX = String(item).substr(indexX - 1, 1)
let nilaiX = String(item).substr(indexX + 1, String(item).length)
// if (forecast == undefined) {
if (forecast == undefined) {
let convertID = -1
if (tableMeta.rowData[10].value == 'FORMULA') {
console.log(tableMeta.rowData);
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)
}
// // console.log(value);
// let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${formulaAwal}`) && val.periode == Number(this.props.periode))
// if (indexID !== -1) {
......@@ -812,7 +823,7 @@ export default class CatRevision extends Component {
// // let valuezz = value.formula[indexID].value
// // anjay.push(valuezz == "" ? 0 : valuezz)
// // }
// }
}
anjay.push(operatorX)
anjay.push(nilaiX)
......@@ -827,11 +838,21 @@ export default class CatRevision extends Component {
// }
// }
} else {
console.log(tableMeta.rowData);
let convertID = -1
if (tableMeta.rowData[10].value == 'FORMULA') {
let indexIDReport = dataTable2.findIndex((val) => val[1] == item)
convertID = dataTable2[indexIDReport][tableMeta.columnIndex]
anjay.push(convertID == -1 ? "0" : convertID)
console.log(convertID);
console.log(dataTable2);
console.log(tableMeta);
} else {
let indexID = dataTable2.findIndex((val) => val[31] == item)
if (indexID !== -1) {
let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
if (item == dataTable2[tableMeta.rowIndex][31]) {
if (item == dataTable2[tableMeta.rowIndex][14]) {
anjay.push(0)
} else {
anjay.push(valuezz == "" ? "0" : valuezz)
......@@ -843,6 +864,7 @@ export default class CatRevision extends Component {
}
}
}
}
})
let anjay2 = []
......@@ -1499,7 +1521,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -1509,8 +1555,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1518,11 +1566,10 @@ export default class CatRevision extends Component {
}}
/>
}
/> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
/>
</div>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1599,7 +1646,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -1609,8 +1680,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 5)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1618,11 +1691,10 @@ export default class CatRevision extends Component {
}}
/>
}
/> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
/>
</div>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1633,7 +1705,7 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleValueFormula(value, tableMeta, 5)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
......@@ -1699,7 +1771,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -1709,8 +1805,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 6)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1718,11 +1816,10 @@ export default class CatRevision extends Component {
}}
/>
}
/> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
/>
</div>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1733,7 +1830,7 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleValueFormula(value, tableMeta, 6)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
......@@ -1799,7 +1896,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -1809,8 +1930,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1818,11 +1941,10 @@ export default class CatRevision extends Component {
}}
/>
}
/> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
/>
</div>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1833,7 +1955,7 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
......@@ -1899,7 +2021,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -1909,8 +2055,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 8)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1918,11 +2066,10 @@ export default class CatRevision extends Component {
}}
/>
}
/> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
/>
</div>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1933,7 +2080,7 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleValueFormula(value, tableMeta, 8)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
......@@ -1999,7 +2146,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -2009,8 +2180,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 9)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -2018,11 +2191,10 @@ export default class CatRevision extends Component {
}}
/>
}
/> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
/>
</div>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2033,7 +2205,7 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleValueFormula(value, tableMeta, 9)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
......@@ -2099,7 +2271,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -2109,8 +2305,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 10)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -2118,11 +2316,10 @@ export default class CatRevision extends Component {
}}
/>
}
/> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
/>
</div>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2133,7 +2330,7 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleValueFormula(value, tableMeta, 10)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
......@@ -2199,7 +2396,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -2209,8 +2430,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 11)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -2218,11 +2441,10 @@ export default class CatRevision extends Component {
}}
/>
}
/> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
/>
</div>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2233,7 +2455,7 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleValueFormula(value, tableMeta, 11)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
......@@ -2299,7 +2521,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -2309,8 +2555,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 12)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -2318,11 +2566,10 @@ export default class CatRevision extends Component {
}}
/>
}
/> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
/>
</div>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2333,7 +2580,7 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleValueFormula(value, tableMeta, 12)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
......@@ -2399,7 +2646,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(handleTotal(tableMeta, 'roic')).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// />
// </div> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2410,8 +2681,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleTotal(tableMeta, 'roic')).toFixed(1)}
// value={Number(handleValueForecast(value, tableMeta, this.props.periode)).toFixed(1)}
value={Number(handleTotal(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -2420,10 +2693,9 @@ export default class CatRevision extends Component {
/>
}
/>
</div> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
</div>
:
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2434,8 +2706,8 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// value={Number(handleValueForecast(value, tableMeta, this.props.periode)).toFixed(1)}
value={Number(handleTotal(tableMeta)).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
......@@ -2499,7 +2771,31 @@ export default class CatRevision extends Component {
value={Number(value).toFixed(1)}
/>
:
tableMeta.rowData[5] === 'ROIC' ?
// tableMeta.rowData[5] === 'ROIC' ?
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -2509,8 +2805,10 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -2518,11 +2816,10 @@ export default class CatRevision extends Component {
}}
/>
}
/> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
/>
</div>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
tableMeta.rowData[10].value === "FORMULA" ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2533,8 +2830,8 @@ export default class CatRevision extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
value={Number(value).toFixed(1)}
value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
......
......@@ -57,7 +57,7 @@ export default class TaxPlanning extends Component {
maxValue: 0,
alert: false,
get_for: "view",
viewOnly : true,
viewOnly: true,
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -99,11 +99,11 @@ export default class TaxPlanning extends Component {
checkStatus = false
}
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev})
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
}
handleGetFor(type) {
this.setState({loading: true, get_for: type}, () => {
this.setState({ loading: true, get_for: type }, () => {
this.getSettingControl()
this.getLatestUpdate()
console.log("masukhandle")
......@@ -762,7 +762,7 @@ export default class TaxPlanning extends Component {
})
console.log(errorContrl)
console.log(editAble)
if (errorContrl === false && editAble === false ) {
if (errorContrl === false && editAble === false) {
this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
} else {
this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false })
......@@ -1225,7 +1225,7 @@ export default class TaxPlanning extends Component {
null
:
// this.state.get_for == 'view'?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1243,6 +1243,24 @@ export default class TaxPlanning extends Component {
/>
</div>
:
tableMeta.rowData[3] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf.value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf.value).toFixed(2) : Number(value.tbf.value).toFixed(1)}
/>
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1296,7 +1314,26 @@ export default class TaxPlanning extends Component {
null
:
// this.state.get_for == 'view'?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf.value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf.value).toFixed(2) : Number(value.tbf.value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[3] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1367,7 +1404,26 @@ export default class TaxPlanning extends Component {
null
:
// this.state.get_for == 'view'?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf.value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf.value).toFixed(2) : Number(value.tbf.value).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[3] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1423,12 +1479,12 @@ export default class TaxPlanning extends Component {
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Commercial) MTD"}</span>
</div>
: null }
: null}
{this.props.quarter == 'q1' ?
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Fiscal Correction Positive /(Negative)"}</span>
</div>
: null }
: null}
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Fiscal) MTD"}</span>
</div>
......@@ -1447,7 +1503,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 || this.props.quarter === "q2" || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -1584,7 +1640,7 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
{this.props.quarter == 'q1' ?
<div className="col-2">
<div style={{ textAlign: 'right' }}>
......@@ -1592,7 +1648,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 || this.props.quarter === "q2" || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1655,6 +1711,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[2] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1731,7 +1788,7 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
<div className={this.props.quarter == 'q1' ? "col-3" : ""}>
<div style={{ textAlign: 'right' }}>
{
......@@ -1856,6 +1913,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[3] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -1930,12 +1988,12 @@ export default class TaxPlanning extends Component {
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Commercial) MTD"}</span>
</div>
: null }
: null}
{this.props.quarter == 'q1' ?
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Fiscal Correction Positive /(Negative)"}</span>
</div>
: null }
: null}
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Fiscal) MTD"}</span>
</div>
......@@ -1955,7 +2013,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 || this.props.quarter === "q2" || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -2037,6 +2095,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[1] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -2092,7 +2151,7 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
{this.props.quarter == 'q1' ?
<div className="col-2">
<div style={{ textAlign: 'right' }}>
......@@ -2100,7 +2159,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 || this.props.quarter === "q2" || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2164,6 +2223,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[2] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -2219,14 +2279,14 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
<div className={this.props.quarter == 'q1' ? "col-3" : ""}>
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -2344,6 +2404,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[3] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -2418,12 +2479,12 @@ export default class TaxPlanning extends Component {
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Commercial) MTD"}</span>
</div>
: null }
: null}
{this.props.quarter == 'q1' ?
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Fiscal Correction Positive /(Negative)"}</span>
</div>
: null }
: null}
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Fiscal) MTD"}</span>
</div>
......@@ -2443,7 +2504,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 || this.props.quarter === "q2" || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -2525,6 +2586,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[1] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -2580,7 +2642,7 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
{this.props.quarter == 'q1' ?
<div className="col-2">
<div style={{ textAlign: 'right' }}>
......@@ -2588,7 +2650,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 || this.props.quarter === "q2" || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2652,6 +2714,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[2] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -2707,14 +2770,14 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
<div className={this.props.quarter == 'q1' ? "col-3" : ""}>
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -2832,6 +2895,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[3] === 7 ?
this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -2906,12 +2970,12 @@ export default class TaxPlanning extends Component {
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Commercial) MTD"}</span>
</div>
: null }
: null}
{this.props.quarter == 'q1' || this.props.quarter == 'q2' ?
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Fiscal Correction Positive /(Negative)"}</span>
</div>
: null }
: null}
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Fiscal) MTD"}</span>
</div>
......@@ -2931,7 +2995,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -3013,6 +3077,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[1] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -3068,15 +3133,15 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
{this.props.quarter == 'q1' || this.props.quarter == 'q2' ?
<div className="col-2">
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1|| this.props.quarter === "q3" ?
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -3140,6 +3205,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[2] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -3195,14 +3261,14 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
<div className={this.props.quarter == 'q1' || this.props.quarter == 'q2' ? "col-3" : ""}>
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -3320,6 +3386,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[3] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -3394,12 +3461,12 @@ export default class TaxPlanning extends Component {
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Commercial) MTD"}</span>
</div>
: null }
: null}
{this.props.quarter == 'q1' || this.props.quarter == 'q2' ?
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Fiscal Correction Positive /(Negative)"}</span>
</div>
: null }
: null}
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Fiscal) MTD"}</span>
</div>
......@@ -3419,7 +3486,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -3501,6 +3568,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[1] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -3556,7 +3624,7 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
{this.props.quarter == 'q1' || this.props.quarter == 'q2' ?
<div className="col-2">
<div style={{ textAlign: 'right' }}>
......@@ -3564,7 +3632,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -3628,6 +3696,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[2] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -3683,14 +3752,14 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
<div className={this.props.quarter == 'q1' || this.props.quarter == 'q2' ? "col-3" : ""}>
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -3808,6 +3877,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[3] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -3882,12 +3952,12 @@ export default class TaxPlanning extends Component {
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Commercial) MTD"}</span>
</div>
: null }
: null}
{this.props.quarter == 'q1' || this.props.quarter == 'q2' ?
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Fiscal Correction Positive /(Negative)"}</span>
</div>
: null }
: null}
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Fiscal) MTD"}</span>
</div>
......@@ -3907,7 +3977,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -3989,6 +4059,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[1] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -4044,7 +4115,7 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
{this.props.quarter == 'q1' || this.props.quarter == 'q2' ?
<div className="col-2">
<div style={{ textAlign: 'right' }}>
......@@ -4052,7 +4123,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 || this.props.quarter === "q3" ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -4116,6 +4187,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[2] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -4171,14 +4243,14 @@ export default class TaxPlanning extends Component {
}
</div>
</div>
: null }
: null}
<div className={this.props.quarter == 'q1' || this.props.quarter == 'q2' ? "col-3" : ""}>
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -4296,6 +4368,7 @@ export default class TaxPlanning extends Component {
/>
:
tableMeta.rowData[3] === 7 ?
this.props.quarter === 'q3' ? null :
(Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
......@@ -4387,10 +4460,10 @@ export default class TaxPlanning extends Component {
<div className="col-1">
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1?
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -4530,10 +4603,10 @@ export default class TaxPlanning extends Component {
<div className="col-2">
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1?
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -4658,7 +4731,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -4831,10 +4904,10 @@ export default class TaxPlanning extends Component {
<div className="col-1">
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1?
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -4974,10 +5047,10 @@ export default class TaxPlanning extends Component {
<div className="col-2">
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1?
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -5102,7 +5175,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -5275,10 +5348,10 @@ export default class TaxPlanning extends Component {
<div className="col-1">
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1?
tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -5418,10 +5491,10 @@ export default class TaxPlanning extends Component {
<div className="col-2">
<div style={{ textAlign: 'right' }}>
{
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1?
tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -5546,7 +5619,7 @@ export default class TaxPlanning extends Component {
tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -5714,7 +5787,7 @@ export default class TaxPlanning extends Component {
{tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -5854,7 +5927,7 @@ export default class TaxPlanning extends Component {
options: {
display: false
}
},{
}, {
name: "",
options: {
display: false
......@@ -5915,7 +5988,7 @@ export default class TaxPlanning extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
{this.props.isApprover === true || this.state.get_for == 'view'?
{this.props.isApprover === true || this.state.get_for == 'view' ?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download">
<button
......@@ -6042,7 +6115,7 @@ export default class TaxPlanning extends Component {
// marginRight: 20
}}
onClick={() => {
this.setState({loading: true}, () => {
this.setState({ loading: true }, () => {
this.handleGetFor('edit')
})
}}
......
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