Commit 3ef2d52d authored by Arfin Syadziy's avatar Arfin Syadziy

Merge branch 'syadziy' into 'master'

update arfin

See merge request !974
parents 8a2a0821 50c72da0
...@@ -67,7 +67,8 @@ export default class MonthlyReport extends Component { ...@@ -67,7 +67,8 @@ export default class MonthlyReport extends Component {
approverTrue: false, approverTrue: false,
listStatus: [], listStatus: [],
selectedStatus: [], selectedStatus: [],
detailRevisiCheck: [] detailRevisiCheck: [],
isApprovedMB: false
} }
this.myRef = React.createRef() this.myRef = React.createRef()
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -206,7 +207,7 @@ export default class MonthlyReport extends Component { ...@@ -206,7 +207,7 @@ export default class MonthlyReport extends Component {
item.number, item.number,
item.report_name == "CAT"? "Corporate Annual Target" : item.report_name, item.report_name == "CAT"? "Corporate Annual Target" : item.report_name,
item.revision, item.revision,
this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : item.current_status, this.state.isApprovedMB ? (this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : item.current_status) : "CLOSED",
item.report_id, item.report_id,
item.is_can_upload, item.is_can_upload,
item.revision item.revision
...@@ -347,14 +348,14 @@ export default class MonthlyReport extends Component { ...@@ -347,14 +348,14 @@ export default class MonthlyReport extends Component {
let data = [] let data = []
response.data.data.map((item) => { response.data.data.map((item) => {
if (this.state.isApprover) { if (this.state.isApprover) {
if (item >= 2000 && item <= (Number(currentYear) + 1)) { if (item >= 2000 && item <= (Number(currentYear))) {
data.push(item) data.push(item)
} }
} else { } else {
// if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) { // if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) {
// data.push(item) // data.push(item)
// } // }
if ((item >= 2000) && (item == currentYear || item <= currentYear + 1)) { if ((item >= 2000) && (item == currentYear || item <= currentYear)) {
data.push(item) data.push(item)
} }
} }
...@@ -580,6 +581,7 @@ export default class MonthlyReport extends Component { ...@@ -580,6 +581,7 @@ export default class MonthlyReport extends Component {
lastRevision: response.data.data.last_revision, lastRevision: response.data.data.last_revision,
btnApprove: response.data.data.is_submit, btnApprove: response.data.data.is_submit,
monthlyReportId: response.data.data ? response.data.data.monthly_report_id : null, monthlyReportId: response.data.data ? response.data.data.monthly_report_id : null,
isApprovedMB: response.data.data.is_approved_master_budget
}, () => { }, () => {
// // console.log(this.state.lastStatus); // // console.log(this.state.lastStatus);
this.historyApproval() this.historyApproval()
...@@ -1502,6 +1504,11 @@ export default class MonthlyReport extends Component { ...@@ -1502,6 +1504,11 @@ export default class MonthlyReport extends Component {
</div> </div>
)} )}
</div> </div>
{this.state.isApprovedMB === false && (
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>Master Budget Has Not Been Approved</span>
</div>
)}
{this.state.approverTrue === true ? {this.state.approverTrue === true ?
this.state.lastStatus === 'WAITING FOR REVIEW' ? this.state.lastStatus === 'WAITING FOR REVIEW' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}> <div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
......
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