Commit 94ee6781 authored by r.kurnia's avatar r.kurnia

usapprover tp

parent cd9c7f4c
...@@ -1159,6 +1159,7 @@ export default class MonthlyReport extends Component { ...@@ -1159,6 +1159,7 @@ export default class MonthlyReport extends Component {
onClickClose={() => this.setState({ visibleTP: false, visibleMonthlyReport: true })} onClickClose={() => this.setState({ visibleTP: false, visibleMonthlyReport: true })}
btnCreate={this.state.btnCreate} btnCreate={this.state.btnCreate}
loadview={this.state.loadview} loadview={this.state.loadview}
isApprover={this.state.isApprover}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
/> />
)} )}
......
...@@ -62,6 +62,7 @@ export default class TaxPlanningMR extends Component { ...@@ -62,6 +62,7 @@ export default class TaxPlanningMR extends Component {
this.getSettingControl() this.getSettingControl()
// this.getItemHierarki() // this.getItemHierarki()
this.getLatestUpdate() this.getLatestUpdate()
console.log(this.props.isApprover)
} }
getSettingControl() { getSettingControl() {
...@@ -245,8 +246,8 @@ export default class TaxPlanningMR extends Component { ...@@ -245,8 +246,8 @@ export default class TaxPlanningMR extends Component {
} }
api.create('UPLOAD').createMonthlyReportTP(payload).then(response => { api.create('UPLOAD').createMonthlyReportTP(payload).then(response => {
// console.log(payload); console.log(payload);
// console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
...@@ -903,10 +904,10 @@ export default class TaxPlanningMR extends Component { ...@@ -903,10 +904,10 @@ export default class TaxPlanningMR extends Component {
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
decimalSeparator={"."} decimalSeparator={"."}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.isApprover ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="input" placeholder="input"
disabled={true} disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)} value={Number(value.tbc).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
...@@ -1428,8 +1429,8 @@ export default class TaxPlanningMR extends Component { ...@@ -1428,8 +1429,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.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={{
...@@ -1438,24 +1439,19 @@ export default class TaxPlanningMR extends Component { ...@@ -1438,24 +1439,19 @@ export default class TaxPlanningMR extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => null onClick={() =>
// 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.btncreate === true &&
<div>
<a data-tip={'Download Template'} data-for="template"> <a data-tip={'Download Template'} data-for="template">
<button <button
style={{ style={{
...@@ -1470,12 +1466,6 @@ export default class TaxPlanningMR extends Component { ...@@ -1470,12 +1466,6 @@ export default class TaxPlanningMR extends Component {
</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>
}
{/* )} */}
{/* {((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.btncreate === true &&
<div>
<a data-tip={'Upload'} data-for="upload"> <a data-tip={'Upload'} data-for="upload">
<button <button
style={{ style={{
...@@ -1484,19 +1474,12 @@ export default class TaxPlanningMR extends Component { ...@@ -1484,19 +1474,12 @@ export default class TaxPlanningMR extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => onClick={() => this.setState({ visibleUpload: true })}
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>
}
{/* )} */}
{(this.props.loadview === true || this.props.btncreate === true) && (
<div>
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
style={{ style={{
...@@ -1510,17 +1493,14 @@ export default class TaxPlanningMR extends Component { ...@@ -1510,17 +1493,14 @@ export default class TaxPlanningMR extends Component {
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>
...@@ -1560,7 +1540,9 @@ export default class TaxPlanningMR extends Component { ...@@ -1560,7 +1540,9 @@ export default class TaxPlanningMR extends Component {
</div> </div>
{/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null : {/* {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') ? */} (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.btncreate === true && {this.props.isApprover === true ?
<div className="col-2">
</div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button <button
className="button" className="button"
...@@ -1639,7 +1621,6 @@ export default class TaxPlanningMR extends Component { ...@@ -1639,7 +1621,6 @@ export default class TaxPlanningMR extends Component {
</button> </button>
</div> </div>
} }
{/* : null } */}
</div> </div>
</Paper> </Paper>
: :
......
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