Commit f215313d authored by Riri Novita's avatar Riri Novita

Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'

LOV Done

See merge request !2193
parents 398f145e 7e58bf90
......@@ -553,8 +553,7 @@ const create = (type = "") => {
const getTypeOfInvestment = () => api.get('setting_type/get_all_setting_type_by_investment')
const validateSaveLOV = (body) => api.post('transaction/lov/monthly_report/validate_save', body)
const validateSaveLOCF = (body) => api.post('transaction/locf/monthly_report/validate_save', body)
const uploadMonthlyReportLOV = (body) => api.post('transaction/lov/monthly_report/import_monthly_report', body)
const createMonthlyReportLOV = (body) => api.post('transaction/lov/monthly_report/create_monthly_report', body)
const createMonthlyReportLOV = (body) => api.post('transaction/lov/monthly_report/save_monthly_report', body)
// Superadmin Approve
......@@ -961,7 +960,6 @@ const create = (type = "") => {
getTypeOfInvestment,
validateSaveLOCF,
validateSaveLOV,
uploadMonthlyReportLOV,
createMonthlyReportLOV
}
......
This diff is collapsed.
......@@ -148,7 +148,7 @@ export default class LOV extends Component {
let array = this.props.dataTablelov
let datas = array[array.length - 1]
console.log(datas);
this.setState({ dataTable: this.props.dataTablelov, diff: datas[16], perBS: datas[18] })
this.setState({ dataTable: this.props.dataTablelov, diff: datas[16], loanTotal: datas[17], perBS: datas[18] })
}
if (this.props.loadingChild !== prevProps.loadingChild) {
this.setState({ loading: this.props.loadingChild })
......@@ -286,7 +286,7 @@ export default class LOV extends Component {
console.log(dataTable)
let lastArray = dataTable[res.length - 1]
console.log(lastArray);
this.setState({ dataTable, diff: lastArray[16], perBS: lastArray[18], loading: false, visibleLOVMR: true }, () => {
this.setState({ dataTable, diff: lastArray[16], loanTotal: lastArray[17], perBS: lastArray[18], loading: false, visibleLOVMR: true }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOV')
})
}
......@@ -369,7 +369,7 @@ export default class LOV extends Component {
"lov": payload,
"per_bs": this.state.perBS,
"diff": this.state.diff,
"total_loan": this.state.perBS
"total_loan": this.state.loanTotal
}
console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
......@@ -475,7 +475,7 @@ export default class LOV extends Component {
})
console.log(dataTable)
let lastArray = dataTable[dataTable.length - 1]
this.setState({ dataTable, diff: lastArray[16], perBS: lastArray[18], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => {
this.setState({ dataTable, diff: lastArray[16], loanTotal: lastArray[17], perBS: lastArray[18], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOV', 'upload', this.state.visibleLOVMR)
})
} else {
......@@ -1770,7 +1770,7 @@ export default class LOV 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} displayType={'text'} thousandSeparator={true} prefix={''} /></Typography>
</div>
</div>
</div>
......@@ -1874,7 +1874,7 @@ export default class LOV 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} displayType={'text'} thousandSeparator={true} prefix={''} /></Typography>
</div>
</div>
</div>
......
......@@ -116,8 +116,10 @@ export default class ListOfCreditFacilities extends Component {
totalOutStand: 0,
diffLOCF: 0,
perBSLOCF: 0,
totalLoanLOCF: 0,
diffLOV: 0,
perBSLOV: 0,
totalLoanLOV: 0,
snekbar: false,
snekbarMsg: '',
visibleParent: true,
......@@ -161,10 +163,10 @@ export default class ListOfCreditFacilities extends Component {
switch (params) {
case "LOV":
console.log(data);
this.setState({ dataTableLOV: data, diffLOV: array[16], perBSLOV: array[18], tambahLOV: type, visibleParent: visibleView == undefined ? true : visibleView })
this.setState({ dataTableLOV: data, diffLOV: array[16], totalLoanLOV: array[17], perBSLOV: array[18], tambahLOV: type, visibleParent: visibleView == undefined ? true : visibleView })
break;
case "LOCF":
this.setState({ dataTableLOCF: data, diffLOCF: array[46], perBSLOCF: array[48], tambah: type, visibleParent: visibleView == undefined ? true : visibleView })
this.setState({ dataTableLOCF: data, diffLOCF: array[46], totalLoanLOCF: array[47] , perBSLOCF: array[48], tambah: type, visibleParent: visibleView == undefined ? true : visibleView })
break
default:
break;
......@@ -577,9 +579,9 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id,
"locf": data,
"per_bs": this.state.perBS,
"diff": this.state.diff,
"total_loan": this.state.perBS
"per_bs": this.state.perBSLOCF,
"diff": this.state.diffLOCF,
"total_loan": this.state.totalLoanLOCF
}
console.log(body);
if (error && type == 'submitted') {
......@@ -678,9 +680,9 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id,
"lov": data,
"per_bs": this.state.perBS,
"diff": this.state.diff,
"total_loan": this.state.perBS
"per_bs": this.state.perBSLOV,
"diff": this.state.diffLOV,
"total_loan": this.state.totalLoanLOV
}
console.log(body);
if (error && type == 'submitted') {
......@@ -844,7 +846,7 @@ export default class ListOfCreditFacilities extends Component {
"locf": data,
"per_bs": this.state.perBSLOCF,
"diff": this.state.diffLOCF,
"total_loan": this.state.perBSLOCF
"total_loan": this.state.totalLoanLOCF
}
console.log(body);
api.create().validateSaveLOCF(body).then((response) => {
......@@ -994,7 +996,7 @@ export default class ListOfCreditFacilities extends Component {
this.setState({ saveDraft: false, saveComp: lastArrayLOCF[46] == 0 || lastArrayLOCF[46] == '0.0' || lastArrayLOCF[46] == "-0.0" ? false : true })
}
}
this.setState({ dataTablelocf, diffLOCF: lastArrayLOCF[46], perBSLOCF: lastArrayLOCF[48], loading: false }, () => {
this.setState({ dataTablelocf, diffLOCF: lastArrayLOCF[46], totalLoanLOCF: lastArrayLOCF[47], perBSLOCF: lastArrayLOCF[48], loading: false }, () => {
this.handleCalculateLOV()
})
}
......@@ -1068,7 +1070,7 @@ export default class ListOfCreditFacilities extends Component {
"lov": data,
"per_bs": this.state.perBSLOV,
"diff": this.state.diffLOV,
"total_loan": this.state.perBSLOV
"total_loan": this.state.totalLoanLOV
}
console.log(body);
api.create().validateSaveLOV(body).then((response) => {
......@@ -1157,7 +1159,7 @@ export default class ListOfCreditFacilities extends Component {
this.setState({ saveDraft: false, saveCompLOV: lastArrayLOV[16] == 0 || lastArrayLOV[16] == '0.0' || lastArrayLOV[16] == "-0.0" ? false : true })
}
}
this.setState({ dataTablelov, diffLOV: lastArrayLOV[16], perBSLOV: lastArrayLOV[18], loading: false, loadingChild: false }, () => {
this.setState({ dataTablelov, diffLOV: lastArrayLOV[16], totalLoanLOV: lastArrayLOV[17], perBSLOV: lastArrayLOV[18], loading: false, loadingChild: false }, () => {
// this.handleCalculateLOV()
})
} else {
......@@ -1294,9 +1296,9 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id,
"locf": data,
"per_bs": this.state.perBS,
"diff": this.state.diff,
"total_loan": this.state.perBS
"per_bs": this.state.perBSLOCF,
"diff": this.state.diffLOCF,
"total_loan": this.state.totalLoanLOCF
}
console.log(body);
if (error && type == 'submitted') {
......@@ -1398,15 +1400,15 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id,
"lov": data,
"per_bs": this.state.perBS,
"diff": this.state.diff,
"total_loan": this.state.perBS
"per_bs": this.state.perBSLOV,
"diff": this.state.diffLOV,
"total_loan": this.state.totalLoanLOV
}
console.log(body);
if (error && type == 'submitted') {
this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 })
} else {
api.create('UPLOAD').uploadMonthlyReportLOV(body).then(response => {
api.create('UPLOAD').createMonthlyReportLOV(body).then(response => {
console.log(response);
if (response.data) {
if (response.ok) {
......@@ -1444,9 +1446,6 @@ export default class ListOfCreditFacilities extends Component {
render() {
let dataTable2 = this.state.dataTable
let loading = this.state.loading
let totalLoan = 0
const loadingComponent = (
<div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
......@@ -1579,7 +1578,7 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none',
marginRight: 20
}}
onClick={() => this.setState({ totalOutStand: totalLoan, saveTambahan: false, loadingChild: true }, () => {
onClick={() => this.setState({ saveTambahan: false, loadingChild: true }, () => {
setTimeout(() => {
this.handleCalculateLOCF()
}, 100);
......@@ -1725,7 +1724,7 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none',
marginRight: 20
}}
onClick={() => this.setState({ totalOutStand: totalLoan, saveTambahan: false, loadingChild: true }, () => {
onClick={() => this.setState({saveTambahan: false, loadingChild: true }, () => {
this.handleCalculateLOCF()
})}
>
......
......@@ -620,7 +620,7 @@ export default class BalanceSheetOLPA extends Component {
let err = false
let dataTable = this.state.dataTable
let kansas = this.state.kansas
console.log(this.state.dataTable)
// console.log(this.state.dataTable)
dataTable.map((i, index) => {
if (String(i[5]) == "Control (should be nil)") {
// console.log(this.state.minValue)
......
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