Commit a4e6165c authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-dev(pc)' into 'master'

depsss

See merge request !512
parents 65c9ba94 71eb6b95
......@@ -49,7 +49,6 @@ export default class BalanceSheet extends Component {
handleTekTekTek: 0,
saveDraft: true
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -103,21 +102,21 @@ export default class BalanceSheet extends Component {
item.level,
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.january,
item.balance_sheet.february,
item.balance_sheet.march,
item.balance_sheet.april,
item.balance_sheet.may,
item.balance_sheet.june,
item.balance_sheet.july,
item.balance_sheet.august,
item.balance_sheet.september,
item.balance_sheet.october,
item.balance_sheet.november,
item.balance_sheet.december,
item.balance_sheet.total_current_year,
item.balance_sheet.total_next_year,
item.balance_sheet.total_more_year,
Number(item.balance_sheet.january).toFixed(1),
Number(item.balance_sheet.february).toFixed(1),
Number(item.balance_sheet.march).toFixed(1),
Number(item.balance_sheet.april).toFixed(1),
Number(item.balance_sheet.may).toFixed(1),
Number(item.balance_sheet.june).toFixed(1),
Number(item.balance_sheet.july).toFixed(1),
Number(item.balance_sheet.august).toFixed(1),
Number(item.balance_sheet.september).toFixed(1),
Number(item.balance_sheet.october).toFixed(1),
Number(item.balance_sheet.november).toFixed(1),
Number(item.balance_sheet.december).toFixed(1),
Number(item.balance_sheet.total_current_year).toFixed(1),
Number(item.balance_sheet.total_next_year).toFixed(1),
Number(item.balance_sheet.total_more_year).toFixed(1),
item.order,
item.condition_it_should_be,
item.condition_if_wrong
......@@ -140,21 +139,21 @@ export default class BalanceSheet extends Component {
item.level,
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.january,
item.balance_sheet.february,
item.balance_sheet.march,
item.balance_sheet.april,
item.balance_sheet.may,
item.balance_sheet.june,
item.balance_sheet.july,
item.balance_sheet.august,
item.balance_sheet.september,
item.balance_sheet.october,
item.balance_sheet.november,
item.balance_sheet.december,
item.balance_sheet.total_current_year,
item.balance_sheet.total_next_year,
item.balance_sheet.total_more_year,
Number(item.balance_sheet.january).toFixed(1),
Number(item.balance_sheet.february).toFixed(1),
Number(item.balance_sheet.march).toFixed(1),
Number(item.balance_sheet.april).toFixed(1),
Number(item.balance_sheet.may).toFixed(1),
Number(item.balance_sheet.june).toFixed(1),
Number(item.balance_sheet.july).toFixed(1),
Number(item.balance_sheet.august).toFixed(1),
Number(item.balance_sheet.september).toFixed(1),
Number(item.balance_sheet.october).toFixed(1),
Number(item.balance_sheet.november).toFixed(1),
Number(item.balance_sheet.december).toFixed(1),
Number(item.balance_sheet.total_current_year).toFixed(1),
Number(item.balance_sheet.total_next_year).toFixed(1),
Number(item.balance_sheet.total_more_year).toFixed(1),
item.order,
item.condition_it_should_be,
item.condition_if_wrong
......@@ -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) {
let data = []
this.state.dataTable.map(i => {
......@@ -316,21 +288,21 @@ export default class BalanceSheet extends Component {
item.level,
item.item_report,
item.total_actual_before,
item.january,
item.february,
item.march,
item.april,
item.may,
item.june,
item.july,
item.august,
item.september,
item.october,
item.november,
item.december,
item.total_current_year,
item.total_next_year,
item.total_more_year,
Number(item.january).toFixed(1),
Number(item.february).toFixed(1),
Number(item.march).toFixed(1),
Number(item.april).toFixed(1),
Number(item.may).toFixed(1),
Number(item.june).toFixed(1),
Number(item.july).toFixed(1),
Number(item.august).toFixed(1),
Number(item.september).toFixed(1),
Number(item.october).toFixed(1),
Number(item.november).toFixed(1),
Number(item.december).toFixed(1),
Number(item.total_current_year).toFixed(1),
Number(item.total_next_year).toFixed(1),
Number(item.total_more_year).toFixed(1),
item.orders,
item.condition_it_should_be,
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