Commit 7d662834 authored by d.arizona's avatar d.arizona

bobo nyenyak

parent 2f758a59
......@@ -108,6 +108,27 @@ export default class OperatingIndicator extends Component {
if (response.data) {
if (response.data.status === 'success') {
let data = response.data.data
let compActive = []
let userCompActive = []
this.state.userCompany.map((item, index) => {
let indeks = data.findIndex((val) => val.company_id == item)
if (indeks !== -1 && String(data[indeks].status).toLocaleLowerCase() == 'active'){
userCompActive.push(item)
}
})
data.map(( item, index ) => {
if (String(item.status).toLocaleLowerCase() == 'active') {
compActive.push(item)
}
})
if (compActive.length == userCompActive.length){
this.setState({ superUser: false})
} else {
this.setState({ superUser: true})
}
let companyData = data.map((item) => {
return {
company_id: item.company_id,
......@@ -501,7 +522,7 @@ export default class OperatingIndicator extends Component {
})}
getReport={() => this.getReport()}
saveOperatingInd={this.saveOperatingInd.bind(this)}
superUser={this.state.superUser}
/>
}
......
......@@ -1244,7 +1244,7 @@ export default class BalanceSheet extends Component {
</div>
<div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template">
{this.props.superUser && <a data-tip={'Download Template'} data-for="template">
<button
style={{
backgroundColor: 'transparent',
......@@ -1256,9 +1256,9 @@ export default class BalanceSheet extends Component {
>
<img src={Images.template} />
</button>
</a>
</a>}
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
<a data-tip={'Upload'} data-for="upload">
{this.props.superUser && <a data-tip={'Upload'} data-for="upload">
<button
style={{
backgroundColor: 'transparent',
......@@ -1270,7 +1270,7 @@ export default class BalanceSheet extends Component {
>
<img src={Images.upload} />
</button>
</a>
</a>}
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download">
<button
......@@ -1323,7 +1323,7 @@ export default class BalanceSheet extends Component {
</div>
</button>
</div>
{!this.state.emptyData && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
{!this.state.emptyData && this.props.superUser && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
onClick={() =>
......
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