Commit c7f03c84 authored by syadziy's avatar syadziy

update issue tia

parent 02463a4b
...@@ -674,8 +674,34 @@ export default class BalanceSheetOLPA extends Component { ...@@ -674,8 +674,34 @@ export default class BalanceSheetOLPA extends Component {
return a return a
} }
const handleTotal = (tableMeta) => {
let total = 0
tableMeta.rowData.map((item, index) => {
if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd") {
console.log(index)
if (index >= 7 && index <= 18) {
console.log(item.value + "aaa")
if (item.value == undefined) {
total += Number(item)
} else {
total += Number(item.value)
}
}
}
})
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value == undefined) {
// console.log([tableMeta.rowIndex][tableMeta.columnIndex])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value = total
}
console.log(total)
return total
}
const handleValueFormula = (value, tableMeta, column, periode, forecast) => { const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
// console.log(value)
// console.log(tableMeta.rowData[5])
let splitFormula = String(tableMeta.rowData[3]).split('@') let splitFormula = String(tableMeta.rowData[3]).split('@')
let baru = [] let baru = []
let anjay = [] let anjay = []
...@@ -769,7 +795,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -769,7 +795,7 @@ export default class BalanceSheetOLPA extends Component {
}) })
// console.log(baru) // console.log(baru)
// console.log(anjay) // console.log(anjay)
// if (tableMeta.rowData[5] == 'Profit (loss) MTD') { // if (tableMeta.rowData[5] == 'TOTAL CURRENT ASSETS') {
// console.log(splitFormula) // console.log(splitFormula)
// console.log(baru) // console.log(baru)
// console.log(anjay) // console.log(anjay)
...@@ -1718,7 +1744,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -1718,7 +1744,7 @@ export default class BalanceSheetOLPA extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd" ? Number(handleTotal(tableMeta)).toFixed(1) : Number(handleForecast(tableMeta, `${Number(this.props.periode)}`, 19)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
......
This diff is collapsed.
...@@ -428,7 +428,7 @@ export default class ProfitLossOLPA extends Component { ...@@ -428,7 +428,7 @@ export default class ProfitLossOLPA extends Component {
}) })
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[23].length > 0) { if (item[24].length > 0) {
console.log('masuk') console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true }) this.setState({ buttonError: true, errorPreview: true, editable: true })
} }
......
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