Commit 2e70f3b1 authored by Riri Novita's avatar Riri Novita

up

parent c72dc7e0
...@@ -333,7 +333,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -333,7 +333,7 @@ export default class OperatingIndicatorRO extends Component {
downloadTemplate = async () => { downloadTemplate = async () => {
let res = await fetch( let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/rolling_outlook/download_template?report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/rolling_outlook/download_template?report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}&&quartal=${this.props.quartal}`
) )
res = await res.blob() res = await res.blob()
// // console.log(res) // // console.log(res)
...@@ -341,7 +341,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -341,7 +341,7 @@ export default class OperatingIndicatorRO extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Template Master Budget Operating Indicator.xlsx'; a.download = 'Template Rolling Outlook Operating Indicator.xlsx';
a.click(); a.click();
} }
} }
...@@ -520,14 +520,6 @@ export default class OperatingIndicatorRO extends Component { ...@@ -520,14 +520,6 @@ export default class OperatingIndicatorRO extends Component {
let val = String(value).split(",").join("") let val = String(value).split(",").join("")
let total = 0 let total = 0
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// dataTable2[tableMeta.rowIndex].map((item,index) => {
// if (index >= 8 && index <= 19) {
// let valItem = item == undefined || item == ""? 0 : item
// total += Number(valItem)
// }
// })
// dataTable2[tableMeta.rowIndex][20] = total
// // console.log(dataTable2[tableMeta.rowIndex])
} }
const handleValue = (value, tableMeta) => { const handleValue = (value, tableMeta) => {
...@@ -535,12 +527,12 @@ export default class OperatingIndicatorRO extends Component { ...@@ -535,12 +527,12 @@ export default class OperatingIndicatorRO extends Component {
let total = 0 let total = 0
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
dataTable2[tableMeta.rowIndex].map((item, index) => { dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 8 && index <= 19) { if (index >= 7 && index <= 19) {
let valItem = item == undefined || item == "" ? 0 : item let valItem = item == undefined || item == "" ? 0 : item
total += Number(valItem) total += Number(valItem)
} }
}) })
dataTable2[tableMeta.rowIndex][20] = total dataTable2[tableMeta.rowIndex][19] = total
return total return total
} }
...@@ -572,7 +564,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -572,7 +564,7 @@ export default class OperatingIndicatorRO extends Component {
} else if (item == '-' || item == '+' || item == '/' || item == '*') { } else if (item == '-' || item == '+' || item == '/' || item == '*') {
arrayFormulaConvert.push(item) arrayFormulaConvert.push(item)
} else { } else {
let indexID = dataTable2.findIndex((val) => val[21] == item) let indexID = dataTable2.findIndex((val) => val[20] == item)
if (tambahan) { if (tambahan) {
if (item == '-' || item == '+' || item == '/' || item == '*') { if (item == '-' || item == '+' || item == '/' || item == '*') {
opet = item opet = item
......
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