Commit 4ab49346 authored by Riri Novita's avatar Riri Novita

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

validate save lov

See merge request !2256
parents 25d658a8 0c874113
...@@ -474,11 +474,15 @@ export default class ListOfCreditFacilities extends Component { ...@@ -474,11 +474,15 @@ export default class ListOfCreditFacilities extends Component {
console.log(dataTable2); console.log(dataTable2);
dataTable2.map(i => { dataTable2.map(i => {
if (i[0] == 3) { if (i[0] == 3) {
if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "" || i[12] == "") { if (i[6] == null || i[7] == null || i[9] == "" || i[10] == "" || i[11] == "" || i[12] == "") {
console.log('masuk sini');
error = true error = true
} }
console.log(i[7]?.value);
if (i[8] == '' && i[7]?.value == 'Time deposit' || i[7]?.value == 'N/A') { if (i[7].value == 'N/A' || i[7].value == 'Time deposit' && i[8] == '') {
error = false
} else {
error = true error = true
} }
let tgl = String(i[9]).split('-') let tgl = String(i[9]).split('-')
...@@ -929,13 +933,19 @@ export default class ListOfCreditFacilities extends Component { ...@@ -929,13 +933,19 @@ export default class ListOfCreditFacilities extends Component {
bankNameEmpty = true bankNameEmpty = true
} }
if (i[0] == 3) { if (i[0] == 3) {
if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "" || i[12] == "") { if (i[6] == null || i[7] == null || i[9] == "" || i[10] == "" || i[11] == "" || i[12] == "") {
error = true error = true
} }
if (i[8] == '' && i[7]?.value == 'Time deposit' || i[7]?.value == 'N/A') { if (i[7].value == 'N/A' || i[7].value == 'Time deposit' && i[8] == '') {
error = false
} else {
error = true error = true
} }
// if (i[7].value == 'Government bonds' || i[7].value == 'Stocks' || i[7].value == 'Mutual funds' || i[7].value == 'Investment in associate' || i[7].value == 'Investment in joint venture' || i[7].value == 'Investment in subsidiary' || i[7].value == 'Corporate bonds' || i[7].value == 'Others' && i[8] == '' ) {
// error = true
// }
let tgl = String(i[9]).split('-') let tgl = String(i[9]).split('-')
let checkUndifined = tgl.findIndex((val) => val == undefined) let checkUndifined = tgl.findIndex((val) => val == undefined)
if (this.props.defaultCurrency.id == 2) { if (this.props.defaultCurrency.id == 2) {
...@@ -988,6 +998,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -988,6 +998,7 @@ export default class ListOfCreditFacilities extends Component {
"total_loan": this.state.totalLoanLOV "total_loan": this.state.totalLoanLOV
} }
console.log(body); console.log(body);
console.log(error);
api.create().validateSaveLOV(body).then((response) => { api.create().validateSaveLOV(body).then((response) => {
console.log(response); console.log(response);
let dataTablelov = [] let dataTablelov = []
...@@ -1297,7 +1308,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1297,7 +1308,9 @@ export default class ListOfCreditFacilities extends Component {
error = true error = true
} }
if (i[8] == '' && i[7]?.value == 'Time deposit' || i[7]?.value == 'N/A') { if (i[7].value == 'N/A' || i[7].value == 'Time deposit' && i[8] == '') {
error = false
} else {
error = true error = true
} }
let tgl = String(i[9]).split('-') let tgl = String(i[9]).split('-')
......
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