Commit 372c50b8 authored by Riri Novita's avatar Riri Novita

ubah ui currency

parent 417a524b
......@@ -233,7 +233,8 @@ export default class LOV extends Component {
item.lov.placement_date == null || item.lov.placement_date == "" ? null : (item.lov.placement_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.lov.placement_date) : null),
item.lov.tenor === null || item.lov.tenor === "" ? "" : item.lov.tenor,
item.lov.expected_return === null || item.lov.expected_return === "" || item.lov.expected_return === "0.0" ? "0.00" : item.lov.expected_return,
item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
// item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
item.lov.currency === null || item.lov.currency === "" ? "" : item.lov.currency,
item.lov.investment_amount_ori === null ? "0.0" : item.lov.investment_amount_ori === "" ? "0.0" : item.lov.investment_amount_ori,
item.lov.investment_amount_cur === null ? "0.0" : item.lov.investment_amount_cur === "" ? "0.0" : item.lov.investment_amount_cur,
item.lov.notes,
......@@ -266,7 +267,8 @@ export default class LOV extends Component {
item.lov.placement_date == null || item.lov.placement_date == "" ? null : (item.lov.placement_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.lov.placement_date) : null),
item.lov.tenor === null || item.lov.tenor === "" ? "" : item.lov.tenor,
item.lov.expected_return === null || item.lov.expected_return === "" ? "0.0" : item.lov.expected_return,
item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
// item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
item.lov.currency === null || item.lov.currency === "" ? "" : item.lov.currency,
item.lov.investment_amount_ori === null ? "0.0" : item.lov.investment_amount_ori === "" ? "0.0" : item.lov.investment_amount_ori,
item.lov.investment_amount_cur === null ? "0.0" : item.lov.investment_amount_cur === "" ? "0.0" : item.lov.investment_amount_cur,
item.lov.notes,
......@@ -425,7 +427,8 @@ export default class LOV extends Component {
item.lov.placement_date == null || item.lov.placement_date == "" ? null : (item.lov.placement_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.lov.placement_date) : null),
item.lov.tenor === null || item.lov.tenor === "" ? "" : item.lov.tenor,
item.lov.expected_return === null || item.lov.expected_return === "" ? "0.0" : item.lov.expected_return,
item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
// item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
item.lov.currency === null || item.lov.currency === "" ? "" : item.lov.currency,
item.lov.investment_amount_ori === null ? "0.0" : item.lov.investment_amount_ori === "" ? "0.0" : item.lov.investment_amount_ori,
item.lov.investment_amount_cur === null ? "0.0" : item.lov.investment_amount_cur === "" ? "0.0" : item.lov.investment_amount_cur,
item.lov.notes,
......@@ -458,7 +461,8 @@ export default class LOV extends Component {
item.lov.placement_date == null || item.lov.placement_date == "" ? null : (item.lov.placement_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.lov.placement_date) : null),
item.lov.tenor === null || item.lov.tenor === "" ? "" : item.lov.tenor,
item.lov.expected_return === null || item.lov.expected_return === "" ? "0.0" : item.lov.expected_return,
item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
// item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
item.lov.currency === null || item.lov.currency === "" ? "" : item.lov.currency,
item.lov.investment_amount_ori === null ? "0.0" : item.lov.investment_amount_ori === "" ? "0.0" : item.lov.investment_amount_ori,
item.lov.investment_amount_cur === null ? "0.0" : item.lov.investment_amount_cur === "" ? "0.0" : item.lov.investment_amount_cur,
item.lov.notes,
......@@ -964,7 +968,7 @@ export default class LOV extends Component {
null,
"",
"",
null,
"",
"0",
"",
"",
......@@ -1445,7 +1449,43 @@ export default class LOV extends Component {
)
}
}
}, {
},
// {
// name: "Currency",
// options: {
// customHeadRender: (columnMeta) => (
// <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96, borderRight: '1px #fff solid' }}>
// <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
// </TableCell>
// ),
// setCellProps: () => ({ style2 }),
// customBodyRender: (val, tableMeta, updateValue) => {
// return (
// <div style={{ textAlign: 'right', width: 90 }}>
// {tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 || tableMeta.rowData[0] === 4 ?
// null :
// <Autocomplete
// {...this.state.currencyList}
// id="currencyList"
// onChange={(event, newInputValue) => handleChange(newInputValue, tableMeta, tableMeta.columnIndex)}
// debug
// value={handleValueDropDown(val, 'currencyList', tableMeta)}
// disableClearable
// disabled={this.props.get_for == 'view'}
// style={{ padding: 0, margin: 0 }}
// renderInput={(params) =>
// <div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
// <textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: tableMeta.rowData[12] == null && this.props.get_for == 'edit' ? '#ffac99' : 'white' }} type="text" {...params.inputProps} />
// </div>
// }
// />
// }
// </div>
// )
// }
// }
// },
{
name: "Currency",
options: {
customHeadRender: (columnMeta) => (
......@@ -1456,24 +1496,13 @@ export default class LOV extends Component {
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 || tableMeta.rowData[0] === 4 ?
<div style={{ display: 'flex' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9 ?
null :
<Autocomplete
{...this.state.currencyList}
id="currencyList"
onChange={(event, newInputValue) => handleChange(newInputValue, tableMeta, tableMeta.columnIndex)}
debug
value={handleValueDropDown(val, 'currencyList', tableMeta)}
disableClearable
disabled={this.props.get_for == 'view'}
style={{ padding: 0, margin: 0 }}
renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: tableMeta.rowData[12] == null && this.props.get_for == 'edit' ? '#ffac99' : 'white' }} type="text" {...params.inputProps} />
</div>
}
/>
<div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: tableMeta.rowData[12] == '' && this.props.get_for == 'edit' ? '#ffac99' : 'white' }} type="text" defaultValue={tableMeta.rowData[12]}
onBlur={(event) => handleChange(event.target.value, tableMeta, tableMeta.columnIndex)} />
</div>
}
</div>
)
......
......@@ -493,7 +493,8 @@ export default class ListOfCreditFacilities extends Component {
"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],
"expected_return": i[11] == "" ? "0.00" : i[11],
"currency": i[12] == null ? i[12] : i[12].value,
// "currency": i[12] == null ? i[12] : i[12].value,
"currency": i[12],
"investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]),
"investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]),
"notes": i[15],
......@@ -508,7 +509,8 @@ export default class ListOfCreditFacilities extends Component {
"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],
"expected_return": i[11] == "" ? "0.00" : i[11],
"currency": i[12] == null ? i[12] : i[12].value,
// "currency": i[12] == null ? i[12] : i[12].value,
"currency": i[12],
"investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]),
"investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]),
"notes": i[15],
......@@ -946,7 +948,8 @@ export default class ListOfCreditFacilities extends Component {
"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],
"expected_return": i[11] == "" ? "0.00" : i[11],
"currency": i[12] == null ? i[12] : i[12].value,
// "currency": i[12] == null ? i[12] : i[12].value,
"currency": i[12],
"investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]),
"investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]),
"notes": i[15],
......@@ -961,7 +964,8 @@ export default class ListOfCreditFacilities extends Component {
"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],
"expected_return": i[11] == "" ? "0.00" : i[11],
"currency": i[12] == null ? i[12] : i[12].value,
// "currency": i[12] == null ? i[12] : i[12].value,
"currency": i[12],
"investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]),
"investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]),
"notes": i[15],
......@@ -1006,7 +1010,8 @@ export default class ListOfCreditFacilities extends Component {
item.lov.placement_date == null || item.lov.placement_date == "" ? null : (item.lov.placement_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.lov.placement_date) : null),
item.lov.tenor === null || item.lov.tenor === "" ? "" : item.lov.tenor,
item.lov.expected_return === null || item.lov.expected_return === "" ? "0.0" : item.lov.expected_return,
item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
// item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
item.lov.currency === null || item.lov.currency === "" ? "" : item.lov.currency,
item.lov.investment_amount_ori === null ? "0.0" : item.lov.investment_amount_ori === "" ? "0.0" : item.lov.investment_amount_ori,
item.lov.investment_amount_cur === null ? "0.0" : item.lov.investment_amount_cur === "" ? "0.0" : item.lov.investment_amount_cur,
item.lov.notes,
......@@ -1039,7 +1044,8 @@ export default class ListOfCreditFacilities extends Component {
item.lov.placement_date == null || item.lov.placement_date == "" ? null : (item.lov.placement_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.lov.placement_date) : null),
item.lov.tenor === null || item.lov.tenor === "" ? "" : item.lov.tenor,
item.lov.expected_return === null || item.lov.expected_return === "" ? "0.0" : item.lov.expected_return,
item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
// item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency },
item.lov.currency === null || item.lov.currency === "" ? "" : item.lov.currency,
item.lov.investment_amount_ori === null ? "0.0" : item.lov.investment_amount_ori === "" ? "0.0" : item.lov.investment_amount_ori,
item.lov.investment_amount_cur === null ? "0.0" : item.lov.investment_amount_cur === "" ? "0.0" : item.lov.investment_amount_cur,
item.lov.notes,
......@@ -1306,7 +1312,8 @@ export default class ListOfCreditFacilities extends Component {
"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],
"expected_return": i[11] == "" ? "0.00" : i[11],
"currency": i[12] == null ? i[12] : i[12].value,
// "currency": i[12] == null ? i[12] : i[12].value,
"currency": i[12],
"investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]),
"investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]),
"notes": i[15],
......@@ -1321,7 +1328,8 @@ export default class ListOfCreditFacilities extends Component {
"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],
"expected_return": i[11] == "" ? "0.00" : i[11],
"currency": i[12] == null ? i[12] : i[12].value,
// "currency": i[12] == null ? i[12] : i[12].value,
"currency": i[12],
"investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]),
"investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]),
"notes": i[15],
......
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