Commit a2ae22f7 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

apdet

See merge request !825
parents 2b718c59 6771f56e
...@@ -347,17 +347,17 @@ export default class BalanceSheetMR extends Component { ...@@ -347,17 +347,17 @@ export default class BalanceSheetMR extends Component {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
item_report: String(i[5]).trim(), item_report: String(i[5]).trim(),
rolling_outlook: i[0] === 5 || i[0] === 6 ? String(Number(i[6].value).toFixed(1)) : i[0] === 3 && i[6] === "" ? "0.0" : String(Number(i[6]).toFixed(1)), rolling_outlook: i[0] === 5 || i[0] === 6 ? String(Number(i[6]).toFixed(1)) : i[0] === 3 && i[6] === "" ? "0.0" : String(Number(i[6]).toFixed(1)),
master_budget: i[0] === 5 || i[0] === 6 ? String(Number(i[7].value).toFixed(1)) : i[0] === 3 && i[7] === "" ? "0.0" : String(Number(i[7]).toFixed(1)), master_budget: i[0] === 5 || i[0] === 6 ? String(Number(i[7]).toFixed(1)) : i[0] === 3 && i[7] === "" ? "0.0" : String(Number(i[7]).toFixed(1)),
rolling_budget: i[0] === 5 || i[0] === 6 ? String(Number(i[8].value).toFixed(1)) : i[0] === 3 && i[8] === "" ? "0.0" : String(Number(i[8]).toFixed(1)), rolling_budget: i[0] === 5 || i[0] === 6 ? String(Number(i[8]).toFixed(1)) : i[0] === 3 && i[8] === "" ? "0.0" : String(Number(i[8]).toFixed(1)),
actual: i[0] === 5 || i[0] === 6 ? String(Number(i[9].value).toFixed(1)) : i[0] === 3 && i[9] === "" ? "0.0" : String(Number(i[9]).toFixed(1)), actual: i[0] === 5 || i[0] === 6 ? String(Number(i[9]).toFixed(1)) : i[0] === 3 && i[9] === "" ? "0.0" : String(Number(i[9]).toFixed(1)),
actual_previous_month: i[0] === 5 || i[0] === 6 ? String(Number(i[10].value).toFixed(1)) : i[0] === 3 && i[10] === "" ? "0.0" : String(Number(i[10]).toFixed(1)), actual_previous_month: i[0] === 5 || i[0] === 6 ? String(Number(i[10]).toFixed(1)) : i[0] === 3 && i[10] === "" ? "0.0" : String(Number(i[10]).toFixed(1)),
amount_act_vs_previous_month: i[0] === 5 || i[0] === 6 ? String(Number(i[11].value).toFixed(1)) : i[0] === 3 && i[11] === "" ? "0.0" : String(Number(i[11]).toFixed(1)), amount_act_vs_previous_month: i[0] === 5 || i[0] === 6 ? String(Number(i[11]).toFixed(1)) : i[0] === 3 && i[11] === "" ? "0.0" : String(Number(i[11]).toFixed(1)),
percent_act_vs_previous_month: i[0] === 5 || i[0] === 6 ? String(Number(i[12].value).toFixed(1)) : i[0] === 3 && i[12] === "" ? "0.0" : String(Number(i[12]).toFixed(1)), percent_act_vs_previous_month: i[0] === 5 || i[0] === 6 ? String(Number(i[12]).toFixed(1)) : i[0] === 3 && i[12] === "" ? "0.0" : String(Number(i[12]).toFixed(1)),
amount_act_vs_mb: i[0] === 5 || i[0] === 6 ? String(Number(i[13].value).toFixed(1)) : i[0] === 3 && i[13] === "" ? "0.0" : String(Number(i[13]).toFixed(1)), amount_act_vs_mb: i[0] === 5 || i[0] === 6 ? String(Number(i[13]).toFixed(1)) : i[0] === 3 && i[13] === "" ? "0.0" : String(Number(i[13]).toFixed(1)),
percent_act_vs_mb: i[0] === 5 || i[0] === 6 ? String(Number(i[14].value).toFixed(1)) : i[0] === 3 && i[14] === "" ? "0.0" : String(Number(i[14]).toFixed(1)), percent_act_vs_mb: i[0] === 5 || i[0] === 6 ? String(Number(i[14]).toFixed(1)) : i[0] === 3 && i[14] === "" ? "0.0" : String(Number(i[14]).toFixed(1)),
amount_act_vs_rb: i[0] === 5 || i[0] === 6 ? String(Number(i[15].value).toFixed(1)) : i[0] === 3 && i[15] === "" ? "0.0" : String(Number(i[15]).toFixed(1)), amount_act_vs_rb: i[0] === 5 || i[0] === 6 ? String(Number(i[15]).toFixed(1)) : i[0] === 3 && i[15] === "" ? "0.0" : String(Number(i[15]).toFixed(1)),
percent_act_vs_rb: i[0] === 5 || i[0] === 6 ? String(Number(i[16].value).toFixed(1)) : i[0] === 3 && i[16] === "" ? "0.0" : String(Number(i[16]).toFixed(1)), percent_act_vs_rb: i[0] === 5 || i[0] === 6 ? String(Number(i[16]).toFixed(1)) : i[0] === 3 && i[16] === "" ? "0.0" : String(Number(i[16]).toFixed(1)),
mtd_vs_previous_month: String(i[17]), mtd_vs_previous_month: String(i[17]),
mtd_vs_mb: String(i[18]), mtd_vs_mb: String(i[18]),
mtd_vs_rb: String(i[19]) mtd_vs_rb: String(i[19])
...@@ -373,13 +373,13 @@ export default class BalanceSheetMR extends Component { ...@@ -373,13 +373,13 @@ export default class BalanceSheetMR extends Component {
"balance_sheet": data "balance_sheet": data
} }
// console.log(data); // console.log(JSON.stringify(body));
api.create('UPLOAD').uploadMonthlyReportBS(body).then(response => { api.create('UPLOAD').uploadMonthlyReportBS(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.onClickClose() this.props.onClickClose()
this.props.getReport() // this.props.getReport()
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -498,6 +498,7 @@ export default class BalanceSheetMR extends Component { ...@@ -498,6 +498,7 @@ export default class BalanceSheetMR extends Component {
"balance_sheet": data "balance_sheet": data
} }
console.log(JSON.stringify(payload)); console.log(JSON.stringify(payload));
console.log(this.state.dataTable)
api.create().validateSubmitReportBS(payload).then((response) => { api.create().validateSubmitReportBS(payload).then((response) => {
console.log(response) console.log(response)
if (response.data) { if (response.data) {
...@@ -646,15 +647,16 @@ export default class BalanceSheetMR extends Component { ...@@ -646,15 +647,16 @@ export default class BalanceSheetMR extends Component {
let tst = String(item).replace('[M-1]', '') let tst = String(item).replace('[M-1]', '')
// let indexID = dataTable2.findIndex((val) => val[21] == tst) // let indexID = dataTable2.findIndex((val) => val[21] == tst)
let data = tableMeta.rowData[20] let data = tableMeta.rowData[20]
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`)) let indexID = data.findIndex((val) => val.item_formula == String(`${item}`))
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = data[indexID].value let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
} else { } else {
let data = tableMeta.rowData[20] let data = tableMeta.rowData[20]
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`)) let indexID = data.findIndex((val) => val.item_formula == String(`${item}`))
if (indexID !== -1) { if (indexID !== -1) {
console.log(tableMeta)
let valuezz = data[indexID].value let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
......
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