Commit 71eb6b95 authored by Deni Rinaldi's avatar Deni Rinaldi

depsss

parent 1f2de160
...@@ -49,7 +49,6 @@ export default class BalanceSheet extends Component { ...@@ -49,7 +49,6 @@ export default class BalanceSheet extends Component {
handleTekTekTek: 0, handleTekTekTek: 0,
saveDraft: true saveDraft: true
} }
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -103,21 +102,21 @@ export default class BalanceSheet extends Component { ...@@ -103,21 +102,21 @@ export default class BalanceSheet extends Component {
item.level, item.level,
item.description, item.description,
item.balance_sheet.total_actual_before === null ? "0" : item.balance_sheet.total_actual_before === "" ? "0" : item.balance_sheet.total_actual_before, item.balance_sheet.total_actual_before === null ? "0" : item.balance_sheet.total_actual_before === "" ? "0" : item.balance_sheet.total_actual_before,
item.balance_sheet.january, Number(item.balance_sheet.january).toFixed(1),
item.balance_sheet.february, Number(item.balance_sheet.february).toFixed(1),
item.balance_sheet.march, Number(item.balance_sheet.march).toFixed(1),
item.balance_sheet.april, Number(item.balance_sheet.april).toFixed(1),
item.balance_sheet.may, Number(item.balance_sheet.may).toFixed(1),
item.balance_sheet.june, Number(item.balance_sheet.june).toFixed(1),
item.balance_sheet.july, Number(item.balance_sheet.july).toFixed(1),
item.balance_sheet.august, Number(item.balance_sheet.august).toFixed(1),
item.balance_sheet.september, Number(item.balance_sheet.september).toFixed(1),
item.balance_sheet.october, Number(item.balance_sheet.october).toFixed(1),
item.balance_sheet.november, Number(item.balance_sheet.november).toFixed(1),
item.balance_sheet.december, Number(item.balance_sheet.december).toFixed(1),
item.balance_sheet.total_current_year, Number(item.balance_sheet.total_current_year).toFixed(1),
item.balance_sheet.total_next_year, Number(item.balance_sheet.total_next_year).toFixed(1),
item.balance_sheet.total_more_year, Number(item.balance_sheet.total_more_year).toFixed(1),
item.order, item.order,
item.condition_it_should_be, item.condition_it_should_be,
item.condition_if_wrong item.condition_if_wrong
...@@ -140,21 +139,21 @@ export default class BalanceSheet extends Component { ...@@ -140,21 +139,21 @@ export default class BalanceSheet extends Component {
item.level, item.level,
item.description, item.description,
item.balance_sheet.total_actual_before === null ? "0" : item.balance_sheet.total_actual_before === "" ? "0" : item.balance_sheet.total_actual_before, item.balance_sheet.total_actual_before === null ? "0" : item.balance_sheet.total_actual_before === "" ? "0" : item.balance_sheet.total_actual_before,
item.balance_sheet.january, Number(item.balance_sheet.january).toFixed(1),
item.balance_sheet.february, Number(item.balance_sheet.february).toFixed(1),
item.balance_sheet.march, Number(item.balance_sheet.march).toFixed(1),
item.balance_sheet.april, Number(item.balance_sheet.april).toFixed(1),
item.balance_sheet.may, Number(item.balance_sheet.may).toFixed(1),
item.balance_sheet.june, Number(item.balance_sheet.june).toFixed(1),
item.balance_sheet.july, Number(item.balance_sheet.july).toFixed(1),
item.balance_sheet.august, Number(item.balance_sheet.august).toFixed(1),
item.balance_sheet.september, Number(item.balance_sheet.september).toFixed(1),
item.balance_sheet.october, Number(item.balance_sheet.october).toFixed(1),
item.balance_sheet.november, Number(item.balance_sheet.november).toFixed(1),
item.balance_sheet.december, Number(item.balance_sheet.december).toFixed(1),
item.balance_sheet.total_current_year, Number(item.balance_sheet.total_current_year).toFixed(1),
item.balance_sheet.total_next_year, Number(item.balance_sheet.total_next_year).toFixed(1),
item.balance_sheet.total_more_year, Number(item.balance_sheet.total_more_year).toFixed(1),
item.order, item.order,
item.condition_it_should_be, item.condition_it_should_be,
item.condition_if_wrong item.condition_if_wrong
...@@ -173,33 +172,6 @@ export default class BalanceSheet extends Component { ...@@ -173,33 +172,6 @@ export default class BalanceSheet extends Component {
} }
} }
handleValue(data) {
let total = 0
this.state.dataTable.map((item, index) => {
if (data.rowData[1] === item[2]) {
total = item[data.columnIndex] === undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex]))
}
})
let indexParent = this.state.dataTable.findIndex((val) => val[1] === this.state.dataTable[data.rowIndex][2])
let a = this.state.dataTable[data.rowIndex][data.columnIndex] = total
// console.log(indexParent);
return a
}
handleChange(value, tableMeta) {
let val = String(value).split(",").join("")
let data = this.state.dataTable
let indexParent = data.findIndex((val) => val[1] === data[tableMeta.rowIndex][2])
if (indexParent > 0) {
// console.log(indexParent)
let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
let jagain = data[indexParent][tableMeta.columnIndex]
a = data[indexParent][tableMeta.columnIndex] = jagain === undefined ? (0 + Number(val)) : (jagain + Number(val))
} else {
data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
}
}
backToMasterBudget(type) { backToMasterBudget(type) {
let data = [] let data = []
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
...@@ -316,21 +288,21 @@ export default class BalanceSheet extends Component { ...@@ -316,21 +288,21 @@ export default class BalanceSheet extends Component {
item.level, item.level,
item.item_report, item.item_report,
item.total_actual_before, item.total_actual_before,
item.january, Number(item.january).toFixed(1),
item.february, Number(item.february).toFixed(1),
item.march, Number(item.march).toFixed(1),
item.april, Number(item.april).toFixed(1),
item.may, Number(item.may).toFixed(1),
item.june, Number(item.june).toFixed(1),
item.july, Number(item.july).toFixed(1),
item.august, Number(item.august).toFixed(1),
item.september, Number(item.september).toFixed(1),
item.october, Number(item.october).toFixed(1),
item.november, Number(item.november).toFixed(1),
item.december, Number(item.december).toFixed(1),
item.total_current_year, Number(item.total_current_year).toFixed(1),
item.total_next_year, Number(item.total_next_year).toFixed(1),
item.total_more_year, Number(item.total_more_year).toFixed(1),
item.orders, item.orders,
item.condition_it_should_be, item.condition_it_should_be,
item.condition_if_wrong, item.condition_if_wrong,
......
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