Commit 9952b840 authored by faisalhamdi's avatar faisalhamdi

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into faisal

parents bfecb1ae 726a7cf1
...@@ -236,7 +236,8 @@ export default class MonthlyReport extends Component { ...@@ -236,7 +236,8 @@ export default class MonthlyReport extends Component {
item.revision, item.revision,
this.state.isApprovedMB ? (this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : status_approv) : "CLOSED", this.state.isApprovedMB ? (this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : status_approv) : "CLOSED",
item.report_id, item.report_id,
item.is_can_upload, // item.is_can_upload,
item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload),
item.revision item.revision
] ]
}) })
......
...@@ -238,7 +238,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -238,7 +238,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.order item.order
]) ])
// let index = dataTable.findIndex((val) => val[5] == item.description) // let index = dataTable.findIndex((val) => val[5] == item.description)
console.log(index, length - 1) // console.log(index, length - 1)
if (index == length - 1 && item.parent_name == "LEARNING & GROWTH PERSPECTIVE") { if (index == length - 1 && item.parent_name == "LEARNING & GROWTH PERSPECTIVE") {
dataTable.push([ dataTable.push([
4, 4,
...@@ -677,6 +677,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -677,6 +677,7 @@ export default class CorporateAnnualTargetMR extends Component {
let total = 0 let total = 0
let perfomanceScore = '' let perfomanceScore = ''
let totalWeight = 0 let totalWeight = 0
// console.log(datatable2)
let datatable3 = datatable2.map((item, index) => { let datatable3 = datatable2.map((item, index) => {
// console.log(item[6]) // console.log(item[6])
//total weight //total weight
...@@ -746,7 +747,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -746,7 +747,7 @@ export default class CorporateAnnualTargetMR extends Component {
} }
} }
totalAch = String(totalAch) == 'NaN' || String(totalAch) == 'Infinity' || String(totalAch) == '-Infinity' ? 0 : totalAch totalAch = String(totalAch) == 'NaN' || String(totalAch) == 'Infinity' || String(totalAch) == '-Infinity' ? 0 : totalAch
totalAch = Number(totalAch) * 100 totalAch = this.props.lastStatus == 'APPROVED'? item[13] : Number(totalAch) * 100
//score //score
let listParameter = this.state.parameterScore let listParameter = this.state.parameterScore
...@@ -756,7 +757,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -756,7 +757,7 @@ export default class CorporateAnnualTargetMR extends Component {
let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase()) let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase())
let listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id) let listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id)
let totalScore = 0 let totalScore = 0
let achx100 = item[9] == '100%' && (item[8] == 'HIB' || item[8] == 'HIG') ? Number(totalAch) / 100 > 1 ? 1 : Number(totalAch) / 100 : Number(totalAch) / 100 let achx100 = item[9] == '100%' && (item[8] == 'HIB' || item[8] == 'HIG') ? (Number(totalAch) / 100 > 1 ? 1 : Number(totalAch) / 100) : Number(totalAch) / 100
// if (item[5] == "Max Quality drop from Bor-Barge") { // if (item[5] == "Max Quality drop from Bor-Barge") {
// console.log(listParameterFilter) // console.log(listParameterFilter)
// console.log(listParameterFilterCompany) // console.log(listParameterFilterCompany)
...@@ -776,7 +777,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -776,7 +777,7 @@ export default class CorporateAnnualTargetMR extends Component {
} }
}) })
} }
let totalScorez = Number(totalScore).toFixed(0) let totalScorez = this.props.lastStatus == 'APPROVED'? item[14] : Number(totalScore).toFixed(0)
// if (item[5] == "Max Quality drop from Bor-Barge") { // if (item[5] == "Max Quality drop from Bor-Barge") {
// console.log(totalScorez) // console.log(totalScorez)
// } // }
...@@ -793,7 +794,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -793,7 +794,7 @@ export default class CorporateAnnualTargetMR extends Component {
} else { } else {
totalSW = (Number(totalScorez) * Number(handlePercent) / 100) totalSW = (Number(totalScorez) * Number(handlePercent) / 100)
} }
totalSW = Number(totalSW).toFixed(2) totalSW = this.props.lastStatus == 'APPROVED'? item[15] : Number(totalSW).toFixed(2)
if (item[0] !== 1 && item[0] !== 4) { if (item[0] !== 1 && item[0] !== 4) {
total += Number(totalSW) total += Number(totalSW)
} }
...@@ -804,6 +805,8 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -804,6 +805,8 @@ export default class CorporateAnnualTargetMR extends Component {
// console.log(listParameterFilterCompany); // console.log(listParameterFilterCompany);
// console.log(totalScorez) // console.log(totalScorez)
// console.log(totalSW) // console.log(totalSW)
// console.log(item[12])
// console.log(item[5])
// console.log(total) // console.log(total)
return [ return [
item[0], item[0],
...@@ -1373,7 +1376,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1373,7 +1376,7 @@ export default class CorporateAnnualTargetMR extends Component {
let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase() && String(val.company_name).toLocaleLowerCase() === "default") let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase() && String(val.company_name).toLocaleLowerCase() === "default")
let listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id) let listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id)
let totalScore = 0 let totalScore = 0
let achx100 = tableMeta.rowData[9] == '100%' && (tableMeta.rowData[8] == 'HIB' || tableMeta.rowData[8] == 'HIG') ? Number(tableMeta.rowData[13]) / 100 > 1 ? 1 : Number(tableMeta.rowData[13]) / 100 : Number(tableMeta.rowData[13]) / 100 let achx100 = tableMeta.rowData[9] == '100%' && (tableMeta.rowData[8] == 'HIB' || tableMeta.rowData[8] == 'HIG') ? (Number(tableMeta.rowData[13]) / 100 > 1 ? 1 : Number(tableMeta.rowData[13]) / 100) : Number(tableMeta.rowData[13]) / 100
if (listParameterFilterCompany.length == 0) { if (listParameterFilterCompany.length == 0) {
listParameterFilter.map((item, index) => { listParameterFilter.map((item, index) => {
if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) { if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) {
......
...@@ -136,8 +136,8 @@ export default class ProfitLossMR extends Component { ...@@ -136,8 +136,8 @@ export default class ProfitLossMR extends Component {
checkStatus = false checkStatus = false
} }
// this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev }) this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
this.setState({viewOnly: true}) // this.setState({viewOnly: true})
} }
handleGetFor(type) { handleGetFor(type) {
......
...@@ -221,7 +221,8 @@ export default class OutlookPA extends Component { ...@@ -221,7 +221,8 @@ export default class OutlookPA extends Component {
item.revision, item.revision,
this.state.isSubmit === false ? "CLOSED" : item.current_status, this.state.isSubmit === false ? "CLOSED" : item.current_status,
item.report_id, item.report_id,
Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload, // Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload),
item.revision item.revision
] ]
}) })
......
...@@ -267,7 +267,8 @@ export default class RollingOutlook extends Component { ...@@ -267,7 +267,8 @@ export default class RollingOutlook extends Component {
item.revision, item.revision,
this.state.isSubmit === false ? "CLOSED" : item.current_status, this.state.isSubmit === false ? "CLOSED" : item.current_status,
item.report_id, item.report_id,
Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload, // Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload),
item.revision item.revision
] ]
}) })
......
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