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 { ...@@ -671,7 +671,7 @@ export default class BudgetTahunan extends Component {
} }
} }
}) })
// console.log(dataTable) console.log(dataTable)
this.setState({ dbCF: dataTable }, () => { this.setState({ dbCF: dataTable }, () => {
this.olahDataCashFlow(this.state.dbCF, type) this.olahDataCashFlow(this.state.dbCF, type)
}) })
...@@ -929,7 +929,7 @@ export default class BudgetTahunan extends Component { ...@@ -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 return total
} }
...@@ -1089,6 +1089,7 @@ export default class BudgetTahunan extends Component { ...@@ -1089,6 +1089,7 @@ export default class BudgetTahunan extends Component {
console.log(this.state.dbCF) console.log(this.state.dbCF)
console.log(JSON.stringify(payload)) console.log(JSON.stringify(payload))
api.create().createReportCF(payload).then((res) => { api.create().createReportCF(payload).then((res) => {
this.setState({loading: false})
console.log(res) console.log(res)
// if (response.data) { // if (response.data) {
// if (response.data.status === "success") { // if (response.data.status === "success") {
...@@ -1220,7 +1221,7 @@ export default class BudgetTahunan extends Component { ...@@ -1220,7 +1221,7 @@ export default class BudgetTahunan extends Component {
this.olahDataPL(this.state.dbPL, type) this.olahDataPL(this.state.dbPL, type)
}) })
} else { } 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 { ...@@ -80,7 +80,11 @@ export default class DashboardFinancial extends React.Component {
intervalEBITDA: 0, intervalEBITDA: 0,
data: [], data: [],
defaultMonth: [], defaultMonth: [],
defaultYear: [] defaultYear: [],
revOptions: {},
tpatOptions: {},
ebitdaOptions: {},
totalAssetsOptions: {}
}; };
} }
...@@ -390,7 +394,7 @@ export default class DashboardFinancial extends React.Component { ...@@ -390,7 +394,7 @@ export default class DashboardFinancial extends React.Component {
// newName = `asd \n baba` // newName = `asd \n baba`
// } else { // } else {
let splitName = String(name).split(' ') let splitName = String(name).split(' ')
console.log(splitName) // console.log(splitName)
newName = name newName = name
// } // }
} }
...@@ -424,61 +428,487 @@ export default class DashboardFinancial extends React.Component { ...@@ -424,61 +428,487 @@ export default class DashboardFinancial extends React.Component {
let minEBITDA = response.ebitda.vertical_pointing[1] let minEBITDA = response.ebitda.vertical_pointing[1]
let intervalEBITDA = Number(response.ebitda.interval) 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') { if (this.state.report.value == 'summary') {
companyRev.push(item.periode) companyRev.push(item.periode)
mbRev.push(item.value) mbRev.push(Number(item.value))
mrRev.push(item.gp_margin) mrRev.push(Number(item.gp_margin))
} else { } else {
companyRev.push(handleName(item.company)) companyRev.push(handleName(item.company))
mbRev.push(item.value_mb) mbRev.push(Number(item.value_mb))
mrRev.push(item.value_mr) 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') { if (this.state.report.value == 'summary') {
companyTPAT.push(item.periode) companyTPAT.push(item.periode)
mbTPAT.push(item.value) mbTPAT.push(Number(item.value))
mrTPAT.push(item.gp_margin) mrTPAT.push(Number(item.gp_margin))
} else { } else {
companyTPAT.push(handleName(item.company)) companyTPAT.push(handleName(item.company))
mbTPAT.push(item.value_mb) mbTPAT.push(Number(item.value_mb))
mrTPAT.push(item.value_mr) 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') { if (this.state.report.value == 'summary') {
companyEBITDA.push(item.periode) companyEBITDA.push(item.periode)
mbEBITDA.push(item.value) mbEBITDA.push(Number(item.value))
mrEBITDA.push(item.gp_margin) mrEBITDA.push(Number(item.gp_margin))
} else { } else {
companyEBITDA.push(handleName(item.company)) companyEBITDA.push(handleName(item.company))
mbEBITDA.push(item.value_mb) mbEBITDA.push(Number(item.value_mb))
mrEBITDA.push(item.value_mr) mrEBITDA.push(Number(item.value_mr))
} }
}) })
let ebitdaOptions = {
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: companyEBITDA,
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: 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') { if (this.state.report.value == 'summary') {
response.revenue.nodes.map((item, index) => { response.total_asset.nodes.sort((a, b) => a.index - b.index).map((item, index) => {
totalAssets.push({ companyTA.push(item.periode)
"company": item.company, mbTA.push(item.value)
"MB": item.value_mb,
"MBColor": "hsl(212, 64%, 46%)",
"MR": item.value_mr,
"MRColor": "hsl(212, 78%, 62%)",
})
}) })
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({ 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 }) this.setState({ revOptions, tpatOptions, ebitdaOptions }, () => {
setTimeout(() => {
this.setState({ loading: false })
}, 300);
}) })
} }
}) })
...@@ -523,7 +953,7 @@ export default class DashboardFinancial extends React.Component { ...@@ -523,7 +953,7 @@ export default class DashboardFinancial extends React.Component {
} }
return ( return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }} ref={this.myRef}> <div style={{ flex: 1, backgroundColor: '#f8f8f8' }} ref={this.myRef}>
{this.state.loading && loadingComponent} {/* {this.state.loading && loadingComponent} */}
<div> <div>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}> <div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Dashboard Financial</Typography> <Typography style={{ fontSize: '16px', color: 'white' }}>Dashboard Financial</Typography>
...@@ -672,7 +1102,7 @@ export default class DashboardFinancial extends React.Component { ...@@ -672,7 +1102,7 @@ export default class DashboardFinancial extends React.Component {
} }
}) })
let listMonth2 = monthData2 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() this.getDashboardFinancial()
}) })
} else { } else {
...@@ -762,443 +1192,38 @@ export default class DashboardFinancial extends React.Component { ...@@ -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 }}> <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.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 }} style={{ height: 500, width: '100%', marginTop: 20 }}
option={{ option={this.state.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']
},
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
}
]
}}
/>} />}
</div> </div>
<div style={{ height: Number(0.6 * this.props.height), border: '1px solid black', marginTop: 50, paddingBottom: 50 }}> <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.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 }} style={{ height: 500, width: '100%', marginTop: 20 }}
option={{ option={this.state.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: 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
}
]
}}
/>} />}
{/* <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>
<div style={{ height: Number(0.6 * this.props.height), border: '1px solid black', marginTop: 50, paddingBottom: 50 }}> <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.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 }} style={{ height: 500, width: '100%', marginTop: 20 }}
option={{ option={this.state.ebitdaOptions}
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
}
]
}}
/>} />}
</div> </div>
{this.state.report.value == 'summary' && <div style={{ height: Number(0.6 * this.props.height), border: '1px solid black', marginTop: 50, paddingBottom: 50 }}> {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> <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 }} style={{ height: 500, width: '100%', marginTop: 20 }}
option={{ showLoading={this.state.loading}
tooltip: { option={this.state.totalAssetsOptions}
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
}
]
}}
/>} />}
</div>} </div>}
</div> </div>
......
...@@ -119,9 +119,9 @@ export default class MonthlyReport extends Component { ...@@ -119,9 +119,9 @@ export default class MonthlyReport extends Component {
if (this.props.location.state !== undefined) { if (this.props.location.state !== undefined) {
console.log(this.props); console.log(this.props);
if (this.props.location.state.month != null || this.props.location.state.month != undefined) { 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() this.getPermission()
}) })
} else { } else {
...@@ -135,19 +135,19 @@ export default class MonthlyReport extends Component { ...@@ -135,19 +135,19 @@ export default class MonthlyReport extends Component {
getChecApprover() { getChecApprover() {
let listStatus1 = [ let listStatus1 = [
{name: 'Open', value: 'not-yet'}, { name: 'Open', value: 'not-yet' },
{name: 'Submitted', value: 'approval_review'}, { name: 'Submitted', value: 'approval_review' },
{name: 'Waiting for Review / Approval', value: 'approval_proccess'}, { name: 'Waiting for Review / Approval', value: 'approval_proccess' },
// {name: 'Waiting for Approval', value: 'approval_proccess'}, // {name: 'Waiting for Approval', value: 'approval_proccess'},
// {name: 'Revision', value: 'revision'}, // {name: 'Revision', value: 'revision'},
{name: 'Approved', value: 'approved'}, { name: 'Approved', value: 'approved' },
] ]
let listStatus2 = [ let listStatus2 = [
{name: 'Open', value: 'not-yet'}, { name: 'Open', value: 'not-yet' },
{name: 'Submitted', value: 'approval_review'}, { name: 'Submitted', value: 'approval_review' },
// {name: 'Revision', value: 'revision'}, // {name: 'Revision', value: 'revision'},
{name: 'Approved', value: 'approved'}, { name: 'Approved', value: 'approved' },
] ]
api.create().checkApproverMonthly().then(response => { api.create().checkApproverMonthly().then(response => {
...@@ -155,18 +155,17 @@ export default class MonthlyReport extends Component { ...@@ -155,18 +155,17 @@ export default class MonthlyReport extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
if (response.data.data.is_approver === true) { 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) {
// if (this.state.submittedOnly) { this.getMonth()
this.getMonth() // } else {
// } else { // this.getCompanyActive()
// this.getCompanyActive() // }
// } })
})
} else { } 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.getMonth())
// this.getCompanyActive()) // this.getCompanyActive())
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -226,13 +225,13 @@ export default class MonthlyReport extends Component { ...@@ -226,13 +225,13 @@ export default class MonthlyReport extends Component {
let indexC = String(item.current_status).toLocaleUpperCase().indexOf('C') let indexC = String(item.current_status).toLocaleUpperCase().indexOf('C')
let status_approv = '' let status_approv = ''
if (String(item.current_status).toLocaleUpperCase().includes('CC')) { 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 { } else {
status_approv = String(item.current_status) status_approv = String(item.current_status)
} }
return [ return [
item.number, item.number,
item.report_name == "CAT"? "Corporate Annual Target" : item.report_name, item.report_name == "CAT" ? "Corporate Annual Target" : item.report_name,
item.revision, item.revision,
this.state.isApprovedMB ? (this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : status_approv) : "CLOSED", this.state.isApprovedMB ? (this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : status_approv) : "CLOSED",
item.report_id, item.report_id,
...@@ -253,7 +252,7 @@ export default class MonthlyReport extends Component { ...@@ -253,7 +252,7 @@ export default class MonthlyReport extends Component {
} }
}) })
// console.log(dataTable); // 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 { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -285,7 +284,7 @@ export default class MonthlyReport extends Component { ...@@ -285,7 +284,7 @@ export default class MonthlyReport extends Component {
options: companyData, options: companyData,
getOptionLabel: (option) => titleCase(option.company_name), 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() this.getMonth()
// console.log(this.state.company_active) // console.log(this.state.company_active)
}) })
...@@ -332,7 +331,7 @@ export default class MonthlyReport extends Component { ...@@ -332,7 +331,7 @@ export default class MonthlyReport extends Component {
indexMonthHome = monthData.findIndex((val) => val.month_id == this.state.monthHome.month_id) indexMonthHome = monthData.findIndex((val) => val.month_id == this.state.monthHome.month_id)
} }
console.log(indexMonthHome) 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.isApprover === true) {
// if (this.state.submittedOnly) { // if (this.state.submittedOnly) {
// console.log('masuk cuk') // console.log('masuk cuk')
...@@ -341,8 +340,8 @@ export default class MonthlyReport extends Component { ...@@ -341,8 +340,8 @@ export default class MonthlyReport extends Component {
// this.getLastPeriod() // this.getLastPeriod()
// } // }
// } else { // } else {
// this.getLastPeriod() // this.getLastPeriod()
this.getPeriode() this.getPeriode()
// } // }
}) })
} else { } else {
...@@ -415,11 +414,11 @@ export default class MonthlyReport extends Component { ...@@ -415,11 +414,11 @@ export default class MonthlyReport extends Component {
// console.log(index) // console.log(index)
this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => { this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => {
// if (this.state.isApprover === true && this.state.submittedOnly) { // if (this.state.isApprover === true && this.state.submittedOnly) {
this.getDetailUser() this.getDetailUser()
// this.getCompanySubmitted() // this.getCompanySubmitted()
// console.log('masuk') // console.log('masuk')
// } else { // } else {
// this.getRevision() // this.getRevision()
// } // }
}) })
} else { } else {
...@@ -492,7 +491,7 @@ export default class MonthlyReport extends Component { ...@@ -492,7 +491,7 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id, "months": this.state.month.month_id,
"status": selectedStatus "status": selectedStatus
} }
this.setState({isApprovedMB: true}) this.setState({ isApprovedMB: true })
api.create().getCompanySubmittedMonthly(body).then(response => { api.create().getCompanySubmittedMonthly(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
...@@ -515,7 +514,7 @@ export default class MonthlyReport extends Component { ...@@ -515,7 +514,7 @@ export default class MonthlyReport extends Component {
}) })
if (arrayBaru.length > 0) { 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 = { let defaultProps = {
options: arrayBaru, options: arrayBaru,
...@@ -607,7 +606,7 @@ export default class MonthlyReport extends Component { ...@@ -607,7 +606,7 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id, "months": this.state.month.month_id,
"is_approver": this.state.isApprover "is_approver": this.state.isApprover
} }
this.setState({visibleTableHistory: false}) this.setState({ visibleTableHistory: false })
api.create().getMonthlyReportID(payload).then(response => { api.create().getMonthlyReportID(payload).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
...@@ -625,8 +624,13 @@ export default class MonthlyReport extends Component { ...@@ -625,8 +624,13 @@ export default class MonthlyReport extends Component {
// // console.log(this.state.lastStatus); // // console.log(this.state.lastStatus);
this.historyApproval() this.historyApproval()
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
this.getCashFlow(type) if (type != undefined) {
this.getPL(type) this.getCashFlow(type)
this.getPL(type)
} else {
this.setState({ loading: false })
}
// this.getFR(type) // this.getFR(type)
// this.getReport() // this.getReport()
// this.getReportAttachment() // this.getReportAttachment()
...@@ -634,7 +638,7 @@ export default class MonthlyReport extends Component { ...@@ -634,7 +638,7 @@ export default class MonthlyReport extends Component {
console.log(response) console.log(response)
if (this.state.btnCreate === true && this.state.btnEdit === true) { if (this.state.btnCreate === true && this.state.btnEdit === true) {
console.log('editable'); 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 { } else {
console.log('just view'); console.log('just view');
this.setState({ isApprover: true, checkApprover: true }) this.setState({ isApprover: true, checkApprover: true })
...@@ -661,7 +665,7 @@ export default class MonthlyReport extends Component { ...@@ -661,7 +665,7 @@ export default class MonthlyReport extends Component {
let body = { let body = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"months" : this.state.month.month_id "months": this.state.month.month_id
} }
api.create().getSubmitMonthlyReport(body).then(response => { api.create().getSubmitMonthlyReport(body).then(response => {
console.log(response); console.log(response);
...@@ -690,7 +694,7 @@ export default class MonthlyReport extends Component { ...@@ -690,7 +694,7 @@ export default class MonthlyReport extends Component {
let indexC = String(item.status_approval).toLocaleUpperCase().indexOf('C') let indexC = String(item.status_approval).toLocaleUpperCase().indexOf('C')
let status_approv = '' let status_approv = ''
if (String(item.status_approval).toLocaleUpperCase().includes('CC')) { 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 { } else {
status_approv = String(item.status_approval) status_approv = String(item.status_approval)
} }
...@@ -744,7 +748,7 @@ export default class MonthlyReport extends Component { ...@@ -744,7 +748,7 @@ export default class MonthlyReport extends Component {
this.setState({ prevRevision: false }) 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") { if (String(i.current_status).toLocaleLowerCase() == "submitted") {
PLBSFAMSubmitted += 1 PLBSFAMSubmitted += 1
} }
...@@ -851,7 +855,7 @@ export default class MonthlyReport extends Component { ...@@ -851,7 +855,7 @@ export default class MonthlyReport extends Component {
visibleLOCF: false, visibleLOCF: false,
visibleOI: false, visibleOI: false,
visibleCF: true, visibleCF: true,
PLBSFAMSubmitted: PLBSFAMSubmitted == 3? true : false PLBSFAMSubmitted: PLBSFAMSubmitted == 3 ? true : false
}) })
} }
}) })
...@@ -1121,7 +1125,7 @@ export default class MonthlyReport extends Component { ...@@ -1121,7 +1125,7 @@ export default class MonthlyReport extends Component {
// console.log(item); // console.log(item);
// console.log(items); // console.log(items);
// console.log(subForm); // console.log(subForm);
let re = /^[a-zA-Z0-9_]+$/; let re = /^[a-zA-Z0-9_]+$/;
if (item !== "") { if (item !== "") {
if (items == ']') { if (items == ']') {
...@@ -1153,14 +1157,14 @@ export default class MonthlyReport extends Component { ...@@ -1153,14 +1157,14 @@ export default class MonthlyReport extends Component {
// console.log(tst); // console.log(tst);
let indexID = dbCF[indexS][6].formula.findIndex((val) => val.item_formula == tst) let indexID = dbCF[indexS][6].formula.findIndex((val) => val.item_formula == tst)
// console.log(indexID); // console.log(indexID);
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dbCF[indexS][6].formula[indexID].value let valuezz = dbCF[indexS][6].formula[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
// console.log(valuezz); // console.log(valuezz);
} }
} else { } 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) // console.log(data)
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`)) let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`))
if (indexID !== -1) { if (indexID !== -1) {
...@@ -1184,7 +1188,7 @@ export default class MonthlyReport extends Component { ...@@ -1184,7 +1188,7 @@ export default class MonthlyReport extends Component {
if (item == '-' || item == '+' || item == '/' || item == '*') { if (item == '-' || item == '+' || item == '/' || item == '*') {
opet = item opet = item
} else { } else {
anjay.push(opet == ''? Number(item) : Number(String(opet + String(item)))) anjay.push(opet == '' ? Number(item) : Number(String(opet + String(item))))
tambahan = false tambahan = false
opet = "" opet = ""
} }
...@@ -1330,41 +1334,41 @@ export default class MonthlyReport extends Component { ...@@ -1330,41 +1334,41 @@ export default class MonthlyReport extends Component {
} }
olahDataCashFlow(dbCF, type) { olahDataCashFlow(dbCF, type) {
dbCF.map((item,index) => { dbCF.map((item, index) => {
if(item[0] == 5 || item[0] == 6) { if (item[0] == 5 || item[0] == 6) {
item[6].value = this.handleValueFormula(item,index) item[6].value = this.handleValueFormula(item, index)
} }
}) })
console.log(dbCF) console.log(dbCF)
this.setState({dbCF}, () => { this.setState({ dbCF }, () => {
this.payloadCF(type) this.payloadCF(type)
}) })
} }
payloadCF(type) { payloadCF(type) {
let listCF = [] 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") { 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({ listCF.push({
"item_report_id": item[1], "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 { } else {
listCF.push({ listCF.push({
"item_report_id": item[1], "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) // console.log(listCF)
this.setState({dbCF: listCF} , () => { this.setState({ dbCF: listCF }, () => {
// if (type != undefined) { // if (type != undefined) {
// if (type == 'BS' || type == 'FAM' || type == 'PL') { // if (type == 'BS' || type == 'FAM' || type == 'PL') {
console.log('tarik sis') console.log('tarik sis')
this.createCashFlow() this.createCashFlow()
// } // }
// } // }
}) })
...@@ -1410,7 +1414,7 @@ export default class MonthlyReport extends Component { ...@@ -1410,7 +1414,7 @@ export default class MonthlyReport extends Component {
api.create().getPLID(payloadID).then(response => { api.create().getPLID(payloadID).then(response => {
console.log(response); console.log(response);
if (response) { if (response) {
PLID = response.data.data == null ? null : response.data.data.profit_loss_id PLID = response.data.data == null ? null : response.data.data.profit_loss_id
} else { } else {
PLID = null PLID = null
} }
...@@ -1424,12 +1428,12 @@ export default class MonthlyReport extends Component { ...@@ -1424,12 +1428,12 @@ export default class MonthlyReport extends Component {
"report_id": 28, "report_id": 28,
"submission_id": this.state.PLID "submission_id": this.state.PLID
} }
api.create().getHierarkiCreateReportPLMR(payload).then((response) => { api.create().getHierarkiCreateReportPLMR(payload).then((response) => {
console.log(response) console.log(response)
let dataTable = [] let dataTable = []
let err = false let err = false
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
...@@ -1443,29 +1447,29 @@ export default class MonthlyReport extends Component { ...@@ -1443,29 +1447,29 @@ export default class MonthlyReport extends Component {
item.formula, item.formula,
item.level, item.level,
item.description, 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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.november, formula: item.profit_detail.november_formula } :
{ value: item.profit_detail.december, formula: item.profit_detail.december_formula }, { value: item.profit_detail.december, formula: item.profit_detail.december_formula },
item.order, item.order,
item.profit_detail.notes item.profit_detail.notes
]) ])
...@@ -1486,29 +1490,29 @@ export default class MonthlyReport extends Component { ...@@ -1486,29 +1490,29 @@ export default class MonthlyReport extends Component {
item.formula, item.formula,
item.level, item.level,
item.description, 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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 } : { 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.november, formula: item.profit_detail.november_formula } :
{ value: item.profit_detail.december, formula: item.profit_detail.december_formula }, { value: item.profit_detail.december, formula: item.profit_detail.december_formula },
item.order, item.order,
item.profit_detail.notes item.profit_detail.notes
]) ])
...@@ -1541,7 +1545,7 @@ export default class MonthlyReport extends Component { ...@@ -1541,7 +1545,7 @@ export default class MonthlyReport extends Component {
}) })
}) })
}) })
} }
handleValueFormulaDBPLMR = (value, tableMeta, column, periode, forecast) => { handleValueFormulaDBPLMR = (value, tableMeta, column, periode, forecast) => {
...@@ -1752,43 +1756,43 @@ export default class MonthlyReport extends Component { ...@@ -1752,43 +1756,43 @@ export default class MonthlyReport extends Component {
} }
olahDataPL(dbPL, type) { olahDataPL(dbPL, type) {
dbPL.map((item,index) => { dbPL.map((item, index) => {
if(item[0] == 5 || item[0] == 6 ) { if (item[0] == 5 || item[0] == 6) {
item[6].value = this.handleValueFormulaDBPLMR(item[6],item,6) item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6)
} }
}) })
// console.log(dbPL) // console.log(dbPL)
this.setState({dbPL}, () => { this.setState({ dbPL }, () => {
this.payloadPL(type) this.payloadPL(type)
}) })
} }
payloadPL(type) { payloadPL(type) {
let listPL = [] 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") { 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({ listPL.push({
"item_report_id": item[1], "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] "notes": item[8]
}) })
} else { } else {
listPL.push({ listPL.push({
"item_report_id": item[1], "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] "notes": item[8]
}) })
} }
}) })
console.log(listPL) console.log(listPL)
this.setState({dbPL: listPL} , () => { this.setState({ dbPL: listPL }, () => {
// if (type != undefined) { // if (type != undefined) {
// if ( type == 'PL') { // if ( type == 'PL') {
console.log('tarik sis') console.log('tarik sis')
this.createPL() this.createPL()
// } // }
// } // }
}) })
...@@ -1808,7 +1812,7 @@ export default class MonthlyReport extends Component { ...@@ -1808,7 +1812,7 @@ export default class MonthlyReport extends Component {
} }
api.create().createReportPLMR(payload).then((res) => { api.create().createReportPLMR(payload).then((res) => {
console.log(res) console.log(res)
this.setState({loading: false}) this.setState({ loading: false })
// if (response.data) { // if (response.data) {
// if (response.data.status === "success") { // if (response.data.status === "success") {
// this.props.saveToMonthlyReport() // this.props.saveToMonthlyReport()
...@@ -1836,7 +1840,7 @@ export default class MonthlyReport extends Component { ...@@ -1836,7 +1840,7 @@ export default class MonthlyReport extends Component {
api.create().getFRID(payloadID).then(response => { api.create().getFRID(payloadID).then(response => {
console.log(response); console.log(response);
if (response) { if (response) {
FRID = response.data.data == null ? null : response.data.data.ratio_id FRID = response.data.data == null ? null : response.data.data.ratio_id
} else { } else {
FRID = null FRID = null
} }
...@@ -1880,7 +1884,7 @@ export default class MonthlyReport extends Component { ...@@ -1880,7 +1884,7 @@ export default class MonthlyReport extends Component {
Number(item.ratio.monthly_november).toFixed(2), Number(item.ratio.monthly_november).toFixed(2),
Number(item.ratio.monthly_december).toFixed(2), Number(item.ratio.monthly_december).toFixed(2),
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
item.children.map((items, indexs) => { item.children.map((items, indexs) => {
...@@ -1925,18 +1929,18 @@ export default class MonthlyReport extends Component { ...@@ -1925,18 +1929,18 @@ export default class MonthlyReport extends Component {
}) })
console.log(dataTable) console.log(dataTable)
this.setState({ dbFR: dataTable, loading: false }, () => { this.setState({ dbFR: dataTable, loading: false }, () => {
this.olahDataFR(this.state.dbFR, type) this.olahDataFR(this.state.dbFR, type)
}) })
} else { } else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
} }
}) })
}) })
}) })
} }
handleFormulaRatio = (value, tableMeta, month) => { handleFormulaRatio = (value, tableMeta, month) => {
...@@ -1950,7 +1954,7 @@ export default class MonthlyReport extends Component { ...@@ -1950,7 +1954,7 @@ export default class MonthlyReport extends Component {
total += Number(dataTable2[35][7 + index]) total += Number(dataTable2[35][7 + index])
// console.log(index); // console.log(index);
} }
total = total/month total = total / month
} }
let hasil = Number(value) / total let hasil = Number(value) / total
// console.log(hasil, value, total); // console.log(hasil, value, total);
...@@ -1958,25 +1962,25 @@ export default class MonthlyReport extends Component { ...@@ -1958,25 +1962,25 @@ export default class MonthlyReport extends Component {
} }
olahDataFR(dbFR, type) { olahDataFR(dbFR, type) {
dbFR.map((item,index) => { dbFR.map((item, index) => {
if(item[0] != 4 || item[0] != 1) { if (item[0] != 4 || item[0] != 1) {
if (item[5] === "Return on Invested Capital - YTD (ROIC)" ) { if (item[5] === "Return on Invested Capital - YTD (ROIC)") {
item[7] = this.handleFormulaRatio(item[7],item,1) item[7] = this.handleFormulaRatio(item[7], item, 1)
item[8] = this.handleFormulaRatio(item[8],item,2) item[8] = this.handleFormulaRatio(item[8], item, 2)
item[9] = this.handleFormulaRatio(item[9],item,3) item[9] = this.handleFormulaRatio(item[9], item, 3)
item[10] = this.handleFormulaRatio(item[10],item,4) item[10] = this.handleFormulaRatio(item[10], item, 4)
item[11] = this.handleFormulaRatio(item[11],item,5) item[11] = this.handleFormulaRatio(item[11], item, 5)
item[12] = this.handleFormulaRatio(item[12],item,6) item[12] = this.handleFormulaRatio(item[12], item, 6)
item[13] = this.handleFormulaRatio(item[13],item,7) item[13] = this.handleFormulaRatio(item[13], item, 7)
item[14] = this.handleFormulaRatio(item[14],item,8) item[14] = this.handleFormulaRatio(item[14], item, 8)
item[15] = this.handleFormulaRatio(item[15],item,9) item[15] = this.handleFormulaRatio(item[15], item, 9)
item[16] = this.handleFormulaRatio(item[16],item,10) item[16] = this.handleFormulaRatio(item[16], item, 10)
item[17] = this.handleFormulaRatio(item[17],item,11) item[17] = this.handleFormulaRatio(item[17], item, 11)
item[18] = this.handleFormulaRatio(item[18],item,12) item[18] = this.handleFormulaRatio(item[18], item, 12)
} }
} }
}) })
this.setState({dbFR}, () => { this.setState({ dbFR }, () => {
this.payloadFR(type) this.payloadFR(type)
}) })
} }
...@@ -1984,7 +1988,7 @@ export default class MonthlyReport extends Component { ...@@ -1984,7 +1988,7 @@ export default class MonthlyReport extends Component {
payloadFR(type) { payloadFR(type) {
let listFR = [] let listFR = []
console.log(this.state.dbFR) 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[0] != 4 || item[0] != 1) {
// if (item[5] === "Return on Invested Capital - YTD (ROIC)" ) { // if (item[5] === "Return on Invested Capital - YTD (ROIC)" ) {
// item[7] = this.handleFormulaRatio(item[7],item,1) // item[7] = this.handleFormulaRatio(item[7],item,1)
...@@ -2001,34 +2005,34 @@ export default class MonthlyReport extends Component { ...@@ -2001,34 +2005,34 @@ export default class MonthlyReport extends Component {
// item[18] = this.handleFormulaRatio(item[18],item,12) // item[18] = this.handleFormulaRatio(item[18],item,12)
// } // }
} }
listFR.push( listFR.push(
{ {
"item_report_id": item[1], "item_report_id": item[1],
"actual": this.state.month.month_id == 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)) : String(item[7] == undefined || item[7] == 'Infinity' || item[7] == '-Infinity' ? "0.0" : Number(item[7]).toFixed(2)) :
this.state.month.month_id == 2? this.state.month.month_id == 2 ?
String(item[8] == undefined || item[8] == 'Infinity' || item[8] == '-Infinity'? "0.0" : Number(item[8]).toFixed(2)) : String(item[8] == undefined || item[8] == 'Infinity' || item[8] == '-Infinity' ? "0.0" : Number(item[8]).toFixed(2)) :
this.state.month.month_id == 3? this.state.month.month_id == 3 ?
String(item[9] == undefined || item[9] == 'Infinity' || item[9] == '-Infinity'? "0.0" : Number(item[9]).toFixed(2)) : String(item[9] == undefined || item[9] == 'Infinity' || item[9] == '-Infinity' ? "0.0" : Number(item[9]).toFixed(2)) :
this.state.month.month_id == 4? this.state.month.month_id == 4 ?
String(item[10] == undefined || item[10] == 'Infinity' || item[10] == '-Infinity'? "0.0" : Number(item[10]).toFixed(2)) : String(item[10] == undefined || item[10] == 'Infinity' || item[10] == '-Infinity' ? "0.0" : Number(item[10]).toFixed(2)) :
this.state.month.month_id == 5? this.state.month.month_id == 5 ?
String(item[11] == undefined || item[11] == 'Infinity' || item[11] == '-Infinity'? "0.0" : Number(item[11]).toFixed(2)) : String(item[11] == undefined || item[11] == 'Infinity' || item[11] == '-Infinity' ? "0.0" : Number(item[11]).toFixed(2)) :
this.state.month.month_id == 6? this.state.month.month_id == 6 ?
String(item[12] == undefined || item[12] == 'Infinity' || item[12] == '-Infinity'? "0.0" : Number(item[12]).toFixed(2)) : String(item[12] == undefined || item[12] == 'Infinity' || item[12] == '-Infinity' ? "0.0" : Number(item[12]).toFixed(2)) :
this.state.month.month_id == 7? this.state.month.month_id == 7 ?
String(item[13] == undefined || item[13] == 'Infinity' || item[13] == '-Infinity'? "0.0" : Number(item[13]).toFixed(2)) : String(item[13] == undefined || item[13] == 'Infinity' || item[13] == '-Infinity' ? "0.0" : Number(item[13]).toFixed(2)) :
this.state.month.month_id == 8? this.state.month.month_id == 8 ?
String(item[14] == undefined || item[14] == 'Infinity' || item[14] == '-Infinity'? "0.0" : Number(item[14]).toFixed(2)) : String(item[14] == undefined || item[14] == 'Infinity' || item[14] == '-Infinity' ? "0.0" : Number(item[14]).toFixed(2)) :
this.state.month.month_id == 9? this.state.month.month_id == 9 ?
String(item[15] == undefined || item[15] == 'Infinity' || item[15] == '-Infinity'? "0.0" : Number(item[15]).toFixed(2)) : String(item[15] == undefined || item[15] == 'Infinity' || item[15] == '-Infinity' ? "0.0" : Number(item[15]).toFixed(2)) :
this.state.month.month_id == 10? this.state.month.month_id == 10 ?
String(item[16] == undefined || item[16] == 'Infinity' || item[16] == '-Infinity'? "0.0" : Number(item[16]).toFixed(2)) : String(item[16] == undefined || item[16] == 'Infinity' || item[16] == '-Infinity' ? "0.0" : Number(item[16]).toFixed(2)) :
this.state.month.month_id == 11? 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[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)) 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)), // "january": String(item[7] == undefined? item[7] : Number(item[7]).toFixed(1)),
// "february": String(item[8] == undefined? item[8] : Number(item[8]).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)), // "march": String(item[9] == undefined? item[9] : Number(item[9]).toFixed(1)),
...@@ -2043,14 +2047,14 @@ export default class MonthlyReport extends Component { ...@@ -2043,14 +2047,14 @@ export default class MonthlyReport extends Component {
// "december": String(item[18] == undefined? item[18] : Number(item[18]).toFixed(1)), // "december": String(item[18] == undefined? item[18] : Number(item[18]).toFixed(1)),
// "total_next_year": String(item[19] != ''? Number(item[19]).toFixed(1) : item[19]), // "total_next_year": String(item[19] != ''? Number(item[19]).toFixed(1) : item[19]),
// "total_more_year": String(item[20] != ''? Number(item[20]).toFixed(1) : item[20]), // "total_more_year": String(item[20] != ''? Number(item[20]).toFixed(1) : item[20]),
} }
) )
}) })
console.log(listFR) console.log(listFR)
console.log('subOD',this.state.submissionID) console.log('subOD', this.state.submissionID)
this.setState({dbFR: listFR} , () => { this.setState({ dbFR: listFR }, () => {
if (this.state.monthlyReportId != null) { if (this.state.monthlyReportId != null) {
this.createDBFR() this.createDBFR()
} }
...@@ -2088,7 +2092,7 @@ export default class MonthlyReport extends Component { ...@@ -2088,7 +2092,7 @@ export default class MonthlyReport extends Component {
// } // }
}) })
} }
render() { render() {
const columns = ["#", "Report Type", const columns = ["#", "Report Type",
{ {
...@@ -2172,7 +2176,7 @@ export default class MonthlyReport extends Component { ...@@ -2172,7 +2176,7 @@ export default class MonthlyReport extends Component {
: null : null
// console.log(tableMeta.rowData) // console.log(tableMeta.rowData)
// } // }
} }
> >
<Typography style={{ color: tableMeta.rowData[5] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography> <Typography style={{ color: tableMeta.rowData[5] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography>
...@@ -2234,7 +2238,7 @@ export default class MonthlyReport extends Component { ...@@ -2234,7 +2238,7 @@ export default class MonthlyReport extends Component {
let handleDate = Number(moment(this.state.maxDateRevision).format('YYYYMMDD')) - Number(moment(this.state.minDateRevision).format('YYYYMMDD')) let handleDate = Number(moment(this.state.maxDateRevision).format('YYYYMMDD')) - Number(moment(this.state.minDateRevision).format('YYYYMMDD'))
return handleDate < 0 ? moment(this.state.minDateRevision).format('YYYY/MM/DD') : moment(this.state.maxDateRevision).format('YYYY/MM/DD') return handleDate < 0 ? moment(this.state.minDateRevision).format('YYYY/MM/DD') : moment(this.state.maxDateRevision).format('YYYY/MM/DD')
} }
const handleChangeText = (value, tableMeta) => { const handleChangeText = (value, tableMeta) => {
let dataTableRevision = this.state.dataTableRevision let dataTableRevision = this.state.dataTableRevision
dataTableRevision[tableMeta.rowIndex][tableMeta.columnIndex] = value dataTableRevision[tableMeta.rowIndex][tableMeta.columnIndex] = value
...@@ -2459,12 +2463,12 @@ export default class MonthlyReport extends Component { ...@@ -2459,12 +2463,12 @@ export default class MonthlyReport extends Component {
// if (this.state.isApprover === true) { // if (this.state.isApprover === true) {
// this.getCompanySubmitted() // this.getCompanySubmitted()
// } else { // } else {
this.setState({ visibleTableHistory: false }) this.setState({ visibleTableHistory: false })
if (this.state.listCompany == null) { if (this.state.listCompany == null) {
this.getCompanySubmitted() this.getCompanySubmitted()
} else { } else {
this.getRevision() this.getRevision()
} }
// } // }
})} })}
disableClearable disableClearable
...@@ -2479,12 +2483,12 @@ export default class MonthlyReport extends Component { ...@@ -2479,12 +2483,12 @@ export default class MonthlyReport extends Component {
// if (this.state.isApprover === true) { // if (this.state.isApprover === true) {
// this.getCompanySubmitted() // this.getCompanySubmitted()
// } else { // } else {
this.setState({ visibleTableHistory: false }) this.setState({ visibleTableHistory: false })
if (this.state.listCompany == null) { if (this.state.listCompany == null) {
this.getCompanySubmitted() this.getCompanySubmitted()
} else { } else {
this.getRevision() this.getRevision()
} }
// } // }
})} })}
disableClearable disableClearable
...@@ -2493,11 +2497,11 @@ export default class MonthlyReport extends Component { ...@@ -2493,11 +2497,11 @@ export default class MonthlyReport extends Component {
value={this.state.periode} value={this.state.periode}
/> />
</div> </div>
{/* } */} {/* } */}
</div> </div>
<div style={{ marginTop: 20 }}> <div style={{ marginTop: 20 }}>
<Autocomplete <Autocomplete
...@@ -2507,7 +2511,7 @@ export default class MonthlyReport extends Component { ...@@ -2507,7 +2511,7 @@ export default class MonthlyReport extends Component {
getOptionLabel={(option) => option.name} getOptionLabel={(option) => option.name}
style={{ width: 250 }} style={{ width: 250 }}
onChange={(event, newInputValue) => { onChange={(event, newInputValue) => {
this.setState({selectedStatus: newInputValue, loading: true}, () => { this.setState({ selectedStatus: newInputValue, loading: true }, () => {
console.log(newInputValue); console.log(newInputValue);
this.getCompanySubmitted() this.getCompanySubmitted()
}) })
...@@ -2729,7 +2733,7 @@ export default class MonthlyReport extends Component { ...@@ -2729,7 +2733,7 @@ export default class MonthlyReport extends Component {
</div> </div>
</div> </div>
: :
this.state.checkApprover? this.state.checkApprover ?
this.state.lastStatus === 'WAITING FOR REVIEW' ? this.state.lastStatus === 'WAITING FOR REVIEW' ?
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} > <div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<button <button
...@@ -2781,7 +2785,7 @@ export default class MonthlyReport extends Component { ...@@ -2781,7 +2785,7 @@ export default class MonthlyReport extends Component {
</div> </div>
</div> : null </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' }} > <div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<button <button
style={{ style={{
...@@ -2872,7 +2876,7 @@ export default class MonthlyReport extends Component { ...@@ -2872,7 +2876,7 @@ export default class MonthlyReport extends Component {
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
createCF={this.createCashFlow.bind(this)} createCF={this.createCashFlow.bind(this)}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
/> />
)} )}
{this.state.visiblePL && ( {this.state.visiblePL && (
...@@ -2893,7 +2897,7 @@ export default class MonthlyReport extends Component { ...@@ -2893,7 +2897,7 @@ export default class MonthlyReport extends Component {
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
createCF={this.createCashFlow.bind(this)} createCF={this.createCashFlow.bind(this)}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
/> />
)} )}
...@@ -2915,7 +2919,7 @@ export default class MonthlyReport extends Component { ...@@ -2915,7 +2919,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
...@@ -3014,7 +3018,7 @@ export default class MonthlyReport extends Component { ...@@ -3014,7 +3018,7 @@ export default class MonthlyReport extends Component {
/> />
)} )}
{ {
this.state.visibleRevision && ( this.state.visibleRevision && (
<div className="test app-popup-show"> <div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}> <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