Commit de017dec authored by r.kurnia's avatar r.kurnia

dikit

parent e155096d
...@@ -635,9 +635,10 @@ export default class MonthlyReport extends Component { ...@@ -635,9 +635,10 @@ export default class MonthlyReport extends Component {
company={this.state.company} company={this.state.company}
revision={this.state.revisionTable} revision={this.state.revisionTable}
periode={this.state.periode.periode} periode={this.state.periode.periode}
submissionID={this.state.submissionID} // submissionID={this.state.submissionID}
monthlyReportId={this.state.monthlyReportId}
month={this.state.month}
// saveToMasterBudget={this.saveToMasterBudget.bind(this)} // saveToMasterBudget={this.saveToMasterBudget.bind(this)}
// onClickClose={() => this.setState({ visibleTP: false, visibleBudgetTahunan: true })}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
onClickClose={() => this.setState({ visibleTP: false, visibleMonthlyReport: true })} onClickClose={() => this.setState({ visibleTP: false, visibleMonthlyReport: true })}
/> />
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormControlLabel, TextField, Input, Tooltip, withStyles, Snackbar } from '@material-ui/core'; import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormControlLabel, Tooltip, withStyles, Snackbar } from '@material-ui/core';
import MUIDataTable from 'mui-datatables'; import MUIDataTable from 'mui-datatables';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
import api from '../../api'; import api from '../../api';
import AddIcon from '@material-ui/icons/Add';
import { values } from 'ramda';
import PropagateLoader from "react-spinners/PropagateLoader" import PropagateLoader from "react-spinners/PropagateLoader"
import Images from '../../assets/Images'; import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip'; import ReactTooltip from 'react-tooltip';
...@@ -45,6 +43,7 @@ export default class TaxPlanningMR extends Component { ...@@ -45,6 +43,7 @@ export default class TaxPlanningMR extends Component {
super(props) super(props)
this.state = { this.state = {
dataTable: [], dataTable: [],
loading: true,
visibleTP: true, visibleTP: true,
disabledSave: true, disabledSave: true,
editable: false, editable: false,
...@@ -62,7 +61,7 @@ export default class TaxPlanningMR extends Component { ...@@ -62,7 +61,7 @@ export default class TaxPlanningMR extends Component {
componentDidMount() { componentDidMount() {
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate() // this.getLatestUpdate()
} }
getLatestUpdate() { getLatestUpdate() {
...@@ -1219,20 +1218,16 @@ export default class TaxPlanningMR extends Component { ...@@ -1219,20 +1218,16 @@ export default class TaxPlanningMR extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ width: 300 }}> <div style={{ width: 300 }}>
{tableMeta.rowData[30] ? {tableMeta.rowData[0] === null ?
tableMeta.rowData[30].length > 0 ? tableMeta.rowData[7] == 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}> <LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(val).toUpperCase()}</span>
</LightTooltip> :
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[7]) }}>
<LightTooltip title={"Report Items Not Registered"} arrow> <LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</LightTooltip> </LightTooltip>
</div> </div>
:
tableMeta.rowData[7] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[7]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
: :
tableMeta.rowData[7] == 0 ? tableMeta.rowData[7] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span> <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
...@@ -1898,8 +1893,8 @@ export default class TaxPlanningMR extends Component { ...@@ -1898,8 +1893,8 @@ export default class TaxPlanningMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.state.dataTable.length == 0 ? null : this.props.isApprover == true ? {/* {this.state.dataTable.length == 0 ? null : this.props.isApprover == true ? */}
<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={{
...@@ -1908,20 +1903,22 @@ export default class TaxPlanningMR extends Component { ...@@ -1908,20 +1903,22 @@ export default class TaxPlanningMR extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => onClick={() => null
this.setState({ loading: true }, () => { // this.setState({ loading: true }, () => {
setTimeout(() => { // setTimeout(() => {
this.downloadAllData() // this.downloadAllData()
}, 100); // }, 100);
})} // })
}
> >
<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' }}>
{((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')) && ( {/* {((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> <div>
<a data-tip={'Download Template'} data-for="template"> <a data-tip={'Download Template'} data-for="template">
<button <button
...@@ -1931,15 +1928,17 @@ export default class TaxPlanningMR extends Component { ...@@ -1931,15 +1928,17 @@ export default class TaxPlanningMR extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => this.downloadTemplate()} onClick={() => null
// 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" />
</div> </div>
)} {/* )} */}
{((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')) && ( {/* {((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> <div>
<a data-tip={'Upload'} data-for="upload"> <a data-tip={'Upload'} data-for="upload">
<button <button
...@@ -1949,14 +1948,16 @@ export default class TaxPlanningMR extends Component { ...@@ -1949,14 +1948,16 @@ export default class TaxPlanningMR extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => this.setState({ visibleUpload: true })} onClick={() => null
// this.setState({ visibleUpload: true })
}
> >
<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" />
</div> </div>
)} {/* )} */}
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
style={{ style={{
...@@ -1965,31 +1966,33 @@ export default class TaxPlanningMR extends Component { ...@@ -1965,31 +1966,33 @@ export default class TaxPlanningMR extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => onClick={() => null
this.setState({ loading: true }, () => { // this.setState({ loading: true }, () => {
setTimeout(() => { // setTimeout(() => {
this.downloadAllData() // this.downloadAllData()
}, 100); // }, 100);
})} // })
}
> >
<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> </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 && loadingComponent} {this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
</MuiThemeProvider> </MuiThemeProvider>
{/* )} */}
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
</div> </div>
...@@ -2010,7 +2013,7 @@ export default class TaxPlanningMR extends Component { ...@@ -2010,7 +2013,7 @@ export default class TaxPlanningMR extends Component {
}} }}
> >
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
...@@ -2027,15 +2030,17 @@ export default class TaxPlanningMR extends Component { ...@@ -2027,15 +2030,17 @@ export default class TaxPlanningMR extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => { onClick={() => null
// this.forceUpdate() // {
this.setState({ loading: true, buttonDraft: false }, () => { // // this.forceUpdate()
setTimeout(() => { // this.setState({ loading: true, buttonDraft: false }, () => {
// this.setState({ loading: false, buttonError: false, editable: true }) // setTimeout(() => {
this.handleValidate() // // this.setState({ loading: false, buttonError: false, editable: true })
}, 100); // this.handleValidate()
}) // }, 100);
}} // })
// }
}
> >
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <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> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
...@@ -2044,15 +2049,15 @@ export default class TaxPlanningMR extends Component { ...@@ -2044,15 +2049,15 @@ export default class TaxPlanningMR extends Component {
<button <button
className="button" className="button"
type="button" type="button"
onClick={() => onClick={() => null
this.state.saveDraft === true ? // this.state.saveDraft === true ?
null : // null :
this.state.handleTekTekTek == 1 ? null : // this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => { // this.setState({ handleTekTekTek: 1, loading: true }, () => {
setTimeout(() => { // setTimeout(() => {
this.backToMasterBudget('draft') // this.backToMasterBudget('draft')
}, 100); // }, 100);
}) // })
} }
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -2069,15 +2074,17 @@ export default class TaxPlanningMR extends Component { ...@@ -2069,15 +2074,17 @@ export default class TaxPlanningMR extends Component {
<button <button
type="button" type="button"
disabled={this.state.buttonError} disabled={this.state.buttonError}
onClick={() => this.state.buttonError ? onClick={() => null
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' }) // this.state.buttonError ?
: // this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
this.state.handleTekTekTek == 1 ? null : // :
this.setState({ handleTekTekTek: 1, loading: true }, () => { // this.state.handleTekTekTek == 1 ? null :
setTimeout(() => { // this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.backToMasterBudget('submitted') // setTimeout(() => {
}, 100); // this.backToMasterBudget('submitted')
})} // }, 100);
// })
}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer', cursor: this.state.buttonError === true ? 'default' : 'pointer',
......
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