Commit de70f159 authored by d.arizona's avatar d.arizona

apdet

parent c32d3821
......@@ -249,6 +249,7 @@ const create = (type = "") => {
//CASH FLOW
const getDetailReportCF = (body) => api.post('/transaction/cash_flow/master_budget/get_report_hierarki', body)
const createReportCF = (body) => api.post('transaction/cash_flow/master_budget/create_submission_report', body)
//OUTLOOK PA
const getOutlookPAID = (body) => api.post('transaction/outlook_pa/get_outlook_pa_id', body)
......@@ -598,7 +599,8 @@ const create = (type = "") => {
getReportOIMB,
getReportOIMR,
getReportCFSumaMB,
getReportCFSumaMR
getReportCFSumaMR,
createReportCF
}
}
......
......@@ -1039,6 +1039,9 @@ export default class BudgetTahunan extends Component {
// console.log(listCF)
this.setState({dbCF: listCF} , () => {
if (this.state.company.company_id == '13467') {
this.createCashFlow()
}
if (type != undefined) {
if (type == 'BS' || type == 'FAM' || type == 'PL') {
console.log('tarik sis')
......@@ -1057,7 +1060,9 @@ export default class BudgetTahunan extends Component {
"status": "submitted",
"cash_flow": this.state.dbCF
}
api.create().createMonthlyReportCF(payload).then((res) => {
console.log(this.state.dbCF)
console.log(JSON.stringify(payload))
api.create().createReportCF(payload).then((res) => {
console.log(res)
// if (response.data) {
// if (response.data.status === "success") {
......
......@@ -32,7 +32,7 @@ export default class SubHolding extends Component {
{ value: 4, label: 'DB Ratio' },
{ value: 5, label: 'DB Tax Planning' },
{ value: 21, label: 'DB Operating Indicator' },
{ value: 7, label: 'DB Cash FLow - Summary' },
{ value: 6, label: 'Cash FLow - Summary' },
],
report: null,
loading: false,
......@@ -745,9 +745,9 @@ export default class SubHolding extends Component {
}
}
})
this.setState({ dataTable, loading: false, previewDownload: false }, () => {
this.setState({ dataTable, loading: false, previewDownload: true }, () => {
console.log(this.state.dataTable)
this.getTaxPlanMR(payload)
// this.getTaxPlanMR(payload)
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
......@@ -884,9 +884,7 @@ export default class SubHolding extends Component {
})
}
})
} else if (this.state.report.value === 7) {
} else if (this.state.report.value === 6) {
api.create().getReportCFSumaMB(payload).then(response => {
// console.log(payload);
console.log(response);
......@@ -895,79 +893,87 @@ export default class SubHolding extends Component {
if (response.data.status === 'success') {
let res = response.data.data
console.log(res)
// const handlePushChild = (item) => {
// let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
// if (indexIDzz === -1) {
// dataTable.push([
// item.type_report_id,
// item.id,
// item.parent,
// item.formula,
// item.level,
// item.description,
// item.uom,
// item.master_budget.total_actual_before == "" ? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1 ? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before).toFixed(1),
// item.master_budget.january == "" ? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1 ? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
// item.master_budget.february == "" ? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1 ? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
// item.master_budget.march == "" ? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1 ? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
// item.master_budget.april == "" ? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1 ? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
// item.master_budget.may == "" ? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1 ? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
// item.master_budget.june == "" ? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1 ? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
// item.master_budget.july == "" ? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1 ? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
// item.master_budget.august == "" ? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1 ? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
// item.master_budget.september == "" ? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1 ? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
// item.master_budget.october == "" ? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1 ? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
// item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
// item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
// item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
// item.order
// ])
// }
// if (item.children !== null) {
// if (item.children.length > 0) {
// item.children.map((items, indexs) => {
// handlePushChild(items)
// })
// }
// }
// }
// res.map((item, index) => {
// dataTable.push([
// item.type_report_id,
// item.id,
// item.parent,
// item.formula,
// item.level,
// item.description,
// item.uom,
// item.master_budget.total_actual_before == "" ? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1 ? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before).toFixed(1),
// item.master_budget.january == "" ? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1 ? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
// item.master_budget.february == "" ? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1 ? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
// item.master_budget.march == "" ? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1 ? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
// item.master_budget.april == "" ? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1 ? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
// item.master_budget.may == "" ? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1 ? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
// item.master_budget.june == "" ? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1 ? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
// item.master_budget.july == "" ? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1 ? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
// item.master_budget.august == "" ? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1 ? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
// item.master_budget.september == "" ? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1 ? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
// item.master_budget.october == "" ? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1 ? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
// item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
// item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
// item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
// item.order
// ])
// if (item.children !== null) {
// if (item.children.length > 0) {
// item.children.map((items, indexs) => {
// handlePushChild(items)
// })
// }
// }
// })
// this.setState({ dataTable }, () => {
// console.log(this.state.dataTable)
// this.getOIMR(payloadOI)
// })
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) {
dataTable.push([
item.type_report_id,
item.id,
item.parent,
item.formula,
item.level,
item.description,
item.cash_flow.total_actual_before === null ? "0" : item.cash_flow.total_actual_before === "" ? "0" : item.cash_flow.total_actual_before,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.january, formula: item.cash_flow.january_formula } : item.cash_flow.january,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.february, formula: item.cash_flow.february_formula } : item.cash_flow.february,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.march, formula: item.cash_flow.march_formula } : item.cash_flow.march,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.april, formula: item.cash_flow.april_formula } : item.cash_flow.april,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.may, formula: item.cash_flow.may_formula } : item.cash_flow.may,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.june, formula: item.cash_flow.june_formula } : item.cash_flow.june,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.july, formula: item.cash_flow.july_formula } : item.cash_flow.july,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.august, formula: item.cash_flow.august_formula } : item.cash_flow.august,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.september, formula: item.cash_flow.september_formula } : item.cash_flow.september,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.october, formula: item.cash_flow.october_formula } : item.cash_flow.october,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.november, formula: item.cash_flow.november_formula } : item.cash_flow.november,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.december, formula: item.cash_flow.december_formula } : item.cash_flow.december,
item.cash_flow.total_current_year,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.cash_flow.total_next_year,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.cash_flow.total_more_year,
item.order,
item.condition_it_should_be,
item.condition_if_wrong,
item.cash_flow.forecast_formula == null ? [] : item.cash_flow.forecast_formula
])
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
res.map((item, index) => {
dataTable.push([
item.type_report_id,
item.id,
item.parent,
item.formula,
item.level,
item.description,
item.cash_flow.total_actual_before === null ? "0" : item.cash_flow.total_actual_before === "" ? "0" : item.cash_flow.total_actual_before,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.january, formula: item.cash_flow.january_formula } : item.cash_flow.january,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.february, formula: item.cash_flow.february_formula } : item.cash_flow.february,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.march, formula: item.cash_flow.march_formula } : item.cash_flow.march,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.april, formula: item.cash_flow.april_formula } : item.cash_flow.april,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.may, formula: item.cash_flow.may_formula } : item.cash_flow.may,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.june, formula: item.cash_flow.june_formula } : item.cash_flow.june,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.july, formula: item.cash_flow.july_formula } : item.cash_flow.july,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.august, formula: item.cash_flow.august_formula } : item.cash_flow.august,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.september, formula: item.cash_flow.september_formula } : item.cash_flow.september,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.october, formula: item.cash_flow.october_formula } : item.cash_flow.october,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.november, formula: item.cash_flow.november_formula } : item.cash_flow.november,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.december, formula: item.cash_flow.december_formula } : item.cash_flow.december,
item.cash_flow.total_current_year,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.cash_flow.total_next_year,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.cash_flow.total_more_year,
item.order,
item.condition_it_should_be,
item.condition_if_wrong,
item.cash_flow.forecast_formula == null ? [] : item.cash_flow.forecast_formula
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
})
this.setState({ dataTable}, () => {
console.log(this.state.dataTable)
this.getCFSumaMR(payload)
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
......@@ -985,6 +991,164 @@ export default class SubHolding extends Component {
}
}
getCFSumaMR(payload) {
// let payloadOI = {...payload, "periode": Number(this.state.periode.periode) - 1}
let payloadLast = {
"report_id": this.state.report.value,
"revision": this.state.revisionType,
"periode": Number(this.state.periode.periode) -1,
"company_id": this.state.company.company_id,
"submission_id": this.state.submissionID
}
api.create().getReportCFSumaMR(payload).then(response => {
console.log(payload);
console.log(response);
let dataTable = this.state.dataTable
let dataTable2 = []
if (response.data) {
let res = response.data.data
res.map((item,index) => {
let indexID = dataTable.findIndex((val) => val[1] == item.id)
if (indexID != -1) {
const handlePushChild = (items) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === items.id)
// console.log(indexIDzz)
if (indexIDzz != -1) {
dataTable2.push([...dataTable[indexIDzz],
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.january, formula: items.cash_flow.january_formula } : items.cash_flow.january,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.february, formula: items.cash_flow.february_formula } : items.cash_flow.february,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.march, formula: items.cash_flow.march_formula } : items.cash_flow.march,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.april, formula: items.cash_flow.april_formula } : items.cash_flow.april,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.may, formula: items.cash_flow.may_formula } : items.cash_flow.may,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.june, formula: items.cash_flow.june_formula } : items.cash_flow.june,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.july, formula: items.cash_flow.july_formula } : items.cash_flow.july,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.august, formula: items.cash_flow.august_formula } : items.cash_flow.august,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.september, formula: items.cash_flow.september_formula } : items.cash_flow.september,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.october, formula: items.cash_flow.october_formula } : items.cash_flow.october,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.november, formula: items.cash_flow.november_formula } : items.cash_flow.november,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.december, formula: items.cash_flow.december_formula } : items.cash_flow.december,
])
}
if (items.children !== null) {
if (items.children.length > 0) {
items.children.map((itemss, indexss) => {
handlePushChild(itemss)
})
}
}
}
dataTable2.push([...dataTable[indexID],
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.january, formula: item.cash_flow.january_formula } : item.cash_flow.january,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.february, formula: item.cash_flow.february_formula } : item.cash_flow.february,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.march, formula: item.cash_flow.march_formula } : item.cash_flow.march,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.april, formula: item.cash_flow.april_formula } : item.cash_flow.april,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.may, formula: item.cash_flow.may_formula } : item.cash_flow.may,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.june, formula: item.cash_flow.june_formula } : item.cash_flow.june,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.july, formula: item.cash_flow.july_formula } : item.cash_flow.july,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.august, formula: item.cash_flow.august_formula } : item.cash_flow.august,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.september, formula: item.cash_flow.september_formula } : item.cash_flow.september,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.october, formula: item.cash_flow.october_formula } : item.cash_flow.october,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.november, formula: item.cash_flow.november_formula } : item.cash_flow.november,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.december, formula: item.cash_flow.december_formula } : item.cash_flow.december,
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
})
this.setState({ dataTable2 }, () => {
// console.log(this.state.dataTable2)
this.getCFSumaLastMR(payloadLast)
})
console.log(dataTable2)
// this.setState({ dataTable: dataTable2, previewTable: true, loading: false, previewDownload: false })
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
})
}
getCFSumaLastMR(payload) {
api.create().getReportCFSumaMR(payload).then(response => {
console.log(payload);
console.log(response);
let dataTable2 = this.state.dataTable2
let dataTable3 = []
if (response.data) {
let res = response.data.data
res.map((item,index) => {
let indexID = dataTable2.findIndex((val) => val[1] == item.id)
if (indexID != -1) {
const handlePushChild = (items) => {
let indexIDzz = dataTable2.findIndex((val) => val[1] === items.id)
// console.log(indexIDzz)
if (indexIDzz != -1) {
dataTable3.push([...dataTable2[indexIDzz],
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.january, formula: items.cash_flow.january_formula } : items.cash_flow.january,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.february, formula: items.cash_flow.february_formula } : items.cash_flow.february,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.march, formula: items.cash_flow.march_formula } : items.cash_flow.march,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.april, formula: items.cash_flow.april_formula } : items.cash_flow.april,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.may, formula: items.cash_flow.may_formula } : items.cash_flow.may,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.june, formula: items.cash_flow.june_formula } : items.cash_flow.june,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.july, formula: items.cash_flow.july_formula } : items.cash_flow.july,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.august, formula: items.cash_flow.august_formula } : items.cash_flow.august,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.september, formula: items.cash_flow.september_formula } : items.cash_flow.september,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.october, formula: items.cash_flow.october_formula } : items.cash_flow.october,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.november, formula: items.cash_flow.november_formula } : items.cash_flow.november,
items.type_report_id == 5 || items.type_report_id == 6 || items.type_report_id == 7 ? { value: items.cash_flow.december, formula: items.cash_flow.december_formula } : items.cash_flow.december,
])
}
if (items.children !== null) {
if (items.children.length > 0) {
items.children.map((itemss, indexss) => {
handlePushChild(itemss)
})
}
}
}
dataTable3.push([...dataTable2[indexID],
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.january, formula: item.cash_flow.january_formula } : item.cash_flow.january,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.february, formula: item.cash_flow.february_formula } : item.cash_flow.february,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.march, formula: item.cash_flow.march_formula } : item.cash_flow.march,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.april, formula: item.cash_flow.april_formula } : item.cash_flow.april,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.may, formula: item.cash_flow.may_formula } : item.cash_flow.may,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.june, formula: item.cash_flow.june_formula } : item.cash_flow.june,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.july, formula: item.cash_flow.july_formula } : item.cash_flow.july,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.august, formula: item.cash_flow.august_formula } : item.cash_flow.august,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.september, formula: item.cash_flow.september_formula } : item.cash_flow.september,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.october, formula: item.cash_flow.october_formula } : item.cash_flow.october,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.november, formula: item.cash_flow.november_formula } : item.cash_flow.november,
item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.cash_flow.december, formula: item.cash_flow.december_formula } : item.cash_flow.december,
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
})
console.log(dataTable3)
this.setState({ dataTable: dataTable3, previewTable: true, loading: false, previewDownload: true })
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
})
}
getOIMR(payload) {
// let payloadOI = {...payload, "periode": Number(this.state.periode.periode) - 1}
......
......@@ -742,6 +742,293 @@ export default class TableSubHolding extends Component {
return Number(hasil).toFixed(2)
}
const handleValueFormulaCF = (value, tableMeta, column, periode, forecast) => {
// loading = true
let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/)
let baru = []
let anjay = []
splitFormula.map((item, index) => {
let items = String(item).substr(Number(String(item).length) - 1, 1)
let subForm = String(item).substr(0, Number(String(item).length) - 1)
let re = /^[a-zA-Z0-9_]+$/;
if (item !== "") {
if (!re.test(items)) {
baru.push(subForm)
baru.push(items)
} else {
baru.push(String(item))
}
}
})
let handledoubleFC = 0
baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item)
} else {
if (String(item).includes('#')) {
if (String(item).includes('[M-1]')) {
if (forecast !== undefined) {
let forecastt = 0
if (column == 20) {
let tst = String(item).replace('[M-1]', '')
let data = 18
let period = this.props.periode
let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
if (indexID !== -1) {
let valuezz = tableMeta.rowData[data].formula[indexID].value
forecastt += Number(valuezz == "" ? 0 : valuezz)
}
}
if (column == 21) {
let tst = String(item).replace('[M-1]', '')
let period = Number(this.props.periode) + 1
let indexID = forecast.findIndex((val) => String(val.item_formula).replace('forecast_', '') == String(`@${tst}`) && val.periode == period)
if (indexID !== -1) {
let valuezz = forecast[indexID].value
forecastt += Number(valuezz == "" ? 0 : valuezz)
}
}
anjay.push(forecastt)
} else {
let tst = String(item).replace('[M-1]', '')
let data = column == 7 ? 18 : column - 1
let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode
let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
if (indexID !== -1) {
let valuezz = tableMeta.rowData[data].formula[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
}
} else {
if (forecast !== undefined) {
let indexID = forecast.findIndex((val) => String(val.item_formula).replace('forecast_', '') == String(`@${item}`) && val.periode == Number(periode))
if (indexID !== -1) {
let valuezz = forecast[indexID].value
anjay.push(valuezz == "" ? 0 : Number(valuezz))
}
} else {
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
anjay.push(valuezz == "" ? 0 : valuezz)
}
}
}
} else {
let indexID = dataTable2.findIndex((val) => val[22] == item)
if (indexID !== -1) {
let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
if (item == dataTable2[tableMeta.rowIndex][22]) {
anjay.push(0)
} else {
anjay.push(valuezz == "" ? 0 : valuezz)
}
} else {
if (item === '(-1)') {
anjay.push(-1)
}
}
}
}
})
let anjay2 = []
let kurung = false
let item1 = []
anjay.map((item, index) => {
if (item == "(") {
kurung = true
} else if (item == ")") {
kurung = false
anjay2.push(item1)
item1 = []
} else {
if (kurung) {
item1.push(item)
} else {
anjay2.push(item)
}
}
})
let total = 0
let opt = ""
let totalPrio = 0
let optPrio = ""
let prio = false
let optPrev = ""
anjay2.map((item, index) => {
if (Array.isArray(item)) {
prio = true
optPrev = opt
item.map((items, indexs) => {
if (items == "+") {
optPrio = "tambah"
} else if (items == "-") {
optPrio = "kurang"
} else if (items == "*") {
optPrio = "kali"
} else if (items == "/") {
optPrio = "bagi"
} else {
if (optPrio == "tambah") {
totalPrio = Number(totalPrio) + Number(items)
} else if (optPrio == "kurang") {
totalPrio = Number(totalPrio) - Number(items)
} else if (optPrio == "kali") {
totalPrio = Number(totalPrio) * Number(items)
} else if (optPrio == "bagi") {
totalPrio = Number(totalPrio) / Number(items) == NaN ? 0 : Number(totalPrio) / Number(items)
} else {
totalPrio += Number(items)
}
}
})
if (index == anjay2.length - 1) {
if (opt == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (opt == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (opt == "kali") {
total = Number(total) * Number(totalPrio)
} else if (opt == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
}
} else {
if (item == "+") {
opt = "tambah"
if (prio) {
if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false
totalPrio = 0
optPrio = ""
}
} else if (item == "-") {
opt = "kurang"
if (prio) {
if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false
totalPrio = 0
optPrio = ""
}
} else if (item == "*") {
opt = "kali"
if (prio) {
if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false
totalPrio = 0
optPrio = ""
}
} else if (item == "/") {
opt = "bagi"
if (prio) {
if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false
totalPrio = 0
optPrio = ""
}
} else {
if (opt == "tambah") {
total = Number(total) + Number(item)
} else if (opt == "kurang") {
total = Number(total) - Number(item)
} else if (opt == "kali") {
total = Number(total) * Number(item)
} else if (opt == "bagi") {
total = Number(total) / Number(item) == NaN ? 0 : Number(total) / Number(item)
} else {
total += Number(item)
}
}
}
// if (String(tableMeta.rowData[5]).toLocaleUpperCase() == "4.0 CASH FLOW MOVEMENT" && column == 7) {
// console.log(item)
// console.log(totalPrio)
// console.log(total)
// }
})
total = R.equals(total, NaN) ? "0.0" : total
// // total = R.equals(total, NaN) ? "0.0" : total
// // console.log(dataTable2[tableMeta.rowIndex][22])
// // console.log(tableMeta.rowData[5])
// if (tableMeta.rowData[5] == "1.5 Other non-current assets") {
// if (forecast !== undefined) {
// if (String(tableMeta.rowData[5]).toLocaleUpperCase() == "4.0 CASH FLOW MOVEMENT" && column == 7) {
// console.log(splitFormula)
// console.log(baru)
// console.log(anjay)
// console.log(anjay2)
// console.log(total)
// console.log(dataTable2[tableMeta.rowIndex])
// }
// }
if (dataTable2[tableMeta.rowIndex][column].value == undefined) {
dataTable2[tableMeta.rowIndex][column] = total
} else {
dataTable2[tableMeta.rowIndex][column].value = total
}
// loading = false
return total
}
const handleForecastCF = (tableMeta, periode, column) => {
let total = 0
total = handleValueFormulaCF(dataTable2[tableMeta.rowIndex][column], tableMeta, column, periode, dataTable2[tableMeta.rowIndex][25])
return total
}
let datas = [
["ABCD", "Testing", { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }],
["Total Assets", "Notes", { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }]
......@@ -10808,6 +11095,32 @@ export default class TableSubHolding extends Component {
]
const columnDBCF = [
{
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
},
{
name: "Account",
options: {
......@@ -10861,7 +11174,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
{/* <div className="grid grid-3x content-center"> */}
......@@ -10882,7 +11195,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -10905,7 +11218,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -10928,7 +11241,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -10951,7 +11264,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -10993,7 +11306,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
{/* <div className="grid grid-3x content-center"> */}
......@@ -11014,7 +11327,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11037,7 +11350,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11060,7 +11373,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11083,7 +11396,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11125,7 +11438,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
{/* <div className="grid grid-3x content-center"> */}
......@@ -11146,7 +11459,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11169,7 +11482,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11192,7 +11505,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11215,7 +11528,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11257,7 +11570,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
{/* <div className="grid grid-3x content-center"> */}
......@@ -11278,7 +11591,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11301,7 +11614,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11324,7 +11637,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11347,7 +11660,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -11419,7 +11732,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
<div className="grid grid-3x content-center">
......@@ -11440,7 +11753,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[7], tableMeta, 7)).toFixed(1)}
/>
}
/>
......@@ -11463,7 +11776,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[8], tableMeta, 8)).toFixed(1)}
/>
}
/>
......@@ -11486,7 +11799,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[9], tableMeta, 9)).toFixed(1)}
/>
}
/>
......@@ -11509,7 +11822,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[10], tableMeta, 10)).toFixed(1)}
/>
}
/>
......@@ -11534,7 +11847,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(5).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[11], tableMeta, 11)).toFixed(1)}
/>
}
/>
......@@ -11557,7 +11870,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(6).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[12], tableMeta, 12)).toFixed(1)}
/>
}
/>
......@@ -11580,7 +11893,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(7).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[13], tableMeta, 13)).toFixed(1)}
/>
}
/>
......@@ -11603,7 +11916,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(8).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[14], tableMeta, 14)).toFixed(1)}
/>
}
/>
......@@ -11628,7 +11941,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(9).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)}
/>
}
/>
......@@ -11651,7 +11964,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(10).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)}
/>
}
/>
......@@ -11674,7 +11987,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(11).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)}
/>
}
/>
......@@ -11697,7 +12010,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(12).toFixed(1)}
value={Number(handleValueFormulaCF(tableMeta.rowData[18], tableMeta, 18)).toFixed(1)}
/>
}
/>
......@@ -11711,7 +12024,7 @@ export default class TableSubHolding extends Component {
}
}
},{
name: `${Number(this.props.periode) + 1} (2022)`,
name: `${Number(this.props.periode) + 1}`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
......@@ -11725,7 +12038,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
......@@ -11753,7 +12066,7 @@ export default class TableSubHolding extends Component {
}
}
},{
name: `${Number(this.props.periode) + 2} (2023)`,
name: `${Number(this.props.periode) + 2}`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
......@@ -11767,7 +12080,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
......@@ -11795,7 +12108,7 @@ export default class TableSubHolding extends Component {
}
}
},{
name: `ACTUAL ${this.props.periode} 2021`,
name: `ACTUAL ${this.props.periode}`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
......@@ -11853,7 +12166,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
<div className="grid grid-3x content-center">
......@@ -12145,7 +12458,7 @@ export default class TableSubHolding extends Component {
}
}
},{
name: `ACTUAL ${Number(this.props.periode) - 1} 2020`,
name: `ACTUAL ${Number(this.props.periode) - 1}`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
......@@ -12203,7 +12516,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
<div className="grid grid-3x content-center">
......@@ -12553,7 +12866,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
<div className="grid grid-3x content-center">
......@@ -12574,7 +12887,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12597,7 +12910,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12620,7 +12933,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12643,7 +12956,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12668,7 +12981,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(5).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12691,7 +13004,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(6).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12714,7 +13027,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(7).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12737,7 +13050,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(8).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12762,7 +13075,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(9).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12785,7 +13098,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(10).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12808,7 +13121,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(11).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12831,7 +13144,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(12).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12903,7 +13216,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
<div className="grid grid-3x content-center">
......@@ -12924,7 +13237,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12947,7 +13260,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12970,7 +13283,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -12993,7 +13306,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13018,7 +13331,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(5).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13041,7 +13354,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(6).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13064,7 +13377,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(7).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13087,7 +13400,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(8).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13112,7 +13425,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(9).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13135,7 +13448,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(10).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13158,7 +13471,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(11).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13181,7 +13494,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(12).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13253,7 +13566,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
<div className="grid grid-3x content-center">
......@@ -13274,7 +13587,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13297,7 +13610,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13320,7 +13633,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13343,7 +13656,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13368,7 +13681,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(5).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13391,7 +13704,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(6).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13414,7 +13727,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(7).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13437,7 +13750,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(8).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13462,7 +13775,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(9).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13485,7 +13798,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(10).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13508,7 +13821,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(11).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13531,7 +13844,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(12).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13603,7 +13916,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
<div className="grid grid-3x content-center">
......@@ -13624,7 +13937,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13647,7 +13960,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13670,7 +13983,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13693,7 +14006,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13718,7 +14031,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(5).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13741,7 +14054,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(6).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13764,7 +14077,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(7).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13787,7 +14100,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(8).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13812,7 +14125,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(9).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13835,7 +14148,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(10).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13858,7 +14171,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(11).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13881,7 +14194,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(12).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13943,7 +14256,7 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
console.log(tableMeta)
// console.log(tableMeta)
return (
<div>
<div className="grid grid-2x content-center">
......@@ -13964,7 +14277,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -13987,7 +14300,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -14010,7 +14323,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -14033,7 +14346,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -14056,7 +14369,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(5).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -14081,7 +14394,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(5).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -14104,7 +14417,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(6).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -14127,7 +14440,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(7).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -14150,7 +14463,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(8).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -14173,7 +14486,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(5).toFixed(1)}
value={Number(0).toFixed(1)}
/>
}
/>
......@@ -14197,7 +14510,7 @@ export default class TableSubHolding extends Component {
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={this.props.type === 7 ? datas : dataTable2}
columns={this.props.type === 2 ? columnDBBS : this.props.type === 1 ? columnDBPLDetail : this.props.type === 3 ? columnDBPL : this.props.type === 4 ? columnDBFR : this.props.type === 5 ? columnDBTP : this.props.type === 7 ? columnDBCF : this.props.type === 21 ? columnDBOI : columns}
columns={this.props.type === 2 ? columnDBBS : this.props.type === 1 ? columnDBPLDetail : this.props.type === 3 ? columnDBPL : this.props.type === 4 ? columnDBFR : this.props.type === 5 ? columnDBTP : this.props.type === 7 ? columnDBCF : this.props.type === 21 ? columnDBOI : this.props.type === 6? columnDBCF : columns}
options={options}
/>
</MuiThemeProvider>
......
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