Commit 136ec101 authored by Riri Novita's avatar Riri Novita

pl semua

parent 02e5bcba
...@@ -1402,34 +1402,56 @@ export default class SubHolding extends Component { ...@@ -1402,34 +1402,56 @@ export default class SubHolding extends Component {
let ytd_actual = item.profit_loss.ytd_actual == ''? 0 : item.profit_loss.ytd_actual let ytd_actual = item.profit_loss.ytd_actual == ''? 0 : item.profit_loss.ytd_actual
let ytd_mb = item.profit_loss.ytd_mb == ''? 0 : item.profit_loss.ytd_mb let ytd_mb = item.profit_loss.ytd_mb == ''? 0 : item.profit_loss.ytd_mb
let persenYtd = Number(ytd_actual/ytd_mb) let ytd_last_year = item.profit_loss.ytd_last_year == ''? 0 : item.profit_loss.ytd_last_year
let persenYtdMB = Number(ytd_actual/ytd_mb)
let persenYtdLY = Number(ytd_actual/ytd_last_year)
let q1_actual = item.profit_loss.q1_actual == ''? 0 : item.profit_loss.q1_actual let q1_actual = item.profit_loss.q1_actual == ''? 0 : item.profit_loss.q1_actual
let q1_mb = item.profit_loss.q1_mb == ''? 0 : item.profit_loss.q1_mb let q1_mb = item.profit_loss.q1_mb == ''? 0 : item.profit_loss.q1_mb
let persenQuarter = Number(q1_actual/q1_mb) let q1_last_year = item.profit_loss.q1_last_year == ''? 0 : item.profit_loss.q1_last_year
let persenQuarterMB = Number(q1_actual/q1_mb)
let persenQuarterLY = Number(q1_actual/q1_last_year)
let fy_actual = item.profit_loss.fy_actual == ''? 0 : item.profit_loss.fy_actual let fy_actual = item.profit_loss.fy_actual == ''? 0 : item.profit_loss.fy_actual
let fy_mb = item.profit_loss.fy_mb == ''? 0 : item.profit_loss.fy_mb let fy_mb = item.profit_loss.fy_mb == ''? 0 : item.profit_loss.fy_mb
let persenFy = Number(fy_actual/fy_mb) let fy_ol = item.profit_loss.fy_ol == ''? 0 : item.profit_loss.fy_ol
let fy_last_year = item.profit_loss.fy_last_year == ''? 0 : item.profit_loss.fy_last_year
let persenFyMB = Number(fy_actual/fy_mb)
let persenFyOL = Number(fy_actual/fy_ol)
let persenFyLY = Number(fy_actual/fy_last_year)
let persenFyOLMB = Number(fy_ol/fy_mb)
dbSumaPL.push([ dbSumaPL.push([
item.type_report_id,
item.id, item.id,
item.parent,
item.formula,
item.level,
item.description,
item.profit_loss.mtd_actual, item.profit_loss.mtd_actual,
item.profit_loss.mtd, item.profit_loss.mtd_mb,
isNaN(persenMtd)? 0 : persenMtd * 100, isNaN(persenMtd) || persenMtd == 'Infinity' || persenMtd == '-Infinity'? (item.profit_loss.mtd_mb == '' || item.profit_loss.mtd_mb == 0? -0 : 0) : (item.profit_loss.mtd_mb == '' || item.profit_loss.mtd_mb == 0? persenMtd * -100 : persenMtd * 100),
item.profit_loss.mtd_last_year, item.profit_loss.mtd_last_year,
item.profit_loss.ytd_actual, item.profit_loss.ytd_actual,
item.profit_loss.ytd, item.profit_loss.ytd_mb,
isNaN(persenYtd)? 0 : persenYtd * 100, isNaN(persenYtdMB) || persenYtdMB == 'Infinity' || persenYtdMB == '-Infinity'? (item.profit_loss.ytd_mb == '' || item.profit_loss.ytd_mb == 0? -0 : 0) : (item.profit_loss.ytd_mb == '' || item.profit_loss.ytd_mb == 0? persenYtdMB * -100 : persenYtdMB * 100),
item.profit_loss.ytd_last_year, item.profit_loss.ytd_last_year,
item.profit_loss.quarter_actual, isNaN(persenYtdLY) || persenYtdLY == 'Infinity' || persenYtdLY == '-Infinity'? (item.profit_loss.ytd_last_year == '' || item.profit_loss.ytd_last_year == 0? -0 : 0) : (item.profit_loss.ytd_last_year == '' || item.profit_loss.ytd_last_year == 0? persenYtdLY * -100 : persenYtdLY * 100),
item.profit_loss.quarter, item.profit_loss.q1_actual,
isNaN(persenQuarter)? 0 : persenQuarter * 100, item.profit_loss.q1_mb,
item.profit_loss.quarter_last_year, isNaN(persenQuarterMB) || persenQuarterMB == 'Infinity' || persenQuarterMB == '-Infinity'? (item.profit_loss.q1_mb == '' || item.profit_loss.q1_mb == 0? -0 : 0) : (item.profit_loss.q1_mb == '' || item.profit_loss.q1_mb == 0? persenQuarterMB * -100 : persenQuarterMB * 100),
item.profit_loss.q1_last_year,
isNaN(persenQuarterLY) || persenQuarterLY == 'Infinity' || persenQuarterLY == '-Infinity'? (item.profit_loss.q1_last_year == '' || item.profit_loss.q1_last_year == 0? -0 : 0) : (item.profit_loss.q1_last_year == '' || item.profit_loss.q1_last_year == 0? persenQuarterLY * -100 : persenQuarterLY * 100),
item.profit_loss.fy_actual, item.profit_loss.fy_actual,
item.profit_loss.fy, item.profit_loss.fy_mb,
isNaN(persenFy)? 0 : persenFy * 100, isNaN(persenFyMB) || persenFyMB == 'Infinity' || persenFyMB == '-Infinity'? (item.profit_loss.fy_mb == '' || item.profit_loss.fy_mb == 0? -0 : 0) : (item.profit_loss.fy_mb == '' || item.profit_loss.fy_mb == 0? persenFyMB * -100 : persenFyMB * 100),
item.profit_loss.fy_ol,
isNaN(persenFyOL) || persenFyOL == 'Infinity' || persenFyOL == '-Infinity'? (item.profit_loss.fy_ol == '' || item.profit_loss.fy_ol == 0? -0 : 0) : (item.profit_loss.fy_ol == '' || item.profit_loss.fy_ol == 0? persenFyOL * -100 : persenFyOL * 100),
item.profit_loss.fy_last_year, item.profit_loss.fy_last_year,
isNaN(persenFyLY) || persenFyLY == 'Infinity' || persenFyLY == '-Infinity'? (item.profit_loss.fy_last_year == '' || item.profit_loss.fy_last_year == 0? -0 : 0) : (item.profit_loss.fy_last_year == '' || item.profit_loss.fy_last_year == 0? persenFyLY * -100 : persenFyLY * 100),
isNaN(persenFyOLMB) || persenFyOLMB == 'Infinity' || persenFyOLMB == '-Infinity'? (item.profit_loss.fy_percent_ach_ol_to_mb == '' || item.profit_loss.fy_percent_ach_ol_to_mb == 0? -0 : 0) : (item.profit_loss.fy_percent_ach_ol_to_mb == '' || item.profit_loss.fy_percent_ach_ol_to_mb == 0? persenFyOLMB * -100 : persenFyOLMB * 100),
item.profit_loss.forecast_next_year,
item.profit_loss.forecast_more_year
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -1442,39 +1464,59 @@ export default class SubHolding extends Component { ...@@ -1442,39 +1464,59 @@ export default class SubHolding extends Component {
} }
res.map((item,index) => { res.map((item,index) => {
let mtd_actual = item.profit_loss.mtd_actual == ''? 0 : item.profit_loss.mtd_actual let mtd_actual = item.profit_loss.mtd_actual == ''? 0 : item.profit_loss.mtd_actual
let mtd = item.profit_loss.mtd == ''? 0 : item.profit_loss.mtd let mtd_mb = item.profit_loss.mtd_mb == ''? 0 : item.profit_loss.mtd_mb
let persenMtd = Number(mtd_actual/mtd) let persenMtd = Number(mtd_actual/mtd_mb)
console.log(persenMtd)
let ytd_actual = item.profit_loss.ytd_actual == ''? 0 : item.profit_loss.ytd_actual let ytd_actual = item.profit_loss.ytd_actual == ''? 0 : item.profit_loss.ytd_actual
let ytd = item.profit_loss.ytd == ''? 0 : item.profit_loss.ytd let ytd_mb = item.profit_loss.ytd_mb == ''? 0 : item.profit_loss.ytd_mb
let persenYtd = Number(ytd_actual/ytd) let ytd_last_year = item.profit_loss.ytd_last_year == ''? 0 : item.profit_loss.ytd_last_year
let persenYtdMB = Number(ytd_actual/ytd_mb)
let persenYtdLY = Number(ytd_actual/ytd_last_year)
let quarter_actual = item.profit_loss.quarter_actual == ''? 0 : item.profit_loss.quarter_actual let q1_actual = item.profit_loss.q1_actual == ''? 0 : item.profit_loss.q1_actual
let quarter = item.profit_loss.quarter == ''? 0 : item.profit_loss.quarter let q1_mb = item.profit_loss.q1_mb == ''? 0 : item.profit_loss.q1_mb
let persenQuarter = Number(quarter_actual/quarter) let q1_last_year = item.profit_loss.q1_last_year == ''? 0 : item.profit_loss.q1_last_year
let persenQuarterMB = Number(q1_actual/q1_mb)
let persenQuarterLY = Number(q1_actual/q1_last_year)
let fy_actual = item.profit_loss.fy_actual == ''? 0 : item.profit_loss.fy_actual let fy_actual = item.profit_loss.fy_actual == ''? 0 : item.profit_loss.fy_actual
let fy = item.profit_loss.fy == ''? 0 : item.profit_loss.fy let fy_mb = item.profit_loss.fy_mb == ''? 0 : item.profit_loss.fy_mb
let persenFy = Number(fy_actual/fy) let fy_ol = item.profit_loss.fy_ol == ''? 0 : item.profit_loss.fy_ol
let fy_last_year = item.profit_loss.fy_last_year == ''? 0 : item.profit_loss.fy_last_year
let persenFyMB = Number(fy_actual/fy_mb)
let persenFyOL = Number(fy_actual/fy_ol)
let persenFyLY = Number(fy_actual/fy_last_year)
let persenFyOLMB = Number(fy_ol/fy_mb)
dbSumaPL.push([ dbSumaPL.push([
item.type_report_id,
item.id, item.id,
item.parent,
item.formula,
item.level,
item.description,
item.profit_loss.mtd_actual, item.profit_loss.mtd_actual,
item.profit_loss.mtd_mb, item.profit_loss.mtd_mb,
isNaN(persenMtd) || persenMtd == 'Infinity' || persenMtd == '-Infinity'? (item.profit_loss.mtd == '' || item.profit_loss.mtd == 0? -0 : 0) : (item.profit_loss.mtd == '' || item.profit_loss.mtd == 0? persenMtd * -100 : persenMtd * 100), isNaN(persenMtd) || persenMtd == 'Infinity' || persenMtd == '-Infinity'? (item.profit_loss.mtd_mb == '' || item.profit_loss.mtd_mb == 0? -0 : 0) : (item.profit_loss.mtd_mb == '' || item.profit_loss.mtd_mb == 0? persenMtd * -100 : persenMtd * 100),
item.profit_loss.mtd_last_year, item.profit_loss.mtd_last_year,
item.profit_loss.ytd_actual, item.profit_loss.ytd_actual,
item.profit_loss.ytd, item.profit_loss.ytd_mb,
isNaN(persenYtd) || persenYtd == 'Infinity' || persenYtd == '-Infinity'? (item.profit_loss.ytd == '' || item.profit_loss.ytd == 0? -0 : 0) : (item.profit_loss.ytd == '' || item.profit_loss.ytd == 0? persenYtd * -100 : persenYtd * 100), isNaN(persenYtdMB) || persenYtdMB == 'Infinity' || persenYtdMB == '-Infinity'? (item.profit_loss.ytd_mb == '' || item.profit_loss.ytd_mb == 0? -0 : 0) : (item.profit_loss.ytd_mb == '' || item.profit_loss.ytd_mb == 0? persenYtdMB * -100 : persenYtdMB * 100),
item.profit_loss.ytd_last_year, item.profit_loss.ytd_last_year,
item.profit_loss.quarter_actual, isNaN(persenYtdLY) || persenYtdLY == 'Infinity' || persenYtdLY == '-Infinity'? (item.profit_loss.ytd_last_year == '' || item.profit_loss.ytd_last_year == 0? -0 : 0) : (item.profit_loss.ytd_last_year == '' || item.profit_loss.ytd_last_year == 0? persenYtdLY * -100 : persenYtdLY * 100),
item.profit_loss.quarter, item.profit_loss.q1_actual,
isNaN(persenQuarter) || persenQuarter == 'Infinity' || persenQuarter == '-Infinity'? (item.profit_loss.quarter == '' || item.profit_loss.quarter == 0? -0 : 0) : (item.profit_loss.quarter == '' || item.profit_loss.quarter == 0? persenQuarter * -100 : persenQuarter * 100), item.profit_loss.q1_mb,
item.profit_loss.quarter_last_year, isNaN(persenQuarterMB) || persenQuarterMB == 'Infinity' || persenQuarterMB == '-Infinity'? (item.profit_loss.q1_mb == '' || item.profit_loss.q1_mb == 0? -0 : 0) : (item.profit_loss.q1_mb == '' || item.profit_loss.q1_mb == 0? persenQuarterMB * -100 : persenQuarterMB * 100),
item.profit_loss.q1_last_year,
isNaN(persenQuarterLY) || persenQuarterLY == 'Infinity' || persenQuarterLY == '-Infinity'? (item.profit_loss.q1_last_year == '' || item.profit_loss.q1_last_year == 0? -0 : 0) : (item.profit_loss.q1_last_year == '' || item.profit_loss.q1_last_year == 0? persenQuarterLY * -100 : persenQuarterLY * 100),
item.profit_loss.fy_actual, item.profit_loss.fy_actual,
item.profit_loss.fy, item.profit_loss.fy_mb,
isNaN(persenFy) || persenFy == 'Infinity' || persenFy == '-Infinity'? (item.profit_loss.fy == '' || item.profit_loss.fy == 0? -0 : 0) : (item.profit_loss.fy == '' || item.profit_loss.fy == 0? persenFy * -100 : persenFy * 100), isNaN(persenFyMB) || persenFyMB == 'Infinity' || persenFyMB == '-Infinity'? (item.profit_loss.fy_mb == '' || item.profit_loss.fy_mb == 0? -0 : 0) : (item.profit_loss.fy_mb == '' || item.profit_loss.fy_mb == 0? persenFyMB * -100 : persenFyMB * 100),
item.profit_loss.fy_ol,
isNaN(persenFyOL) || persenFyOL == 'Infinity' || persenFyOL == '-Infinity'? (item.profit_loss.fy_ol == '' || item.profit_loss.fy_ol == 0? -0 : 0) : (item.profit_loss.fy_ol == '' || item.profit_loss.fy_ol == 0? persenFyOL * -100 : persenFyOL * 100),
item.profit_loss.fy_last_year, item.profit_loss.fy_last_year,
isNaN(persenFyLY) || persenFyLY == 'Infinity' || persenFyLY == '-Infinity'? (item.profit_loss.fy_last_year == '' || item.profit_loss.fy_last_year == 0? -0 : 0) : (item.profit_loss.fy_last_year == '' || item.profit_loss.fy_last_year == 0? persenFyLY * -100 : persenFyLY * 100),
isNaN(persenFyOLMB) || persenFyOLMB == 'Infinity' || persenFyOLMB == '-Infinity'? (item.profit_loss.fy_percent_ach_ol_to_mb == '' || item.profit_loss.fy_percent_ach_ol_to_mb == 0? -0 : 0) : (item.profit_loss.fy_percent_ach_ol_to_mb == '' || item.profit_loss.fy_percent_ach_ol_to_mb == 0? persenFyOLMB * -100 : persenFyOLMB * 100),
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
......
...@@ -1029,21 +1029,6 @@ export default class TableSubHolding extends Component { ...@@ -1029,21 +1029,6 @@ export default class TableSubHolding extends Component {
return total 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" }]
]
let dataSummaryBS = [
["ABCD", { a: "0", b: "0", c: "0", d: "0" }, { 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", { 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" }]
]
let dataSummaryPL = [
["ABCD", { 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", { 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" }]
]
let dataSummaryFR = [ let dataSummaryFR = [
["ABCD", "test unit", { 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" }], ["ABCD", "test unit", { 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", "unit try", { 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" }] ["Total Assets", "unit try", { 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" }]
...@@ -15311,6 +15296,31 @@ export default class TableSubHolding extends Component { ...@@ -15311,6 +15296,31 @@ export default class TableSubHolding extends Component {
const columnSummaryPL = [ const columnSummaryPL = [
{ {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "Account", name: "Account",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
...@@ -15322,13 +15332,20 @@ export default class TableSubHolding extends Component { ...@@ -15322,13 +15332,20 @@ export default class TableSubHolding extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ width: 300 }}> <div style={{ width: 300 }}>
{ val } {
tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
}
</div> </div>
) )
} }
} }
}, { }, {
name: `MTD 2021`, name: `MTD ${this.props.periode}`,
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)" }} >
...@@ -15353,32 +15370,101 @@ export default class TableSubHolding extends Component { ...@@ -15353,32 +15370,101 @@ export default class TableSubHolding 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-1x content-center"> <div className="grid grid-1x content-center">
<div className="grid grid-4x content-center"> <div className="grid grid-4x content-center">
<div className="col-1"> <div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-2"> <div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[7]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-3"> <div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-4"> <div className="col-4">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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(1)}
/>
}
/>
</div> </div>
}
</div> </div>
</div> </div>
</div> </div>
...@@ -15387,13 +15473,13 @@ export default class TableSubHolding extends Component { ...@@ -15387,13 +15473,13 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: `YTD 2021`, name: `YTD ${this.props.periode}`,
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)" }} >
<div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 50 }}>{columnMeta.name}</div> <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 50 }}>{columnMeta.name}</div>
<div className="grid grid-1x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}> <div className="grid grid-1x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center' }}> <div className="column-1 grid grid-5x" style={{ placeSelf: 'center', textAlign: 'center' }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}> <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Actual"}</span> <span>{"Actual"}</span>
</div> </div>
...@@ -15406,38 +15492,133 @@ export default class TableSubHolding extends Component { ...@@ -15406,38 +15492,133 @@ export default class TableSubHolding extends Component {
<div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d06' }}> <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d06' }}>
<span>{"Last Year"}</span> <span>{"Last Year"}</span>
</div> </div>
<div className="column-5" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d06' }}>
<span>{"% of LY"}</span>
</div>
</div> </div>
</div> </div>
</th> </th>
), ),
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-1x content-center"> <div className="grid grid-1x content-center">
<div className="grid grid-4x content-center"> <div className="grid grid-5x content-center">
<div className="col-1"> <div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-2"> <div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[11]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-3"> <div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[12]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-4"> <div className="col-4">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[13]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-5">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[14]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
</div> </div>
</div> </div>
...@@ -15446,13 +15627,13 @@ export default class TableSubHolding extends Component { ...@@ -15446,13 +15627,13 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: `Q1 2021`, name: `Q1 ${this.props.periode}`,
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)" }} >
<div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 50 }}>{columnMeta.name}</div> <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 50 }}>{columnMeta.name}</div>
<div className="grid grid-1x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}> <div className="grid grid-1x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center' }}> <div className="column-1 grid grid-5x" style={{ placeSelf: 'center', textAlign: 'center' }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}> <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Actual"}</span> <span>{"Actual"}</span>
</div> </div>
...@@ -15465,47 +15646,142 @@ export default class TableSubHolding extends Component { ...@@ -15465,47 +15646,142 @@ export default class TableSubHolding extends Component {
<div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d06' }}> <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d06' }}>
<span>{"Last Year"}</span> <span>{"Last Year"}</span>
</div> </div>
<div className="column-5" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d06' }}>
<span>{"% of LY"}</span>
</div>
</div> </div>
</div> </div>
</th> </th>
), ),
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-1x content-center"> <div className="grid grid-1x content-center">
<div className="grid grid-4x content-center"> <div className="grid grid-5x content-center">
<div className="col-1"> <div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
</div> : tableMeta.rowData[0] === 1 ?
</div> null :
<div className="col-2"> <div style={{ flex: 1 }}>
<div style={{ textAlign: 'center', width: 90 }}> <FormControlLabel
0.0 style={{ margin: 0 }}
</div> value={val}
</div> control={
<div className="col-3"> <NumberFormat
<div style={{ textAlign: 'center', width: 90 }}> thousandSeparator={true}
0.0 style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
</div> type="text"
</div> placeholder=""
<div className="col-4"> disabled={true}
<div style={{ textAlign: 'center', width: 90 }}> value={Number(tableMeta.rowData[15]).toFixed(1)}
0.0 />
</div> }
</div> />
</div> </div>
</div> }
</div> </div>
) <div className="col-2">
} {tableMeta.rowData[0] === 4 ?
} null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[16]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[17]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-4">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[18]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-5">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[19]).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
</div>
</div>
)
}
}
}, { }, {
name: `FY 2021`, name: `FY ${this.props.periode}`,
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)" }} >
...@@ -15544,57 +15820,198 @@ export default class TableSubHolding extends Component { ...@@ -15544,57 +15820,198 @@ export default class TableSubHolding 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="col-1"> <div className="col-1">
<div className="grid grid-4x content-center"> <div className="grid grid-4x content-center">
<div className="col-1"> <div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[20]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-2"> <div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[21]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-3"> <div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[22]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-4"> <div className="col-4">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[23]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
</div> </div>
</div> </div>
<div className="col-2"> <div className="col-2">
<div className="grid grid-4x content-center"> <div className="grid grid-4x content-center">
<div className="col-1"> <div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[24]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-2"> <div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[25]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-3"> <div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[26]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
<div className="col-4"> <div className="col-4">
<div style={{ textAlign: 'center', width: 90 }}> {tableMeta.rowData[0] === 4 ?
0.0 null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[27]).toFixed(1)}
/>
}
/>
</div> </div>
}
</div> </div>
</div> </div>
</div> </div>
...@@ -15604,7 +16021,7 @@ export default class TableSubHolding extends Component { ...@@ -15604,7 +16021,7 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: "2022", name: `${Number(this.props.periode) + 1}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, top: 0, zIndex: 102, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} > <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, top: 0, zIndex: 102, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
...@@ -15613,7 +16030,7 @@ export default class TableSubHolding extends Component { ...@@ -15613,7 +16030,7 @@ export default class TableSubHolding extends Component {
</TableCell> */} </TableCell> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 50 }}>{columnMeta.name}</div> <div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 50 }}>{columnMeta.name}</div>
<div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}> <div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8', width: 96 }}> <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8', width: 145 }}>
<span>{"ForeCast"}</span> <span>{"ForeCast"}</span>
</div> </div>
</div> </div>
...@@ -15623,13 +16040,33 @@ export default class TableSubHolding extends Component { ...@@ -15623,13 +16040,33 @@ export default class TableSubHolding extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{textAlign: 'right' }}> <div style={{textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[28]).toFixed(1)}
/>
}
/>
</div>
}
</div> </div>
) )
} }
} }
}, { }, {
name: "2023", name: `${Number(this.props.periode) + 2}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, top: 0, zIndex: 102, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} > <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, top: 0, zIndex: 102, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
...@@ -15638,7 +16075,7 @@ export default class TableSubHolding extends Component { ...@@ -15638,7 +16075,7 @@ export default class TableSubHolding extends Component {
</TableCell> */} </TableCell> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 50 }}>{columnMeta.name}</div> <div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 50 }}>{columnMeta.name}</div>
<div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}> <div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8', width: 96 }}> <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8', width: 145 }}>
<span>{"ForeCast"}</span> <span>{"ForeCast"}</span>
</div> </div>
</div> </div>
...@@ -15648,12 +16085,123 @@ export default class TableSubHolding extends Component { ...@@ -15648,12 +16085,123 @@ export default class TableSubHolding extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{textAlign: 'right' }}> <div style={{textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<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[29]).toFixed(1)}
/>
}
/>
</div>
}
</div> </div>
) )
} }
} }
}, {
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: "",
options: {
display: false
}
}, {
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: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}
] ]
const columnSummaryFR = [ const columnSummaryFR = [
...@@ -16148,7 +16696,7 @@ export default class TableSubHolding extends Component { ...@@ -16148,7 +16696,7 @@ export default class TableSubHolding 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 === 8 ? dataSummaryPL : this.props.type === 9 ? dataSummaryFR : dataTable2} data={this.props.type === 9 ? dataSummaryFR : 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 ? columnSummaryBS : this.props.type === 21 ? columnDBOI : this.props.type === 6? columnDBCF : this.props.type === 8 ? columnSummaryPL : this.props.type === 9 ? columnSummaryFR : 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 ? columnSummaryBS : this.props.type === 21 ? columnDBOI : this.props.type === 6? columnDBCF : this.props.type === 8 ? columnSummaryPL : this.props.type === 9 ? columnSummaryFR : columns}
options={options} options={options}
/> />
...@@ -376,22 +376,22 @@ export default class ProfitLossMR extends Component { ...@@ -376,22 +376,22 @@ export default class ProfitLossMR extends Component {
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
"item_report_id": i[1], "item_report_id": i[1],
"notes": i[6], "notes": String(i[6]),
"rolling_outlook": i[7], "rolling_outlook": String(Number(i[7]).toFixed(1)),
"master_budget": i[8], "master_budget": String(Number(i[8]).toFixed(1)),
"rolling_budget": i[9], "rolling_budget": String(Number(i[9]).toFixed(1)),
"actual": i[10], "actual": String(Number(i[10]).toFixed(1)),
"ytd_actual": i[11], "ytd_actual": String(Number(i[11]).toFixed(1)),
"actual_previous_month": i[12], "actual_previous_month": String(Number(i[12]).toFixed(1)),
"amount_act_vs_previous_month": i[13], "amount_act_vs_previous_month": String(Number(i[13]).toFixed(1)),
"percent_act_vs_previous_month": i[14], "percent_act_vs_previous_month": String(Number(i[14]).toFixed(1)),
"amount_act_vs_mb": i[15], "amount_act_vs_mb": String(Number(i[15]).toFixed(1)),
"percent_act_vs_mb": i[16], "percent_act_vs_mb": String(Number(i[16]).toFixed(1)),
"amount_act_vs_rb": i[17], "amount_act_vs_rb": String(Number(i[17]).toFixed(1)),
"percent_act_vs_rb": i[18], "percent_act_vs_rb": String(Number(i[18]).toFixed(1)),
"mtd_vs_mb": i[19], "mtd_vs_mb": String(i[19]),
"mtd_vs_rb": i[20], "mtd_vs_rb": String(i[20]),
"mtd_vs_previous_month": i[21], "mtd_vs_previous_month": String(i[21]),
}) })
}) })
let payload = { let payload = {
...@@ -405,31 +405,31 @@ export default class ProfitLossMR extends Component { ...@@ -405,31 +405,31 @@ export default class ProfitLossMR extends Component {
} }
console.log(payload); console.log(payload);
// console.log(JSON.stringify(payload)); // console.log(JSON.stringify(payload));
api.create('UPLOAD').createMonthlyReportPL(payload).then(response => { // api.create('UPLOAD').createMonthlyReportPL(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { // if (response.data) {
if (response.data.status === "success") { // if (response.data.status === "success") {
if (type == 'submitted') { // if (type == 'submitted') {
this.props.saveToMonthlyReport('PL') // this.props.saveToMonthlyReport('PL')
} else { // } else {
this.props.saveToMonthlyReport() // this.props.saveToMonthlyReport()
} // }
} else { // } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => { // this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
document.body.style.overflow = 'unset'; // document.body.style.overflow = 'unset';
if (response.data.message.includes("Someone Logged In")) { // if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => { // setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) // localStorage.removeItem(Constant.TOKEN)
window.location.reload(); // window.location.reload();
}, 1000); // }, 1000);
} // }
this.props.saveToMonthlyReport() // this.props.saveToMonthlyReport()
}) // })
} // }
} else { // } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }) // this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 })
} // }
}) // })
} }
fileHandler = (event) => { fileHandler = (event) => {
......
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