Commit e3327301 authored by Riri Novita's avatar Riri Novita

fix(handleCalculate) : undefined value

parent 4eede6e4
...@@ -356,7 +356,7 @@ export default class LOV extends Component { ...@@ -356,7 +356,7 @@ export default class LOV extends Component {
isi.map((i, index) => { isi.map((i, index) => {
if (i.length > 0) { if (i.length > 0) {
let tgl = String(i[6]).split('-') let tgl = String(i[6]).split('-')
console.log(tgl); // console.log(tgl);
payload.push({ payload.push({
"item_report_id": i[1], "item_report_id": i[1],
"company_name": this.props.company.company_name, "company_name": this.props.company.company_name,
......
...@@ -721,6 +721,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -721,6 +721,8 @@ export default class ListOfCreditFacilities extends Component {
console.log(response); console.log(response);
let dataTablelocf = [] let dataTablelocf = []
if (response.data) { if (response.data) {
if (response.data.status == 'success') {
let res = response.data.data let res = response.data.data
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTablelocf.findIndex((val) => val[1] === item.id) let indexIDzz = dataTablelocf.findIndex((val) => val[1] === item.id)
...@@ -874,6 +876,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -874,6 +876,7 @@ export default class ListOfCreditFacilities extends Component {
this.handleCalculateLOV() this.handleCalculateLOV()
}) })
} }
}
}) })
} }
...@@ -946,7 +949,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -946,7 +949,7 @@ export default class ListOfCreditFacilities extends Component {
error = true error = true
} }
if ((i[7].value == 'Government bonds' && i[8] == '') || (i[7].value == 'Stocks' && i[8] == '') || (i[7].value == 'Mutual funds' && i[8] == '') || (i[7].value == 'Investment in associate' && i[8] == '') || (i[7].value == 'Investment in joint venture' && i[8] == '') || (i[7].value == 'Investment in subsidiary' && i[8] == '') || (i[7].value == 'Corporate bonds' && i[8] == '') || (i[7].value == 'Others' && i[8] == '')) { if ((i[7]?.value == 'Government bonds' && i[8] == '') || (i[7]?.value == 'Stocks' && i[8] == '') || (i[7]?.value == 'Mutual funds' && i[8] == '') || (i[7]?.value == 'Investment in associate' && i[8] == '') || (i[7]?.value == 'Investment in joint venture' && i[8] == '') || (i[7]?.value == 'Investment in subsidiary' && i[8] == '') || (i[7]?.value == 'Corporate bonds' && i[8] == '') || (i[7]?.value == 'Others' && i[8] == '')) {
error = true error = true
} else { } else {
error = false error = false
...@@ -962,7 +965,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -962,7 +965,7 @@ export default class ListOfCreditFacilities extends Component {
"item_report_id": i[1], "item_report_id": i[1],
"company_name": i[5], "company_name": i[5],
"institution_name": i[6], "institution_name": i[6],
"type_of_investment": i[7] == null ? i[7] : i[7].value, "type_of_investment": i[7] == null ? i[7] : i[7]?.value,
"remarks": i[8], "remarks": i[8],
"placement_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), "placement_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])),
"tenor": i[10], "tenor": i[10],
...@@ -978,7 +981,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -978,7 +981,7 @@ export default class ListOfCreditFacilities extends Component {
"item_report_id": i[1], "item_report_id": i[1],
"company_name": i[5], "company_name": i[5],
"institution_name": i[6], "institution_name": i[6],
"type_of_investment": i[7] == null ? i[7] : i[7].value, "type_of_investment": i[7] == null ? i[7] : i[7]?.value,
"remarks": i[8], "remarks": i[8],
"placement_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), "placement_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])),
"tenor": i[10], "tenor": i[10],
......
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