Commit 8df349a2 authored by d.arizona's avatar d.arizona

update

parent deb4e1c1
......@@ -762,7 +762,7 @@ export default class BudgetTahunan extends Component {
})
}
} else {
this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false }, () => {
this.setState({ alert: true, messageAlert: 'Error saving data. Please try again', tipeAlert: 'error', loading: false }, () => {
this.getSubmission()
document.body.style.overflow = 'unset';
})
......
......@@ -442,7 +442,7 @@ export default class BalanceSheet extends Component {
})
}
} else {
this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Error saving data. Please try again', tipeAlert: 'error', loading: false })
}
})
}
......
......@@ -670,7 +670,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Error saving data. Please try again', tipeAlert: 'error', loading: false })
}
})
}
......
......@@ -447,7 +447,7 @@ export default class FixedAssetsMovement extends Component {
} else {
// this.setState({ loading: false })
// alert(response.problem)
this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Error saving data. Please try again', tipeAlert: 'error', loading: false })
}
})
}
......
......@@ -447,7 +447,7 @@ export default class ProfitLoss extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Error saving data. Please try again', tipeAlert: 'error', loading: false })
}
})
}
......
......@@ -632,7 +632,7 @@ export default class TaxPlanning extends Component {
// alert(response.data.status)
}
} else {
this.setState({ loading: false, alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error' })
this.setState({ loading: false, alert: true, messageAlert: 'Error saving data. Please try again', tipeAlert: 'error' })
}
})
}
......
......@@ -430,6 +430,7 @@ export default class BalanceSheetMR extends Component {
}
api.create('UPLOAD').createMonthlyReportBS(payload).then(response => {
console.log(response);
console.log(JSON.stringify(payload))
if (response.data) {
if (response.data.status === "success") {
this.props.saveToMonthlyReport()
......
......@@ -1202,6 +1202,7 @@ export default class ListOfCreditFacilities extends Component {
let loading = this.state.loading
let dataTampungBank = []
let indexNyasar = false
let totalLoan = 0
const handleAction = (typeReport, tableMeta, typeButton) => {
// console.log(typeReport)
......@@ -1221,6 +1222,7 @@ export default class ListOfCreditFacilities extends Component {
}
const handleChange = (value, tableMeta, column, typeChange, typeDrop) => {
let val = ''
if (typeChange == 'date') {
dataTable2[tableMeta.rowIndex][column] = format(value, 'yyyy-MM-dd')
this.setState({loading: true}, () => {
......@@ -1228,12 +1230,13 @@ export default class ListOfCreditFacilities extends Component {
})
} else {
if (column != 8 && column != 11 && column != 18 && column != 25 && column != 27 && column != 29 && column != 31 && column != 33 && column != 36 && column != 39 && column != 42 && column != 45 ) {
value = String(value).split(",").join("")
value = Number(value).toFixed(2)
val = String(value).split(",").join("")
val = Number(val).toFixed(2)
} else {
value = String(value).split(",").join("")
val = String(value).split(",").join("")
}
dataTable2[tableMeta.rowIndex][column] = value
if (value.value !== undefined) {
if (value.value == 'Investment Loan') {
dataTable2[tableMeta.rowIndex][16] = 0
......@@ -1253,8 +1256,14 @@ export default class ListOfCreditFacilities extends Component {
dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = 0
}
dataTable2[tableMeta.rowIndex][column] = value
} else {
dataTable2[tableMeta.rowIndex][column] = val
}
}
console.log(dataTable2[tableMeta.rowIndex][column]);
console.log(value)
console.log(String(value).split(",").join(""))
}
const handleValueDropDown = (value, type, tableMeta) => {
......@@ -1306,6 +1315,9 @@ export default class ListOfCreditFacilities extends Component {
valuez += Number(item[column])
}
})
if (column == 22) {
totalLoan = valuez
}
} else {
if (column == 21) {
valuez = Number(tableMeta.rowData[14]) + Number(tableMeta.rowData[16]) + Number(tableMeta.rowData[19])
......@@ -1317,7 +1329,6 @@ export default class ListOfCreditFacilities extends Component {
valuez = Number(tableMeta.rowData[13]) - Number(tableMeta.rowData[22])
}
}
dataTable2[tableMeta.rowIndex][column] = valuez
return valuez
}
......@@ -3593,7 +3604,7 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none'
}}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginLeft: 10}}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div>
</button>
......@@ -3611,7 +3622,9 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none',
marginRight: 20
}}
onClick={() => this.handleCalculate()}
onClick={() => this.setState({totalOutStand: totalLoan}, () => {
this.handleCalculate()
})}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
......@@ -3639,7 +3652,11 @@ export default class ListOfCreditFacilities extends Component {
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
{this.state.saveDraft? <LightTooltip title={'Data Incomplete'} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>}
</div>
</button>
<button
......@@ -3664,7 +3681,11 @@ export default class ListOfCreditFacilities extends Component {
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
{this.state.saveComp? <LightTooltip title={'Data Incomplete / Total Diff must be 0'} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>}
</div>
</button>
</div>
......@@ -3737,7 +3758,7 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none'
}}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginLeft: 10 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div>
</button>
......@@ -3755,7 +3776,9 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none',
marginRight: 20
}}
onClick={() => this.handleCalculate()}
onClick={() => this.setState({totalOutStand: totalLoan}, () => {
this.handleCalculate()
})}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
......@@ -3783,7 +3806,13 @@ export default class ListOfCreditFacilities extends Component {
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
{this.state.saveDraft ?
<LightTooltip title={'Data Incomplete'} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div>
</button>
<button
......@@ -3808,7 +3837,13 @@ export default class ListOfCreditFacilities extends Component {
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
{this.state.saveComp ?
<LightTooltip title={'Data Incomplete / Total Diff must be 0'} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
}
</div>
</button>
</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