Commit 7e58bf90 authored by Riri Novita's avatar Riri Novita

Merge branch 'dev-riri' into 'ENV-DEV'

LOV Done

See merge request !2192
parents fcc16ad8 45b2ef78
...@@ -553,8 +553,7 @@ const create = (type = "") => { ...@@ -553,8 +553,7 @@ const create = (type = "") => {
const getTypeOfInvestment = () => api.get('setting_type/get_all_setting_type_by_investment') 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 validateSaveLOV = (body) => api.post('transaction/lov/monthly_report/validate_save', body)
const validateSaveLOCF = (body) => api.post('transaction/locf/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/save_monthly_report', body)
const createMonthlyReportLOV = (body) => api.post('transaction/lov/monthly_report/create_monthly_report', body)
// Superadmin Approve // Superadmin Approve
...@@ -961,7 +960,6 @@ const create = (type = "") => { ...@@ -961,7 +960,6 @@ const create = (type = "") => {
getTypeOfInvestment, getTypeOfInvestment,
validateSaveLOCF, validateSaveLOCF,
validateSaveLOV, validateSaveLOV,
uploadMonthlyReportLOV,
createMonthlyReportLOV createMonthlyReportLOV
} }
......
This diff is collapsed.
...@@ -148,7 +148,7 @@ export default class LOV extends Component { ...@@ -148,7 +148,7 @@ export default class LOV extends Component {
let array = this.props.dataTablelov let array = this.props.dataTablelov
let datas = array[array.length - 1] let datas = array[array.length - 1]
console.log(datas); 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) { if (this.props.loadingChild !== prevProps.loadingChild) {
this.setState({ loading: this.props.loadingChild }) this.setState({ loading: this.props.loadingChild })
...@@ -286,7 +286,7 @@ export default class LOV extends Component { ...@@ -286,7 +286,7 @@ export default class LOV extends Component {
console.log(dataTable) console.log(dataTable)
let lastArray = dataTable[res.length - 1] let lastArray = dataTable[res.length - 1]
console.log(lastArray); 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') this.props.sendToParent(dataTable, lastArray, 'LOV')
}) })
} }
...@@ -369,7 +369,7 @@ export default class LOV extends Component { ...@@ -369,7 +369,7 @@ export default class LOV extends Component {
"lov": payload, "lov": payload,
"per_bs": this.state.perBS, "per_bs": this.state.perBS,
"diff": this.state.diff, "diff": this.state.diff,
"total_loan": this.state.perBS "total_loan": this.state.loanTotal
} }
console.log(body) console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
...@@ -475,7 +475,7 @@ export default class LOV extends Component { ...@@ -475,7 +475,7 @@ export default class LOV extends Component {
}) })
console.log(dataTable) console.log(dataTable)
let lastArray = dataTable[dataTable.length - 1] 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) this.props.sendToParent(dataTable, lastArray, 'LOV', 'upload', this.state.visibleLOVMR)
}) })
} else { } else {
...@@ -1770,7 +1770,7 @@ export default class LOV extends Component { ...@@ -1770,7 +1770,7 @@ export default class LOV extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b' }}>Diff</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b' }}>Diff</Typography>
</div> </div>
<div style={{ borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}> <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> </div>
</div> </div>
...@@ -1874,7 +1874,7 @@ export default class LOV extends Component { ...@@ -1874,7 +1874,7 @@ export default class LOV extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b' }}>Diff</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b' }}>Diff</Typography>
</div> </div>
<div style={{ borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}> <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> </div>
</div> </div>
......
...@@ -116,8 +116,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -116,8 +116,10 @@ export default class ListOfCreditFacilities extends Component {
totalOutStand: 0, totalOutStand: 0,
diffLOCF: 0, diffLOCF: 0,
perBSLOCF: 0, perBSLOCF: 0,
totalLoanLOCF: 0,
diffLOV: 0, diffLOV: 0,
perBSLOV: 0, perBSLOV: 0,
totalLoanLOV: 0,
snekbar: false, snekbar: false,
snekbarMsg: '', snekbarMsg: '',
visibleParent: true, visibleParent: true,
...@@ -161,10 +163,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -161,10 +163,10 @@ export default class ListOfCreditFacilities extends Component {
switch (params) { switch (params) {
case "LOV": case "LOV":
console.log(data); 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; break;
case "LOCF": 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 break
default: default:
break; break;
...@@ -577,9 +579,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -577,9 +579,9 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id, "months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"locf": data, "locf": data,
"per_bs": this.state.perBS, "per_bs": this.state.perBSLOCF,
"diff": this.state.diff, "diff": this.state.diffLOCF,
"total_loan": this.state.perBS "total_loan": this.state.totalLoanLOCF
} }
console.log(body); console.log(body);
if (error && type == 'submitted') { if (error && type == 'submitted') {
...@@ -678,9 +680,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -678,9 +680,9 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id, "months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"lov": data, "lov": data,
"per_bs": this.state.perBS, "per_bs": this.state.perBSLOV,
"diff": this.state.diff, "diff": this.state.diffLOV,
"total_loan": this.state.perBS "total_loan": this.state.totalLoanLOV
} }
console.log(body); console.log(body);
if (error && type == 'submitted') { if (error && type == 'submitted') {
...@@ -844,7 +846,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -844,7 +846,7 @@ export default class ListOfCreditFacilities extends Component {
"locf": data, "locf": data,
"per_bs": this.state.perBSLOCF, "per_bs": this.state.perBSLOCF,
"diff": this.state.diffLOCF, "diff": this.state.diffLOCF,
"total_loan": this.state.perBSLOCF "total_loan": this.state.totalLoanLOCF
} }
console.log(body); console.log(body);
api.create().validateSaveLOCF(body).then((response) => { api.create().validateSaveLOCF(body).then((response) => {
...@@ -994,7 +996,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -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({ 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() this.handleCalculateLOV()
}) })
} }
...@@ -1068,7 +1070,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1068,7 +1070,7 @@ export default class ListOfCreditFacilities extends Component {
"lov": data, "lov": data,
"per_bs": this.state.perBSLOV, "per_bs": this.state.perBSLOV,
"diff": this.state.diffLOV, "diff": this.state.diffLOV,
"total_loan": this.state.perBSLOV "total_loan": this.state.totalLoanLOV
} }
console.log(body); console.log(body);
api.create().validateSaveLOV(body).then((response) => { api.create().validateSaveLOV(body).then((response) => {
...@@ -1157,7 +1159,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -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({ 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() // this.handleCalculateLOV()
}) })
} else { } else {
...@@ -1294,9 +1296,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1294,9 +1296,9 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id, "months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"locf": data, "locf": data,
"per_bs": this.state.perBS, "per_bs": this.state.perBSLOCF,
"diff": this.state.diff, "diff": this.state.diffLOCF,
"total_loan": this.state.perBS "total_loan": this.state.totalLoanLOCF
} }
console.log(body); console.log(body);
if (error && type == 'submitted') { if (error && type == 'submitted') {
...@@ -1398,15 +1400,15 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1398,15 +1400,15 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id, "months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"lov": data, "lov": data,
"per_bs": this.state.perBS, "per_bs": this.state.perBSLOV,
"diff": this.state.diff, "diff": this.state.diffLOV,
"total_loan": this.state.perBS "total_loan": this.state.totalLoanLOV
} }
console.log(body); console.log(body);
if (error && type == 'submitted') { if (error && type == 'submitted') {
this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 }) this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 })
} else { } else {
api.create('UPLOAD').uploadMonthlyReportLOV(body).then(response => { api.create('UPLOAD').createMonthlyReportLOV(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
...@@ -1444,9 +1446,6 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1444,9 +1446,6 @@ export default class ListOfCreditFacilities extends Component {
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
let loading = this.state.loading let loading = this.state.loading
let totalLoan = 0
const loadingComponent = ( 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)' }}> <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 { ...@@ -1579,7 +1578,7 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => this.setState({ totalOutStand: totalLoan, saveTambahan: false, loadingChild: true }, () => { onClick={() => this.setState({ saveTambahan: false, loadingChild: true }, () => {
setTimeout(() => { setTimeout(() => {
this.handleCalculateLOCF() this.handleCalculateLOCF()
}, 100); }, 100);
...@@ -1725,7 +1724,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1725,7 +1724,7 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => this.setState({ totalOutStand: totalLoan, saveTambahan: false, loadingChild: true }, () => { onClick={() => this.setState({saveTambahan: false, loadingChild: true }, () => {
this.handleCalculateLOCF() this.handleCalculateLOCF()
})} })}
> >
......
...@@ -620,7 +620,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -620,7 +620,7 @@ export default class BalanceSheetOLPA extends Component {
let err = false let err = false
let dataTable = this.state.dataTable let dataTable = this.state.dataTable
let kansas = this.state.kansas let kansas = this.state.kansas
console.log(this.state.dataTable) // console.log(this.state.dataTable)
dataTable.map((i, index) => { dataTable.map((i, index) => {
if (String(i[5]) == "Control (should be nil)") { if (String(i[5]) == "Control (should be nil)") {
// console.log(this.state.minValue) // 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