Commit 5b4dc246 authored by Riri Novita's avatar Riri Novita

Merge branch 'dev/riri' into 'ENV-DEV'

Fixing Issue RO

See merge request !2125
parents aa7174e7 322d60a5
...@@ -396,6 +396,7 @@ export default class BalanceSheetRO extends Component { ...@@ -396,6 +396,7 @@ export default class BalanceSheetRO extends Component {
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"balance_sheet": data "balance_sheet": data
} }
console.log(payload);
api.create('UPLOAD').createRollingOutlookBS(payload).then(response => { api.create('UPLOAD').createRollingOutlookBS(payload).then(response => {
console.log(payload); console.log(payload);
console.log(response); console.log(response);
...@@ -443,7 +444,7 @@ export default class BalanceSheetRO extends Component { ...@@ -443,7 +444,7 @@ export default class BalanceSheetRO extends Component {
// this.props.onClickClose() // this.props.onClickClose()
// this.props.refresh() // this.props.refresh()
// }) // })
// } // }
} else { } else {
this.setState({ loading: false, handleDoubleClick: 0 }) this.setState({ loading: false, handleDoubleClick: 0 })
} }
...@@ -459,9 +460,16 @@ export default class BalanceSheetRO extends Component { ...@@ -459,9 +460,16 @@ export default class BalanceSheetRO extends Component {
this.setState({ loading: true }) this.setState({ loading: true })
let n = 0 let n = 0
for (n = (this.props.quarter == 'q1' ? 10 : (this.props.quarter == 'q2' ? 13 : 16)); n <= 18; n++) { for (n = (this.props.quarter == 'q1' ? 10 : (this.props.quarter == 'q2' ? 13 : 16)); n <= 18; n++) {
if ((this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[n]), 2) : Number(i[n]) < Number(this.state.minValue) || this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[n]), 1) : Number(i[n]) > Number(this.state.maxValue))) { if (this.props.defaultCurrency.id == 1) {
err = true if ((fixNumber(Number(i[n]), 2) < Number(this.state.minValue) || fixNumber(Number(i[n]), 1) > Number(this.state.maxValue))) {
err = true
}
} else {
if ((Number(i[n]) < Number(this.state.minValue) || Number(i[n]) > Number(this.state.maxValue))) {
err = true
}
} }
} }
} }
}) })
...@@ -553,7 +561,7 @@ export default class BalanceSheetRO extends Component { ...@@ -553,7 +561,7 @@ export default class BalanceSheetRO extends Component {
this.setState({ visibleUpload: false, visibleBSRO: false, loading: true }) this.setState({ visibleUpload: false, visibleBSRO: false, loading: true })
let err = false let err = false
let dataTable = response.data.data.map((item, index) => { let dataTable = response.data.data.map((item, index) => {
// if (item.type_report_id === 3) { // if (item.type_report_id === 3) {
// if (item.mtd_vs_mb == "" && Number(item.percent_act_vs_mb) < this.state.minValue || Number(item.percent_act_vs_mb) > this.state.maxValue) { // if (item.mtd_vs_mb == "" && Number(item.percent_act_vs_mb) < this.state.minValue || Number(item.percent_act_vs_mb) > this.state.maxValue) {
// err = true // err = true
// } // }
...@@ -1479,7 +1487,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1479,7 +1487,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1496,7 +1504,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1496,7 +1504,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1648,7 +1656,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1648,7 +1656,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1665,7 +1673,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1665,7 +1673,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1817,7 +1825,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1817,7 +1825,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1834,7 +1842,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1834,7 +1842,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1986,7 +1994,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1986,7 +1994,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2003,7 +2011,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2003,7 +2011,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2155,7 +2163,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2155,7 +2163,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2172,7 +2180,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2172,7 +2180,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2323,7 +2331,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2323,7 +2331,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2340,7 +2348,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2340,7 +2348,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2491,7 +2499,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2491,7 +2499,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2508,7 +2516,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2508,7 +2516,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2659,7 +2667,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2659,7 +2667,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2676,7 +2684,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2676,7 +2684,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2722,7 +2730,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2722,7 +2730,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : fixNumber(Number(val),1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/> />
: :
tableMeta.rowData[0] === 2 ? tableMeta.rowData[0] === 2 ?
...@@ -2771,7 +2779,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2771,7 +2779,7 @@ export default class BalanceSheetRO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)), 1)) : (Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)) == 0 ? "0.0" : Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)))} value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)), 1)) : (Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)) == 0 ? "0.0" : Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)))}
// value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)}
/> />
} }
/> />
...@@ -2827,7 +2835,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2827,7 +2835,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2844,7 +2852,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2844,7 +2852,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2932,82 +2940,82 @@ export default class BalanceSheetRO extends Component { ...@@ -2932,82 +2940,82 @@ export default class BalanceSheetRO extends Component {
</Snackbar> </Snackbar>
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
{this.state.visibleBSRO ? <Paper style={{ paddingTop: 10, paddingBottom: 20 }}> {this.state.visibleBSRO ? <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} > <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Rolling Outlook - Balance Sheet</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Rolling Outlook - Balance Sheet</Typography>
</div> </div>
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} {String(this.props.quarter).toLocaleUpperCase()} (rev.{this.props.revision})</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} {String(this.props.quarter).toLocaleUpperCase()} (rev.{this.props.revision})</Typography>
{this.props.defaultCurrency.id === 1 ? {this.props.defaultCurrency.id === 1 ?
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
: :
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in USD thousand</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in USD thousand</Typography>
} }
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.props.isApprover === true || this.state.get_for == 'view' ? {this.props.isApprover === true || this.state.get_for == 'view' ?
null null
// <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> // <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
// <a data-tip={'Download'} data-for="download"> // <a data-tip={'Download'} data-for="download">
// <button // <button
// style={{ // style={{
// backgroundColor: 'transparent', // backgroundColor: 'transparent',
// cursor: 'pointer', // cursor: 'pointer',
// borderColor: 'transparent', // borderColor: 'transparent',
// margin: 5 // margin: 5
// }} // }}
// onClick={() => // onClick={() =>
// this.setState({ loading: true }, () => { // this.setState({ loading: true }, () => {
// this.downloadAllData() // this.downloadAllData()
// })} // })}
// > // >
// <img src={Images.download} /> // <img src={Images.download} />
// </button> // </button>
// </a> // </a>
// <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> // <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
// </div> // </div>
: :
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template"> <a data-tip={'Download Template'} data-for="template">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => this.setState({ loading: true }, () => { onClick={() => this.setState({ loading: true }, () => {
this.downloadTemplate() this.downloadTemplate()
})} })}
> >
<img src={Images.template} /> <img src={Images.template} />
</button> </button>
</a> </a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
<a data-tip={'Upload'} data-for="upload"> <a data-tip={'Upload'} data-for="upload">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => this.setState({ loading: true }, () => { onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ this.setState({
loading: false, loading: false,
visibleUpload: true visibleUpload: true
}) })
}, 300); }, 300);
})} })}
> >
<img src={Images.upload} /> <img src={Images.upload} />
</button> </button>
</a> </a>
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
{/* <a data-tip={'Download'} data-for="download"> {/* <a data-tip={'Download'} data-for="download">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -3026,65 +3034,65 @@ export default class BalanceSheetRO extends Component { ...@@ -3026,65 +3034,65 @@ export default class BalanceSheetRO extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> */} <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> */}
</div> </div>
} }
</div>
</div> </div>
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{!this.state.loading && ( {!this.state.loading && (
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
</MuiThemeProvider> </MuiThemeProvider>
)} )}
</div> </div>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : </Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : </Typography>
<div style={{ marginLeft: 10, overflowY: 'scroll', height: this.state.updateBy.length < 2 ? 25 : 75, marginTop: 10 }}> <div style={{ marginLeft: 10, overflowY: 'scroll', height: this.state.updateBy.length < 2 ? 25 : 75, marginTop: 10 }}>
{ {
this.state.updateBy.length > 0 ? this.state.updateBy.reverse().map((item, index) => { this.state.updateBy.length > 0 ? this.state.updateBy.reverse().map((item, index) => {
return ( return (
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography>
) )
}) : }) :
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>-</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>-</Typography>
} }
</div>
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Notes : {this.state.notes}</Typography> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Notes : {this.state.notes}</Typography>
</div>
<div className="grid grid-2x" style={{ padding: 20 }}>
<div className="col-1" style={{ paddingLeft: 0 }}>
<button
type="button"
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div>
</button>
</div> </div>
<div className="grid grid-2x" style={{ padding: 20 }}> {this.props.isApprover === true ?
<div className="col-1" style={{ paddingLeft: 0 }}> <div className="col-2">
<button </div> :
type="button" <div className="" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
onClick={() => this.setState({ loading: true }, () => { {this.state.get_for == 'view' && this.state.viewOnly &&
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div>
</button>
</div>
{this.props.isApprover === true ?
<div className="col-2">
</div> :
<div className="" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
{this.state.get_for == 'view' && this.state.viewOnly &&
<button <button
className="button" className="button"
type="button" type="button"
...@@ -3105,79 +3113,79 @@ export default class BalanceSheetRO extends Component { ...@@ -3105,79 +3113,79 @@ export default class BalanceSheetRO extends Component {
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Edit</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Edit</Typography>
</div> </div>
</button> </button>
}
{this.state.get_for == 'edit' && <button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({ loading: true, dataTable: dataTable2 }, () => {
setTimeout(() => {
this.handleValidate()
}, 100);
})
}}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div>
</button>}
{this.state.get_for === 'edit' && <button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() =>
this.state.saveDraft ?
this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' })
:
this.state.handleDoubleClick == 1 ? null :
this.setState({ handleDoubleClick: 1, loading: true }, () => {
this.backToRollingOutlook('draft')
})
} }
{this.state.get_for == 'edit' && <button >
className="button" <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
type="button" <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
style={{ </div>
backgroundColor: 'transparent', </button>}
cursor: 'pointer', {this.state.get_for === 'edit' && <button
borderColor: 'transparent', type="button"
outline: 'none', // disabled={this.state.buttonError}
marginRight: 20 onClick={() =>
}} this.state.buttonError ?
onClick={() => { this.setState({ alert: true, messageAlert: 'Data incomplete !', tipeAlert: 'error' })
this.setState({ loading: true, dataTable: dataTable2 }, () => { :
setTimeout(() => { this.state.handleDoubleClick == 1 ? null :
this.handleValidate() this.setState({ handleDoubleClick: 1 }, () => {
}, 100); this.backToRollingOutlook('submitted')
}) })}
}} style={{
> backgroundColor: 'transparent',
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> cursor: 'pointer',
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography> borderColor: 'transparent',
</div> outline: 'none',
</button>} }}
{this.state.get_for === 'edit' && <button >
className="button" <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
type="button" <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
style={{ </div>
backgroundColor: 'transparent', </button>}
cursor: 'pointer', </div>
borderColor: 'transparent', }
outline: 'none', </div>
marginRight: 20 </Paper> :
}}
onClick={() =>
this.state.saveDraft ?
this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' })
:
this.state.handleDoubleClick == 1 ? null :
this.setState({ handleDoubleClick: 1, loading: true }, () => {
this.backToRollingOutlook('draft')
})
}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div>
</button>}
{this.state.get_for === 'edit' && <button
type="button"
// disabled={this.state.buttonError}
onClick={() =>
this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data incomplete !', tipeAlert: 'error' })
:
this.state.handleDoubleClick == 1 ? null :
this.setState({ handleDoubleClick: 1 }, () => {
this.backToRollingOutlook('submitted')
})}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>}
</div>
}
</div>
</Paper> :
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}> <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} > <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Rolling Outlook - Balance Sheet</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Rolling Outlook - Balance Sheet</Typography>
......
...@@ -760,7 +760,6 @@ export default class TaxPlanning extends Component { ...@@ -760,7 +760,6 @@ export default class TaxPlanning extends Component {
// let data = [] // let data = []
let errorContrl = this.state.buttonError let errorContrl = this.state.buttonError
let editAble = this.state.editAble let editAble = this.state.editAble
// console.log(this.state.dataTable)
this.state.dataTable.map((i, index) => { this.state.dataTable.map((i, index) => {
if (String(i[8]) == "Control (should be nil)") { if (String(i[8]) == "Control (should be nil)") {
this.setState({ loading: true }) this.setState({ loading: true })
...@@ -7190,9 +7189,13 @@ export default class TaxPlanning extends Component { ...@@ -7190,9 +7189,13 @@ export default class TaxPlanning extends Component {
marginRight: 20 marginRight: 20
}} }}
onClick={() => { onClick={() => {
this.setState({ loading: true, dataTable: dataTable2 }, () => { this.setState({ datatable: dataTable2 }, () => {
setTimeout(() => { setTimeout(() => {
this.handleValidate() this.setState({ loading: true }, () => {
setTimeout(() => {
this.handleValidate()
}, 100);
})
}, 100); }, 100);
}) })
}} }}
...@@ -7308,9 +7311,13 @@ export default class TaxPlanning extends Component { ...@@ -7308,9 +7311,13 @@ export default class TaxPlanning extends Component {
}} }}
onClick={() => { onClick={() => {
// this.forceUpdate() // this.forceUpdate()
this.setState({ loading: true, buttonDraft: false }, () => { this.setState({ datatable: dataTable2 }, () => {
setTimeout(() => { setTimeout(() => {
this.handleValidate() this.setState({ loading: true }, () => {
setTimeout(() => {
this.handleValidate()
}, 100);
})
}, 100); }, 100);
}) })
}} }}
......
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