Commit 9afbb74f authored by Riri Novita's avatar Riri Novita

Issue

parent 04cb795b
......@@ -149,7 +149,7 @@ export default class LOCF extends Component {
if (this.props.dataTablelocf !== prevProps.dataTablelocf) {
let array = this.props.dataTablelocf
let datas = array[array.length - 1]
this.setState({ dataTable: this.props.dataTablelocf, diff: datas[47], loanTotal: datas[48], perBS: datas[49] })
this.setState({ dataTable: this.props.dataTablelocf, diff: this.props.defaultCurrency.id == 1 ? fixNumber(Number(datas[47]), 1) : datas[47], loanTotal: datas[48], perBS: this.props.defaultCurrency.id == 1 ? fixNumber(Number(datas[49]), 1) : datas[49] })
}
if (this.props.loadingChild !== prevProps.loadingChild) {
this.setState({ loading: this.props.loadingChild })
......@@ -353,7 +353,7 @@ export default class LOCF extends Component {
// let sortingTable = dataTable.sort((a, b) => a[6].value - b[6].value)
// console.log(sortingTable);
let lastArray = dataTable[res.length - 1]
this.setState({ dataTable, diff: lastArray[47], loanTotal: lastArray[48], perBS: lastArray[49], loading: false, visibleLOCFMR: true }, () => {
this.setState({ dataTable, diff: this.props.defaultCurrency.id == 1 ? fixNumber(Number(lastArray[47]), 1) : lastArray[47], loanTotal: lastArray[48], perBS: this.props.defaultCurrency.id == 1 ? fixNumber(Number(lastArray[49]), 1) : lastArray[49], loading: false, visibleLOCFMR: true }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOCF')
})
}
......@@ -565,10 +565,8 @@ export default class LOCF extends Component {
console.log(dataTable);
let lastArray = dataTable[dataTable.length - 1]
console.log(lastArray);
this.setState({ dataTable, diff: lastArray[47], loanTotal: lastArray[48], perBS: lastArray[49], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => {
console.log(this.state.visibleLOCFMR);
this.props.sendToParent(dataTable, lastArray , 'LOCF', 'upload', this.state.visibleLOCFMR)
this.setState({ dataTable, diff: this.props.defaultCurrency.id == 1 ? fixNumber(Number(lastArray[47]), 1) : lastArray[47], loanTotal: lastArray[48], perBS: this.props.defaultCurrency.id == 1 ? fixNumber(Number(lastArray[49]), 1) : lastArray[49], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOCF', 'upload', this.state.visibleLOCFMR)
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, typeAlert: 'warning', loading: false }, () => {
......@@ -3619,7 +3617,7 @@ export default class LOCF extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b' }}>Diff</Typography>
</div>
<div style={{ borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}>
<Typography style={{ fontSize: '14px', color: Number(this.state.diff) > 0 ? 'red' : '#4b4b4b' }}><NumberFormat value={this.state.diff} displayType={'text'} thousandSeparator={true} prefix={''} /></Typography>
<Typography style={{ fontSize: '14px', color: Number(this.state.diff) > '0.0' || Number(this.state.diff) < '0.0' ? 'red' : '#4b4b4b' }}><NumberFormat value={this.state.diff == 0 ? "0.0" : this.state.diff} displayType={'text'} thousandSeparator={true} prefix={''} /></Typography>
</div>
</div>
</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