Commit 6875717e authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

Didam

See merge request !841
parents 7ff858c5 cc099446
...@@ -762,7 +762,7 @@ export default class BudgetTahunan extends Component { ...@@ -762,7 +762,7 @@ export default class BudgetTahunan extends Component {
}) })
} }
} else { } 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() this.getSubmission()
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
}) })
......
...@@ -442,7 +442,7 @@ export default class BalanceSheet extends Component { ...@@ -442,7 +442,7 @@ export default class BalanceSheet extends Component {
}) })
} }
} else { } 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 { ...@@ -670,7 +670,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
} }
} else { } 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 { ...@@ -447,7 +447,7 @@ export default class FixedAssetsMovement extends Component {
} else { } else {
// this.setState({ loading: false }) // this.setState({ loading: false })
// alert(response.problem) // 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 { ...@@ -447,7 +447,7 @@ export default class ProfitLoss extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
} }
} else { } 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 { ...@@ -632,7 +632,7 @@ export default class TaxPlanning extends Component {
// alert(response.data.status) // alert(response.data.status)
} }
} else { } 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 { ...@@ -430,6 +430,7 @@ export default class BalanceSheetMR extends Component {
} }
api.create('UPLOAD').createMonthlyReportBS(payload).then(response => { api.create('UPLOAD').createMonthlyReportBS(payload).then(response => {
console.log(response); console.log(response);
console.log(JSON.stringify(payload))
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
......
...@@ -1202,6 +1202,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1202,6 +1202,7 @@ export default class ListOfCreditFacilities extends Component {
let loading = this.state.loading let loading = this.state.loading
let dataTampungBank = [] let dataTampungBank = []
let indexNyasar = false let indexNyasar = false
let totalLoan = 0
const handleAction = (typeReport, tableMeta, typeButton) => { const handleAction = (typeReport, tableMeta, typeButton) => {
// console.log(typeReport) // console.log(typeReport)
...@@ -1221,6 +1222,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1221,6 +1222,7 @@ export default class ListOfCreditFacilities extends Component {
} }
const handleChange = (value, tableMeta, column, typeChange, typeDrop) => { const handleChange = (value, tableMeta, column, typeChange, typeDrop) => {
let val = ''
if (typeChange == 'date') { if (typeChange == 'date') {
dataTable2[tableMeta.rowIndex][column] = format(value, 'yyyy-MM-dd') dataTable2[tableMeta.rowIndex][column] = format(value, 'yyyy-MM-dd')
this.setState({loading: true}, () => { this.setState({loading: true}, () => {
...@@ -1228,12 +1230,13 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1228,12 +1230,13 @@ export default class ListOfCreditFacilities extends Component {
}) })
} else { } 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 ) { 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("") val = String(value).split(",").join("")
value = Number(value).toFixed(2) val = Number(val).toFixed(2)
} else { } else {
value = String(value).split(",").join("") val = String(value).split(",").join("")
} }
dataTable2[tableMeta.rowIndex][column] = value
if (value.value !== undefined) { if (value.value !== undefined) {
if (value.value == 'Investment Loan') { if (value.value == 'Investment Loan') {
dataTable2[tableMeta.rowIndex][16] = 0 dataTable2[tableMeta.rowIndex][16] = 0
...@@ -1253,8 +1256,14 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1253,8 +1256,14 @@ export default class ListOfCreditFacilities extends Component {
dataTable2[tableMeta.rowIndex][16] = 0 dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = 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) => { const handleValueDropDown = (value, type, tableMeta) => {
...@@ -1306,6 +1315,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1306,6 +1315,9 @@ export default class ListOfCreditFacilities extends Component {
valuez += Number(item[column]) valuez += Number(item[column])
} }
}) })
if (column == 22) {
totalLoan = valuez
}
} else { } else {
if (column == 21) { if (column == 21) {
valuez = Number(tableMeta.rowData[14]) + Number(tableMeta.rowData[16]) + Number(tableMeta.rowData[19]) valuez = Number(tableMeta.rowData[14]) + Number(tableMeta.rowData[16]) + Number(tableMeta.rowData[19])
...@@ -1317,7 +1329,6 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1317,7 +1329,6 @@ export default class ListOfCreditFacilities extends Component {
valuez = Number(tableMeta.rowData[13]) - Number(tableMeta.rowData[22]) valuez = Number(tableMeta.rowData[13]) - Number(tableMeta.rowData[22])
} }
} }
dataTable2[tableMeta.rowIndex][column] = valuez dataTable2[tableMeta.rowIndex][column] = valuez
return valuez return valuez
} }
...@@ -3593,7 +3604,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3593,7 +3604,7 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none' 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> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
...@@ -3611,7 +3622,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3611,7 +3622,9 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none', outline: 'none',
marginRight: 20 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' }}> <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> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
...@@ -3639,7 +3652,11 @@ export default class ListOfCreditFacilities extends Component { ...@@ -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' }}> <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> </div>
</button> </button>
<button <button
...@@ -3664,7 +3681,11 @@ export default class ListOfCreditFacilities extends Component { ...@@ -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 }}> <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> </div>
</button> </button>
</div> </div>
...@@ -3737,7 +3758,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3737,7 +3758,7 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none' 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> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
...@@ -3755,7 +3776,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3755,7 +3776,9 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none', outline: 'none',
marginRight: 20 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' }}> <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> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
...@@ -3783,7 +3806,13 @@ export default class ListOfCreditFacilities extends Component { ...@@ -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' }}> <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> </div>
</button> </button>
<button <button
...@@ -3808,7 +3837,13 @@ export default class ListOfCreditFacilities extends Component { ...@@ -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 }}> <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> </div>
</button> </button>
</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