Commit 162b210c authored by EKSAD's avatar EKSAD

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

parents 19b0ac4c 574b28ed
......@@ -266,7 +266,7 @@ export default class CorporateAnnualTarget extends Component {
// console.log(nilaiTotal)
// // console.log(i[2] === undefined ? "" : String(Number(i[2]*100)).length > 3? String(Number(i[2]*100).toFixed(0) + '%') : String(Number(i[2]*100)) + '%')
payload.push({
item_report_id: i[0] === undefined ? "" : reg.test(String(i[0])) === false ? "" : String(i[0]).trim(),
item_report_id: i[0] === undefined ? 0 : reg.test(String(i[0])) === false ? 0 : String(i[0]).trim(),
item_report: i[1] === undefined ? "" : String(i[1]).trim(),
weight: i[2] === undefined ? "" : String(Number(i[2] * 100)).length > 3 ? String(Number(i[2] * 100).toFixed(0) + '%') : String(Number(i[2] * 100)) + '%',
uom: i[3] === undefined ? "" : String(i[3]).trim(),
......@@ -322,7 +322,7 @@ export default class CorporateAnnualTarget extends Component {
}
}
})
// console.log(JSON.stringify(this.state.payload))
console.log(JSON.stringify(this.state.payload))
api.create().checkUploadMB(this.state.payload).then(response => {
// // console.log(JSON.stringify(this.state.payload));
// console.log(response)
......@@ -488,6 +488,13 @@ export default class CorporateAnnualTarget extends Component {
}
}
// if (i[0] == null && i[2] == null) {
// if (i[6] == "" || i[7] == "" || i[9] == null || i[10] == null || i[11] == null) {
// handleKosongKPIMAXYTD = true
// // console.log(handleKosongKPIMAXYTD)
// }
// }
if (i[2] !== null) {
let indexID = dataTampung.findIndex((val) => val.id == i[2])
if (indexID !== -1) {
......@@ -511,7 +518,7 @@ export default class CorporateAnnualTarget extends Component {
}
data.push({
"item_report_id": i[1] == "" ? null : i[1],
"item_report_id": i[1] == "" || i[1] == null? 0 : i[1],
"item_name": String(i[6]),
"parent": i[2] == "" ? null : i[2],
"weight": weightReal == null ? String(i[7]) : weightReal,
......@@ -578,7 +585,7 @@ export default class CorporateAnnualTarget extends Component {
this.state.dataTable.map(i => {
// // console.log(i[9] == null? "" : i[9].value)
data.push({
"item_report_id": i[1] == "" ? null : i[1],
"item_report_id": i[1] == "" || i[1] == null? 0 : i[1],
"item_name": String(i[6]),
"parent": i[2] == "" ? null : i[2],
"weight": String(i[7]),
......@@ -865,7 +872,7 @@ export default class CorporateAnnualTarget extends Component {
return false
}
} else {
if (typeReport == null) {
if (typeReport == null || typeReport == 3) {
return true
} else if (tableMeta !== undefined && tableMeta.rowData[0] == 1) {
let indexID = dataTable2.findIndex((val) => val[2] == tableMeta.rowData[1])
......@@ -887,9 +894,9 @@ export default class CorporateAnnualTarget extends Component {
newData.push(item)
if (index == rowIndex) {
newData.push([
3,
null,
"",
item[2] == null ? item[1] : item[2],
item[2] == null || item[2] == ""? item[1] : item[2],
item[3],
item[4],
"",
......@@ -1065,7 +1072,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// console.log(event.target.value)
handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
console.log(dataTable2)
}}
/>
}
......
......@@ -9,6 +9,7 @@ import ReactTooltip from 'react-tooltip';
import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
import { Alert } from '@material-ui/lab';
import * as R from 'ramda'
const LightTooltip = withStyles((theme) => ({
tooltip: {
......@@ -102,21 +103,21 @@ export default class FixedAssetsMovement extends Component {
item.level,
item.description,
item.fixed_asset_movement.total_actual_before === null ? "0" : item.fixed_asset_movement.total_actual_before === "" ? "0" : item.fixed_asset_movement.total_actual_before,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.january, formula: item.fixed_asset_movement.january_formula} : item.fixed_asset_movement.january,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.february, formula: item.fixed_asset_movement.february_formula} : item.fixed_asset_movement.february,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.march, formula: item.fixed_asset_movement.march_formula} : item.fixed_asset_movement.march,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.april, formula: item.fixed_asset_movement.april_formula} : item.fixed_asset_movement.april,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.may, formula: item.fixed_asset_movement.may_formula} : item.fixed_asset_movement.may,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.june, formula: item.fixed_asset_movement.june_formula} : item.fixed_asset_movement.june,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.july, formula: item.fixed_asset_movement.july_formula} : item.fixed_asset_movement.july,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.august, formula: item.fixed_asset_movement.august_formula} : item.fixed_asset_movement.august,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.september, formula: item.fixed_asset_movement.september_formula} : item.fixed_asset_movement.september,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.october, formula: item.fixed_asset_movement.october_formula} : item.fixed_asset_movement.october,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.november, formula: item.fixed_asset_movement.november_formula} : item.fixed_asset_movement.november,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.december, formula: item.fixed_asset_movement.december_formula} : item.fixed_asset_movement.december,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.january, formula: item.fixed_asset_movement.january_formula } : item.fixed_asset_movement.january,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.february, formula: item.fixed_asset_movement.february_formula } : item.fixed_asset_movement.february,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.march, formula: item.fixed_asset_movement.march_formula } : item.fixed_asset_movement.march,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.april, formula: item.fixed_asset_movement.april_formula } : item.fixed_asset_movement.april,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.may, formula: item.fixed_asset_movement.may_formula } : item.fixed_asset_movement.may,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.june, formula: item.fixed_asset_movement.june_formula } : item.fixed_asset_movement.june,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.july, formula: item.fixed_asset_movement.july_formula } : item.fixed_asset_movement.july,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.august, formula: item.fixed_asset_movement.august_formula } : item.fixed_asset_movement.august,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.september, formula: item.fixed_asset_movement.september_formula } : item.fixed_asset_movement.september,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.october, formula: item.fixed_asset_movement.october_formula } : item.fixed_asset_movement.october,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.november, formula: item.fixed_asset_movement.november_formula } : item.fixed_asset_movement.november,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.december, formula: item.fixed_asset_movement.december_formula } : item.fixed_asset_movement.december,
item.fixed_asset_movement.total_current_year,
item.fixed_asset_movement.total_next_year,
item.fixed_asset_movement.total_more_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_next_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_more_year,
item.order
])
}
......@@ -137,21 +138,21 @@ export default class FixedAssetsMovement extends Component {
item.level,
item.description,
item.fixed_asset_movement.total_actual_before === null ? "0" : item.fixed_asset_movement.total_actual_before === "" ? "0" : item.fixed_asset_movement.total_actual_before,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.january, formula: item.fixed_asset_movement.january_formula} : item.fixed_asset_movement.january,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.february, formula: item.fixed_asset_movement.february_formula} : item.fixed_asset_movement.february,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.march, formula: item.fixed_asset_movement.march_formula} : item.fixed_asset_movement.march,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.april, formula: item.fixed_asset_movement.april_formula} : item.fixed_asset_movement.april,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.may, formula: item.fixed_asset_movement.may_formula} : item.fixed_asset_movement.may,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.june, formula: item.fixed_asset_movement.june_formula} : item.fixed_asset_movement.june,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.july, formula: item.fixed_asset_movement.july_formula} : item.fixed_asset_movement.july,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.august, formula: item.fixed_asset_movement.august_formula} : item.fixed_asset_movement.august,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.september, formula: item.fixed_asset_movement.september_formula} : item.fixed_asset_movement.september,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.october, formula: item.fixed_asset_movement.october_formula} : item.fixed_asset_movement.october,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.november, formula: item.fixed_asset_movement.november_formula} : item.fixed_asset_movement.november,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.fixed_asset_movement.december, formula: item.fixed_asset_movement.december_formula} : item.fixed_asset_movement.december,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.january, formula: item.fixed_asset_movement.january_formula } : item.fixed_asset_movement.january,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.february, formula: item.fixed_asset_movement.february_formula } : item.fixed_asset_movement.february,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.march, formula: item.fixed_asset_movement.march_formula } : item.fixed_asset_movement.march,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.april, formula: item.fixed_asset_movement.april_formula } : item.fixed_asset_movement.april,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.may, formula: item.fixed_asset_movement.may_formula } : item.fixed_asset_movement.may,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.june, formula: item.fixed_asset_movement.june_formula } : item.fixed_asset_movement.june,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.july, formula: item.fixed_asset_movement.july_formula } : item.fixed_asset_movement.july,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.august, formula: item.fixed_asset_movement.august_formula } : item.fixed_asset_movement.august,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.september, formula: item.fixed_asset_movement.september_formula } : item.fixed_asset_movement.september,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.october, formula: item.fixed_asset_movement.october_formula } : item.fixed_asset_movement.october,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.november, formula: item.fixed_asset_movement.november_formula } : item.fixed_asset_movement.november,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.december, formula: item.fixed_asset_movement.december_formula } : item.fixed_asset_movement.december,
item.fixed_asset_movement.total_current_year,
item.fixed_asset_movement.total_next_year,
item.fixed_asset_movement.total_more_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_next_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_more_year,
item.order
])
if (item.children !== null) {
......@@ -202,18 +203,18 @@ export default class FixedAssetsMovement extends Component {
data.push({
item_report_id: i[1],
total_actual_before: String(Number(i[6]).toFixed(1)),
january: String(Number(i[7]).toFixed(1)),
february: String(Number(i[8]).toFixed(1)),
march: String(Number(i[9]).toFixed(1)),
april: String(Number(i[10]).toFixed(1)),
may: String(Number(i[11]).toFixed(1)),
june: String(Number(i[12]).toFixed(1)),
july: String(Number(i[13]).toFixed(1)),
august: String(Number(i[14]).toFixed(1)),
september: String(Number(i[15]).toFixed(1)),
october: String(Number(i[16]).toFixed(1)),
november: String(Number(i[17]).toFixed(1)),
december: String(Number(i[18]).toFixed(1)),
january: i[0] === 5 || i[0] === 6 ? String(Number(i[7].value).toFixed(1)) : String(Number(i[7]).toFixed(1)),
february: i[0] === 5 || i[0] === 6 ? String(Number(i[8].value).toFixed(1)) : String(Number(i[8]).toFixed(1)),
march: i[0] === 5 || i[0] === 6 ? String(Number(i[9].value).toFixed(1)) : String(Number(i[9]).toFixed(1)),
april: i[0] === 5 || i[0] === 6 ? String(Number(i[10].value).toFixed(1)) : String(Number(i[10]).toFixed(1)),
may: i[0] === 5 || i[0] === 6 ? String(Number(i[11].value).toFixed(1)) : String(Number(i[11]).toFixed(1)),
june: i[0] === 5 || i[0] === 6 ? String(Number(i[12].value).toFixed(1)) : String(Number(i[12]).toFixed(1)),
july: i[0] === 5 || i[0] === 6 ? String(Number(i[13].value).toFixed(1)) : String(Number(i[13]).toFixed(1)),
august: i[0] === 5 || i[0] === 6 ? String(Number(i[14].value).toFixed(1)) : String(Number(i[14]).toFixed(1)),
september: i[0] === 5 || i[0] === 6 ? String(Number(i[15].value).toFixed(1)) : String(Number(i[15]).toFixed(1)),
october: i[0] === 5 || i[0] === 6 ? String(Number(i[16].value).toFixed(1)) : String(Number(i[16]).toFixed(1)),
november: i[0] === 5 || i[0] === 6 ? String(Number(i[17].value).toFixed(1)) : String(Number(i[17]).toFixed(1)),
december: i[0] === 5 || i[0] === 6 ? String(Number(i[18].value).toFixed(1)) : String(Number(i[18]).toFixed(1)),
total_current_year: String(Number(i[19]).toFixed(1)),
total_next_year: String(Number(i[20]).toFixed(1)),
total_more_year: String(Number(i[21]).toFixed(1))
......@@ -311,18 +312,18 @@ export default class FixedAssetsMovement extends Component {
item.level,
item.item_report,
item.total_actual_before,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.january, formula: item.january_formula} : item.january,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.february, formula: item.february_formula} : item.february,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.march, formula: item.march_formula} : item.march,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.april, formula: item.april_formula} : item.april,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.may, formula: item.may_formula} : item.may,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.june, formula: item.june_formula} : item.june,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.july, formula: item.july_formula} : item.july,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.august, formula: item.august_formula} : item.august,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.september, formula: item.september_formula} : item.september,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.october, formula: item.october_formula} : item.october,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.november, formula: item.november_formula} : item.november,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.december, formula: item.december_formula} : item.december,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.january, formula: item.january_formula } : item.january,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.february, formula: item.february_formula } : item.february,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.march, formula: item.march_formula } : item.march,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.april, formula: item.april_formula } : item.april,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.may, formula: item.may_formula } : item.may,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.june, formula: item.june_formula } : item.june,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.july, formula: item.july_formula } : item.july,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.august, formula: item.august_formula } : item.august,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.september, formula: item.september_formula } : item.september,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.october, formula: item.october_formula } : item.october,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.november, formula: item.november_formula } : item.november,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.december, formula: item.december_formula } : item.december,
item.total_current_year,
item.total_next_year,
item.total_more_year,
......@@ -411,29 +412,29 @@ export default class FixedAssetsMovement extends Component {
handleValidate() {
let data = []
// console.log(this.state.dataTable)
console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
total_actual_before: String(i[6]),
january: i[0] === 3 && i[7] === "" ? "0" : String(i[7]),
february: i[0] === 3 && i[8] === "" ? "0" : String(i[8]),
march: i[0] === 3 && i[9] === "" ? "0" : String(i[9]),
april: i[0] === 3 && i[10] === "" ? "0" : String(i[10]),
may: i[0] === 3 && i[11] === "" ? "0" : String(i[11]),
june: i[0] === 3 && i[12] === "" ? "0" : String(i[12]),
july: i[0] === 3 && i[13] === "" ? "0" : String(i[13]),
august: i[0] === 3 && i[14] === "" ? "0" : String(i[14]),
september: i[0] === 3 && i[15] === "" ? "0" : String(i[15]),
october: i[0] === 3 && i[16] === "" ? "0" : String(i[16]),
november: i[0] === 3 && i[17] === "" ? "0" : String(i[17]),
december: i[0] === 3 && i[18] === "" ? "0" : String(i[18]),
january: i[0] === 3 && i[7] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[7].value) : String(i[7]),
february: i[0] === 3 && i[8] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[8].value) : String(i[8]),
march: i[0] === 3 && i[9] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[9].value) : String(i[9]),
april: i[0] === 3 && i[10] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[10].value) : String(i[10]),
may: i[0] === 3 && i[11] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[11].value) : String(i[11]),
june: i[0] === 3 && i[12] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[12].value) : String(i[12]),
july: i[0] === 3 && i[13] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[13].value) : String(i[13]),
august: i[0] === 3 && i[14] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[14].value) : String(i[14]),
september: i[0] === 3 && i[15] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[15].value) : String(i[15]),
october: i[0] === 3 && i[16] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[16].value) : String(i[16]),
november: i[0] === 3 && i[17] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[17].value) : String(i[17]),
december: i[0] === 3 && i[18] === "" ? "0" : i[0] === 5 || i[0] === 6 ? String(i[18].value) : String(i[18]),
total_current_year: i[0] === 3 && i[19] === "" ? "0" : String(i[19]),
total_next_year: i[0] === 3 && i[20] === "" ? "0" : String(i[20]),
total_more_year: i[0] === 3 && i[21] === "" ? "0" : String(i[21])
})
})
// console.log(JSON.stringify(data))
console.log(JSON.stringify(data))
let payload = {
"submission_id": this.props.submissionID,
"company_id": this.props.company.company_id,
......@@ -462,14 +463,14 @@ export default class FixedAssetsMovement extends Component {
let splitFormula = String(tableMeta.rowData[3]).split('@')
let baru = []
let anjay = []
splitFormula.map((item,index) => {
let items = String(item).substr(Number(String(item).length) -1, 1)
splitFormula.map((item, index) => {
let items = String(item).substr(Number(String(item).length) - 1, 1)
let re = /^[a-zA-Z0-9_]+$/;
let asd = ''
if (item !== "") {
if (!re.test(items)) {
baru.push(String(item).substr(0, Number(String(item).length) -1))
baru.push(String(item).substr(Number(String(item).length) -1, 1))
baru.push(String(item).substr(0, Number(String(item).length) - 1))
baru.push(String(item).substr(Number(String(item).length) - 1, 1))
} else {
baru.push(String(item))
}
......@@ -481,22 +482,22 @@ export default class FixedAssetsMovement extends Component {
// console.log(baru)
// }
// console.log(baru)
baru.map((item,index) => {
baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*') {
anjay.push(item)
} else {
if (String(item).includes('#')) {
if (String(item).includes('[M-1]')) {
let tst = String(item).replace('[M-1]', '')
let data = tableMeta.columnIndex == 7? 18 : tableMeta.columnIndex - 1
let period = data == 18? Number(this.props.periode)-1 : this.props.periode
let data = tableMeta.columnIndex == 7 ? 18 : tableMeta.columnIndex - 1
let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode
// console.log(tableMeta.columnIndex)
let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
// console.log(indexID)
if (indexID !== -1) {
let valuezz = tableMeta.rowData[data].formula[indexID].value
// baru.push(valuezz)
anjay.push(valuezz == ""? 0 : valuezz)
anjay.push(valuezz == "" ? 0 : valuezz)
// console.log(valuezz)
}
} else {
......@@ -505,7 +506,7 @@ export default class FixedAssetsMovement extends Component {
if (indexID !== -1) {
// console.log(value.formula[indexID].value)
let valuezz = value.formula[indexID].value
anjay.push(valuezz == ""? 0 : valuezz)
anjay.push(valuezz == "" ? 0 : valuezz)
}
}
} else {
......@@ -513,8 +514,8 @@ export default class FixedAssetsMovement extends Component {
let indexID = dataTable2.findIndex((val) => val[22] == item)
// console.log(dataTable2[indexID][tableMeta.columnIndex])
if (indexID !== -1) {
let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value
anjay.push(valuezz == ""? 0 : valuezz)
let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined ? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
}
}
......@@ -532,7 +533,7 @@ export default class FixedAssetsMovement extends Component {
} else if (item == "/") {
opt = "bagi"
} else {
item = item == ""? 0 : item
item = item == "" ? 0 : item
if (opt == "tambah") {
total = Number(total) + Number(item)
} else if (opt == "kurang") {
......@@ -540,12 +541,13 @@ export default class FixedAssetsMovement extends Component {
} else if (opt == "kali") {
total = Number(total) * Number(item)
} else if (opt == "bagi") {
total = Number(total) / Number(item) == NaN? 0 : Number(total) / Number(item)
total = Number(total) / Number(item) == NaN ? 0 : Number(total) / Number(item)
} else {
total += Number(item)
}
}
})
total = R.equals(total, NaN) ? "0.0" : total
// console.log(dataTable2[tableMeta.rowIndex][22])
// console.log(tableMeta.rowData[5])
// if (tableMeta.rowData[5] == 'Beginning Balance') {
......@@ -587,7 +589,7 @@ export default class FixedAssetsMovement extends Component {
// }
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 7 && index <= 18) {
let valItem = item.value == undefined? item == undefined || item == "" ? 0 : item : item.value == "" ? 0 : item.value
let valItem = item.value == undefined ? item == undefined || item == "" ? 0 : item : item.value == "" ? 0 : item.value
total += Number(valItem)
}
})
......@@ -2366,7 +2368,7 @@ export default class FixedAssetsMovement extends Component {
<button
className="button"
type="button"
disabled={this.state.buttonError}
// disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
......
......@@ -110,7 +110,7 @@ export default class TaxPlanning extends Component {
{ tbc: item.formula_tax.value_tbc, fcp: item.formula_tax.value_fc, tbf: item.formula_tax.value_tbf },
item.level,
item.description,
{ tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.january.tbc, formula: item.tax_planning.january_formula } : item.tax_planning.january.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.january.fcp, formula: item.tax_planning.january_formula } : item.tax_planning.january.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.january.tbf, formula: item.tax_planning.january_formula } : item.tax_planning.january.tbf },
{ tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.january.tbc, formula: item.tax_planning.january_formula } : item.tax_planning.january.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.january.fcp, formula: item.tax_planning.january_formula } : item.tax_planning.january.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.january.tbf, formula: item.tax_planning.january_formula } : item.tax_planning.january.tbf },
{ tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.february.tbc, formula: item.tax_planning.february_formula } : item.tax_planning.february.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.february.fcp, formula: item.tax_planning.february_formula } : item.tax_planning.february.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.february.tbf, formula: item.tax_planning.february_formula } : item.tax_planning.february.tbf },
{ tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.march.tbc, formula: item.tax_planning.march_formula } : item.tax_planning.march.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.march.fcp, formula: item.tax_planning.march_formula } : item.tax_planning.march.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.march.tbf, formula: item.tax_planning.march_formula } : item.tax_planning.march.tbf },
{ tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.april.tbc, formula: item.tax_planning.april_formula } : item.tax_planning.april.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.april.fcp, formula: item.tax_planning.april_formula } : item.tax_planning.april.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.april.tbf, formula: item.tax_planning.april_formula } : item.tax_planning.april.tbf },
......@@ -222,64 +222,64 @@ export default class TaxPlanning extends Component {
data.push({
item_report_id: i[4],
january: {
tbc: String(Number(i[9].tbc).toFixed(1)),
fcp: String(Number(i[9].fcp).toFixed(1)),
tbf: String(Number(i[9].tbf).toFixed(1))
tbc: i[1] === 3 && i[9].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[9].tbc.value) : String(i[9].tbc),
fcp: i[2] === 3 && i[9].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[9].fcp.value) : String(i[9].fcp),
tbf: i[3] === 3 && i[9].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[9].tbf.value) : String(i[9].tbf)
},
february: {
tbc: String(Number(i[10].tbc).toFixed(1)),
fcp: String(Number(i[10].fcp).toFixed(1)),
tbf: String(Number(i[10].tbf).toFixed(1))
tbc: i[1] === 3 && i[10].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[10].tbc.value) : String(i[10].tbc),
fcp: i[2] === 3 && i[10].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[10].fcp.value) : String(i[10].fcp),
tbf: i[3] === 3 && i[10].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[10].tbf.value) : String(i[10].tbf)
},
march: {
tbc: String(Number(i[11].tbc).toFixed(1)),
fcp: String(Number(i[11].fcp).toFixed(1)),
tbf: String(Number(i[11].tbf).toFixed(1))
tbc: i[1] === 3 && i[11].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[11].tbc.value) : String(i[11].tbc),
fcp: i[2] === 3 && i[11].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[11].fcp.value) : String(i[11].fcp),
tbf: i[3] === 3 && i[11].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[11].tbf.value) : String(i[11].tbf)
},
april: {
tbc: String(Number(i[12].tbc).toFixed(1)),
fcp: String(Number(i[12].fcp).toFixed(1)),
tbf: String(Number(i[12].tbf).toFixed(1))
tbc: i[1] === 3 && i[12].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[12].tbc.value) : String(i[12].tbc),
fcp: i[2] === 3 && i[12].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[12].fcp.value) : String(i[12].fcp),
tbf: i[3] === 3 && i[12].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[12].tbf.value) : String(i[12].tbf)
},
may: {
tbc: String(Number(i[13].tbc).toFixed(1)),
fcp: String(Number(i[13].fcp).toFixed(1)),
tbf: String(Number(i[13].tbf).toFixed(1))
tbc: i[1] === 3 && i[13].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[13].tbc.value) : String(i[13].tbc),
fcp: i[2] === 3 && i[13].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[13].fcp.value) : String(i[13].fcp),
tbf: i[3] === 3 && i[13].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[13].tbf.value) : String(i[13].tbf)
},
june: {
tbc: String(Number(i[14].tbc).toFixed(1)),
fcp: String(Number(i[14].fcp).toFixed(1)),
tbf: String(Number(i[14].tbf).toFixed(1))
tbc: i[1] === 3 && i[14].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[14].tbc.value) : String(i[14].tbc),
fcp: i[2] === 3 && i[14].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[14].fcp.value) : String(i[14].fcp),
tbf: i[3] === 3 && i[14].tbc === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[14].tbf.value) : String(i[14].tbf)
},
july: {
tbc: String(Number(i[15].tbc).toFixed(1)),
fcp: String(Number(i[15].fcp).toFixed(1)),
tbf: String(Number(i[15].tbf).toFixed(1))
tbc: i[1] === 3 && i[15].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[15].tbc.value) : String(i[15].tbc),
fcp: i[2] === 3 && i[15].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[15].fcp.value) : String(i[15].fcp),
tbf: i[3] === 3 && i[15].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[15].tbf.value) : String(i[15].tbf)
},
august: {
tbc: String(Number(i[16].tbc).toFixed(1)),
fcp: String(Number(i[16].fcp).toFixed(1)),
tbf: String(Number(i[16].tbf).toFixed(1))
tbc: i[1] === 3 && i[16].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[16].tbc.value) : String(i[16].tbc),
fcp: i[2] === 3 && i[16].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[16].fcp.value) : String(i[16].fcp),
tbf: i[3] === 3 && i[16].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[16].tbf.value) : String(i[16].tbf)
},
september: {
tbc: String(Number(i[17].tbc).toFixed(1)),
fcp: String(Number(i[17].fcp).toFixed(1)),
tbf: String(Number(i[17].tbf).toFixed(1))
tbc: i[1] === 3 && i[17].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[17].tbc.value) : String(i[17].tbc),
fcp: i[2] === 3 && i[17].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[17].fcp.value) : String(i[17].fcp),
tbf: i[3] === 3 && i[17].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[17].tbf.value) : String(i[17].tbf)
},
october: {
tbc: String(Number(i[18].tbc).toFixed(1)),
fcp: String(Number(i[18].fcp).toFixed(1)),
tbf: String(Number(i[18].tbf).toFixed(1))
tbc: i[1] === 3 && i[18].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[18].tbc.value) : String(i[18].tbc),
fcp: i[2] === 3 && i[18].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[18].fcp.value) : String(i[18].fcp),
tbf: i[3] === 3 && i[18].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[18].tbf.value) : String(i[18].tbf)
},
november: {
tbc: String(Number(i[19].tbc).toFixed(1)),
fcp: String(Number(i[19].fcp).toFixed(1)),
tbf: String(Number(i[19].tbf).toFixed(1))
tbc: i[1] === 3 && i[19].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[19].tbc.value) : String(i[19].tbc),
fcp: i[2] === 3 && i[19].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[19].fcp.value) : String(i[19].fcp),
tbf: i[3] === 3 && i[19].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[19].tbf.value) : String(i[19].tbf)
},
december: {
tbc: String(Number(i[20].tbc).toFixed(1)),
fcp: String(Number(i[20].fcp).toFixed(1)),
tbf: String(Number(i[20].tbf).toFixed(1))
tbc: i[1] === 3 && i[20].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[20].tbc.value) : String(i[20].tbc),
fcp: i[2] === 3 && i[20].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[20].fcp.value) : String(i[20].fcp),
tbf: i[3] === 3 && i[20].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[20].tbf.value) : String(i[20].tbf)
},
total_current_year: String(Number(i[21]).toFixed(1)),
total_next_year: {
......@@ -302,7 +302,7 @@ export default class TaxPlanning extends Component {
"status": type,
"tax_planning": data
}
// console.log(JSON.stringify(payload));
console.log(JSON.stringify(payload));
this.props.saveToMasterBudget(payload)
this.props.onClickClose()
}
......@@ -585,64 +585,64 @@ export default class TaxPlanning extends Component {
data.push({
item_report_id: i[4],
january: {
tbc: i[1] === 3 && i[9].tbc === "" ? "0" : String(i[9].tbc),
fcp: i[2] === 3 && i[9].fcp === "" ? "0" : String(i[9].fcp),
tbf: i[3] === 3 && i[9].tbf === "" ? "0" : String(i[9].tbf)
tbc: i[1] === 3 && i[9].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[9].tbc.value) : String(i[9].tbc),
fcp: i[2] === 3 && i[9].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[9].fcp.value) : String(i[9].fcp),
tbf: i[3] === 3 && i[9].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[9].tbf.value) : String(i[9].tbf)
},
february: {
tbc: i[1] === 3 && i[10].tbc === "" ? "0" : String(i[10].tbc),
fcp: i[2] === 3 && i[10].fcp === "" ? "0" : String(i[10].fcp),
tbf: i[3] === 3 && i[10].tbf === "" ? "0" : String(i[10].tbf)
tbc: i[1] === 3 && i[10].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[10].tbc.value) : String(i[10].tbc),
fcp: i[2] === 3 && i[10].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[10].fcp.value) : String(i[10].fcp),
tbf: i[3] === 3 && i[10].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[10].tbf.value) : String(i[10].tbf)
},
march: {
tbc: i[1] === 3 && i[11].tbc === "" ? "0" : String(i[11].tbc),
fcp: i[2] === 3 && i[11].fcp === "" ? "0" : String(i[11].fcp),
tbf: i[3] === 3 && i[11].tbf === "" ? "0" : String(i[11].tbf)
tbc: i[1] === 3 && i[11].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[11].tbc.value) : String(i[11].tbc),
fcp: i[2] === 3 && i[11].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[11].fcp.value) : String(i[11].fcp),
tbf: i[3] === 3 && i[11].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[11].tbf.value) : String(i[11].tbf)
},
april: {
tbc: i[1] === 3 && i[12].tbc === "" ? "0" : String(i[12].tbc),
fcp: i[2] === 3 && i[12].fcp === "" ? "0" : String(i[12].fcp),
tbf: i[3] === 3 && i[12].tbf === "" ? "0" : String(i[12].tbf)
tbc: i[1] === 3 && i[12].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[12].tbc.value) : String(i[12].tbc),
fcp: i[2] === 3 && i[12].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[12].fcp.value) : String(i[12].fcp),
tbf: i[3] === 3 && i[12].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[12].tbf.value) : String(i[12].tbf)
},
may: {
tbc: i[1] === 3 && i[13].tbc === "" ? "0" : String(i[13].tbc),
fcp: i[2] === 3 && i[13].fcp === "" ? "0" : String(i[13].fcp),
tbf: i[3] === 3 && i[13].tbf === "" ? "0" : String(i[13].tbf)
tbc: i[1] === 3 && i[13].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[13].tbc.value) : String(i[13].tbc),
fcp: i[2] === 3 && i[13].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[13].fcp.value) : String(i[13].fcp),
tbf: i[3] === 3 && i[13].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[13].tbf.value) : String(i[13].tbf)
},
june: {
tbc: i[1] === 3 && i[14].tbc === "" ? "0" : String(i[14].tbc),
fcp: i[2] === 3 && i[14].fcp === "" ? "0" : String(i[14].fcp),
tbf: i[3] === 3 && i[14].tbc === "" ? "0" : String(i[14].tbf)
tbc: i[1] === 3 && i[14].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[14].tbc.value) : String(i[14].tbc),
fcp: i[2] === 3 && i[14].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[14].fcp.value) : String(i[14].fcp),
tbf: i[3] === 3 && i[14].tbc === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[14].tbf.value) : String(i[14].tbf)
},
july: {
tbc: i[1] === 3 && i[15].tbc === "" ? "0" : String(i[15].tbc),
fcp: i[2] === 3 && i[15].fcp === "" ? "0" : String(i[15].fcp),
tbf: i[3] === 3 && i[15].tbf === "" ? "0" : String(i[15].tbf)
tbc: i[1] === 3 && i[15].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[15].tbc.value) : String(i[15].tbc),
fcp: i[2] === 3 && i[15].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[15].fcp.value) : String(i[15].fcp),
tbf: i[3] === 3 && i[15].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[15].tbf.value) : String(i[15].tbf)
},
august: {
tbc: i[1] === 3 && i[16].tbc === "" ? "0" : String(i[16].tbc),
fcp: i[2] === 3 && i[16].fcp === "" ? "0" : String(i[16].fcp),
tbf: i[3] === 3 && i[16].tbf === "" ? "0" : String(i[16].tbf)
tbc: i[1] === 3 && i[16].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[16].tbc.value) : String(i[16].tbc),
fcp: i[2] === 3 && i[16].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[16].fcp.value) : String(i[16].fcp),
tbf: i[3] === 3 && i[16].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[16].tbf.value) : String(i[16].tbf)
},
september: {
tbc: i[1] === 3 && i[17].tbc === "" ? "0" : String(i[17].tbc),
fcp: i[2] === 3 && i[17].fcp === "" ? "0" : String(i[17].fcp),
tbf: i[3] === 3 && i[17].tbf === "" ? "0" : String(i[17].tbf)
tbc: i[1] === 3 && i[17].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[17].tbc.value) : String(i[17].tbc),
fcp: i[2] === 3 && i[17].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[17].fcp.value) : String(i[17].fcp),
tbf: i[3] === 3 && i[17].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[17].tbf.value) : String(i[17].tbf)
},
october: {
tbc: i[1] === 3 && i[18].tbc === "" ? "0" : String(i[18].tbc),
fcp: i[2] === 3 && i[18].fcp === "" ? "0" : String(i[18].fcp),
tbf: i[3] === 3 && i[18].tbf === "" ? "0" : String(i[18].tbf)
tbc: i[1] === 3 && i[18].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[18].tbc.value) : String(i[18].tbc),
fcp: i[2] === 3 && i[18].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[18].fcp.value) : String(i[18].fcp),
tbf: i[3] === 3 && i[18].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[18].tbf.value) : String(i[18].tbf)
},
november: {
tbc: i[1] === 3 && i[19].tbc === "" ? "0" : String(i[19].tbc),
fcp: i[2] === 3 && i[19].fcp === "" ? "0" : String(i[19].fcp),
tbf: i[3] === 3 && i[19].tbf === "" ? "0" : String(i[19].tbf)
tbc: i[1] === 3 && i[19].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[19].tbc.value) : String(i[19].tbc),
fcp: i[2] === 3 && i[19].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[19].fcp.value) : String(i[19].fcp),
tbf: i[3] === 3 && i[19].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[19].tbf.value) : String(i[19].tbf)
},
december: {
tbc: i[1] === 3 && i[20].tbc === "" ? "0" : String(i[20].tbc),
fcp: i[2] === 3 && i[20].fcp === "" ? "0" : String(i[20].fcp),
tbf: i[3] === 3 && i[20].tbf === "" ? "0" : String(i[20].tbf)
tbc: i[1] === 3 && i[20].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[20].tbc.value) : String(i[20].tbc),
fcp: i[2] === 3 && i[20].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[20].fcp.value) : String(i[20].fcp),
tbf: i[3] === 3 && i[20].tbf === "" ? "0" : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[20].tbf.value) : String(i[20].tbf)
},
total_current_year: i[2] === 3 && i[21] === "" ? "0" : String(i[21]),
total_next_year: {
......@@ -810,6 +810,7 @@ export default class TaxPlanning extends Component {
}
}
})
total = R.equals(total, NaN) ? "0.0" : total
// console.log(tableMeta.rowData[8])
// console.log(baru)
// console.log(anjay)
......@@ -820,19 +821,19 @@ export default class TaxPlanning extends Component {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = total
} else {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value = total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value = total
}
} else if (dex == 2) {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp = total
} else {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value = total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value = total
}
} else {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = total
} else {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = total
}
}
......@@ -868,7 +869,7 @@ export default class TaxPlanning extends Component {
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 9 && index <= 20) {
// console.log(item);
let valItem = item.fcp == undefined || item.fcp == "" ? 0 : item.fcp
let valItem = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0 : item.fcp
total += Number(valItem)
}
})
......
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