Commit 0ff6fc8b authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'rifka' into 'master'

issue taxplan

See merge request !559
parents 499a4366 60a89358
...@@ -93,7 +93,7 @@ export default class TaxPlanning extends Component { ...@@ -93,7 +93,7 @@ export default class TaxPlanning extends Component {
"submission_id": this.props.submissionID "submission_id": this.props.submissionID
} }
api.create().getDetailReportMB(payload).then(response => { api.create().getDetailReportMB(payload).then(response => {
console.log(payload); // console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
let res = response.data.data let res = response.data.data
...@@ -815,12 +815,8 @@ export default class TaxPlanning extends Component { ...@@ -815,12 +815,8 @@ export default class TaxPlanning extends Component {
if (dataTable2[indexID][24] == tableMeta.rowData[24]) { if (dataTable2[indexID][24] == tableMeta.rowData[24]) {
anjay.push(0) anjay.push(0)
} else { } else {
// console.log(dataTable2[indexID][tableMeta.columnIndex]);
let data = dex == 1 ? dataTable2[indexID][tableMeta.columnIndex].tbc : dex == 2 ? dataTable2[indexID][tableMeta.columnIndex].fcp : dataTable2[indexID][tableMeta.columnIndex].tbf let data = dex == 1 ? dataTable2[indexID][tableMeta.columnIndex].tbc : dex == 2 ? dataTable2[indexID][tableMeta.columnIndex].fcp : dataTable2[indexID][tableMeta.columnIndex].tbf
let valuezz = data.value == undefined ? data : data.value let valuezz = data.value == undefined ? data : data.value
// console.log(data);
// console.log(data.value);
// console.log(valuezz);
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
...@@ -1010,23 +1006,32 @@ export default class TaxPlanning extends Component { ...@@ -1010,23 +1006,32 @@ export default class TaxPlanning extends Component {
} }
const handleTotal = (tableMeta, dex) => { const handleTotal = (tableMeta, dex) => {
let total = 0 let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => { let totalfcp = 0
if (index >= 9 && index <= 20) { if (String(tableMeta.rowData[8]).toLowerCase() === "fiscal correction positive / (negative) year to date"){
if ( tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ) { dataTable2[tableMeta.rowIndex -2].map((item, index) => {
let valItem = item.tbf.value == undefined || item.tbf.value == "" || item.tbf.value == "undefined" ? 0.0 : item.tbf.value if (index >= 9 && index <= 20) {
total += Number(valItem) if ( dataTable2[tableMeta.rowIndex -2][2] === 5 || dataTable2[tableMeta.rowIndex -2][2] === 6 || dataTable2[tableMeta.rowIndex -2][2] === 7 ) {
} else { let valItem = item.fcp.value == undefined || item.fcp.value == "" || item.fcp.value == "undefined" ? 0.0 : item.fcp.value
if (tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"){ total += Number(valItem)
} else {
let valItem = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp let valItem = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp
total += Number(valItem) total += Number(valItem)
}
}
})
} else {
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 9 && index <= 20) {
if ( tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ) {
let valItem = item.tbf.value == undefined || item.tbf.value == "" || item.tbf.value == "undefined" ? 0.0 : item.tbf.value
total += Number(valItem)
} else { } else {
let valItem = item.tbf == undefined || item.tbf == "" || item.tbf == "undefined" ? 0.0 : item.tbf let valItem = item.tbf == undefined || item.tbf == "" || item.tbf == "undefined" ? 0.0 : item.tbf
total += Number(valItem) total += Number(valItem)
} }
} }
} })
}) }
dataTable2[tableMeta.rowIndex][21] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][21] = Number(total).toFixed(1)
return total return total
} }
...@@ -1150,20 +1155,6 @@ export default class TaxPlanning extends Component { ...@@ -1150,20 +1155,6 @@ export default class TaxPlanning extends Component {
let total = 0 let total = 0
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (item[5] == tableMeta.rowData[4]) { if (item[5] == tableMeta.rowData[4]) {
// if (type == 1) {
// console.log(item[tableMeta.columnIndex].tbc.value)
// console.log(item[tableMeta.columnIndex].tbc)
// } else
// if (type == 2) {
// console.log(item[tableMeta.columnIndex].fcp.value)
// console.log(item[tableMeta.columnIndex].fcp)}
// console.log(type)
// if (type == 3) {
// console.log(item[tableMeta.columnIndex].tbf.value)
// console.log(item[tableMeta.columnIndex].tbf)
// }
// console.log(item[4])
// console.log(tableMeta.rowData[5])
total += Number(type == 1 ? total += Number(type == 1 ?
item[tableMeta.columnIndex].tbc.value == undefined ? Number(item[tableMeta.columnIndex].tbc == "" || item[tableMeta.columnIndex].tbc == "0.0" ? 0 : item[tableMeta.columnIndex].tbc) : Number(item[tableMeta.columnIndex].tbc.value == "" || item[tableMeta.columnIndex].tbc.value == "0.0" ? 0 : item[tableMeta.columnIndex].tbc.value) item[tableMeta.columnIndex].tbc.value == undefined ? Number(item[tableMeta.columnIndex].tbc == "" || item[tableMeta.columnIndex].tbc == "0.0" ? 0 : item[tableMeta.columnIndex].tbc) : Number(item[tableMeta.columnIndex].tbc.value == "" || item[tableMeta.columnIndex].tbc.value == "0.0" ? 0 : item[tableMeta.columnIndex].tbc.value)
: :
...@@ -1310,7 +1301,7 @@ export default class TaxPlanning extends Component { ...@@ -1310,7 +1301,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -2714,7 +2705,7 @@ export default class TaxPlanning extends Component { ...@@ -2714,7 +2705,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -3140,7 +3131,7 @@ export default class TaxPlanning extends Component { ...@@ -3140,7 +3131,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
...@@ -3272,7 +3263,7 @@ export default class TaxPlanning extends Component { ...@@ -3272,7 +3263,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -3567,7 +3558,7 @@ export default class TaxPlanning extends Component { ...@@ -3567,7 +3558,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
...@@ -3699,7 +3690,7 @@ export default class TaxPlanning extends Component { ...@@ -3699,7 +3690,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -3994,7 +3985,7 @@ export default class TaxPlanning extends Component { ...@@ -3994,7 +3985,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
...@@ -4126,7 +4117,7 @@ export default class TaxPlanning extends Component { ...@@ -4126,7 +4117,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -4421,7 +4412,7 @@ export default class TaxPlanning extends Component { ...@@ -4421,7 +4412,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
...@@ -4553,7 +4544,7 @@ export default class TaxPlanning extends Component { ...@@ -4553,7 +4544,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -4848,7 +4839,7 @@ export default class TaxPlanning extends Component { ...@@ -4848,7 +4839,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
...@@ -4980,7 +4971,7 @@ export default class TaxPlanning extends Component { ...@@ -4980,7 +4971,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -5275,7 +5266,7 @@ export default class TaxPlanning extends Component { ...@@ -5275,7 +5266,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
...@@ -5407,7 +5398,7 @@ export default class TaxPlanning extends Component { ...@@ -5407,7 +5398,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -5702,7 +5693,7 @@ export default class TaxPlanning extends Component { ...@@ -5702,7 +5693,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
...@@ -5834,7 +5825,7 @@ export default class TaxPlanning extends Component { ...@@ -5834,7 +5825,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -6129,7 +6120,7 @@ export default class TaxPlanning extends Component { ...@@ -6129,7 +6120,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
...@@ -6261,7 +6252,7 @@ export default class TaxPlanning extends Component { ...@@ -6261,7 +6252,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
......
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