Commit b1233ae3 authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

apdet

See merge request !967
parents bd259167 5c827416
......@@ -2,6 +2,7 @@ import React, { Component } from 'react'
import { Typography, MenuItem, TextField, AppBar, Paper, Tabs, Tab } from '@material-ui/core'
import ExceutiveScoreboard from './ExceutiveScoreboard'
import StrategiMap from './StrategiMap'
import KPIs from './KPIs'
export default class DashboardCAT extends Component {
constructor(props) {
......@@ -85,7 +86,7 @@ export default class DashboardCAT extends Component {
this.state.tab === 1 ?
<StrategiMap height={this.props.height} />
:
<span>Test2</span>
<KPIs height={this.props.height} />
}
</Paper>
</div>
......
import React, { Component } from 'react'
import { Paper, Typography } from '@material-ui/core'
import Images from '../../assets/Images'
export default class StrategiMap extends Component {
render() {
return (
<div style={{ padding: 20 }}>
<Paper style={{ borderRadius: 10, boxShadow: '0 0 4px 0 rgba(0, 0, 0, 0.5)' }}>
<div style={{ height: 56, borderTopLeftRadius: 10, borderTopRightRadius: 10, backgroundColor: '#f1f1f1', display: 'flex' }}>
<div style={{ width: '100%', borderBottom: 'solid 3px #979696 ', display: 'grid', alignContent: 'center', marginLeft: 20 }}>
<Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 12 }}>Category</Typography>
</div>
<div style={{ width: '75%', borderBottom: 'solid 3px #979696 ', display: 'grid', alignContent: 'center', paddingLeft: 20 }}>
<Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 12 }}>KPI</Typography>
</div>
<div style={{ width: '100%', borderBottom: 'solid 3px #979696 ', display: 'grid', alignContent: 'center', paddingLeft: 20 }}>
<Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 12 }}>Trends</Typography>
</div>
<div style={{ width: '75%', borderBottom: 'solid 3px #979696 ', display: 'grid', alignContent: 'center', paddingLeft: 20 }}>
<Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 12 }}>Current</Typography>
</div>
<div style={{ width: '75%', borderBottom: 'solid 3px #979696 ', marginRight: 20, display: 'grid', alignContent: 'center', paddingLeft: 20 }}>
<Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 12 }}>Achievement</Typography>
</div>
</div>
</Paper>
</div>
)
}
}
......@@ -92,7 +92,7 @@ export default class ProfitLossMR extends Component {
handleTekTekTek: 0,
saveDraft: true,
buttonError: true,
viewOnly : true,
viewOnly: true,
get_for: 'view'
}
......@@ -132,11 +132,11 @@ export default class ProfitLossMR extends Component {
checkStatus = false
}
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus})
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus })
}
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.setState({ get_for: type }, () => {
this.getLatestUpdate()
this.getSettingControl()
})
......@@ -273,7 +273,7 @@ export default class ProfitLossMR extends Component {
}
}
res.map((item, index) => {
if (item.type_report_id === 3 ) {
if (item.type_report_id === 3) {
if (item.profit_loss.mtd_vs_mb == "" && Number(item.profit_loss.percent_act_vs_mb) < this.state.minValue || Number(item.profit_loss.percent_act_vs_mb) > this.state.maxValue) {
err = true
}
......@@ -498,9 +498,9 @@ export default class ProfitLossMR extends Component {
item.percent_act_vs_mb,
item.amount_act_vs_rb,
item.percent_act_vs_rb,
item.mtd_vs_mb ,
item.mtd_vs_rb ,
item.mtd_vs_previous_month ,
item.mtd_vs_mb,
item.mtd_vs_rb,
item.mtd_vs_previous_month,
item.orders,
item.ytd_actual === null ? "" : item.ytd_actual === "" ? "" : item.ytd_actual,
item.error
......@@ -586,9 +586,9 @@ export default class ProfitLossMR extends Component {
let data = []
let err = false
this.state.dataTable.map((i, index) => {
if(i[0] === 3 ) {
if (i[0] === 3) {
// console.log(i);
if ( i[19] === "" && (Number(i[16]) < this.state.minValue || Number(i[16]) > this.state.maxValue)) {
if (i[19] === "" && (Number(i[16]) < this.state.minValue || Number(i[16]) > this.state.maxValue)) {
console.log('msk 1');
// console.log(i);
err = true
......@@ -694,7 +694,7 @@ export default class ProfitLossMR extends Component {
let total = 0
dataTable2.map((item, index) => {
if (data.rowData[1] == item[2]) {
total = item[data.columnIndex + type] == undefined ? (Number(total) + 0) : (Number(total) + Number(String(item[data.columnIndex + type]).includes('-')? Number(String(item[data.columnIndex + type]).substr(1, String(item[data.columnIndex + type]).length)) * -1 : Number(item[data.columnIndex + type])))
total = item[data.columnIndex + type] == undefined ? (Number(total) + 0) : (Number(total) + Number(String(item[data.columnIndex + type]).includes('-') ? Number(String(item[data.columnIndex + type]).substr(1, String(item[data.columnIndex + type]).length)) * -1 : Number(item[data.columnIndex + type])))
}
})
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[data.rowIndex][2])
......@@ -795,7 +795,7 @@ export default class ProfitLossMR extends Component {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
} else if (dex === 2) {
// total = Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])
total = R.equals(Number((Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100), NaN) ? '0' : R.equals(Number((Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8]))* 100), Infinity) ? '0' : Number((Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100 == "-Infinity" ? '0' : (Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100)
total = R.equals(Number((Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100), NaN) ? '0' : R.equals(Number((Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100), Infinity) ? '0' : Number((Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100 == "-Infinity" ? '0' : (Number(dataTable2[tableMeta.rowIndex][15]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
} else if (dex === 3) {
// total = Number(dataTable2[tableMeta.rowIndex][17]) / Number(dataTable2[tableMeta.rowIndex][9])
......@@ -928,7 +928,7 @@ export default class ProfitLossMR extends Component {
control={
<Input
disableUnderline={true}
style={{fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// value={tableMeta.rowData[6]}
......@@ -963,7 +963,7 @@ export default class ProfitLossMR extends Component {
customBodyRender: (val, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
this.state.get_for == 'view' ?
......@@ -1063,7 +1063,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1) }
value={Number(tableMeta.rowData[8]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1130,7 +1130,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1) }
value={Number(tableMeta.rowData[9]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1197,7 +1197,7 @@ export default class ProfitLossMR extends Component {
placeholder=""
disabled={true}
decimalScale={1}
value={Number(tableMeta.rowData[10]).toFixed(1) }
value={Number(tableMeta.rowData[10]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1209,10 +1209,10 @@ export default class ProfitLossMR extends Component {
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.isApprover || this.state.get_for == 'view'? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: this.props.isApprover || this.state.get_for == 'view' ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
value={Number(tableMeta.rowData[10]).toFixed(1)}
decimalScale={1}
fixedDecimalScale={1}
......@@ -1312,7 +1312,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[23]).toFixed(1) }
value={Number(tableMeta.rowData[23]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1390,7 +1390,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[12]).toFixed(1) }
value={Number(tableMeta.rowData[12]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1523,7 +1523,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[13]).toFixed(1) }
value={Number(tableMeta.rowData[13]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1560,7 +1560,7 @@ export default class ProfitLossMR extends Component {
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[14]).toFixed(1) }
value={Number(tableMeta.rowData[14]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1602,7 +1602,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[15]).toFixed(1) }
value={Number(tableMeta.rowData[15]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1639,7 +1639,7 @@ export default class ProfitLossMR extends Component {
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[16]).toFixed(1) }
value={Number(tableMeta.rowData[16]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1680,7 +1680,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[17]).toFixed(1) }
value={Number(tableMeta.rowData[17]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1717,7 +1717,7 @@ export default class ProfitLossMR extends Component {
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[18]).toFixed(1) }
value={Number(tableMeta.rowData[18]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1845,11 +1845,11 @@ export default class ProfitLossMR extends Component {
<LightTooltipError title={"MTD Explanation vs MB is Reqiured"} arrow>
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', minHeight: 30 , padding: 0 }}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', minHeight: 30, padding: 0 }}
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
// value={tableMeta.rowData[19]}
defaultValue={tableMeta.rowData[19]}
inputProps={{
......@@ -1873,7 +1873,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
defaultValue={tableMeta.rowData[19]}
inputProps={{
style: {
......@@ -1904,7 +1904,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
defaultValue={tableMeta.rowData[20]}
inputProps={{
style: {
......@@ -1927,7 +1927,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
defaultValue={tableMeta.rowData[20]}
inputProps={{
style: {
......@@ -1958,7 +1958,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
defaultValue={tableMeta.rowData[21]}
inputProps={{
style: {
......@@ -1981,7 +1981,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
defaultValue={tableMeta.rowData[21]}
inputProps={{
style: {
......@@ -2069,7 +2069,7 @@ export default class ProfitLossMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
{this.props.isApprover === true || this.state.get_for == 'view'?
{this.props.isApprover === true || this.state.get_for == 'view' ?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download">
<button
......@@ -2162,7 +2162,7 @@ export default class ProfitLossMR extends Component {
{/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */}
<div className="grid grid-2x" style={{ padding: 20 }}>
<div className="col-1" style={{ paddingLeft: 0}}>
<div className="col-1" style={{ paddingLeft: 0 }}>
<button
type="button"
onClick={() => this.setState({ loading: true }, () => {
......@@ -2197,7 +2197,7 @@ export default class ProfitLossMR extends Component {
marginRight: 20
}}
onClick={() => {
this.setState({loading: true, refresh: true}, () => {
this.setState({ loading: true, refresh: true }, () => {
this.handleGetFor('edit')
})
}}
......@@ -2303,7 +2303,7 @@ export default class ProfitLossMR extends Component {
)}
</div>
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1" style={{ paddingLeft: 0}}>
<div className="col-1" style={{ paddingLeft: 0 }}>
<button
type="button"
onClick={() => this.setState({ loading: true, visiblePLMR: true }, () => {
......
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