Commit 55e15ff7 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'GGMAC' into 'master'

update dasbor fin + rapihin save pl cf

See merge request !1220
parents 50e82422 d96d53d7
......@@ -671,7 +671,7 @@ export default class BudgetTahunan extends Component {
}
}
})
// console.log(dataTable)
console.log(dataTable)
this.setState({ dbCF: dataTable }, () => {
this.olahDataCashFlow(this.state.dbCF, type)
})
......@@ -929,7 +929,7 @@ export default class BudgetTahunan extends Component {
}
})
total = R.equals(total, NaN) ? "0.0" : total
total = R.equals(total, NaN) ? "0.0" : Number(total).toFixed(1)
return total
}
......@@ -1089,6 +1089,7 @@ export default class BudgetTahunan extends Component {
console.log(this.state.dbCF)
console.log(JSON.stringify(payload))
api.create().createReportCF(payload).then((res) => {
this.setState({loading: false})
console.log(res)
// if (response.data) {
// if (response.data.status === "success") {
......@@ -1220,7 +1221,7 @@ export default class BudgetTahunan extends Component {
this.olahDataPL(this.state.dbPL, type)
})
} else {
this.setState({ dbPL: [], previewTable: false, loading: false, previewDownload: false })
this.setState({ dbPL: [], previewTable: false, previewDownload: false })
}
......
......@@ -80,7 +80,11 @@ export default class DashboardFinancial extends React.Component {
intervalEBITDA: 0,
data: [],
defaultMonth: [],
defaultYear: []
defaultYear: [],
revOptions: {},
tpatOptions: {},
ebitdaOptions: {},
totalAssetsOptions: {}
};
}
......@@ -390,7 +394,7 @@ export default class DashboardFinancial extends React.Component {
// newName = `asd \n baba`
// } else {
let splitName = String(name).split(' ')
console.log(splitName)
// console.log(splitName)
newName = name
// }
}
......@@ -424,135 +428,561 @@ export default class DashboardFinancial extends React.Component {
let minEBITDA = response.ebitda.vertical_pointing[1]
let intervalEBITDA = Number(response.ebitda.interval)
if (response.total_assets != undefined) {
let companyTA = []
let mbTA = []
let maxTA = 0
let minTA = 0
let intervalTA = 0
if (response.total_asset != undefined) {
intervalTA = Number(response.total_asset.interval)
maxTA = response.total_asset.vertical_pointing[0]
minTA = response.total_asset.vertical_pointing[1]
}
response.revenue.nodes.map((item, index) => {
let respRev = this.state.report.value == 'summary' ? response.revenue.nodes.sort((a, b) => a.index - b.index) : response.revenue.nodes.sort((a, b) => a.company.localeCompare(b.company))
respRev.map((item, index) => {
if (this.state.report.value == 'summary') {
companyRev.push(item.periode)
mbRev.push(item.value)
mrRev.push(item.gp_margin)
mbRev.push(Number(item.value))
mrRev.push(Number(item.gp_margin))
} else {
companyRev.push(handleName(item.company))
mbRev.push(item.value_mb)
mrRev.push(item.value_mr)
mbRev.push(Number(item.value_mb))
mrRev.push(Number(item.value_mr))
}
})
response.tpat.nodes.map((item, index) => {
let revOptions = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
// restore: { show: true },
// saveAsImage: { show: true }
}
},
legend: {
data: ['MB', 'MR', 'Revenue', 'GP Margin']
},
grid: {
bottom: 125,
},
xAxis: [
{
type: 'category',
data: companyRev,
axisPointer: {
type: 'shadow'
},
axisLabel: {
interval: 0,
rotate: 30,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 13,
}
}
}
],
yAxis: this.state.report.value != 'summary' ?
[
{
type: 'value',
name: '(Rp bn)',
min: minRev,
max: maxRev,
interval: intervalRev,
axisLabel: {
formatter: '{value}%',
interval: 0,
// rotate: 10,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 12,
// fontWeight: "bold"
}
}
}
] :
[
{
type: 'value',
name: '(Rp bn)',
min: minRev,
max: maxRev,
interval: intervalRev,
axisLabel: {
interval: 0,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 12,
}
}
},
{
type: 'value',
name: '(%)',
min: 0,
max: 100,
interval: 20,
axisLabel: {
formatter: '{value}%',
interval: 0,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 12,
}
}
}
]
,
series: this.state.report.value != 'summary' ?
[
{
name: 'MB',
type: 'bar',
data: mbRev
},
{
name: 'MR',
type: 'bar',
data: mrRev
}
] :
[
{
name: 'Revenue',
type: 'bar',
data: mbRev
},
{
name: 'GP Margin',
type: 'line',
yAxisIndex: 1,
data: mrRev
}
]
}
let respTpat = this.state.report.value == 'summary' ? response.tpat.nodes.sort((a, b) => a.index - b.index) : response.tpat.nodes.sort((a, b) => a.company.localeCompare(b.company))
respTpat.map((item, index) => {
if (this.state.report.value == 'summary') {
companyTPAT.push(item.periode)
mbTPAT.push(item.value)
mrTPAT.push(item.gp_margin)
mbTPAT.push(Number(item.value))
mrTPAT.push(Number(item.gp_margin))
} else {
companyTPAT.push(handleName(item.company))
mbTPAT.push(item.value_mb)
mrTPAT.push(item.value_mr)
mbTPAT.push(Number(item.value_mb))
mrTPAT.push(Number(item.value_mr))
}
})
response.ebitda.nodes.map((item, index) => {
let tpatOptions = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
// restore: { show: true },
// saveAsImage: { show: true }
}
},
legend: {
data: ['MB', 'MR', 'TPAT', 'TPAT Margin']
},
xAxis: [
{
type: 'category',
data: companyTPAT,
axisPointer: {
type: 'shadow'
},
axisLabel: {
interval: 0,
rotate: 30,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 13,
}
}
}
],
yAxis: this.state.report.value != 'summary' ?
[
{
type: 'value',
name: '(Rp bn)',
min: minTPAT,
max: maxTPAT,
interval: intervalTPAT
}
] :
[
{
type: 'value',
name: '(Rp bn)',
min: minTPAT,
max: maxTPAT,
interval: intervalTPAT,
axisLabel: {
interval: 0,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 12,
}
}
},
{
type: 'value',
name: '(%)',
min: 0,
max: 100,
interval: 20,
axisLabel: {
formatter: '{value}%',
interval: 0,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 12,
}
}
}
]
,
grid: {
bottom: 125,
},
series: this.state.report.value != 'summary' ?
[
{
name: 'MB',
type: 'bar',
data: mbTPAT
},
{
name: 'MR',
type: 'bar',
data: mrTPAT
}
] :
[
{
name: 'TPAT',
type: 'bar',
data: mbTPAT
},
{
name: 'TPAT Margin',
type: 'line',
yAxisIndex: 1,
data: mrTPAT
}
]
}
let respEbit = this.state.report.value == 'summary' ? response.ebitda.nodes.sort((a, b) => a.index - b.index) : response.ebitda.nodes.sort((a, b) => a.company.localeCompare(b.company))
respEbit.map((item, index) => {
if (this.state.report.value == 'summary') {
companyEBITDA.push(item.periode)
mbEBITDA.push(item.value)
mrEBITDA.push(item.gp_margin)
mbEBITDA.push(Number(item.value))
mrEBITDA.push(Number(item.gp_margin))
} else {
companyEBITDA.push(handleName(item.company))
mbEBITDA.push(item.value_mb)
mrEBITDA.push(item.value_mr)
mbEBITDA.push(Number(item.value_mb))
mrEBITDA.push(Number(item.value_mr))
}
})
if (this.state.report.value == 'summary') {
response.revenue.nodes.map((item, index) => {
totalAssets.push({
"company": item.company,
"MB": item.value_mb,
"MBColor": "hsl(212, 64%, 46%)",
"MR": item.value_mr,
"MRColor": "hsl(212, 78%, 62%)",
})
})
let ebitdaOptions = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
this.setState({ companyRev, mbRev, mrRev, minRev, maxRev, intervalRev, companyTPAT, mbTPAT, mrTPAT, minTPAT, maxTPAT, intervalTPAT, companyEBITDA, mbEBITDA, mrEBITDA, minEBITDA, maxEBITDA, intervalEBITDA }, () => {
console.log(companyTPAT)
this.setState({ loading: false })
})
}
})
},
toolbox: {
feature: {
// restore: { show: true },
// saveAsImage: { show: true }
}
render() {
const { data: chartData } = this.state;
const loadingComponent = (
<div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
// css={override}
size={20}
color={"#274B80"}
loading={this.state.loading}
/>
</div>
);
const CustomTick = tick => {
const theme = useTheme()
return (
<g transform={`translate(${tick.x},${tick.y + 22})`}>
{/* <rect x={-14} y={-6} rx={3} ry={3} width={28} height={24} fill="rgba(0, 0, 0, .05)" />
<rect x={-12} y={-12} rx={2} ry={2} width={24} height={24} fill="rgb(232, 193, 160)" />
<line stroke="rgb(232, 193, 160)" strokeWidth={1.5} y1={-22} y2={-12} /> */}
<text
lengthAdjust
fontSizeAdjust
textAnchor="middle"
dominantBaseline="middle"
style={{
...theme.axis.ticks.text,
fill: '#333',
fontSize: 11,
// textAlign: 'justify',
}}
>
{tick.value}
</text>
</g>
)
},
legend: {
data: ['MB', 'MR', 'EBITDA', 'EBITDA Margin']
},
xAxis: [
{
type: 'category',
data: companyEBITDA,
axisPointer: {
type: 'shadow'
},
axisLabel: {
interval: 0,
rotate: 30,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 13,
}
return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }} ref={this.myRef}>
{this.state.loading && loadingComponent}
<div>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Dashboard Financial</Typography>
</div>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
</Snackbar>
<div style={{ padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10, minHeight: this.props.height, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>FINANCIAL SUMMARY OF TRIPUTRA GROUP</Typography>
</div>
<div style={{ minWidth: 'max-content', padding: '20px 20px 0px 20px' }}>
<div style={{ marginTop: 15 }}>
<Autocomplete
options={this.state.listReportType}
getOptionLabel={(option) => titleCase(option.name)}
id="typereport"
onChange={(event, newInputValue) => this.setState({ report: newInputValue, loading: true, previewTable: false }, () => {
this.getDashboardFinancial()
})}
disableClearable
style={{ width: 250 }}
renderInput={(params) => <TextField {...params} label="Report Type" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.report}
/>
</div>
}
}
],
yAxis: this.state.report.value != 'summary' ?
[
{
type: 'value',
name: '(Rp bn)',
min: minEBITDA,
max: maxEBITDA,
interval: intervalEBITDA,
axisLabel: {
interval: 0,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 12,
}
}
}
] :
[
{
type: 'value',
name: '(Rp bn)',
min: minEBITDA,
max: maxEBITDA,
interval: intervalEBITDA,
axisLabel: {
interval: 0,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 12,
}
}
},
{
type: 'value',
name: '(%)',
min: 0,
max: 100,
interval: 20,
axisLabel: {
formatter: '{value}%',
interval: 0,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 12,
}
}
}
]
,
grid: {
bottom: 125,
},
series: this.state.report.value != 'summary' ?
[
{
name: 'MB',
type: 'bar',
data: mbEBITDA
},
{
name: 'MR',
type: 'bar',
data: mrEBITDA
}
] :
[
{
name: 'EBITDA',
type: 'bar',
data: mbEBITDA
},
{
name: 'EBITDA Margin',
type: 'line',
yAxisIndex: 1,
data: mrEBITDA
}
]
}
if (this.state.report.value == 'summary') {
response.total_asset.nodes.sort((a, b) => a.index - b.index).map((item, index) => {
companyTA.push(item.periode)
mbTA.push(item.value)
})
let totalAssetsOptions = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
// restore: { show: true },
// saveAsImage: { show: true }
}
},
legend: {
data: ['MB']
},
grid: {
bottom: 125,
},
xAxis: [
{
type: 'category',
data: companyTA,
axisPointer: {
type: 'shadow'
},
axisLabel: {
interval: 0,
rotate: 30,
textStyle: {
baseline: "top",
color: "#333",
fontSize: 13,
}
}
}
],
yAxis:
[
{
type: 'value',
name: '(Rp bn)',
min: minTA,
max: maxTA,
interval: intervalTA
}
]
,
series:
[
{
name: 'MB',
type: 'bar',
data: mbTA
}
]
}
this.setState({ totalAssetsOptions })
}
this.setState({ revOptions, tpatOptions, ebitdaOptions }, () => {
setTimeout(() => {
this.setState({ loading: false })
}, 300);
})
}
})
}
render() {
const { data: chartData } = this.state;
const loadingComponent = (
<div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
// css={override}
size={20}
color={"#274B80"}
loading={this.state.loading}
/>
</div>
);
const CustomTick = tick => {
const theme = useTheme()
return (
<g transform={`translate(${tick.x},${tick.y + 22})`}>
{/* <rect x={-14} y={-6} rx={3} ry={3} width={28} height={24} fill="rgba(0, 0, 0, .05)" />
<rect x={-12} y={-12} rx={2} ry={2} width={24} height={24} fill="rgb(232, 193, 160)" />
<line stroke="rgb(232, 193, 160)" strokeWidth={1.5} y1={-22} y2={-12} /> */}
<text
lengthAdjust
fontSizeAdjust
textAnchor="middle"
dominantBaseline="middle"
style={{
...theme.axis.ticks.text,
fill: '#333',
fontSize: 11,
// textAlign: 'justify',
}}
>
{tick.value}
</text>
</g>
)
}
return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }} ref={this.myRef}>
{/* {this.state.loading && loadingComponent} */}
<div>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Dashboard Financial</Typography>
</div>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
</Snackbar>
<div style={{ padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10, minHeight: this.props.height, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>FINANCIAL SUMMARY OF TRIPUTRA GROUP</Typography>
</div>
<div style={{ minWidth: 'max-content', padding: '20px 20px 0px 20px' }}>
<div style={{ marginTop: 15 }}>
<Autocomplete
options={this.state.listReportType}
getOptionLabel={(option) => titleCase(option.name)}
id="typereport"
onChange={(event, newInputValue) => this.setState({ report: newInputValue, loading: true, previewTable: false }, () => {
this.getDashboardFinancial()
})}
disableClearable
style={{ width: 250 }}
renderInput={(params) => <TextField {...params} label="Report Type" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.report}
/>
</div>
<div style={{ display: 'flex', marginTop: 10 }}>
<Autocomplete
{...this.state.listMonth}
......@@ -672,7 +1102,7 @@ export default class DashboardFinancial extends React.Component {
}
})
let listMonth2 = monthData2
this.setState({ month2: listMonth2[0], listMonth2: {...this.state.listMonth2, options: listMonth2} }, () => {
this.setState({ month2: listMonth2[0], listMonth2: { ...this.state.listMonth2, options: listMonth2 } }, () => {
this.getDashboardFinancial()
})
} else {
......@@ -762,443 +1192,38 @@ export default class DashboardFinancial extends React.Component {
<div style={{ height: Number(0.6 * this.props.height), border: '1px solid black', marginTop: 25, paddingBottom: 50 }}>
{this.state.businessUnit != null && <Typography style={{ fontSize: '16px', color: 'black', textAlign: 'center', marginTop: 10, marginBottom: 10 }}>{`Revenue ${this.state.report.value == 'mtd' || this.state.report.value == 'ytd' ? String(this.state.report.value).toLocaleUpperCase() : ''} - ${this.state.report.value == 'mtd' || this.state.report.value == 'ytd' ? titleCase(this.state.businessUnit.business_unit_name) : this.state.company.company_name}`}</Typography>}
{!this.state.loading && <ReactECharts
{<ReactECharts
showLoading={this.state.loading}
style={{ height: 500, width: '100%', marginTop: 20 }}
option={{
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
restore: { show: true },
saveAsImage: { show: true }
}
},
legend: {
data: ['MB', 'MR', 'Revenue', 'GP Margin']
},
xAxis: [
{
type: 'category',
data: this.state.companyRev,
axisPointer: {
type: 'shadow'
}
}
],
yAxis: this.state.report.value != 'summary' ?
[
{
type: 'value',
name: '(Rp bn)',
min: this.state.minRev,
max: this.state.maxRev,
interval: this.state.intervalRev
}
] :
[
{
type: 'value',
name: '(Rp bn)',
min: this.state.minRev,
max: this.state.maxRev,
interval: this.state.intervalRev
},
{
type: 'value',
name: '(%)',
min: 0,
max: 100,
interval: 20,
axisLabel: {
formatter: '{value}%'
}
}
]
,
series: this.state.report.value != 'summary' ?
[
{
name: 'MB',
type: 'bar',
data: this.state.mbRev
},
{
name: 'MR',
type: 'bar',
data: this.state.mrRev
}
] :
[
{
name: 'Revenue',
type: 'bar',
data: this.state.mbRev
},
{
name: 'GP Margin',
type: 'line',
yAxisIndex: 1,
data: this.state.mrRev
}
]
}}
option={this.state.revOptions}
/>}
</div>
<div style={{ height: Number(0.6 * this.props.height), border: '1px solid black', marginTop: 50, paddingBottom: 50 }}>
{this.state.businessUnit != null && <Typography style={{ fontSize: '16px', color: 'black', textAlign: 'center', marginTop: 10, marginBottom: 10 }}>{`TPAT ${this.state.report.value == 'mtd' || this.state.report.value == 'ytd' ? String(this.state.report.value).toLocaleUpperCase() : ''} - ${this.state.report.value == 'mtd' || this.state.report.value == 'ytd' ? titleCase(this.state.businessUnit.business_unit_name) : this.state.company.company_name}`}</Typography>}
{!this.state.loading && <ReactECharts
{<ReactECharts
showLoading={this.state.loading}
style={{ height: 500, width: '100%', marginTop: 20 }}
option={{
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
restore: { show: true },
saveAsImage: { show: true }
}
},
legend: {
data: ['MB', 'MR', 'TPAT', 'TPAT Margin']
},
xAxis: [
{
type: 'category',
data: this.state.companyTPAT,
axisPointer: {
type: 'shadow'
}
}
],
yAxis: this.state.report.value != 'summary' ?
[
{
type: 'value',
name: '(Rp bn)',
min: this.state.minTPAT,
max: this.state.maxTPAT,
interval: this.state.intervalTPAT
}
] :
[
{
type: 'value',
name: '(Rp bn)',
min: this.state.minTPAT,
max: this.state.maxTPAT,
interval: this.state.intervalTPAT
},
{
type: 'value',
name: '(%)',
min: 0,
max: 100,
interval: 20,
axisLabel: {
formatter: '{value}%'
}
}
]
,
series: this.state.report.value != 'summary' ?
[
{
name: 'MB',
type: 'bar',
data: this.state.mbTPAT
},
{
name: 'MR',
type: 'bar',
data: this.state.mrTPAT
}
] :
[
{
name: 'TPAT',
type: 'bar',
data: this.state.mbTPAT
},
{
name: 'TPAT Margin',
type: 'line',
yAxisIndex: 1,
data: this.state.mrTPAT
}
]
}}
option={this.state.tpatOptions}
/>}
{/* <ReactECharts
style={{height: 500, width: '100%'}}
option={{
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
// dataView: {show: true, readOnly: false},
// magicType: {show: true, type: ['bar']},
restore: {show: true},
saveAsImage: {show: true}
}
},
legend: {
data: ['蒸发量', '降水量', '平均温度']
},
xAxis: [
{
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
axisPointer: {
type: 'shadow'
}
}
],
yAxis: [
{
type: 'value',
name: '水量',
min: 0,
max: 250,
interval: 50,
axisLabel: {
formatter: '{value} ml'
}
},
{
type: 'value',
name: '温度',
min: 0,
max: 25,
interval: 5,
axisLabel: {
formatter: '{value} °C'
}
}
],
series: [
{
name: '蒸发量',
type: 'bar',
data: [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3]
},
{
name: '降水量',
type: 'bar',
data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
},
{
name: '平均温度',
type: 'line',
yAxisIndex: 1,
data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
}
]
}}
/> */}
</div>
<div style={{ height: Number(0.6 * this.props.height), border: '1px solid black', marginTop: 50, paddingBottom: 50 }}>
{this.state.businessUnit != null && <Typography style={{ fontSize: '16px', color: 'black', textAlign: 'center', marginTop: 10, marginBottom: 10 }}>{`EBITDA ${this.state.report.value == 'mtd' || this.state.report.value == 'ytd' ? String(this.state.report.value).toLocaleUpperCase() : ''} - ${this.state.report.value == 'mtd' || this.state.report.value == 'ytd' ? titleCase(this.state.businessUnit.business_unit_name) : this.state.company.company_name}`}</Typography>}
{!this.state.loading && <ReactECharts
{<ReactECharts
lazyUpdate={true}
showLoading={this.state.loading}
style={{ height: 500, width: '100%', marginTop: 20 }}
option={{
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
restore: { show: true },
saveAsImage: { show: true }
}
},
legend: {
data: ['MB', 'MR', 'EBITDA', 'EBITDA Margin']
},
xAxis: [
{
type: 'category',
data: this.state.companyEBITDA,
axisPointer: {
type: 'shadow'
}
}
],
yAxis: this.state.report.value != 'summary' ?
[
{
type: 'value',
name: '(Rp bn)',
min: this.state.minEBITDA,
max: this.state.maxEBITDA,
interval: this.state.intervalEBITDA
}
] :
[
{
type: 'value',
name: '(Rp bn)',
min: this.state.minEBITDA,
max: this.state.maxEBITDA,
interval: this.state.intervalEBITDA
},
{
type: 'value',
name: '(%)',
min: 0,
max: 100,
interval: 20,
axisLabel: {
formatter: '{value}%'
}
}
]
,
series: this.state.report.value != 'summary' ?
[
{
name: 'MB',
type: 'bar',
data: this.state.mbEBITDA
},
{
name: 'MR',
type: 'bar',
data: this.state.mrEBITDA
}
] :
[
{
name: 'EBITDA',
type: 'bar',
data: this.state.mbEBITDA
},
{
name: 'EBITDA Margin',
type: 'line',
yAxisIndex: 1,
data: this.state.mrEBITDA
}
]
}}
option={this.state.ebitdaOptions}
/>}
</div>
{this.state.report.value == 'summary' && <div style={{ height: Number(0.6 * this.props.height), border: '1px solid black', marginTop: 50, paddingBottom: 50 }}>
<Typography style={{ fontSize: '16px', color: 'black', textAlign: 'center', marginTop: 10, marginBottom: 10 }}>{`Total Assets - ${this.state.company.company_name}`}</Typography>
{!this.state.loading && <ReactECharts
{<ReactECharts
style={{ height: 500, width: '100%', marginTop: 20 }}
option={{
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
restore: { show: true },
saveAsImage: { show: true }
}
},
legend: {
data: ['MB', 'MR', 'EBITDA', 'EBITDA Margin']
},
xAxis: [
{
type: 'category',
data: this.state.companyEBITDA,
axisPointer: {
type: 'shadow'
}
}
],
yAxis: this.state.report.value != 'summary' ?
[
{
type: 'value',
name: '(Rp bn)',
min: this.state.minEBITDA,
max: this.state.maxEBITDA,
interval: this.state.intervalEBITDA
}
] :
[
{
type: 'value',
name: '(Rp bn)',
min: this.state.minEBITDA,
max: this.state.maxEBITDA,
interval: this.state.intervalEBITDA
},
{
type: 'value',
name: '(%)',
min: 0,
max: 100,
interval: 20,
axisLabel: {
formatter: '{value}%'
}
}
]
,
series: this.state.report.value != 'summary' ?
[
{
name: 'MB',
type: 'bar',
data: this.state.mbEBITDA
},
{
name: 'MR',
type: 'bar',
data: this.state.mrEBITDA
}
] :
[
{
name: 'EBITDA',
type: 'bar',
data: this.state.mbEBITDA
},
{
name: 'EBITDA Margin',
type: 'line',
yAxisIndex: 1,
data: this.state.mrEBITDA
}
]
}}
showLoading={this.state.loading}
option={this.state.totalAssetsOptions}
/>}
</div>}
</div>
......
......@@ -119,9 +119,9 @@ export default class MonthlyReport extends Component {
if (this.props.location.state !== undefined) {
console.log(this.props);
if (this.props.location.state.month != null || this.props.location.state.month != undefined) {
this.setState({monthHome: this.props.location.state.month})
this.setState({ monthHome: this.props.location.state.month })
}
this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData}, () => {
this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => {
this.getPermission()
})
} else {
......@@ -135,19 +135,19 @@ export default class MonthlyReport extends Component {
getChecApprover() {
let listStatus1 = [
{name: 'Open', value: 'not-yet'},
{name: 'Submitted', value: 'approval_review'},
{name: 'Waiting for Review / Approval', value: 'approval_proccess'},
{ name: 'Open', value: 'not-yet' },
{ name: 'Submitted', value: 'approval_review' },
{ name: 'Waiting for Review / Approval', value: 'approval_proccess' },
// {name: 'Waiting for Approval', value: 'approval_proccess'},
// {name: 'Revision', value: 'revision'},
{name: 'Approved', value: 'approved'},
{ name: 'Approved', value: 'approved' },
]
let listStatus2 = [
{name: 'Open', value: 'not-yet'},
{name: 'Submitted', value: 'approval_review'},
{ name: 'Open', value: 'not-yet' },
{ name: 'Submitted', value: 'approval_review' },
// {name: 'Revision', value: 'revision'},
{name: 'Approved', value: 'approved'},
{ name: 'Approved', value: 'approved' },
]
api.create().checkApproverMonthly().then(response => {
......@@ -155,8 +155,7 @@ export default class MonthlyReport extends Component {
if (response.data) {
if (response.data.status === "success") {
if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true, still_approver: true, approverTrue: true, listStatus: listStatus1, selectedStatus: listStatus1}, () =>
{
this.setState({ isApprover: true, checkApprover: true, still_approver: true, approverTrue: true, listStatus: listStatus1, selectedStatus: listStatus1 }, () => {
// if (this.state.submittedOnly) {
this.getMonth()
// } else {
......@@ -164,7 +163,7 @@ export default class MonthlyReport extends Component {
// }
})
} else {
this.setState({ isApprover: false, checkApprover: false, still_approver: false, approverTrue: false, listStatus: listStatus2, selectedStatus: listStatus2}, () =>
this.setState({ isApprover: false, checkApprover: false, still_approver: false, approverTrue: false, listStatus: listStatus2, selectedStatus: listStatus2 }, () =>
this.getMonth())
// this.getCompanyActive())
}
......@@ -226,13 +225,13 @@ export default class MonthlyReport extends Component {
let indexC = String(item.current_status).toLocaleUpperCase().indexOf('C')
let status_approv = ''
if (String(item.current_status).toLocaleUpperCase().includes('CC')) {
status_approv = `${String(item.current_status).substr(0,indexC)}${String(item.current_status).substr(indexC+1,String(item.current_status).length)}`
status_approv = `${String(item.current_status).substr(0, indexC)}${String(item.current_status).substr(indexC + 1, String(item.current_status).length)}`
} else {
status_approv = String(item.current_status)
}
return [
item.number,
item.report_name == "CAT"? "Corporate Annual Target" : item.report_name,
item.report_name == "CAT" ? "Corporate Annual Target" : item.report_name,
item.revision,
this.state.isApprovedMB ? (this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : status_approv) : "CLOSED",
item.report_id,
......@@ -253,7 +252,7 @@ export default class MonthlyReport extends Component {
}
})
// console.log(dataTable);
this.setState({ dataTable, loading: false, dataTableRevision: dataTableRevision.sort((a, b) => a.number - b.number), dataForRevision: response.data.data })
this.setState({ dataTable, dataTableRevision: dataTableRevision.sort((a, b) => a.number - b.number), dataForRevision: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
......@@ -285,7 +284,7 @@ export default class MonthlyReport extends Component {
options: companyData,
getOptionLabel: (option) => titleCase(option.company_name),
};
this.setState({ listCompany: defaultProps, company: companyData[0], company_active: defaultProps}, () => {
this.setState({ listCompany: defaultProps, company: companyData[0], company_active: defaultProps }, () => {
this.getMonth()
// console.log(this.state.company_active)
})
......@@ -332,7 +331,7 @@ export default class MonthlyReport extends Component {
indexMonthHome = monthData.findIndex((val) => val.month_id == this.state.monthHome.month_id)
}
console.log(indexMonthHome)
this.setState({ listMonth: defaultProps, month: indexMonthHome == -1? (index == -1 ? monthData[0] : monthData[index]) : monthData[indexMonthHome] }, () => {
this.setState({ listMonth: defaultProps, month: indexMonthHome == -1 ? (index == -1 ? monthData[0] : monthData[index]) : monthData[indexMonthHome] }, () => {
// if (this.state.isApprover === true) {
// if (this.state.submittedOnly) {
// console.log('masuk cuk')
......@@ -492,7 +491,7 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id,
"status": selectedStatus
}
this.setState({isApprovedMB: true})
this.setState({ isApprovedMB: true })
api.create().getCompanySubmittedMonthly(body).then(response => {
console.log(response);
if (response.data) {
......@@ -515,7 +514,7 @@ export default class MonthlyReport extends Component {
})
if (arrayBaru.length > 0) {
arrayBaru = arrayBaru.sort((a,b) => a.company_name.localeCompare(b.company_name))
arrayBaru = arrayBaru.sort((a, b) => a.company_name.localeCompare(b.company_name))
}
let defaultProps = {
options: arrayBaru,
......@@ -607,7 +606,7 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id,
"is_approver": this.state.isApprover
}
this.setState({visibleTableHistory: false})
this.setState({ visibleTableHistory: false })
api.create().getMonthlyReportID(payload).then(response => {
console.log(response);
if (response.data) {
......@@ -625,8 +624,13 @@ export default class MonthlyReport extends Component {
// // console.log(this.state.lastStatus);
this.historyApproval()
this.getLatestPeriodSubmit()
if (type != undefined) {
this.getCashFlow(type)
this.getPL(type)
} else {
this.setState({ loading: false })
}
// this.getFR(type)
// this.getReport()
// this.getReportAttachment()
......@@ -634,7 +638,7 @@ export default class MonthlyReport extends Component {
console.log(response)
if (this.state.btnCreate === true && this.state.btnEdit === true) {
console.log('editable');
this.setState({ isApprover: this.state.approverTrue? true : false, checkApprover: this.state.approverTrue? true : false })
this.setState({ isApprover: this.state.approverTrue ? true : false, checkApprover: this.state.approverTrue ? true : false })
} else {
console.log('just view');
this.setState({ isApprover: true, checkApprover: true })
......@@ -661,7 +665,7 @@ export default class MonthlyReport extends Component {
let body = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
"months" : this.state.month.month_id
"months": this.state.month.month_id
}
api.create().getSubmitMonthlyReport(body).then(response => {
console.log(response);
......@@ -690,7 +694,7 @@ export default class MonthlyReport extends Component {
let indexC = String(item.status_approval).toLocaleUpperCase().indexOf('C')
let status_approv = ''
if (String(item.status_approval).toLocaleUpperCase().includes('CC')) {
status_approv = `${String(item.status_approval).substr(0,indexC)}${String(item.status_approval).substr(indexC+1,String(item.status_approval).length)}`
status_approv = `${String(item.status_approval).substr(0, indexC)}${String(item.status_approval).substr(indexC + 1, String(item.status_approval).length)}`
} else {
status_approv = String(item.status_approval)
}
......@@ -744,7 +748,7 @@ export default class MonthlyReport extends Component {
this.setState({ prevRevision: false })
}
}
if (String(i.report_name).toLocaleLowerCase() == "profit loss" || String(i.report_name).toLocaleLowerCase() == "balance sheet" || String(i.report_name).toLocaleLowerCase() == "fixed assets movement" ) {
if (String(i.report_name).toLocaleLowerCase() == "profit loss" || String(i.report_name).toLocaleLowerCase() == "balance sheet" || String(i.report_name).toLocaleLowerCase() == "fixed assets movement") {
if (String(i.current_status).toLocaleLowerCase() == "submitted") {
PLBSFAMSubmitted += 1
}
......@@ -851,7 +855,7 @@ export default class MonthlyReport extends Component {
visibleLOCF: false,
visibleOI: false,
visibleCF: true,
PLBSFAMSubmitted: PLBSFAMSubmitted == 3? true : false
PLBSFAMSubmitted: PLBSFAMSubmitted == 3 ? true : false
})
}
})
......@@ -1160,7 +1164,7 @@ export default class MonthlyReport extends Component {
// console.log(valuezz);
}
} else {
let data = dbCF[indexS][6].formula == null? [] : dbCF[indexS][6].formula
let data = dbCF[indexS][6].formula == null ? [] : dbCF[indexS][6].formula
// console.log(data)
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`))
if (indexID !== -1) {
......@@ -1184,7 +1188,7 @@ export default class MonthlyReport extends Component {
if (item == '-' || item == '+' || item == '/' || item == '*') {
opet = item
} else {
anjay.push(opet == ''? Number(item) : Number(String(opet + String(item))))
anjay.push(opet == '' ? Number(item) : Number(String(opet + String(item))))
tambahan = false
opet = ""
}
......@@ -1330,37 +1334,37 @@ export default class MonthlyReport extends Component {
}
olahDataCashFlow(dbCF, type) {
dbCF.map((item,index) => {
if(item[0] == 5 || item[0] == 6) {
item[6].value = this.handleValueFormula(item,index)
dbCF.map((item, index) => {
if (item[0] == 5 || item[0] == 6) {
item[6].value = this.handleValueFormula(item, index)
}
})
console.log(dbCF)
this.setState({dbCF}, () => {
this.setState({ dbCF }, () => {
this.payloadCF(type)
})
}
payloadCF(type) {
let listCF = []
this.state.dbCF.map((item,index) => {
this.state.dbCF.map((item, index) => {
if (item[6].value == "" || item[6].value == 0 || item[6].value == "0.0") {
item[6].value = this.handleValueFormula(item,index)
item[6].value = this.handleValueFormula(item, index)
listCF.push({
"item_report_id": item[1],
"actual": item[0] == 1? "" : Number(item[6].value).toFixed(1)
"actual": item[0] == 1 ? "" : Number(item[6].value).toFixed(1)
})
} else {
listCF.push({
"item_report_id": item[1],
"actual": item[0] == 1? "" : Number(item[6].value).toFixed(1)
"actual": item[0] == 1 ? "" : Number(item[6].value).toFixed(1)
})
}
})
// console.log(listCF)
this.setState({dbCF: listCF} , () => {
this.setState({ dbCF: listCF }, () => {
// if (type != undefined) {
// if (type == 'BS' || type == 'FAM' || type == 'PL') {
console.log('tarik sis')
......@@ -1443,27 +1447,27 @@ export default class MonthlyReport extends Component {
item.formula,
item.level,
item.description,
this.state.month.month_id == 1?
this.state.month.month_id == 1 ?
{ value: item.profit_detail.january, formula: item.profit_detail.january_formula } :
this.state.month.month_id == 2?
this.state.month.month_id == 2 ?
{ value: item.profit_detail.february, formula: item.profit_detail.february_formula } :
this.state.month.month_id == 3?
this.state.month.month_id == 3 ?
{ value: item.profit_detail.march, formula: item.profit_detail.march_formula } :
this.state.month.month_id == 4?
this.state.month.month_id == 4 ?
{ value: item.profit_detail.april, formula: item.profit_detail.april_formula } :
this.state.month.month_id == 5?
this.state.month.month_id == 5 ?
{ value: item.profit_detail.may, formula: item.profit_detail.may_formula } :
this.state.month.month_id == 6?
this.state.month.month_id == 6 ?
{ value: item.profit_detail.june, formula: item.profit_detail.june_formula } :
this.state.month.month_id == 7?
this.state.month.month_id == 7 ?
{ value: item.profit_detail.july, formula: item.profit_detail.july_formula } :
this.state.month.month_id == 8?
this.state.month.month_id == 8 ?
{ value: item.profit_detail.august, formula: item.profit_detail.august_formula } :
this.state.month.month_id == 9?
this.state.month.month_id == 9 ?
{ value: item.profit_detail.september, formula: item.profit_detail.september_formula } :
this.state.month.month_id == 10?
this.state.month.month_id == 10 ?
{ value: item.profit_detail.october, formula: item.profit_detail.october_formula } :
this.state.month.month_id == 11?
this.state.month.month_id == 11 ?
{ value: item.profit_detail.november, formula: item.profit_detail.november_formula } :
{ value: item.profit_detail.december, formula: item.profit_detail.december_formula },
item.order,
......@@ -1486,27 +1490,27 @@ export default class MonthlyReport extends Component {
item.formula,
item.level,
item.description,
this.state.month.month_id == 1?
this.state.month.month_id == 1 ?
{ value: item.profit_detail.january, formula: item.profit_detail.january_formula } :
this.state.month.month_id == 2?
this.state.month.month_id == 2 ?
{ value: item.profit_detail.february, formula: item.profit_detail.february_formula } :
this.state.month.month_id == 3?
this.state.month.month_id == 3 ?
{ value: item.profit_detail.march, formula: item.profit_detail.march_formula } :
this.state.month.month_id == 4?
this.state.month.month_id == 4 ?
{ value: item.profit_detail.april, formula: item.profit_detail.april_formula } :
this.state.month.month_id == 5?
this.state.month.month_id == 5 ?
{ value: item.profit_detail.may, formula: item.profit_detail.may_formula } :
this.state.month.month_id == 6?
this.state.month.month_id == 6 ?
{ value: item.profit_detail.june, formula: item.profit_detail.june_formula } :
this.state.month.month_id == 7?
this.state.month.month_id == 7 ?
{ value: item.profit_detail.july, formula: item.profit_detail.july_formula } :
this.state.month.month_id == 8?
this.state.month.month_id == 8 ?
{ value: item.profit_detail.august, formula: item.profit_detail.august_formula } :
this.state.month.month_id == 9?
this.state.month.month_id == 9 ?
{ value: item.profit_detail.september, formula: item.profit_detail.september_formula } :
this.state.month.month_id == 10?
this.state.month.month_id == 10 ?
{ value: item.profit_detail.october, formula: item.profit_detail.october_formula } :
this.state.month.month_id == 11?
this.state.month.month_id == 11 ?
{ value: item.profit_detail.november, formula: item.profit_detail.november_formula } :
{ value: item.profit_detail.december, formula: item.profit_detail.december_formula },
item.order,
......@@ -1752,31 +1756,31 @@ export default class MonthlyReport extends Component {
}
olahDataPL(dbPL, type) {
dbPL.map((item,index) => {
if(item[0] == 5 || item[0] == 6 ) {
item[6].value = this.handleValueFormulaDBPLMR(item[6],item,6)
dbPL.map((item, index) => {
if (item[0] == 5 || item[0] == 6) {
item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6)
}
})
// console.log(dbPL)
this.setState({dbPL}, () => {
this.setState({ dbPL }, () => {
this.payloadPL(type)
})
}
payloadPL(type) {
let listPL = []
this.state.dbPL.map((item,index) => {
this.state.dbPL.map((item, index) => {
if (item[6].value == "" || item[6].value == 0 || item[6].value == "0.0") {
item[6].value = this.handleValueFormulaDBPLMR(item[6],item,6)
item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6)
listPL.push({
"item_report_id": item[1],
"actual": item[0] == 1? "" : Number(item[6].value).toFixed(1),
"actual": item[0] == 1 ? "" : Number(item[6].value).toFixed(1),
"notes": item[8]
})
} else {
listPL.push({
"item_report_id": item[1],
"actual": item[0] == 1? "" : Number(item[6].value).toFixed(1),
"actual": item[0] == 1 ? "" : Number(item[6].value).toFixed(1),
"notes": item[8]
})
}
......@@ -1784,7 +1788,7 @@ export default class MonthlyReport extends Component {
})
console.log(listPL)
this.setState({dbPL: listPL} , () => {
this.setState({ dbPL: listPL }, () => {
// if (type != undefined) {
// if ( type == 'PL') {
console.log('tarik sis')
......@@ -1808,7 +1812,7 @@ export default class MonthlyReport extends Component {
}
api.create().createReportPLMR(payload).then((res) => {
console.log(res)
this.setState({loading: false})
this.setState({ loading: false })
// if (response.data) {
// if (response.data.status === "success") {
// this.props.saveToMonthlyReport()
......@@ -1950,7 +1954,7 @@ export default class MonthlyReport extends Component {
total += Number(dataTable2[35][7 + index])
// console.log(index);
}
total = total/month
total = total / month
}
let hasil = Number(value) / total
// console.log(hasil, value, total);
......@@ -1958,25 +1962,25 @@ export default class MonthlyReport extends Component {
}
olahDataFR(dbFR, type) {
dbFR.map((item,index) => {
if(item[0] != 4 || item[0] != 1) {
if (item[5] === "Return on Invested Capital - YTD (ROIC)" ) {
item[7] = this.handleFormulaRatio(item[7],item,1)
item[8] = this.handleFormulaRatio(item[8],item,2)
item[9] = this.handleFormulaRatio(item[9],item,3)
item[10] = this.handleFormulaRatio(item[10],item,4)
item[11] = this.handleFormulaRatio(item[11],item,5)
item[12] = this.handleFormulaRatio(item[12],item,6)
item[13] = this.handleFormulaRatio(item[13],item,7)
item[14] = this.handleFormulaRatio(item[14],item,8)
item[15] = this.handleFormulaRatio(item[15],item,9)
item[16] = this.handleFormulaRatio(item[16],item,10)
item[17] = this.handleFormulaRatio(item[17],item,11)
item[18] = this.handleFormulaRatio(item[18],item,12)
}
}
})
this.setState({dbFR}, () => {
dbFR.map((item, index) => {
if (item[0] != 4 || item[0] != 1) {
if (item[5] === "Return on Invested Capital - YTD (ROIC)") {
item[7] = this.handleFormulaRatio(item[7], item, 1)
item[8] = this.handleFormulaRatio(item[8], item, 2)
item[9] = this.handleFormulaRatio(item[9], item, 3)
item[10] = this.handleFormulaRatio(item[10], item, 4)
item[11] = this.handleFormulaRatio(item[11], item, 5)
item[12] = this.handleFormulaRatio(item[12], item, 6)
item[13] = this.handleFormulaRatio(item[13], item, 7)
item[14] = this.handleFormulaRatio(item[14], item, 8)
item[15] = this.handleFormulaRatio(item[15], item, 9)
item[16] = this.handleFormulaRatio(item[16], item, 10)
item[17] = this.handleFormulaRatio(item[17], item, 11)
item[18] = this.handleFormulaRatio(item[18], item, 12)
}
}
})
this.setState({ dbFR }, () => {
this.payloadFR(type)
})
}
......@@ -1984,7 +1988,7 @@ export default class MonthlyReport extends Component {
payloadFR(type) {
let listFR = []
console.log(this.state.dbFR)
this.state.dbFR.map((item,index) => {
this.state.dbFR.map((item, index) => {
if (item[0] != 4 || item[0] != 1) {
// if (item[5] === "Return on Invested Capital - YTD (ROIC)" ) {
// item[7] = this.handleFormulaRatio(item[7],item,1)
......@@ -2006,29 +2010,29 @@ export default class MonthlyReport extends Component {
listFR.push(
{
"item_report_id": item[1],
"actual": this.state.month.month_id == 1?
String(item[7] == undefined || item[7] == 'Infinity' || item[7] == '-Infinity'? "0.0" : Number(item[7]).toFixed(2)) :
this.state.month.month_id == 2?
String(item[8] == undefined || item[8] == 'Infinity' || item[8] == '-Infinity'? "0.0" : Number(item[8]).toFixed(2)) :
this.state.month.month_id == 3?
String(item[9] == undefined || item[9] == 'Infinity' || item[9] == '-Infinity'? "0.0" : Number(item[9]).toFixed(2)) :
this.state.month.month_id == 4?
String(item[10] == undefined || item[10] == 'Infinity' || item[10] == '-Infinity'? "0.0" : Number(item[10]).toFixed(2)) :
this.state.month.month_id == 5?
String(item[11] == undefined || item[11] == 'Infinity' || item[11] == '-Infinity'? "0.0" : Number(item[11]).toFixed(2)) :
this.state.month.month_id == 6?
String(item[12] == undefined || item[12] == 'Infinity' || item[12] == '-Infinity'? "0.0" : Number(item[12]).toFixed(2)) :
this.state.month.month_id == 7?
String(item[13] == undefined || item[13] == 'Infinity' || item[13] == '-Infinity'? "0.0" : Number(item[13]).toFixed(2)) :
this.state.month.month_id == 8?
String(item[14] == undefined || item[14] == 'Infinity' || item[14] == '-Infinity'? "0.0" : Number(item[14]).toFixed(2)) :
this.state.month.month_id == 9?
String(item[15] == undefined || item[15] == 'Infinity' || item[15] == '-Infinity'? "0.0" : Number(item[15]).toFixed(2)) :
this.state.month.month_id == 10?
String(item[16] == undefined || item[16] == 'Infinity' || item[16] == '-Infinity'? "0.0" : Number(item[16]).toFixed(2)) :
this.state.month.month_id == 11?
String(item[17] == undefined || item[17] == 'Infinity' || item[17] == '-Infinity'? "0.0" : Number(item[17]).toFixed(2)) :
String(item[18] == undefined || item[18] == 'Infinity' || item[18] == '-Infinity'? "0.0" : Number(item[18]).toFixed(2))
"actual": this.state.month.month_id == 1 ?
String(item[7] == undefined || item[7] == 'Infinity' || item[7] == '-Infinity' ? "0.0" : Number(item[7]).toFixed(2)) :
this.state.month.month_id == 2 ?
String(item[8] == undefined || item[8] == 'Infinity' || item[8] == '-Infinity' ? "0.0" : Number(item[8]).toFixed(2)) :
this.state.month.month_id == 3 ?
String(item[9] == undefined || item[9] == 'Infinity' || item[9] == '-Infinity' ? "0.0" : Number(item[9]).toFixed(2)) :
this.state.month.month_id == 4 ?
String(item[10] == undefined || item[10] == 'Infinity' || item[10] == '-Infinity' ? "0.0" : Number(item[10]).toFixed(2)) :
this.state.month.month_id == 5 ?
String(item[11] == undefined || item[11] == 'Infinity' || item[11] == '-Infinity' ? "0.0" : Number(item[11]).toFixed(2)) :
this.state.month.month_id == 6 ?
String(item[12] == undefined || item[12] == 'Infinity' || item[12] == '-Infinity' ? "0.0" : Number(item[12]).toFixed(2)) :
this.state.month.month_id == 7 ?
String(item[13] == undefined || item[13] == 'Infinity' || item[13] == '-Infinity' ? "0.0" : Number(item[13]).toFixed(2)) :
this.state.month.month_id == 8 ?
String(item[14] == undefined || item[14] == 'Infinity' || item[14] == '-Infinity' ? "0.0" : Number(item[14]).toFixed(2)) :
this.state.month.month_id == 9 ?
String(item[15] == undefined || item[15] == 'Infinity' || item[15] == '-Infinity' ? "0.0" : Number(item[15]).toFixed(2)) :
this.state.month.month_id == 10 ?
String(item[16] == undefined || item[16] == 'Infinity' || item[16] == '-Infinity' ? "0.0" : Number(item[16]).toFixed(2)) :
this.state.month.month_id == 11 ?
String(item[17] == undefined || item[17] == 'Infinity' || item[17] == '-Infinity' ? "0.0" : Number(item[17]).toFixed(2)) :
String(item[18] == undefined || item[18] == 'Infinity' || item[18] == '-Infinity' ? "0.0" : Number(item[18]).toFixed(2))
// "january": String(item[7] == undefined? item[7] : Number(item[7]).toFixed(1)),
// "february": String(item[8] == undefined? item[8] : Number(item[8]).toFixed(1)),
// "march": String(item[9] == undefined? item[9] : Number(item[9]).toFixed(1)),
......@@ -2049,8 +2053,8 @@ export default class MonthlyReport extends Component {
})
console.log(listFR)
console.log('subOD',this.state.submissionID)
this.setState({dbFR: listFR} , () => {
console.log('subOD', this.state.submissionID)
this.setState({ dbFR: listFR }, () => {
if (this.state.monthlyReportId != null) {
this.createDBFR()
}
......@@ -2507,7 +2511,7 @@ export default class MonthlyReport extends Component {
getOptionLabel={(option) => option.name}
style={{ width: 250 }}
onChange={(event, newInputValue) => {
this.setState({selectedStatus: newInputValue, loading: true}, () => {
this.setState({ selectedStatus: newInputValue, loading: true }, () => {
console.log(newInputValue);
this.getCompanySubmitted()
})
......@@ -2729,7 +2733,7 @@ export default class MonthlyReport extends Component {
</div>
</div>
:
this.state.checkApprover?
this.state.checkApprover ?
this.state.lastStatus === 'WAITING FOR REVIEW' ?
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<button
......@@ -2781,7 +2785,7 @@ export default class MonthlyReport extends Component {
</div>
</div> : null
:
(this.state.lastStatus === 'SUBMIT' || this.state.lastStatus === 'REVISION') && this.state.isSubmit?
(this.state.lastStatus === 'SUBMIT' || this.state.lastStatus === 'REVISION') && this.state.isSubmit ?
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<button
style={{
......@@ -3014,7 +3018,7 @@ export default class MonthlyReport extends Component {
/>
)}
{
{
this.state.visibleRevision && (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
......
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