Commit 0e134140 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

apdet

See merge request !987
parents 8779cbe4 ed8dbe73
......@@ -689,6 +689,21 @@ export default class MonthlyReport extends Component {
clickDetail(item, id, revision, status) {
console.log(item)
let items = ''
if (item === 'Corporate Annual Target') {
items = 'CAT'
} else {
items = item
}
this.state.dataForRevision.map(i => {
if (i.report_name === items) {
if (i.revision !== revision) {
this.setState({ prevRevision: true })
} else {
this.setState({ prevRevision: false })
}
}
})
this.setState({
report_id: id,
revisionTable: revision,
......@@ -1757,6 +1772,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
// getReport={this.getCompanyActive.bind(this)}
/>
)}
......@@ -1776,6 +1792,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
// getReport={this.getCompanyActive.bind(this)}
/>
......@@ -1799,6 +1816,7 @@ export default class MonthlyReport extends Component {
status={this.state.status}
lastStatus={this.state.lastStatus}
// getReport={this.getCompanyActive.bind(this)}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
)}
{this.state.visibleFAM && (
......@@ -1817,6 +1835,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
)}
{this.state.visibleCAT && (
......@@ -1835,6 +1854,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
)}
{this.state.visibleLOCF && (
......@@ -1853,7 +1873,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
)}
......@@ -1871,6 +1891,7 @@ export default class MonthlyReport extends Component {
onClickClose={() => this.setState({ visibleOI: false, visibleMonthlyReport: true })}
status={this.state.status}
lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
)}
......
......@@ -70,6 +70,7 @@ export default class BalanceSheetMR extends Component {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
let checkPrevRev = false
if (this.props.isApprover) {
checkApprover = true
......@@ -82,9 +83,12 @@ export default class BalanceSheetMR extends Component {
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = false
// }
if (this.props.prevRevision) {
checkPrevRev = true
} else {
checkPrevRev = false
}
if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') {
checkStatus = true
......@@ -92,7 +96,7 @@ export default class BalanceSheetMR extends Component {
checkStatus = false
}
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus})
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev})
}
getLatestUpdate() {
......
......@@ -71,6 +71,7 @@ export default class FixedAssetsMovementMR extends Component {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
let checkPrevRev = false
if (this.props.isApprover) {
checkApprover = true
......@@ -83,9 +84,12 @@ export default class FixedAssetsMovementMR extends Component {
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = false
// }
if (this.props.prevRevision) {
checkPrevRev = true
} else {
checkPrevRev = false
}
if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') {
checkStatus = true
......@@ -93,7 +97,7 @@ export default class FixedAssetsMovementMR extends Component {
checkStatus = false
}
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus })
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
}
getLatestUpdate() {
......
......@@ -145,6 +145,7 @@ export default class ListOfCreditFacilities extends Component {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
let checkPrevRev = false
if (this.props.isApprover) {
checkApprover = true
......@@ -157,9 +158,12 @@ export default class ListOfCreditFacilities extends Component {
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = false
// }
if (this.props.prevRevision) {
checkPrevRev = true
} else {
checkPrevRev = false
}
if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') {
checkStatus = true
......@@ -167,7 +171,7 @@ export default class ListOfCreditFacilities extends Component {
checkStatus = false
}
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus})
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev})
}
getItemHierarki() {
......
......@@ -110,6 +110,7 @@ export default class ProfitLossMR extends Component {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
let checkPrevRev = false
if (this.props.isApprover) {
checkApprover = true
......@@ -122,9 +123,12 @@ export default class ProfitLossMR extends Component {
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = false
// }
if (this.props.prevRevision) {
checkPrevRev = true
} else {
checkPrevRev = false
}
if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') {
checkStatus = true
......@@ -132,7 +136,7 @@ export default class ProfitLossMR extends Component {
checkStatus = false
}
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus })
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev})
}
handleGetFor(type) {
......
......@@ -72,6 +72,7 @@ export default class TaxPlanningMR extends Component {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
let checkPrevRev = false
if (this.props.isApprover) {
checkApprover = true
......@@ -84,9 +85,12 @@ export default class TaxPlanningMR extends Component {
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = false
// }
if (this.props.prevRevision) {
checkPrevRev = true
} else {
checkPrevRev = false
}
if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') {
checkStatus = true
......@@ -94,7 +98,7 @@ export default class TaxPlanningMR extends Component {
checkStatus = false
}
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus})
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev})
}
handleGetFor(type) {
......
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