Commit 6b0778f4 authored by Deni Rinaldi's avatar Deni Rinaldi

duarrr konflik

parent 878fbf47
This diff is collapsed.
...@@ -54,7 +54,7 @@ export default class MonthlyReport extends Component { ...@@ -54,7 +54,7 @@ export default class MonthlyReport extends Component {
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '', messageAlert: '',
btncreate: false, btnCreate: false,
loadview: false loadview: false
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -69,8 +69,10 @@ export default class MonthlyReport extends Component { ...@@ -69,8 +69,10 @@ export default class MonthlyReport extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
btncreate: response.data.data.create, btnCreate: response.data.data.create,
loadview: response.data.data.view btnEdit: response.data.data.edit
}, () => {
this.getChecApprover()
}) })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -89,7 +91,6 @@ export default class MonthlyReport extends Component { ...@@ -89,7 +91,6 @@ export default class MonthlyReport extends Component {
} }
componentDidMount() { componentDidMount() {
this.getChecApprover()
this.getPermission() this.getPermission()
this.setState({ loading: true }) this.setState({ loading: true })
// this.getCompanyActive() // this.getCompanyActive()
...@@ -100,14 +101,13 @@ export default class MonthlyReport extends Component { ...@@ -100,14 +101,13 @@ export default class MonthlyReport extends Component {
console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
// console.log(response); if (response.data.data.is_approver === true) {
// if (response.data.data.is_approver === true) { this.setState({ isApprover: true, checkApprover: true }, () =>
// this.setState({ isApprover: true, checkApprover: true }, () => this.getPeriode())
// this.getPeriode()) } else {
// } else {
this.setState({ isApprover: false, checkApprover: false }, () => this.setState({ isApprover: false, checkApprover: false }, () =>
this.getCompanyActive()) this.getCompanyActive())
// } }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -455,12 +455,13 @@ export default class MonthlyReport extends Component { ...@@ -455,12 +455,13 @@ export default class MonthlyReport extends Component {
this.getReportAttachment() this.getReportAttachment()
api.create().checkApproverMonthly().then(response => { api.create().checkApproverMonthly().then(response => {
// // console.log(response); // // console.log(response);
if (response.data.data.is_approver === true) { if (this.state.btnCreate === true && this.state.btnEdit === true) {
this.setState({ isApprover: true, checkApprover: true }) console.log('editable');
} else {
this.setState({ isApprover: false, checkApprover: false }) this.setState({ isApprover: false, checkApprover: false })
} else {
console.log('just view');
this.setState({ isApprover: true, checkApprover: true })
} }
}) })
}) })
} else { } else {
...@@ -1106,6 +1107,7 @@ export default class MonthlyReport extends Component { ...@@ -1106,6 +1107,7 @@ export default class MonthlyReport extends Component {
month={this.state.month} month={this.state.month}
saveToMonthlyReport={this.saveToMonthlyReport.bind(this)} saveToMonthlyReport={this.saveToMonthlyReport.bind(this)}
onClickClose={() => this.setState({ visibleBS: false, visibleMonthlyReport: true })} onClickClose={() => this.setState({ visibleBS: false, visibleMonthlyReport: true })}
isApprover={this.state.isApprover}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
/> />
)} )}
...@@ -1139,7 +1141,7 @@ export default class MonthlyReport extends Component { ...@@ -1139,7 +1141,7 @@ export default class MonthlyReport extends Component {
month={this.state.month} month={this.state.month}
saveToMonthlyReport={this.saveToMonthlyReport.bind(this)} saveToMonthlyReport={this.saveToMonthlyReport.bind(this)}
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}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
/> />
......
...@@ -1014,10 +1014,10 @@ export default class BalanceSheetMR extends Component { ...@@ -1014,10 +1014,10 @@ export default class BalanceSheetMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
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="" placeholder=""
disabled={false} disabled={this.props.isApprover}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={Number(tableMeta.rowData[9]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1684,6 +1684,28 @@ export default class BalanceSheetMR extends Component { ...@@ -1684,6 +1684,28 @@ export default class BalanceSheetMR 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.props.isApprover === true ?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
this.downloadAllData()
}, 100);
})}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</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
...@@ -1733,6 +1755,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1733,6 +1755,7 @@ export default class BalanceSheetMR extends Component {
</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>
...@@ -1774,6 +1797,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1774,6 +1797,9 @@ export default class BalanceSheetMR extends Component {
</div> </div>
</button> </button>
</div> </div>
{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"
...@@ -1844,6 +1870,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1844,6 +1870,7 @@ export default class BalanceSheetMR extends Component {
</div> </div>
</button> </button>
</div> </div>
}
</div> </div>
{/* : null {/* : null
} */} } */}
......
...@@ -131,7 +131,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -131,7 +131,7 @@ export default class FixedAssetsMovementMR extends Component {
} }
} }
}) })
console.log(dataTable); // console.log(dataTable);
this.setState({ dataTable, loading: false }) this.setState({ dataTable, loading: false })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
...@@ -407,7 +407,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -407,7 +407,7 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(tableMeta); // console.log(tableMeta);
// console.log(tst); // console.log(tst);
let indexID = dataTable2[tableMeta.rowIndex][16].findIndex((val) => val.item_formula == tst) let indexID = dataTable2[tableMeta.rowIndex][16].findIndex((val) => val.item_formula == tst)
console.log(indexID); // console.log(indexID);
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[tableMeta.rowIndex][16][indexID].value let valuezz = dataTable2[tableMeta.rowIndex][16][indexID].value
......
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