Commit 4fb3e440 authored by Riri Novita's avatar Riri Novita

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

parents 92b41747 a4c770a0
...@@ -1124,13 +1124,49 @@ export default class SubHolding extends Component { ...@@ -1124,13 +1124,49 @@ export default class SubHolding extends Component {
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dbSumaCF.findIndex((val) => val[1] === item.id) let indexIDzz = dbSumaCF.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
let mtd_actual = item.cash_flow.mtd_actual == '' ? 0 : item.cash_flow.mtd_actual let mtd_actual = item.cash_flow.mtd_actual == '' ? 0 : Number(item.cash_flow.mtd_actual)
let mtd = item.cash_flow.mtd == '' ? 0 : item.cash_flow.mtd let mtd = item.cash_flow.mtd == '' ? 0 : Number(item.cash_flow.mtd)
let persenMtd = Number(mtd_actual / mtd) // let persenMtd = Number(mtd_actual / mtd)
let persenMtd = 0
if (mtd < 0) {
if (mtd_actual >= mtd) {
persenMtd = ((mtd - mtd_actual) / mtd + 1 )
} else {
persenMtd = ((mtd - mtd_actual) / mtd)
}
}
else {
persenMtd = Number(mtd_actual / mtd)
}
let ytd_actual = item.cash_flow.ytd_actual == '' ? 0 : item.cash_flow.ytd_actual let ytd_actual = item.cash_flow.ytd_actual == '' ? 0 : Number(item.cash_flow.ytd_actual)
let ytd = item.cash_flow.ytd == '' ? 0 : item.cash_flow.ytd let ytd = item.cash_flow.ytd == '' ? 0 : Number(item.cash_flow.ytd)
let persenYtd = Number(ytd_actual / ytd) // let ytd_last_year = item.cash_flow.ytd_last_year == ''? 0 : Number(item.cash_flow.ytd_last_year)
// let persenYtd = Number(ytd_actual / ytd)
let persenYtd = 0
if (ytd < 0) {
if (ytd_actual >= ytd) {
persenYtd = ((ytd - ytd_actual) / ytd + 1 )
} else {
persenYtd = ((ytd - ytd_actual) / ytd)
}
}
else {
persenYtd = Number(ytd_actual/ytd)
}
// let persenYtdLY = 0
// if (ytd_last_year < 0) {
// if (ytd_actual >= ytd_last_year) {
// persenYtdLY = ((ytd_last_year - ytd_actual) / ytd_last_year + 1 )
// } else {
// persenYtdLY = (ytd_last_year - ytd_actual) / ytd_last_year
// }
// }
// else {
// persenYtdLY = Number(ytd_actual/ytd_last_year)
// }
let quarter_actual = item.cash_flow.quarter_actual == '' ? 0 : item.cash_flow.quarter_actual let quarter_actual = item.cash_flow.quarter_actual == '' ? 0 : item.cash_flow.quarter_actual
let quarter = item.cash_flow.quarter == '' ? 0 : item.cash_flow.quarter let quarter = item.cash_flow.quarter == '' ? 0 : item.cash_flow.quarter
...@@ -1174,11 +1210,33 @@ export default class SubHolding extends Component { ...@@ -1174,11 +1210,33 @@ export default class SubHolding extends Component {
res.map((item, index) => { res.map((item, index) => {
let mtd_actual = item.cash_flow.mtd_actual == '' ? 0 : item.cash_flow.mtd_actual let mtd_actual = item.cash_flow.mtd_actual == '' ? 0 : item.cash_flow.mtd_actual
let mtd = item.cash_flow.mtd == '' ? 0 : item.cash_flow.mtd let mtd = item.cash_flow.mtd == '' ? 0 : item.cash_flow.mtd
let persenMtd = Number(mtd_actual / mtd) // let persenMtd = Number(mtd_actual / mtd)
console.log(persenMtd) let persenMtd = 0
let ytd_actual = item.cash_flow.ytd_actual == '' ? 0 : item.cash_flow.ytd_actual if (mtd < 0) {
let ytd = item.cash_flow.ytd == '' ? 0 : item.cash_flow.ytd if (mtd_actual >= mtd) {
let persenYtd = Number(ytd_actual / ytd) persenMtd = ((mtd - mtd_actual) / mtd + 1 )
} else {
persenMtd = ((mtd - mtd_actual) / mtd)
}
}
else {
persenMtd = Number(mtd_actual / mtd)
}
let ytd_actual = item.cash_flow.ytd_actual == '' ? 0 : Number(item.cash_flow.ytd_actual)
let ytd = item.cash_flow.ytd == '' ? 0 : Number(item.cash_flow.ytd)
// let persenYtd = Number(ytd_actual / ytd)
let persenYtd = 0
if (ytd < 0) {
if (ytd_actual >= ytd) {
persenYtd = ((ytd - ytd_actual) / ytd + 1 )
} else {
persenYtd = ((ytd - ytd_actual) / ytd)
}
}
else {
persenYtd = Number(ytd_actual/ytd)
}
let quarter_actual = item.cash_flow.quarter_actual == '' ? 0 : item.cash_flow.quarter_actual let quarter_actual = item.cash_flow.quarter_actual == '' ? 0 : item.cash_flow.quarter_actual
let quarter = item.cash_flow.quarter == '' ? 0 : item.cash_flow.quarter let quarter = item.cash_flow.quarter == '' ? 0 : item.cash_flow.quarter
...@@ -1339,25 +1397,44 @@ export default class SubHolding extends Component { ...@@ -1339,25 +1397,44 @@ export default class SubHolding extends Component {
} }
}) })
} else if (this.state.report.value === 7) { } else if (this.state.report.value === 7) {
let payload = { let dbSumaBS = []
"report_id": 2, let payloadBS = {...payload, report_id: 2, months: this.state.month.month_id, quarter: 0}
"company_id": this.state.company.company_id, api.create().getReportBSSuma(payloadBS).then(response => {
"periode": this.state.periode.periode, // console.log(payloadBS);
"months": this.state.month.month_id,
"revision": this.state.revisionType,
"quarter": 0,
"submission_id": this.state.submissionID
}
api.create().getReportBSSuma(payload).then(response => {
console.log(payload);
console.log(response); console.log(response);
let dataTable = []
if (response.data) { if (response.data) {
if (response.data.status === 'success') {
let res = response.data.data let res = response.data.data
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dbSumaBS.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
dataTable.push([ let mtd_actual = item.balance_sheet.mtd_actual == '' ? 0 : item.balance_sheet.mtd_actual
let mtd_ol = item.balance_sheet.mtd_ol == '' ? 0 : item.balance_sheet.mtd_ol
let mtd_mb = item.balance_sheet.mtd_mb == '' ? 0 : item.balance_sheet.mtd_mb
let persenMtd = 0
let persenOL = 0
if (mtd_mb < 0) {
if (mtd_actual < mtd_mb) {
persenMtd = Number((mtd_mb - mtd_actual)/mtd_mb)
} else {
persenMtd = Number((mtd_mb - mtd_actual)/mtd_mb) + 1
}
} else {
persenMtd = Number(mtd_actual/mtd_mb)
}
if (mtd_ol < 0) {
if (mtd_actual < mtd_ol) {
persenOL = Number((mtd_ol - mtd_actual)/mtd_ol)
} else {
persenOL = Number((mtd_ol - mtd_actual)/mtd_ol) + 1
}
} else {
persenOL = Number(mtd_actual/mtd_ol)
}
dbSumaBS.push([
item.type_report_id, item.type_report_id,
item.id, item.id,
item.parent, item.parent,
...@@ -1367,9 +1444,9 @@ export default class SubHolding extends Component { ...@@ -1367,9 +1444,9 @@ export default class SubHolding extends Component {
item.balance_sheet.mtd_last_month, item.balance_sheet.mtd_last_month,
item.balance_sheet.mtd_actual, item.balance_sheet.mtd_actual,
item.balance_sheet.mtd_mb, item.balance_sheet.mtd_mb,
item.balance_sheet.percent_of_mb, isNaN(persenMtd) || persenMtd == 'Infinity' || persenMtd == '-Infinity' ? (item.balance_sheet.mtd_mb == '' || item.balance_sheet.mtd_mb == 0 ? -0 : 0) : (item.balance_sheet.mtd_mb == '' || item.balance_sheet.mtd_mb == 0 ? persenMtd * -100 : persenMtd * 100),
item.balance_sheet.mtd_ol, item.balance_sheet.mtd_ol,
item.balance_sheet.percent_of_ol, isNaN(persenOL) || persenOL == 'Infinity' || persenOL == '-Infinity' ? (item.balance_sheet.mtd_ol == '' || item.balance_sheet.mtd_ol == 0 ? -0 : 0) : (item.balance_sheet.mtd_ol == '' || item.balance_sheet.mtd_ol == 0 ? persenOL * -100 : persenOL * 100),
item.balance_sheet.mtd_last_year, item.balance_sheet.mtd_last_year,
item.balance_sheet.forecast_next_year, item.balance_sheet.forecast_next_year,
item.balance_sheet.forecast_more_year, item.balance_sheet.forecast_more_year,
...@@ -1385,7 +1462,33 @@ export default class SubHolding extends Component { ...@@ -1385,7 +1462,33 @@ export default class SubHolding extends Component {
} }
} }
res.map((item, index) => { res.map((item, index) => {
dataTable.push([ let mtd_actual = item.balance_sheet.mtd_actual == '' ? 0 : item.balance_sheet.mtd_actual
let mtd_ol = item.balance_sheet.mtd_ol == '' ? 0 : item.balance_sheet.mtd_ol
let mtd_mb = item.balance_sheet.mtd_mb == '' ? 0 : item.balance_sheet.mtd_mb
let persenMtd = 0
let persenOL = 0
if (mtd_mb < 0) {
if (mtd_actual < mtd_mb) {
persenMtd = Number((mtd_mb - mtd_actual)/mtd_mb)
} else {
persenMtd = Number((mtd_mb - mtd_actual)/mtd_mb) + 1
}
} else {
persenMtd = Number(mtd_actual/mtd_mb)
}
if (mtd_ol < 0) {
if (mtd_actual < mtd_ol) {
persenOL = Number((mtd_ol - mtd_actual)/mtd_ol)
} else {
persenOL = Number((mtd_ol - mtd_actual)/mtd_ol) + 1
}
} else {
persenOL = Number(mtd_actual/mtd_ol)
}
dbSumaBS.push([
item.type_report_id, item.type_report_id,
item.id, item.id,
item.parent, item.parent,
...@@ -1395,9 +1498,9 @@ export default class SubHolding extends Component { ...@@ -1395,9 +1498,9 @@ export default class SubHolding extends Component {
item.balance_sheet.mtd_last_month, item.balance_sheet.mtd_last_month,
item.balance_sheet.mtd_actual, item.balance_sheet.mtd_actual,
item.balance_sheet.mtd_mb, item.balance_sheet.mtd_mb,
item.balance_sheet.percent_of_mb, isNaN(persenMtd) || persenMtd == 'Infinity' || persenMtd == '-Infinity' ? (item.balance_sheet.mtd_mb == '' || item.balance_sheet.mtd_mb == 0 ? -0 : 0) : (item.balance_sheet.mtd_mb == '' || item.balance_sheet.mtd_mb == 0 ? persenMtd * -100 : persenMtd * 100),
item.balance_sheet.mtd_ol, item.balance_sheet.mtd_ol,
item.balance_sheet.percent_of_ol, isNaN(persenOL) || persenOL == 'Infinity' || persenOL == '-Infinity' ? (item.balance_sheet.mtd_ol == '' || item.balance_sheet.mtd_ol == 0 ? -0 : 0) : (item.balance_sheet.mtd_ol == '' || item.balance_sheet.mtd_ol == 0 ? persenOL * -100 : persenOL * 100),
item.balance_sheet.mtd_last_year, item.balance_sheet.mtd_last_year,
item.balance_sheet.forecast_next_year, item.balance_sheet.forecast_next_year,
item.balance_sheet.forecast_more_year, item.balance_sheet.forecast_more_year,
...@@ -1411,13 +1514,20 @@ export default class SubHolding extends Component { ...@@ -1411,13 +1514,20 @@ export default class SubHolding extends Component {
} }
} }
}) })
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true }) this.setState({ dataTable: dbSumaBS, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable }, () => {
console.log(this.state.dataTable) console.log(this.state.dataTable)
// // this.getBalanceSheetMR(payload)
// })
} else { } else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
} }
}) })
......
...@@ -1042,22 +1042,6 @@ export default class TableSubHolding extends Component { ...@@ -1042,22 +1042,6 @@ export default class TableSubHolding extends Component {
return total return total
} }
const handleMTDPercent = (tableMeta, dex, type) => {
let total = 0
// if (tableMeta.rowData[5] === "Cash and cash equivalent" ) {
// console.log(tableMeta);
// console.log(dataTable2);
// }
if (dex === 1) {
total = R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])), NaN) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])), Infinity) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])), -Infinity) ? "0" : Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
} else if (dex === 2) {
total = R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])), NaN) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])), Infinity) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])), -Infinity) ? "0" : Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
}
return total
}
let datas = [ 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" }], ["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" }] ["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" }]
...@@ -5265,7 +5249,7 @@ export default class TableSubHolding extends Component { ...@@ -5265,7 +5249,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormulaDBPLMR(tableMeta.rowData[27], tableMeta, 0)).toFixed(1)} value={String(tableMeta.rowData[27]) === "" ? "" : Number(handleValueFormulaDBPLMR(tableMeta.rowData[27], tableMeta, 0)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -5279,7 +5263,7 @@ export default class TableSubHolding extends Component { ...@@ -5279,7 +5263,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormulaDBPLMR(tableMeta.rowData[27], tableMeta, 0)).toFixed(1)} value={String(tableMeta.rowData[27]) === "" ? "" : Number(handleValueFormulaDBPLMR(tableMeta.rowData[27], tableMeta, 0)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -5299,7 +5283,7 @@ export default class TableSubHolding extends Component { ...@@ -5299,7 +5283,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormulaDBPLMR(tableMeta.rowData[27], tableMeta, 0)).toFixed(1)} value={String(tableMeta.rowData[27]) === "" ? "" : Number(handleValueFormulaDBPLMR(tableMeta.rowData[27], tableMeta, 0)).toFixed(1)}
/> />
: :
null null
...@@ -12291,7 +12275,7 @@ export default class TableSubHolding extends Component { ...@@ -12291,7 +12275,7 @@ export default class TableSubHolding extends Component {
name: `${Number(this.props.periode) + 1}`, name: `${Number(this.props.periode) + 1}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', zIndex: 102, color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} > <th style={{ ...style2, backgroundColor: '#1c71b8', zIndex: 102, top: 0, color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
<div style={{ textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div> <div style={{ textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
{/* <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}> {/* <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}> <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
...@@ -12333,7 +12317,7 @@ export default class TableSubHolding extends Component { ...@@ -12333,7 +12317,7 @@ export default class TableSubHolding extends Component {
name: `${Number(this.props.periode) + 2}`, name: `${Number(this.props.periode) + 2}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', zIndex: 102, color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} > <th style={{ ...style2, backgroundColor: '#1c71b8', zIndex: 102, top: 0, color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
<div style={{ textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div> <div style={{ textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
{/* <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}> {/* <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}> <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
...@@ -12451,7 +12435,7 @@ export default class TableSubHolding extends Component { ...@@ -12451,7 +12435,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[26]) === "" ? "" : Number(tableMeta.rowData[26]).toFixed(1)}
/> />
} }
/> />
...@@ -12474,7 +12458,7 @@ export default class TableSubHolding extends Component { ...@@ -12474,7 +12458,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[27]) === "" ? "" : Number(tableMeta.rowData[27]).toFixed(1)}
/> />
} }
/> />
...@@ -12497,7 +12481,7 @@ export default class TableSubHolding extends Component { ...@@ -12497,7 +12481,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[28]) === "" ? "" : Number(tableMeta.rowData[28]).toFixed(1)}
/> />
} }
/> />
...@@ -12520,7 +12504,7 @@ export default class TableSubHolding extends Component { ...@@ -12520,7 +12504,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[29]) === "" ? "" : Number(tableMeta.rowData[29]).toFixed(1)}
/> />
} }
/> />
...@@ -12545,7 +12529,7 @@ export default class TableSubHolding extends Component { ...@@ -12545,7 +12529,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[30]) === "" ? "" : Number(tableMeta.rowData[30]).toFixed(1)}
/> />
} }
/> />
...@@ -12568,7 +12552,7 @@ export default class TableSubHolding extends Component { ...@@ -12568,7 +12552,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[31]) === "" ? "" : Number(tableMeta.rowData[31]).toFixed(1)}
/> />
} }
/> />
...@@ -12591,7 +12575,7 @@ export default class TableSubHolding extends Component { ...@@ -12591,7 +12575,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[32]) === "" ? "" : Number(tableMeta.rowData[32]).toFixed(1)}
/> />
} }
/> />
...@@ -12614,7 +12598,7 @@ export default class TableSubHolding extends Component { ...@@ -12614,7 +12598,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[33]) === "" ? "" : Number(tableMeta.rowData[33]).toFixed(1)}
/> />
} }
/> />
...@@ -12639,7 +12623,7 @@ export default class TableSubHolding extends Component { ...@@ -12639,7 +12623,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[34]) === "" ? "" : Number(tableMeta.rowData[34]).toFixed(1)}
/> />
} }
/> />
...@@ -12662,7 +12646,7 @@ export default class TableSubHolding extends Component { ...@@ -12662,7 +12646,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[35]).toFixed(1)} value={String(tableMeta.rowData[35]) === "" ? "" : Number(tableMeta.rowData[35]).toFixed(1)}
/> />
} }
/> />
...@@ -12685,7 +12669,7 @@ export default class TableSubHolding extends Component { ...@@ -12685,7 +12669,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[36]).toFixed(1)} value={String(tableMeta.rowData[36]) === "" ? "" : Number(tableMeta.rowData[36]).toFixed(1)}
/> />
} }
/> />
...@@ -12708,7 +12692,7 @@ export default class TableSubHolding extends Component { ...@@ -12708,7 +12692,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[37]).toFixed(1)} value={String(tableMeta.rowData[37]) === "" ? "" : Number(tableMeta.rowData[37]).toFixed(1)}
/> />
} }
/> />
...@@ -12801,7 +12785,7 @@ export default class TableSubHolding extends Component { ...@@ -12801,7 +12785,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[38]).toFixed(1)} value={String(tableMeta.rowData[38]) === "" ? "" : Number(tableMeta.rowData[38]).toFixed(1)}
/> />
} }
/> />
...@@ -12824,7 +12808,7 @@ export default class TableSubHolding extends Component { ...@@ -12824,7 +12808,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[39]).toFixed(1)} value={String(tableMeta.rowData[39]) === "" ? "" : Number(tableMeta.rowData[39]).toFixed(1)}
/> />
} }
/> />
...@@ -12847,7 +12831,7 @@ export default class TableSubHolding extends Component { ...@@ -12847,7 +12831,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[40]).toFixed(1)} value={String(tableMeta.rowData[40]) === "" ? "" : Number(tableMeta.rowData[40]).toFixed(1)}
/> />
} }
/> />
...@@ -12870,7 +12854,7 @@ export default class TableSubHolding extends Component { ...@@ -12870,7 +12854,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[41]).toFixed(1)} value={String(tableMeta.rowData[41]) === "" ? "" : Number(tableMeta.rowData[41]).toFixed(1)}
/> />
} }
/> />
...@@ -12895,7 +12879,7 @@ export default class TableSubHolding extends Component { ...@@ -12895,7 +12879,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[42]).toFixed(1)} value={String(tableMeta.rowData[42]) === "" ? "" : Number(tableMeta.rowData[42]).toFixed(1)}
/> />
} }
/> />
...@@ -12918,7 +12902,7 @@ export default class TableSubHolding extends Component { ...@@ -12918,7 +12902,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[43]).toFixed(1)} value={String(tableMeta.rowData[43]) === "" ? "" : Number(tableMeta.rowData[43]).toFixed(1)}
/> />
} }
/> />
...@@ -12941,7 +12925,7 @@ export default class TableSubHolding extends Component { ...@@ -12941,7 +12925,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[44]).toFixed(1)} value={String(tableMeta.rowData[44]) === "" ? "" : Number(tableMeta.rowData[44]).toFixed(1)}
/> />
} }
/> />
...@@ -12964,7 +12948,7 @@ export default class TableSubHolding extends Component { ...@@ -12964,7 +12948,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[45]).toFixed(1)} value={String(tableMeta.rowData[45]) === "" ? "" : Number(tableMeta.rowData[45]).toFixed(1)}
/> />
} }
/> />
...@@ -12989,7 +12973,7 @@ export default class TableSubHolding extends Component { ...@@ -12989,7 +12973,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[46]).toFixed(1)} value={String(tableMeta.rowData[46]) === "" ? "" : Number(tableMeta.rowData[46]).toFixed(1)}
/> />
} }
/> />
...@@ -13012,7 +12996,7 @@ export default class TableSubHolding extends Component { ...@@ -13012,7 +12996,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[47]).toFixed(1)} value={String(tableMeta.rowData[47]) === "" ? "" : Number(tableMeta.rowData[47]).toFixed(1)}
/> />
} }
/> />
...@@ -13035,7 +13019,7 @@ export default class TableSubHolding extends Component { ...@@ -13035,7 +13019,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[48]).toFixed(1)} value={String(tableMeta.rowData[48]) === "" ? "" : Number(tableMeta.rowData[48]).toFixed(1)}
/> />
} }
/> />
...@@ -13058,7 +13042,7 @@ export default class TableSubHolding extends Component { ...@@ -13058,7 +13042,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[49]).toFixed(1)} value={String(tableMeta.rowData[49]) === "" ? "" : Number(tableMeta.rowData[49]).toFixed(1)}
/> />
} }
/> />
...@@ -15052,7 +15036,7 @@ export default class TableSubHolding extends Component { ...@@ -15052,7 +15036,7 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: `MTD 2021`, name: `MTD ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#000', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} > <th style={{ ...style2, color: '#000', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
...@@ -15180,8 +15164,9 @@ export default class TableSubHolding extends Component { ...@@ -15180,8 +15164,9 @@ export default class TableSubHolding extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 70, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 70, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
suffix={`%`}
disabled={true} disabled={true}
value={Number(handleMTDPercent(tableMeta, 1, 3)).toFixed(1)} value={Number(tableMeta.rowData[9]).toFixed(1)}
/> />
} }
/> />
...@@ -15228,8 +15213,9 @@ export default class TableSubHolding extends Component { ...@@ -15228,8 +15213,9 @@ export default class TableSubHolding extends Component {
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=""
suffix={'%'}
disabled={true} disabled={true}
value={Number(handleMTDPercent(tableMeta, 2, 5)).toFixed(1)} value={Number(tableMeta.rowData[11]).toFixed(1)}
/> />
} }
/> />
...@@ -15266,7 +15252,7 @@ export default class TableSubHolding extends Component { ...@@ -15266,7 +15252,7 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: "2022", name: `${(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 }} >
...@@ -15311,7 +15297,7 @@ export default class TableSubHolding extends Component { ...@@ -15311,7 +15297,7 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: "2023", name: `${(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 }} >
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