Commit d4d7e0a5 authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

push

See merge request !1133
parents 53ea4ea1 c76483de
...@@ -274,6 +274,7 @@ const create = (type = "") => { ...@@ -274,6 +274,7 @@ const create = (type = "") => {
const getHierarkiReportYtd = (body) => api.post('/transaction/summary_ytd/summary/get_report_hierarki', body) const getHierarkiReportYtd = (body) => api.post('/transaction/summary_ytd/summary/get_report_hierarki', body)
const getHierarkiReportHistorical = (body) => api.post('/transaction/summary_historical/summary/get_report_hierarki', body) const getHierarkiReportHistorical = (body) => api.post('/transaction/summary_historical/summary/get_report_hierarki', body)
const getHierarkiReportMTD = (body) => api.post('/transaction/summary_mtd/summary/get_report_hierarki', body) const getHierarkiReportMTD = (body) => api.post('/transaction/summary_mtd/summary/get_report_hierarki', body)
const getHierarkiReportCPSM = (body) => api.post('/transaction/summary_cpsm/summary/get_report_hierarki', body)
const getFullApproveMB = (body) => api.post('/transaction/master_budget/get_approved_submit', body) const getFullApproveMB = (body) => api.post('/transaction/master_budget/get_approved_submit', body)
const getFullApproveMonthly = (body) => api.post('/transaction/monthly_report/get_approved_submit', body) const getFullApproveMonthly = (body) => api.post('/transaction/monthly_report/get_approved_submit', body)
...@@ -655,6 +656,7 @@ const create = (type = "") => { ...@@ -655,6 +656,7 @@ const create = (type = "") => {
getHierarkiReportHistorical, getHierarkiReportHistorical,
getHierarkiReportMTD, getHierarkiReportMTD,
getHierarkiReportYtd, getHierarkiReportYtd,
getHierarkiReportCPSM,
getHierarkiCreateReportFRMB, getHierarkiCreateReportFRMB,
getHierarkiCreateReportFRMR, getHierarkiCreateReportFRMR,
createReportFRMB, createReportFRMB,
......
...@@ -634,7 +634,7 @@ export default class ProfitLossMR extends Component { ...@@ -634,7 +634,7 @@ export default class ProfitLossMR extends Component {
}) })
}) })
console.log(this.state.dataTable);
// console.log(JSON.stringify(data)) // console.log(JSON.stringify(data))
let payload = { let payload = {
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
...@@ -690,28 +690,31 @@ export default class ProfitLossMR extends Component { ...@@ -690,28 +690,31 @@ export default class ProfitLossMR extends Component {
if (type === "actual") { if (type === "actual") {
// console.log(val); // console.log(val);
dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1) dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
} else {
let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2])
if (indexParent > 0) {
dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
let jagain = Number(dataTable2[indexParent][10]).toFixed(1)
dataTable2[indexParent][10] = jagain === undefined ? (0 + Number(val)).toFixed(1) : Number(Number(jagain) + Number(val)).toFixed(1)
} else {
dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
}
} }
// else {
// let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2])
// if (indexParent > 0) {
// dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
// let jagain = Number(dataTable2[indexParent][10]).toFixed(1)
// dataTable2[indexParent][10] = jagain === undefined ? (0 + Number(val)).toFixed(1) : Number(Number(jagain) + Number(val)).toFixed(1)
// } else {
// dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
// }
// }
} }
const handleValue = (data, type) => { const handleValue = (value, data) => {
let total = 0 let total = 0
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (data.rowData[1] == item[2]) { if (data.rowData[1] == item[2]) {
total = item[data.columnIndex + type] == undefined ? (Number(total) + 0) : (Number(total) + Number(String(item[data.columnIndex + type]).includes('-') ? Number(String(item[data.columnIndex + type]).substr(1, String(item[data.columnIndex + type]).length)) * -1 : Number(item[data.columnIndex + type]))) total = item[10] == undefined ? (Number(total) + 0) : (Number(total) + Number(String(item[10]).includes('-') ? Number(String(item[10]).substr(1, String(item[10]).length)) * -1 : Number(item[10])))
} }
}) })
// if (data.rowData[5] == 'Revenue') {
// console.log(total)
// }
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[data.rowIndex][2]) let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[data.rowIndex][2])
let a = dataTable2[data.rowIndex][data.columnIndex + type] = Number(total) let a = dataTable2[data.rowIndex][10] = Number(total)
// console.log(indexParent);
return a return a
} }
const handleFormula = (data, tableMeta, type) => { const handleFormula = (data, tableMeta, type) => {
...@@ -1079,38 +1082,6 @@ export default class ProfitLossMR extends Component { ...@@ -1079,38 +1082,6 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
// tableMeta.rowData[0] === 2 ?
// <span style={{ fontSize: 12, textAlign: 'right' }}>
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValue(tableMeta, 0)).toFixed(1)}
// decimalScale={1}
// />
// </span>
// :
// tableMeta.rowData[0] === 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={tableMeta.rowData[8]}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(value, tableMeta, 0)).toFixed(1)}
// decimalScale={1}
// />
// }
// />
// </div>
// :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1146,37 +1117,6 @@ export default class ProfitLossMR extends Component { ...@@ -1146,37 +1117,6 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
// tableMeta.rowData[0] === 2 ?
// <span style={{ fontSize: 12, textAlign: 'right' }}>
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValue(tableMeta, 1)).toFixed(1)}
// decimalScale={1}
// />
// </span> :
// tableMeta.rowData[0] === 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={tableMeta.rowData[9]}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(value, tableMeta, 1)).toFixed(1)}
// decimalScale={1}
// />
// }
// />
// </div>
// :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1244,7 +1184,8 @@ export default class ProfitLossMR extends Component { ...@@ -1244,7 +1184,8 @@ export default class ProfitLossMR extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
value={Number(handleValue(tableMeta, 2)).toFixed(1)} value={Number(handleValue(value, tableMeta)).toFixed(1)}
// value={Number(handleValue(tableMeta, 2)).toFixed(1)}
/> />
</span> : </span> :
tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 5 ?
...@@ -1328,36 +1269,6 @@ export default class ProfitLossMR extends Component { ...@@ -1328,36 +1269,6 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
// tableMeta.rowData[0] === 2 ?
// <span style={{ fontSize: 12, textAlign: 'right' }}>
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValue(tableMeta, 0)).toFixed(1)}
// />
// </span>
// :
// tableMeta.rowData[0] === 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={Number(tableMeta.rowData[11]).toFixed(1)}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(val, tableMeta, 0)).toFixed(1)}
// />
// }
// />
// </div>
// :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1406,38 +1317,6 @@ export default class ProfitLossMR extends Component { ...@@ -1406,38 +1317,6 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
// tableMeta.rowData[0] === 2 ?
// <span style={{ fontSize: 12, textAlign: 'right' }}>
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValue(tableMeta, 0)).toFixed(1)}
// decimalScale={1}
// />
// </span>
// :
// tableMeta.rowData[0] === 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={Number(tableMeta.rowData[12]).toFixed(1)}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(val, tableMeta, 0)).toFixed(1)}
// decimalScale={1}
// />
// }
// />
// </div>
// :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
......
...@@ -892,92 +892,151 @@ export default class SummaryOfTriputra extends Component { ...@@ -892,92 +892,151 @@ export default class SummaryOfTriputra extends Component {
} }
}) })
} else if (this.state.report.value === 3) { } else if (this.state.report.value === 3) {
// api.create().getReportHierarkiPL(payload).then(response => { api.create().getHierarkiReportCPSM(payload).then(response => {
// // console.log(response); console.log(payload);
// if (response.data) { console.log(response);
let dataTable = [] let dataTable = []
// console.log(response) if (response.data) {
// let res = response.data.data let res = [response.data.data]
// const handlePushChild = (item) => { const handlePushChild = (item) => {
// dataTable.push([ let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
// item.type_report_id, if (indexIDzz === -1) {
// item.id, dataTable.push([
// item.parent, // item.company_id,
// item.formula, 0,
// item.level, item.parent,
// item.description, item.level,
// item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before, item.item_name,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january, item.revenue_last_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february, item.revenue_ol,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march, item.revenue_mb,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april, item.revenue_percent_of_mb,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may, item.revenue_next_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june, item.revenue_next_two_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july, item.ebitda_last_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august, item.ebitda_ol,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september, item.ebitda_mb,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october, item.ebitda_percent_of_mb,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november, item.ebitda_next_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december, item.ebitda_next_two_year,
// item.profit_detail.total_current_year, item.tpat_last_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year, item.tpat_ol,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year, item.tpat_mb,
// item.order, item.tpat_percent_of_mb,
// item.condition_it_should_be, item.tpat_next_year,
// item.condition_if_wrong, item.tpat_next_two_year,
// item.profit_detail.forecast_formula == null ? [] : item.profit_detail.forecast_formula item.npat_last_year,
// ]) item.npat_ol,
item.npat_mb,
// if (item.children !== null) { item.npat_percent_of_mb,
// if (item.children.length > 0) { item.npat_next_year,
// item.children.map((items, indexs) => { item.npat_next_two_year,
// handlePushChild(items) item.roic_ol,
// }) item.roic_next_year,
// } item.roic_next_two_year,
// } item.ebitda_margin_ol,
// } item.ebitda_margin_next_year,
// res.map((item, index) => { item.ebitda_margin_next_two_year,
// dataTable.push([ item.tpat_margin_ol,
// item.type_report_id, item.tpat_margin_next_year,
// item.id, item.tpat_margin_next_two_year,
// item.parent, item.percent_revenue_yoy_ol,
// item.formula, item.percent_revenue_yoy_next_year,
// item.level, item.percent_revenue_yoy_next_two_year,
// item.description, item.percent_ebitda_yoy_ol,
// item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before, item.percent_ebitda_yoy_next_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january, item.percent_ebitda_yoy_next_two_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february, item.percent_tpat_yoy_ol,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march, item.percent_tpat_yoy_next_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april, item.percent_tpat_yoy_next_two_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may, item.percent_npat_yoy_ol,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june, item.percent_npat_yoy_next_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july, item.percent_npat_yoy_next_two_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august, // item.npat_margin_ol,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september, // item.npat_margin_next_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october, // item.npat_margin_next_two_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november, item.order,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december, ])
// item.profit_detail.total_current_year, }
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year, if (item.children !== null) {
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year, if (item.children.length > 0) {
// item.order, item.children.map((items, indexs) => {
// item.condition_it_should_be, handlePushChild(items)
// item.condition_if_wrong, })
// item.profit_detail.forecast_formula == null ? [] : item.profit_detail.forecast_formula }
// ]) }
// if (item.children !== null) { }
// if (item.children.length > 0) { res.map((item, index) => {
// item.children.map((items, indexs) => { dataTable.push([
// handlePushChild(items) // item.company_id,
// }) 0,
// } item.parent,
// } item.level,
// }) item.item_name,
item.revenue_last_year,
item.revenue_ol,
item.revenue_mb,
item.revenue_percent_of_mb,
item.revenue_next_year,
item.revenue_next_two_year,
item.ebitda_last_year,
item.ebitda_ol,
item.ebitda_mb,
item.ebitda_percent_of_mb,
item.ebitda_next_year,
item.ebitda_next_two_year,
item.tpat_last_year,
item.tpat_ol,
item.tpat_mb,
item.tpat_percent_of_mb,
item.tpat_next_year,
item.tpat_next_two_year,
item.npat_last_year,
item.npat_ol,
item.npat_mb,
item.npat_percent_of_mb,
item.npat_next_year,
item.npat_next_two_year,
item.roic_ol,
item.roic_next_year,
item.roic_next_two_year,
item.ebitda_margin_ol,
item.ebitda_margin_next_year,
item.ebitda_margin_next_two_year,
item.tpat_margin_ol,
item.tpat_margin_next_year,
item.tpat_margin_next_two_year,
item.percent_revenue_yoy_ol,
item.percent_revenue_yoy_next_year,
item.percent_revenue_yoy_next_two_year,
item.percent_ebitda_yoy_ol,
item.percent_ebitda_yoy_next_year,
item.percent_ebitda_yoy_next_two_year,
item.percent_tpat_yoy_ol,
item.percent_tpat_yoy_next_year,
item.percent_tpat_yoy_next_two_year,
item.percent_npat_yoy_ol,
item.percent_npat_yoy_next_year,
item.percent_npat_yoy_next_two_year,
// item.npat_margin_ol,
// item.npat_margin_next_year,
// item.npat_margin_next_two_year,
item.order,
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
})
console.log(dataTable);
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true }) this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// } else { } else {
// this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
// } }
// }) })
} else if (this.state.report.value === 4) { } else if (this.state.report.value === 4) {
api.create().getHierarkiReportHistorical(newPayload).then(response => { api.create().getHierarkiReportHistorical(newPayload).then(response => {
console.log(newPayload); console.log(newPayload);
......
...@@ -4350,6 +4350,21 @@ export default class TableSummaryTriputra extends Component { ...@@ -4350,6 +4350,21 @@ export default class TableSummaryTriputra extends Component {
const columnCPSM = [ const columnCPSM = [
{ {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "Company", name: "Company",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
...@@ -4361,7 +4376,14 @@ export default class TableSummaryTriputra extends Component { ...@@ -4361,7 +4376,14 @@ export default class TableSummaryTriputra extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ width: 300 }}> <div style={{ width: 300 }}>
{ val } {
tableMeta.rowData[2] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(val).toUpperCase()}</span>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[2]) }}>
<span style={{ fontSize: 12 }}>{val}</span>
</div>
}
</div> </div>
) )
} }
...@@ -4370,7 +4392,7 @@ export default class TableSummaryTriputra extends Component { ...@@ -4370,7 +4392,7 @@ export default class TableSummaryTriputra extends Component {
name: `Revenue`, name: `Revenue`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} > <th style={{ ...style2, backgroundColor: '#1c71b8', top: 0, color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
<div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div> <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div className="grid grid-2x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}> <div className="grid grid-2x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1 grid grid-3x" style={{ placeSelf: 'center', textAlign: 'center' }}> <div className="column-1 grid grid-3x" style={{ placeSelf: 'center', textAlign: 'center' }}>
...@@ -4400,43 +4422,119 @@ export default class TableSummaryTriputra extends Component { ...@@ -4400,43 +4422,119 @@ export default class TableSummaryTriputra extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => { customBodyRender: (val, tableMeta, updateValue) => {
console.log(tableMeta)
console.log(val)
return ( return (
<div> <div>
<div className="grid grid-2x content-center"> <div className="grid grid-2x content-center">
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
<div className="col-1"> <div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}> <div style={{ flex: 1}}>
{val.a} <FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[4]).toFixed(2)}
/>
}
/>
</div> </div>
</div> </div>
<div className="col-2"> <div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}> <div style={{ flex: 1}}>
{val.b} <FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[5]).toFixed(2)}
/>
}
/>
</div> </div>
</div> </div>
<div className="col-3"> <div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}> <div style={{ flex: 1}}>
{val.c} <FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[6]).toFixed(2)}
/>
}
/>
</div> </div>
</div> </div>
</div> </div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
<div className="col-1"> <div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}> <div style={{ flex: 1 }}>
{val.d} <FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
suffix={'%'}
value={tableMeta.rowData[7]}
/>
}
/>
</div> </div>
</div> </div>
<div className="col-2"> <div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}> <div style={{ flex: 1}}>
{val.e} <FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(2)}
/>
}
/>
</div> </div>
</div> </div>
<div className="col-3"> <div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}> <div style={{ flex: 1}}>
{val.f} <FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(2)}
/>
}
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -4445,6 +4543,36 @@ export default class TableSummaryTriputra extends Component { ...@@ -4445,6 +4543,36 @@ export default class TableSummaryTriputra extends Component {
) )
} }
} }
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, { }, {
name: `EBITDA`, name: `EBITDA`,
options: { options: {
...@@ -4484,8 +4612,21 @@ export default class TableSummaryTriputra extends Component { ...@@ -4484,8 +4612,21 @@ export default class TableSummaryTriputra extends Component {
<div className="grid grid-2x content-center"> <div className="grid grid-2x content-center">
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
<div className="col-1"> <div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}> <div style={{ flex: 1 }}>
{val.a} <FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(2)}
/>
}
/>
</div> </div>
</div> </div>
<div className="col-2"> <div className="col-2">
...@@ -4522,7 +4663,37 @@ export default class TableSummaryTriputra extends Component { ...@@ -4522,7 +4663,37 @@ export default class TableSummaryTriputra extends Component {
} }
} }
}, { }, {
name: `NPAT`, name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: `TPAT`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} > <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
...@@ -4598,7 +4769,37 @@ export default class TableSummaryTriputra extends Component { ...@@ -4598,7 +4769,37 @@ export default class TableSummaryTriputra extends Component {
} }
} }
}, { }, {
name: `TPAT`, name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: `NPAT`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} > <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
...@@ -4674,7 +4875,37 @@ export default class TableSummaryTriputra extends Component { ...@@ -4674,7 +4875,37 @@ export default class TableSummaryTriputra extends Component {
} }
} }
}, { }, {
name: `TPAT`, name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: `ROIC`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} > <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
...@@ -4717,6 +4948,21 @@ export default class TableSummaryTriputra extends Component { ...@@ -4717,6 +4948,21 @@ export default class TableSummaryTriputra extends Component {
) )
} }
} }
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, { }, {
name: `EBITDA Margin`, name: `EBITDA Margin`,
options: { options: {
...@@ -4761,6 +5007,21 @@ export default class TableSummaryTriputra extends Component { ...@@ -4761,6 +5007,21 @@ export default class TableSummaryTriputra extends Component {
) )
} }
} }
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, { }, {
name: `TPAT Margin`, name: `TPAT Margin`,
options: { options: {
...@@ -4805,6 +5066,21 @@ export default class TableSummaryTriputra extends Component { ...@@ -4805,6 +5066,21 @@ export default class TableSummaryTriputra extends Component {
) )
} }
} }
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, { }, {
name: `% Revenue YoY`, name: `% Revenue YoY`,
options: { options: {
...@@ -4849,6 +5125,21 @@ export default class TableSummaryTriputra extends Component { ...@@ -4849,6 +5125,21 @@ export default class TableSummaryTriputra extends Component {
) )
} }
} }
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, { }, {
name: `% EBITDA YoY`, name: `% EBITDA YoY`,
options: { options: {
...@@ -4894,7 +5185,22 @@ export default class TableSummaryTriputra extends Component { ...@@ -4894,7 +5185,22 @@ export default class TableSummaryTriputra extends Component {
} }
} }
}, { }, {
name: `TPAT Margin`, name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: `% TPAT YoY`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} > <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
...@@ -4937,6 +5243,21 @@ export default class TableSummaryTriputra extends Component { ...@@ -4937,6 +5243,21 @@ export default class TableSummaryTriputra extends Component {
) )
} }
} }
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, { }, {
name: `% NPAT YoY`, name: `% NPAT YoY`,
options: { options: {
...@@ -4981,7 +5302,22 @@ export default class TableSummaryTriputra extends Component { ...@@ -4981,7 +5302,22 @@ export default class TableSummaryTriputra extends Component {
) )
} }
} }
}, {
name: "",
options: {
display: false
} }
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
},
] ]
const columns = [] const columns = []
...@@ -4991,7 +5327,7 @@ export default class TableSummaryTriputra extends Component { ...@@ -4991,7 +5327,7 @@ export default class TableSummaryTriputra extends Component {
<div style={{ padding: '0px 20px 20px 20px', width: this.props.width - (this.props.open === true ? 350 : 100) }}> <div style={{ padding: '0px 20px 20px 20px', width: this.props.width - (this.props.open === true ? 350 : 100) }}>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={this.props.type === 3 ? datas : dataTable2} data={dataTable2}
columns={this.props.type === 1 ? columnMTD : this.props.type === 2 ? columnYTD : this.props.type === 3 ? columnCPSM : this.props.type === 4 ? columnHistorical : columns} columns={this.props.type === 1 ? columnMTD : this.props.type === 2 ? columnYTD : this.props.type === 3 ? columnCPSM : this.props.type === 4 ? columnHistorical : columns}
options={options} options={options}
/> />
......
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