Commit b082fe19 authored by d.arizona's avatar d.arizona

zz

parent f54623bb
......@@ -182,15 +182,15 @@ export default class BalanceSheetMR extends Component {
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (item.type_report_id === 3) {
if (item.balance_sheet.mtd_vs_previous_month == "" && Number(item.balance_sheet.percent_act_vs_previous_month) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_previous_month) > this.state.maxValue) {
err = true
}
// if (item.balance_sheet.mtd_vs_previous_month == "" && Number(item.balance_sheet.percent_act_vs_previous_month) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_previous_month) > this.state.maxValue) {
// err = true
// }
if (item.balance_sheet.mtd_vs_mb == "" && Number(item.balance_sheet.percent_act_vs_mb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_mb) > this.state.maxValue) {
err = true
}
if (item.balance_sheet.mtd_vs_rb == "" && Number(item.balance_sheet.percent_act_vs_rb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_rb) > this.state.maxValue) {
err = true
}
// if (item.balance_sheet.mtd_vs_rb == "" && Number(item.balance_sheet.percent_act_vs_rb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_rb) > this.state.maxValue) {
// err = true
// }
}
if (indexIDzz === -1) {
dataTable.push([
......@@ -230,15 +230,15 @@ export default class BalanceSheetMR extends Component {
}
res.map((item, index) => {
if (item.type_report_id === 3) {
if (item.balance_sheet.mtd_vs_previous_month == "" && Number(item.balance_sheet.percent_act_vs_previous_month) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_previous_month) > this.state.maxValue) {
err = true
}
// if (item.balance_sheet.mtd_vs_previous_month == "" && Number(item.balance_sheet.percent_act_vs_previous_month) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_previous_month) > this.state.maxValue) {
// err = true
// }
if (item.balance_sheet.mtd_vs_mb == "" && Number(item.balance_sheet.percent_act_vs_mb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_mb) > this.state.maxValue) {
err = true
}
if (item.balance_sheet.mtd_vs_rb == "" && Number(item.balance_sheet.percent_act_vs_rb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_rb) > this.state.maxValue) {
err = true
}
// if (item.balance_sheet.mtd_vs_rb == "" && Number(item.balance_sheet.percent_act_vs_rb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_rb) > this.state.maxValue) {
// err = true
// }
}
dataTable.push([
item.type_report_id,
......@@ -367,7 +367,13 @@ export default class BalanceSheetMR extends Component {
if (response.data) {
if (response.data.status === 'success') {
this.setState({ visibleUpload: false, visibleBSMR: false, loading: true })
let err = false
let dataTable = response.data.data.map((item, index) => {
if (item.type_report_id === 3) {
if (item.mtd_vs_mb == "" && Number(item.percent_act_vs_mb) < this.state.minValue || Number(item.percent_act_vs_mb) > this.state.maxValue) {
err = true
}
}
return [
item.type_report_id,
item.item_report_id,
......@@ -379,19 +385,19 @@ export default class BalanceSheetMR extends Component {
item.master_budget === "" ? "" : item.master_budget,
item.rolling_budget === "" ? "" : item.rolling_budget,
item.actual === "" ? "" : item.actual,
item.actual_previous_month === null ? "" : item.actual_previous_month === "" ? "" : item.actual_previous_month,
// item.amount_act_vs_previous_month === "" ? "" : item.amount_act_vs_previous_month,
// item.percent_act_vs_previous_month === "" ? "" : item.percent_act_vs_previous_month,
// item.amount_act_vs_mb === "" ? "" : item.amount_act_vs_mb,
// item.percent_act_vs_mb === "" ? "9.0" : item.percent_act_vs_mb,
// item.amount_act_vs_rb === "" ? "1" : item.amount_act_vs_rb,
// item.percent_act_vs_rb === "" ? "" : item.percent_act_vs_rb,
0,
0,
0,
0,
0,
0,
item.actual_previous_month === null ? "0.0" : item.actual_previous_month === "" ? "0.0" : item.actual_previous_month,
item.amount_act_vs_previous_month === "" ? "0.0" : item.amount_act_vs_previous_month,
item.percent_act_vs_previous_month === "" ? "0.0" : item.percent_act_vs_previous_month,
item.amount_act_vs_mb === "" ? "0.0" : item.amount_act_vs_mb,
item.percent_act_vs_mb === "" ? "0.0" : item.percent_act_vs_mb,
item.amount_act_vs_rb === "" ? "0.0" : item.amount_act_vs_rb,
item.percent_act_vs_rb === "" ? "0.0" : item.percent_act_vs_rb,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
item.mtd_vs_previous_month,
item.mtd_vs_mb,
item.mtd_vs_rb,
......@@ -533,11 +539,12 @@ export default class BalanceSheetMR extends Component {
dataTable.map((i, index) => {
if(i[0] === 3) {
// console.log(i);
if ( i[17] === "" && (Number(i[12]) < this.state.minValue || Number(i[12]) > this.state.maxValue)) {
console.log('msk 1');
// console.log(i);
err = true
} else if ( i[18] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) {
// if ( i[17] === "" && (Number(i[12]) < this.state.minValue || Number(i[12]) > this.state.maxValue)) {
// console.log('msk 1');
// // console.log(i);
// err = true
// } else
if ( i[18] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) {
console.log('msk 2');
err = true
}
......
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