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 {
approverTrue: false,
listStatus: [],
selectedStatus: [],
detailRevisiCheck: []
detailRevisiCheck: [],
isApprovedMB: false
}
this.myRef = React.createRef()
this.fileHandler = this.fileHandler.bind(this);
......@@ -206,7 +207,7 @@ export default class MonthlyReport extends Component {
item.number,
item.report_name == "CAT"? "Corporate Annual Target" : item.report_name,
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.is_can_upload,
item.revision
......@@ -347,14 +348,14 @@ export default class MonthlyReport extends Component {
let data = []
response.data.data.map((item) => {
if (this.state.isApprover) {
if (item >= 2000 && item <= (Number(currentYear) + 1)) {
if (item >= 2000 && item <= (Number(currentYear))) {
data.push(item)
}
} else {
// if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) {
// data.push(item)
// }
if ((item >= 2000) && (item == currentYear || item <= currentYear + 1)) {
if ((item >= 2000) && (item == currentYear || item <= currentYear)) {
data.push(item)
}
}
......@@ -580,6 +581,7 @@ export default class MonthlyReport extends Component {
lastRevision: response.data.data.last_revision,
btnApprove: response.data.data.is_submit,
monthlyReportId: response.data.data ? response.data.data.monthly_report_id : null,
isApprovedMB: response.data.data.is_approved_master_budget
}, () => {
// // console.log(this.state.lastStatus);
this.historyApproval()
......@@ -1502,6 +1504,11 @@ export default class MonthlyReport extends Component {
</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.lastStatus === 'WAITING FOR REVIEW' ?
<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