Commit 621c57da authored by Riri Novita's avatar Riri Novita

validate save lov

parent c39ad4ed
......@@ -474,11 +474,15 @@ export default class ListOfCreditFacilities extends Component {
console.log(dataTable2);
dataTable2.map(i => {
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
}
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
}
let tgl = String(i[9]).split('-')
......@@ -929,13 +933,19 @@ export default class ListOfCreditFacilities extends Component {
bankNameEmpty = true
}
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
}
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
}
// 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 checkUndifined = tgl.findIndex((val) => val == undefined)
if (this.props.defaultCurrency.id == 2) {
......@@ -988,6 +998,7 @@ export default class ListOfCreditFacilities extends Component {
"total_loan": this.state.totalLoanLOV
}
console.log(body);
console.log(error);
api.create().validateSaveLOV(body).then((response) => {
console.log(response);
let dataTablelov = []
......@@ -1297,7 +1308,9 @@ export default class ListOfCreditFacilities extends Component {
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
}
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