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