Commit 53d61948 authored by faisalhamdi's avatar faisalhamdi

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

parents 5ecbed04 60b4d614
...@@ -843,7 +843,6 @@ export default class SubHolding extends Component { ...@@ -843,7 +843,6 @@ export default class SubHolding extends Component {
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let res = response.data.data let res = response.data.data
console.log(res)
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
...@@ -885,6 +884,7 @@ export default class SubHolding extends Component { ...@@ -885,6 +884,7 @@ export default class SubHolding extends Component {
item.tax_planning_report.monthly_october, item.tax_planning_report.monthly_october,
item.tax_planning_report.monthly_november, item.tax_planning_report.monthly_november,
item.tax_planning_report.monthly_december, item.tax_planning_report.monthly_december,
0
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -934,6 +934,7 @@ export default class SubHolding extends Component { ...@@ -934,6 +934,7 @@ export default class SubHolding extends Component {
item.tax_planning_report.monthly_october, item.tax_planning_report.monthly_october,
item.tax_planning_report.monthly_november, item.tax_planning_report.monthly_november,
item.tax_planning_report.monthly_december, item.tax_planning_report.monthly_december,
0
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -1086,7 +1087,7 @@ export default class SubHolding extends Component { ...@@ -1086,7 +1087,7 @@ export default class SubHolding extends Component {
} }
} }
}) })
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: false }) this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable }, () => { // this.setState({ dataTable }, () => {
// console.log(this.state.dataTable) // console.log(this.state.dataTable)
...@@ -1433,34 +1434,56 @@ export default class SubHolding extends Component { ...@@ -1433,34 +1434,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) {
...@@ -1473,39 +1496,59 @@ export default class SubHolding extends Component { ...@@ -1473,39 +1496,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) {
...@@ -2271,7 +2314,7 @@ export default class SubHolding extends Component { ...@@ -2271,7 +2314,7 @@ export default class SubHolding extends Component {
} }
} else if (this.state.report.value === 3) { } else if (this.state.report.value === 3) {
let res = await fetch( let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_profit_loss_detail/export_master_budget?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_profit_loss/export_report?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}`
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -2283,10 +2326,10 @@ export default class SubHolding extends Component { ...@@ -2283,10 +2326,10 @@ export default class SubHolding extends Component {
a.click(); a.click();
} }
} else if (this.state.report.value === 4) { } else if (this.state.report.value === 4) {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction//db_ratio/export_master_budget?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}` let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_ratio/export_report?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}`
console.log(url); console.log(url);
let res = await fetch( let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction//db_ratio/export_master_budget?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_ratio/export_report?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}`
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -2297,6 +2340,21 @@ export default class SubHolding extends Component { ...@@ -2297,6 +2340,21 @@ export default class SubHolding extends Component {
a.download = 'Report DB Financial Ratio.xlsx'; a.download = 'Report DB Financial Ratio.xlsx';
a.click(); a.click();
} }
} else if (this.state.report.value === 21) {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_operating_indicator/export_report?operating_indicator_id=${this.state.OPID === null ? "" : this.state.OPID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}`
console.log(url);
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_operating_indicator/export_report?operating_indicator_id=${this.state.OPID === null ? "" : this.state.OPID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}`
)
res = await res.blob()
this.setState({ loading: false })
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Report DB Operating Indicator.xlsx';
a.click();
}
} else { } else {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -2363,7 +2421,7 @@ export default class SubHolding extends Component { ...@@ -2363,7 +2421,7 @@ export default class SubHolding extends Component {
renderInput={(params) => <TextField {...params} label="Company" margin="normal" style={{ marginTop: 7 }} />} renderInput={(params) => <TextField {...params} label="Company" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.company} value={this.state.company}
/> />
{this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <Autocomplete {/* {this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <Autocomplete
{...this.state.listUom} {...this.state.listUom}
// getOptionLabel={(option) => titleCase(option.label)} // getOptionLabel={(option) => titleCase(option.label)}
id="uom" id="uom"
...@@ -2374,7 +2432,7 @@ export default class SubHolding extends Component { ...@@ -2374,7 +2432,7 @@ export default class SubHolding extends Component {
style={{ width: 250, marginLeft: 10 }} style={{ width: 250, marginLeft: 10 }}
renderInput={(params) => <TextField {...params} label="Uom" margin="normal" style={{ marginTop: 7 }} />} renderInput={(params) => <TextField {...params} label="Uom" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.uom} value={this.state.uom}
/> : null : null} /> : null : null} */}
</div> </div>
<div style={{ marginTop: 15, display: 'flex' }}> <div style={{ marginTop: 15, display: 'flex' }}>
<Autocomplete <Autocomplete
...@@ -2391,18 +2449,7 @@ export default class SubHolding extends Component { ...@@ -2391,18 +2449,7 @@ export default class SubHolding extends Component {
/>} />}
value={this.state.periode} value={this.state.periode}
/> />
{this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <Autocomplete
{...this.state.listMonths}
// getOptionLabel={(option) => titleCase(option.label)}
id="months"
onChange={(event, newInputValue) => this.setState({ month: newInputValue, loading: true, previewTable: false }, () => {
this.getReportType()
})}
disableClearable
style={{ width: 250, marginLeft: 10 }}
renderInput={(params) => <TextField {...params} label="Months" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.month}
/> : null : null}
{/* {this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <Autocomplete {/* {this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <Autocomplete
{...this.state.listQuarter} {...this.state.listQuarter}
// getOptionLabel={(option) => titleCase(option.label)} // getOptionLabel={(option) => titleCase(option.label)}
...@@ -2416,6 +2463,20 @@ export default class SubHolding extends Component { ...@@ -2416,6 +2463,20 @@ export default class SubHolding extends Component {
value={this.state.quarter} value={this.state.quarter}
/> : null : null} */} /> : null : null} */}
</div> </div>
{this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <div style={{ marginTop: 15, display: 'flex' }}>
<Autocomplete
{...this.state.listMonths}
// getOptionLabel={(option) => titleCase(option.label)}
id="months"
onChange={(event, newInputValue) => this.setState({ month: newInputValue, loading: true, previewTable: false }, () => {
this.getReportType()
})}
disableClearable
style={{ width: 250, marginLeft: 10 }}
renderInput={(params) => <TextField {...params} label="Months" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.month}
/>
</div> : null : null}
</div> </div>
<div> <div>
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0px 20px 10px 20px' }}> <div style={{ display: 'flex', justifyContent: 'space-between', padding: '0px 20px 10px 20px' }}>
......
...@@ -9595,8 +9595,7 @@ export default class TableSubHolding extends Component { ...@@ -9595,8 +9595,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[9]).toFixed(2) : Number(tableMeta.rowData[9]).toFixed(1)}
/> />
} }
/> />
...@@ -9619,7 +9618,7 @@ export default class TableSubHolding extends Component { ...@@ -9619,7 +9618,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[10]).toFixed(2) : Number(tableMeta.rowData[10]).toFixed(1)}
/> />
} }
/> />
...@@ -9642,7 +9641,7 @@ export default class TableSubHolding extends Component { ...@@ -9642,7 +9641,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[11]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[11]).toFixed(2) : Number(tableMeta.rowData[11]).toFixed(1)}
/> />
} }
/> />
...@@ -9665,7 +9664,7 @@ export default class TableSubHolding extends Component { ...@@ -9665,7 +9664,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[12]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[12]).toFixed(2) : Number(tableMeta.rowData[12]).toFixed(1)}
/> />
} }
/> />
...@@ -9690,7 +9689,7 @@ export default class TableSubHolding extends Component { ...@@ -9690,7 +9689,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[13]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[13]).toFixed(2) : Number(tableMeta.rowData[13]).toFixed(1)}
/> />
} }
/> />
...@@ -9713,7 +9712,7 @@ export default class TableSubHolding extends Component { ...@@ -9713,7 +9712,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[14]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[14]).toFixed(2) : Number(tableMeta.rowData[14]).toFixed(1)}
/> />
} }
/> />
...@@ -9736,7 +9735,7 @@ export default class TableSubHolding extends Component { ...@@ -9736,7 +9735,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[15]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[15]).toFixed(2) : Number(tableMeta.rowData[15]).toFixed(1)}
/> />
} }
/> />
...@@ -9759,7 +9758,7 @@ export default class TableSubHolding extends Component { ...@@ -9759,7 +9758,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[16]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[16]).toFixed(2) : Number(tableMeta.rowData[16]).toFixed(1)}
/> />
} }
/> />
...@@ -9784,7 +9783,7 @@ export default class TableSubHolding extends Component { ...@@ -9784,7 +9783,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[17]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[17]).toFixed(2) : Number(tableMeta.rowData[17]).toFixed(1)}
/> />
} }
/> />
...@@ -9807,7 +9806,7 @@ export default class TableSubHolding extends Component { ...@@ -9807,7 +9806,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[18]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[18]).toFixed(2) : Number(tableMeta.rowData[18]).toFixed(1)}
/> />
} }
/> />
...@@ -9830,7 +9829,7 @@ export default class TableSubHolding extends Component { ...@@ -9830,7 +9829,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[19]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[19]).toFixed(2) : Number(tableMeta.rowData[19]).toFixed(1)}
/> />
} }
/> />
...@@ -9853,7 +9852,7 @@ export default class TableSubHolding extends Component { ...@@ -9853,7 +9852,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[20]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[20]).toFixed(2) : Number(tableMeta.rowData[20]).toFixed(1)}
/> />
} }
/> />
...@@ -9991,7 +9990,7 @@ export default class TableSubHolding extends Component { ...@@ -9991,7 +9990,7 @@ export default class TableSubHolding extends Component {
<div className="col-1"> <div className="col-1">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10004,7 +10003,7 @@ export default class TableSubHolding extends Component { ...@@ -10004,7 +10003,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[22]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[22]).toFixed(2) : Number(tableMeta.rowData[22]).toFixed(1)}
/> />
} }
/> />
...@@ -10014,7 +10013,7 @@ export default class TableSubHolding extends Component { ...@@ -10014,7 +10013,7 @@ export default class TableSubHolding extends Component {
<div className="col-2"> <div className="col-2">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10027,7 +10026,7 @@ export default class TableSubHolding extends Component { ...@@ -10027,7 +10026,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[23]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[23]).toFixed(2) : Number(tableMeta.rowData[23]).toFixed(1)}
/> />
} }
/> />
...@@ -10037,7 +10036,7 @@ export default class TableSubHolding extends Component { ...@@ -10037,7 +10036,7 @@ export default class TableSubHolding extends Component {
<div className="col-3"> <div className="col-3">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10050,7 +10049,7 @@ export default class TableSubHolding extends Component { ...@@ -10050,7 +10049,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[24]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[24]).toFixed(2) : Number(tableMeta.rowData[24]).toFixed(1)}
/> />
} }
/> />
...@@ -10060,7 +10059,7 @@ export default class TableSubHolding extends Component { ...@@ -10060,7 +10059,7 @@ export default class TableSubHolding extends Component {
<div className="col-4"> <div className="col-4">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10073,7 +10072,7 @@ export default class TableSubHolding extends Component { ...@@ -10073,7 +10072,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[25]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[25]).toFixed(2) : Number(tableMeta.rowData[25]).toFixed(1)}
/> />
} }
/> />
...@@ -10085,7 +10084,7 @@ export default class TableSubHolding extends Component { ...@@ -10085,7 +10084,7 @@ export default class TableSubHolding extends Component {
<div className="col-1"> <div className="col-1">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10098,7 +10097,7 @@ export default class TableSubHolding extends Component { ...@@ -10098,7 +10097,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[26]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[26]).toFixed(2) : Number(tableMeta.rowData[26]).toFixed(1)}
/> />
} }
/> />
...@@ -10108,7 +10107,7 @@ export default class TableSubHolding extends Component { ...@@ -10108,7 +10107,7 @@ export default class TableSubHolding extends Component {
<div className="col-2"> <div className="col-2">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10121,7 +10120,7 @@ export default class TableSubHolding extends Component { ...@@ -10121,7 +10120,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[27]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[27]).toFixed(2) : Number(tableMeta.rowData[27]).toFixed(1)}
/> />
} }
/> />
...@@ -10131,7 +10130,7 @@ export default class TableSubHolding extends Component { ...@@ -10131,7 +10130,7 @@ export default class TableSubHolding extends Component {
<div className="col-3"> <div className="col-3">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10144,7 +10143,7 @@ export default class TableSubHolding extends Component { ...@@ -10144,7 +10143,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[28]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[28]).toFixed(2) : Number(tableMeta.rowData[28]).toFixed(1)}
/> />
} }
/> />
...@@ -10154,7 +10153,7 @@ export default class TableSubHolding extends Component { ...@@ -10154,7 +10153,7 @@ export default class TableSubHolding extends Component {
<div className="col-4"> <div className="col-4">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10167,7 +10166,7 @@ export default class TableSubHolding extends Component { ...@@ -10167,7 +10166,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[29]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[29]).toFixed(2) : Number(tableMeta.rowData[29]).toFixed(1)}
/> />
} }
/> />
...@@ -10179,7 +10178,7 @@ export default class TableSubHolding extends Component { ...@@ -10179,7 +10178,7 @@ export default class TableSubHolding extends Component {
<div className="col-1"> <div className="col-1">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10192,7 +10191,7 @@ export default class TableSubHolding extends Component { ...@@ -10192,7 +10191,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[30]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[30]).toFixed(2) : Number(tableMeta.rowData[30]).toFixed(1)}
/> />
} }
/> />
...@@ -10202,7 +10201,7 @@ export default class TableSubHolding extends Component { ...@@ -10202,7 +10201,7 @@ export default class TableSubHolding extends Component {
<div className="col-2"> <div className="col-2">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10215,7 +10214,7 @@ export default class TableSubHolding extends Component { ...@@ -10215,7 +10214,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[31]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[31]).toFixed(2) : Number(tableMeta.rowData[31]).toFixed(1)}
/> />
} }
/> />
...@@ -10225,7 +10224,7 @@ export default class TableSubHolding extends Component { ...@@ -10225,7 +10224,7 @@ export default class TableSubHolding extends Component {
<div className="col-3"> <div className="col-3">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10238,7 +10237,7 @@ export default class TableSubHolding extends Component { ...@@ -10238,7 +10237,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[32]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[32]).toFixed(2) : Number(tableMeta.rowData[32]).toFixed(1)}
/> />
} }
/> />
...@@ -10248,7 +10247,7 @@ export default class TableSubHolding extends Component { ...@@ -10248,7 +10247,7 @@ export default class TableSubHolding extends Component {
<div className="col-4"> <div className="col-4">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10261,7 +10260,7 @@ export default class TableSubHolding extends Component { ...@@ -10261,7 +10260,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[33]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[33]).toFixed(2) : Number(tableMeta.rowData[33]).toFixed(1)}
/> />
} }
/> />
...@@ -10271,7 +10270,7 @@ export default class TableSubHolding extends Component { ...@@ -10271,7 +10270,7 @@ export default class TableSubHolding extends Component {
<div className="col-5"> <div className="col-5">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[0] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -10284,7 +10283,7 @@ export default class TableSubHolding extends Component { ...@@ -10284,7 +10283,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[34]).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(tableMeta.rowData[34]).toFixed(2) : Number(tableMeta.rowData[34]).toFixed(1)}
/> />
} }
/> />
...@@ -15324,6 +15323,31 @@ export default class TableSubHolding extends Component { ...@@ -15324,6 +15323,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) => (
...@@ -15335,13 +15359,20 @@ export default class TableSubHolding extends Component { ...@@ -15335,13 +15359,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)" }} >
...@@ -15366,32 +15397,101 @@ export default class TableSubHolding extends Component { ...@@ -15366,32 +15397,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>
...@@ -15400,13 +15500,13 @@ export default class TableSubHolding extends Component { ...@@ -15400,13 +15500,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>
...@@ -15419,38 +15519,133 @@ export default class TableSubHolding extends Component { ...@@ -15419,38 +15519,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
</div> : 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>
...@@ -15459,13 +15654,13 @@ export default class TableSubHolding extends Component { ...@@ -15459,13 +15654,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>
...@@ -15478,38 +15673,133 @@ export default class TableSubHolding extends Component { ...@@ -15478,38 +15673,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[15]).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[16]).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[17]).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[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> </div>
</div> </div>
...@@ -15518,7 +15808,7 @@ export default class TableSubHolding extends Component { ...@@ -15518,7 +15808,7 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
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)" }} >
...@@ -15557,57 +15847,198 @@ export default class TableSubHolding extends Component { ...@@ -15557,57 +15847,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>
...@@ -15617,7 +16048,7 @@ export default class TableSubHolding extends Component { ...@@ -15617,7 +16048,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 }} >
...@@ -15626,7 +16057,7 @@ export default class TableSubHolding extends Component { ...@@ -15626,7 +16057,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>
...@@ -15636,13 +16067,33 @@ export default class TableSubHolding extends Component { ...@@ -15636,13 +16067,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 }} >
...@@ -15651,7 +16102,7 @@ export default class TableSubHolding extends Component { ...@@ -15651,7 +16102,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>
...@@ -15661,12 +16112,123 @@ export default class TableSubHolding extends Component { ...@@ -15661,12 +16112,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 = [
...@@ -16161,7 +16723,7 @@ export default class TableSubHolding extends Component { ...@@ -16161,7 +16723,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) => {
...@@ -989,25 +989,25 @@ export default class ProfitLossMR extends Component { ...@@ -989,25 +989,25 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
tableMeta.rowData[0] === 6 ? // tableMeta.rowData[0] === 6 ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={tableMeta.rowData[7]} // value={tableMeta.rowData[7]}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleFormula(val, tableMeta, 0)).toFixed(1)} // value={Number(handleFormula(val, tableMeta, 0)).toFixed(1)}
decimalScale={1} // decimalScale={1}
/> // />
} // }
/> // />
</div> // </div>
: // :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1079,38 +1079,38 @@ export default class ProfitLossMR extends Component { ...@@ -1079,38 +1079,38 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
tableMeta.rowData[0] === 2 ? // tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> // <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValue(tableMeta, 0)).toFixed(1)} // value={Number(handleValue(tableMeta, 0)).toFixed(1)}
decimalScale={1} // decimalScale={1}
/> // />
</span> // </span>
: // :
tableMeta.rowData[0] === 6 ? // tableMeta.rowData[0] === 6 ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={tableMeta.rowData[8]} // value={tableMeta.rowData[8]}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleFormula(value, tableMeta, 0)).toFixed(1)} // value={Number(handleFormula(value, tableMeta, 0)).toFixed(1)}
decimalScale={1} // decimalScale={1}
/> // />
} // }
/> // />
</div> // </div>
: // :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1146,37 +1146,37 @@ export default class ProfitLossMR extends Component { ...@@ -1146,37 +1146,37 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
tableMeta.rowData[0] === 2 ? // tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> // <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValue(tableMeta, 1)).toFixed(1)} // value={Number(handleValue(tableMeta, 1)).toFixed(1)}
decimalScale={1} // decimalScale={1}
/> // />
</span> : // </span> :
tableMeta.rowData[0] === 6 ? // tableMeta.rowData[0] === 6 ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={tableMeta.rowData[9]} // value={tableMeta.rowData[9]}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleFormula(value, tableMeta, 1)).toFixed(1)} // value={Number(handleFormula(value, tableMeta, 1)).toFixed(1)}
decimalScale={1} // decimalScale={1}
/> // />
} // }
/> // />
</div> // </div>
: // :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1406,38 +1406,38 @@ export default class ProfitLossMR extends Component { ...@@ -1406,38 +1406,38 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
tableMeta.rowData[0] === 2 ? // tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> // <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleValue(tableMeta, 0)).toFixed(1)} // value={Number(handleValue(tableMeta, 0)).toFixed(1)}
decimalScale={1} // decimalScale={1}
/> // />
</span> // </span>
: // :
tableMeta.rowData[0] === 6 ? // tableMeta.rowData[0] === 6 ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={Number(tableMeta.rowData[12]).toFixed(1)} // value={Number(tableMeta.rowData[12]).toFixed(1)}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="" // placeholder=""
disabled={true} // disabled={true}
value={Number(handleFormula(val, tableMeta, 0)).toFixed(1)} // value={Number(handleFormula(val, tableMeta, 0)).toFixed(1)}
decimalScale={1} // decimalScale={1}
/> // />
} // }
/> // />
</div> // </div>
: // :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
......
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