Commit 2104d044 authored by Riri Novita's avatar Riri Novita

tanggal excel

parent 82b1f8fd
...@@ -435,7 +435,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -435,7 +435,7 @@ export default class ListOfCreditFacilities extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) console.log(resp)
if (err) { if (err) {
console.log(err); console.log(err);
} }
...@@ -446,9 +446,15 @@ export default class ListOfCreditFacilities extends Component { ...@@ -446,9 +446,15 @@ export default class ListOfCreditFacilities extends Component {
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/; let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => { isi.map((i, index) => {
if (i.length > 0) { if (i.length > 0) {
let excelDate = i[5]
let excelBaseDate = new Date('1900-01-01');
let javascriptBaseDate = new Date('1970-01-01');
let daysBetween = excelDate - 1;
let javascriptDate = new Date(excelBaseDate.getTime() + (daysBetween * 24 * 60 * 60 * 1000));
let tgl = String(i[5]).split('-') let tgl = String(i[5]).split('-')
console.log(i[5]) console.log(i[5])
console.log(tgl) console.log(tgl)
console.log(javascriptDate);
payload.push({ payload.push({
"item_report_id": i[1], "item_report_id": i[1],
"borrower_comp_name": this.props.company.company_name, "borrower_comp_name": this.props.company.company_name,
...@@ -1675,7 +1681,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1675,7 +1681,7 @@ export default class ListOfCreditFacilities extends Component {
} }
}) })
if (column == 22) { if (column == 22) {
totalLoan = valuez totalLoan = valuez
} }
} else { } else {
if (column == 21) { if (column == 21) {
...@@ -1687,9 +1693,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1687,9 +1693,9 @@ export default class ListOfCreditFacilities extends Component {
} else if (column == 24) { } else if (column == 24) {
valuez = Number(tableMeta.rowData[13]) - Number(tableMeta.rowData[22]) valuez = Number(tableMeta.rowData[13]) - Number(tableMeta.rowData[22])
} }
} }
dataTable2[tableMeta.rowIndex][column] = valuez dataTable2[tableMeta.rowIndex][column] = valuez
return valuez return valuez
} }
...@@ -3295,7 +3301,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3295,7 +3301,7 @@ export default class ListOfCreditFacilities extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")), 2)) : (Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")) )} value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")), 2)) : (Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")))}
/> />
} }
/> />
...@@ -3507,7 +3513,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3507,7 +3513,7 @@ export default class ListOfCreditFacilities extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[37]), 2) : Number(tableMeta.rowData[37]) == 0 ? "0.0" : Number(tableMeta.rowData[37])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[37]), 2) : Number(tableMeta.rowData[37]) == 0 ? "0.0" : Number(tableMeta.rowData[37])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 37) handleChange(event.target.value, tableMeta, 37)
}} }}
......
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