Commit dfe71b76 authored by d.arizona's avatar d.arizona

update issue locf and mb bs

parent 1dc81eb8
......@@ -140,7 +140,7 @@ export default class BalanceSheet extends Component {
"submission_id": this.props.submissionID
}
let response = await api.create().getDetailReportMB(payload)
// console.log(response);
console.log(response);
let dataTable = []
if (response.data) {
let res = response.data.data
......@@ -535,20 +535,36 @@ export default class BalanceSheet extends Component {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta, type) => {
let val = String(value).split(",").join("")
// console.log('masuk')
if (type === "actual") {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val).toFixed(1)
} else {
// console.log('masuk2')
let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2])
if (indexParent > 0) {
// console.log(indexParent)
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
let a = 0
if (type == 'r/e') {
// console.log('masuk8')
a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value = Number(val).toFixed(1)
} else {
// console.log('masuk9')
a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val).toFixed(1)
}
let jagain = dataTable2[indexParent][tableMeta.columnIndex]
a = dataTable2[indexParent][tableMeta.columnIndex] = jagain === undefined ? (0 + Number(val)).toFixed(1) : Number(jagain + Number(val)).toFixed(1)
} else {
// console.log('masuk3')
if (type == 'r/e') {
// console.log('masuk4')
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value = Number(val).toFixed(1)
} else {
// console.log('masuk5')
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val).toFixed(1)
}
}
}
}
const handleTotal = (tableMeta) => {
let total = dataTable2[tableMeta.rowIndex][19] = dataTable2[tableMeta.rowIndex][18]
return total
......@@ -577,7 +593,12 @@ export default class BalanceSheet extends Component {
// console.log(tableMeta.rowIndex)
// console.log(total)
// dataTable2[tableMeta.rowIndex][column] = total
if (column == 19 && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)") {
total = tableMeta.rowData[7].value
dataTable2[tableMeta.rowIndex][column] = tableMeta.rowData[7].value
} else {
total = handleValueFormula(dataTable2[tableMeta.rowIndex][column], tableMeta, column, periode, dataTable2[tableMeta.rowIndex][25])
}
// console.log(total)
return total
}
......@@ -969,8 +990,12 @@ export default class BalanceSheet extends Component {
style={{ color: String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? '#5198ea' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : (String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? false : true))}
disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? Number(value.value).toFixed(1) : Number(handleValueFormula(value, tableMeta)).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 'r/e')
// console.log(dataTable2)
}}
/>
:
tableMeta.rowData[0] === 5 ?
......@@ -979,8 +1004,12 @@ export default class BalanceSheet extends Component {
style={{ color: String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? '#5198ea' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : (String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? false : true))}
disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? Number(value.value).toFixed(1) : Number(handleValueFormula(value, tableMeta)).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 'r/e')
// console.log(dataTable2)
}}
/>
:
tableMeta.rowData[0] === 1 ?
......
......@@ -2461,7 +2461,7 @@ export default class ListOfCreditFacilities extends Component {
// </div>
:
<div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.state.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: this.state.get_for == 'view'? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[18]}
<textarea disabled={this.state.get_for == 'view'? true : tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Others'? false : true} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: this.state.get_for == 'view'? 'black' : tableMeta.rowData[7] == null? 'black' : tableMeta.rowData[7].value == 'Others'? '#5198ea' : 'black' , backgroundColor: this.state.get_for == 'view'? 'white' : tableMeta.rowData[7] == null? 'white' : (tableMeta.rowData[18] == '' && tableMeta.rowData[7].value == 'Others' ? '#ffac99' : 'white') }} type="text" defaultValue={tableMeta.rowData[18]}
onBlur={(event) => handleChange(event.target.value, tableMeta, 18)} />
</div>
}
......
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