Commit 71f98ddc authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

apdet banyak

See merge request !852
parents 4ab8d715 1c549820
...@@ -427,7 +427,7 @@ export default class CashFlowMR extends Component { ...@@ -427,7 +427,7 @@ export default class CashFlowMR extends Component {
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.month.month_value} {this.props.periode} (rev.{this.props.revision})</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {String(this.props.month.month_value).toLocaleUpperCase()} {this.props.periode} (rev.{this.props.revision})</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
......
...@@ -81,8 +81,10 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -81,8 +81,10 @@ export default class CorporateAnnualTargetMR extends Component {
handleGetFor(type) { handleGetFor(type) {
this.setState({get_for: type}, () => { this.setState({get_for: type}, () => {
this.getLatestUpdate()
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate()
this.getKPIType()
this.getMaxAch()
}) })
} }
...@@ -128,7 +130,8 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -128,7 +130,8 @@ export default class CorporateAnnualTargetMR extends Component {
"periode": "2021", "periode": "2021",
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id "months": this.props.month.month_id,
"get_for": this.state.get_for
} }
api.create().getHierarkiMontlyReportCAT(payload).then(response => { api.create().getHierarkiMontlyReportCAT(payload).then(response => {
...@@ -937,12 +940,12 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -937,12 +940,12 @@ export default class CorporateAnnualTargetMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} // disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
disabled={false} disabled={this.state.get_for == 'view'}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1130,11 +1133,11 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1130,11 +1133,11 @@ export default class CorporateAnnualTargetMR extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 75, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 75, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
defaultValue={value} defaultValue={value}
disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} disabled={this.state.get_for == 'view'? true : this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1189,7 +1192,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1189,7 +1192,7 @@ export default class CorporateAnnualTargetMR extends Component {
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template"> {this.state.get_for == 'edit' && <a data-tip={'Download Template'} data-for="template">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -1201,9 +1204,9 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1201,9 +1204,9 @@ export default class CorporateAnnualTargetMR extends Component {
> >
<img src={Images.template} /> <img src={Images.template} />
</button> </button>
</a> </a>}
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
<a data-tip={'Upload'} data-for="upload"> {this.state.get_for == 'edit' && <a data-tip={'Upload'} data-for="upload">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -1215,7 +1218,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1215,7 +1218,7 @@ export default class CorporateAnnualTargetMR extends Component {
> >
<img src={Images.upload} /> <img src={Images.upload} />
</button> </button>
</a> </a>}
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
......
...@@ -88,7 +88,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -88,7 +88,8 @@ export default class ListOfCreditFacilities extends Component {
snekbarMsg: '', snekbarMsg: '',
visibleLOCFMR: true, visibleLOCFMR: true,
saveDraft: true, saveDraft: true,
saveComp: true saveComp: true,
get_for: 'view'
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -99,6 +100,14 @@ export default class ListOfCreditFacilities extends Component { ...@@ -99,6 +100,14 @@ export default class ListOfCreditFacilities extends Component {
this.getSubmission() this.getSubmission()
} }
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getBankData()
this.getTypeOfCredit()
this.getSubmission()
})
}
getItemHierarki() { getItemHierarki() {
let payload = { let payload = {
"report_id": this.props.report_id, "report_id": this.props.report_id,
...@@ -106,7 +115,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -106,7 +115,8 @@ export default class ListOfCreditFacilities extends Component {
"periode": this.props.periode, "periode": this.props.periode,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id "months": this.props.month.month_id,
"get_for": this.state.get_for
} }
api.create().getHierarkiMontlyReportLOCF(payload).then(response => { api.create().getHierarkiMontlyReportLOCF(payload).then(response => {
console.log(payload); console.log(payload);
...@@ -298,7 +308,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -298,7 +308,7 @@ export default class ListOfCreditFacilities extends Component {
// } // }
}) })
// console.log(dataTable); // console.log(dataTable);
if (dataTable.length == 0) { if (dataTable.length == 0 && this.state.get_for == 'edit') {
dataTable.push( dataTable.push(
[3, "", "", "", "", this.props.company.company_name, null, null, "", this.state.currentDate, "", "0", "", "0", "", "0", "", "0", "", "", "0", "0", "0", "0", "0", "", "0", "", "0", "", "0", "", "0", "", "", "", "", "", "", "", "", "", "", "", "", "notes", 0 ], [3, "", "", "", "", this.props.company.company_name, null, null, "", this.state.currentDate, "", "0", "", "0", "", "0", "", "0", "", "", "0", "0", "0", "0", "0", "", "0", "", "0", "", "0", "", "0", "", "", "", "", "", "", "", "", "", "", "", "", "notes", 0 ],
[9, "", "", "", "", "", {value: "Grand Total"}, null, "", "", "", "0", "", "0", "", "0", "", "0", "", "", "0", "0", "0", "0", "0", "", "0", "", "0", "", "0", "", "0", "", "", "", "", "", "", "", "", "", "", "", "", "notes", 999999 ], [9, "", "", "", "", "", {value: "Grand Total"}, null, "", "", "", "0", "", "0", "", "0", "", "0", "", "", "0", "0", "0", "0", "0", "", "0", "", "0", "", "0", "", "0", "", "", "", "", "", "", "", "", "", "", "", "", "notes", 999999 ],
...@@ -1461,7 +1471,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1461,7 +1471,7 @@ export default class ListOfCreditFacilities extends Component {
name: "", name: "",
options: { options: {
filter: false, filter: false,
display: true, display: this.state.get_for == 'view'? false : true,
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 99, backgroundColor: '#dbdbdb' }}> <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 99, backgroundColor: '#dbdbdb' }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
...@@ -1554,12 +1564,13 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1554,12 +1564,13 @@ export default class ListOfCreditFacilities extends Component {
onChange={(event, newInputValue) => handleChange(newInputValue, tableMeta, tableMeta.columnIndex)} onChange={(event, newInputValue) => handleChange(newInputValue, tableMeta, tableMeta.columnIndex)}
debug debug
disableClearable disableClearable
disabled={this.state.get_for == 'view'}
// disabled={!handleAction(tableMeta.rowData[2], tableMeta.rowData[0])} // disabled={!handleAction(tableMeta.rowData[2], tableMeta.rowData[0])}
value={handleValueDropDown(val, 'bankName', tableMeta)} value={handleValueDropDown(val, 'bankName', tableMeta)}
style={{ padding: 0, margin: 0}} style={{ padding: 0, margin: 0}}
renderInput={(params) => renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}> <div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<textarea style={{ borderColor: 'white', width: 150, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" {...params.inputProps} /> <textarea style={{ borderColor: 'white', width: 150, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: this.state.get_for == 'view'? "black" : "#5198ea" }} type="text" {...params.inputProps} />
</div> </div>
} }
/> />
...@@ -1589,11 +1600,12 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1589,11 +1600,12 @@ export default class ListOfCreditFacilities extends Component {
debug debug
value={handleValueDropDown(val, 'typeOfCreditList', tableMeta)} value={handleValueDropDown(val, 'typeOfCreditList', tableMeta)}
disableClearable disableClearable
disabled={this.state.get_for == 'view'}
// disabled={!handleAction(tableMeta.rowData[2], tableMeta.rowData[0])} // disabled={!handleAction(tableMeta.rowData[2], tableMeta.rowData[0])}
style={{ padding: 0, margin: 0 }} style={{ padding: 0, margin: 0 }}
renderInput={(params) => renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}> <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: "#5198ea" }} type="text" {...params.inputProps} /> <textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: this.state.get_for == 'view'? "black" : "#5198ea" }} type="text" {...params.inputProps} />
</div> </div>
} }
/> />
...@@ -1617,13 +1629,13 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1617,13 +1629,13 @@ export default class ListOfCreditFacilities extends Component {
{ tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9? { tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9?
null : null :
<div style={{ padding: 0, margin: 0 }}> <div style={{ padding: 0, margin: 0 }}>
<textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" defaultValue={tableMeta.rowData[8]} <textarea disabled={this.state.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: this.state.get_for == 'view'? "black" : "#5198ea" }} type="text" defaultValue={tableMeta.rowData[8]}
onBlur={(event) => handleChange(event.target.value, tableMeta, tableMeta.columnIndex)} /> onBlur={(event) => handleChange(event.target.value, tableMeta, tableMeta.columnIndex)} />
</div> </div>
// <ThemeProvider theme={theme}> // <ThemeProvider theme={theme}>
// <Input // <Input
// disableUnderline={true} // disableUnderline={true}
// style={{color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -105 }} // style={{color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -105 }}
// type="text" // type="text"
// placeholder="" // placeholder=""
// disabled={tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9? true : false} // disabled={tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9? true : false}
...@@ -1664,6 +1676,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1664,6 +1676,7 @@ export default class ListOfCreditFacilities extends Component {
// label="Valid To" // label="Valid To"
format="dd-MM-yyyy" format="dd-MM-yyyy"
value={val} value={val}
disabled={this.state.get_for == 'view'}
onChange={(e) => handleChange(e, tableMeta, tableMeta.columnIndex, 'date')} onChange={(e) => handleChange(e, tableMeta, tableMeta.columnIndex, 'date')}
// minDate={this.state.startDate} // minDate={this.state.startDate}
KeyboardButtonProps={{ KeyboardButtonProps={{
...@@ -1712,10 +1725,11 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1712,10 +1725,11 @@ export default class ListOfCreditFacilities extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(2)} value={Number(value).toFixed(2)}
disabled={this.state.get_for == 'view'}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} // disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
decimalScale={2} decimalScale={2}
onBlur={(event) => { onBlur={(event) => {
...@@ -1748,10 +1762,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1748,10 +1762,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[11]} defaultValue={tableMeta.rowData[11]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -1825,10 +1839,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1825,10 +1839,10 @@ export default class ListOfCreditFacilities extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[12]).toFixed(1) == 0.0 ? "0.0" : Number(tableMeta.rowData[12]).toFixed(1)} value={Number(tableMeta.rowData[12]).toFixed(1) == 0.0 ? "0.0" : Number(tableMeta.rowData[12]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 12) handleChange(event.target.value, tableMeta, 12)
...@@ -1870,10 +1884,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1870,10 +1884,10 @@ export default class ListOfCreditFacilities extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[13]).toFixed(1)} value={Number(tableMeta.rowData[13]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 13) handleChange(event.target.value, tableMeta, 13)
...@@ -1953,7 +1967,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1953,7 +1967,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Investment Loan'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Investment Loan'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Investment Loan'? false : true} disabled={this.state.get_for == 'view'? true : tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Investment Loan'? false : true}
value={Number(tableMeta.rowData[14]).toFixed(1)} value={Number(tableMeta.rowData[14]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 14) handleChange(event.target.value, tableMeta, 14)
...@@ -1997,7 +2011,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1997,7 +2011,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Investment Loan'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Investment Loan'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Investment Loan'? false : true} disabled={this.state.get_for == 'view'? true : tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Investment Loan'? false : true}
value={Number(tableMeta.rowData[15]).toFixed(1)} value={Number(tableMeta.rowData[15]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 15) handleChange(event.target.value, tableMeta, 15)
...@@ -2076,7 +2090,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2076,7 +2090,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Revolving Loan (KMK)'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Revolving Loan (KMK)'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Revolving Loan (KMK)'? false : true} disabled={this.state.get_for == 'view'? true : tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Revolving Loan (KMK)'? false : true}
value={Number(tableMeta.rowData[16]).toFixed(1)} value={Number(tableMeta.rowData[16]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 16) handleChange(event.target.value, tableMeta, 16)
...@@ -2120,7 +2134,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2120,7 +2134,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Revolving Loan (KMK)'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Revolving Loan (KMK)'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Revolving Loan (KMK)'? false : true} disabled={this.state.get_for == 'view'? true : tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Revolving Loan (KMK)'? false : true}
value={Number(tableMeta.rowData[17]).toFixed(1)} value={Number(tableMeta.rowData[17]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 17) handleChange(event.target.value, tableMeta, 17)
...@@ -2200,7 +2214,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2200,7 +2214,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Others'? "#5198ea" : "black", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Others'? "#5198ea" : "black", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Others'? false : true} disabled={this.state.get_for == 'view'? true : tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Others'? false : true}
defaultValue={tableMeta.rowData[18]} defaultValue={tableMeta.rowData[18]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -2246,7 +2260,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2246,7 +2260,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Others'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Others'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Others'? false : true} disabled={this.state.get_for == 'view'? true : tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Others'? false : true}
value={Number(tableMeta.rowData[19]).toFixed(1)} value={Number(tableMeta.rowData[19]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 19) handleChange(event.target.value, tableMeta, 19)
...@@ -2290,7 +2304,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2290,7 +2304,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Others'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: tableMeta.rowData[7] == null? "black" : tableMeta.rowData[7].value == 'Others'? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[20]).toFixed(1)} value={Number(tableMeta.rowData[20]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 20) handleChange(event.target.value, tableMeta, 20)
...@@ -2574,10 +2588,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2574,10 +2588,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[25]} defaultValue={tableMeta.rowData[25]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -2654,10 +2668,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2654,10 +2668,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[27]} defaultValue={tableMeta.rowData[27]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -2734,10 +2748,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2734,10 +2748,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[29]} defaultValue={tableMeta.rowData[29]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -2814,10 +2828,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2814,10 +2828,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[31]} defaultValue={tableMeta.rowData[31]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -2897,10 +2911,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2897,10 +2911,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[33]} defaultValue={tableMeta.rowData[33]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -2922,10 +2936,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2922,10 +2936,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[34]} defaultValue={tableMeta.rowData[34]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -2950,10 +2964,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2950,10 +2964,10 @@ export default class ListOfCreditFacilities extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[35]).toFixed(1)} value={Number(tableMeta.rowData[35]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 35) handleChange(event.target.value, tableMeta, 35)
...@@ -3008,10 +3022,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3008,10 +3022,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[36]} defaultValue={tableMeta.rowData[36]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -3033,10 +3047,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3033,10 +3047,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[37]} defaultValue={tableMeta.rowData[37]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -3061,10 +3075,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3061,10 +3075,10 @@ export default class ListOfCreditFacilities extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[38]).toFixed(1)} value={Number(tableMeta.rowData[38]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 20) handleChange(event.target.value, tableMeta, 20)
...@@ -3119,10 +3133,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3119,10 +3133,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[39]} defaultValue={tableMeta.rowData[39]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -3144,10 +3158,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3144,10 +3158,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[40]} defaultValue={tableMeta.rowData[40]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -3172,10 +3186,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3172,10 +3186,10 @@ export default class ListOfCreditFacilities extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[41]).toFixed(1)} value={Number(tableMeta.rowData[41]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 20) handleChange(event.target.value, tableMeta, 20)
...@@ -3230,10 +3244,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3230,10 +3244,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[42]} defaultValue={tableMeta.rowData[42]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -3255,10 +3269,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3255,10 +3269,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[43]} defaultValue={tableMeta.rowData[43]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -3283,10 +3297,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3283,10 +3297,10 @@ export default class ListOfCreditFacilities extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[20]).toFixed(1)} value={Number(tableMeta.rowData[20]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 20) handleChange(event.target.value, tableMeta, 20)
...@@ -3320,10 +3334,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3320,10 +3334,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[45]} defaultValue={tableMeta.rowData[45]}
onBlur={(event) => { onBlur={(event) => {
// // // console.log(event.target.value) // // // console.log(event.target.value)
...@@ -3493,7 +3507,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3493,7 +3507,7 @@ export default class ListOfCreditFacilities extends Component {
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
{/* {((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted')) && ( */} {(this.state.get_for == 'edit' && (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted')) && (
<div> <div>
<a data-tip={'Download Template'} data-for="template"> <a data-tip={'Download Template'} data-for="template">
<button <button
...@@ -3510,8 +3524,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3510,8 +3524,8 @@ export default class ListOfCreditFacilities extends Component {
</a> </a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
</div> </div>
{/* )} */} )}
{/* {((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted')) && ( */} {(this.state.get_for == 'edit' && (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted')) && (
<div> <div>
<a data-tip={'Upload'} data-for="upload"> <a data-tip={'Upload'} data-for="upload">
<button <button
...@@ -3530,7 +3544,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3530,7 +3544,7 @@ export default class ListOfCreditFacilities extends Component {
</a> </a>
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
</div> </div>
{/* )} */} )}
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
style={{ style={{
...@@ -3609,10 +3623,31 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3609,10 +3623,31 @@ export default class ListOfCreditFacilities extends Component {
</div> </div>
</button> </button>
</div> </div>
{/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null : {/* (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */}
(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */}
{this.props.isApprover === true ? null :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button {this.state.get_for == 'view' && <button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({loading: true}, () => {
this.handleGetFor('edit')
})
}}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Edit</Typography>
</div>
</button>}
{this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
style={{ style={{
...@@ -3629,8 +3664,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3629,8 +3664,8 @@ export default class ListOfCreditFacilities extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div> </div>
</button> </button>}
<button {this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
onClick={() => onClick={() =>
...@@ -3658,8 +3693,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3658,8 +3693,8 @@ export default class ListOfCreditFacilities extends Component {
: :
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>} <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>}
</div> </div>
</button> </button>}
<button {this.state.get_for == 'edit' && <button
type="button" type="button"
// disabled={this.state.buttonError} // disabled={this.state.buttonError}
onClick={() => onClick={() =>
...@@ -3687,8 +3722,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3687,8 +3722,8 @@ export default class ListOfCreditFacilities extends Component {
: :
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>} <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>}
</div> </div>
</button> </button>}
</div> </div>}
{/* : null } */} {/* : null } */}
</div> </div>
</Paper> </Paper>
......
...@@ -62,7 +62,8 @@ export default class OperatingIndicatorMR extends Component { ...@@ -62,7 +62,8 @@ export default class OperatingIndicatorMR extends Component {
disabledSave: true, disabledSave: true,
editable: true, editable: true,
emptyData: false, emptyData: false,
templateNull: true templateNull: true,
get_for: 'view'
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -73,6 +74,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -73,6 +74,13 @@ export default class OperatingIndicatorMR extends Component {
this.getLatestUpdate() this.getLatestUpdate()
} }
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getSettingControl()
this.getLatestUpdate()
})
}
getLatestUpdate() { getLatestUpdate() {
let payload = { let payload = {
"operating_indicator_id": this.props.data.operatingIndID, "operating_indicator_id": this.props.data.operatingIndID,
...@@ -166,7 +174,8 @@ export default class OperatingIndicatorMR extends Component { ...@@ -166,7 +174,8 @@ export default class OperatingIndicatorMR extends Component {
"report_id": this.props.data.report_id, "report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
"months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null "months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null,
"get_for": this.state.get_for
} }
api.create().getHierarkiMontlyReportOI(payload).then(response => { api.create().getHierarkiMontlyReportOI(payload).then(response => {
console.log(response); console.log(response);
...@@ -978,10 +987,10 @@ export default class OperatingIndicatorMR extends Component { ...@@ -978,10 +987,10 @@ export default class OperatingIndicatorMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit || this.state.get_for == 'view'}
value={Number(tableMeta.rowData[10]).toFixed(1)} value={Number(tableMeta.rowData[10]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1247,10 +1256,11 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1247,10 +1256,11 @@ export default class OperatingIndicatorMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={false} // disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[15]} defaultValue={tableMeta.rowData[15]}
inputProps={{ inputProps={{
style: { style: {
color: "#5198ea", color: this.state.get_for == 'view'? "black" : "#5198ea",
textAlign: 'right', textAlign: 'right',
backgroundColor: '#ffac99' backgroundColor: '#ffac99'
} }
...@@ -1266,6 +1276,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1266,6 +1276,7 @@ export default class OperatingIndicatorMR extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[15]} defaultValue={tableMeta.rowData[15]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1296,11 +1307,11 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1296,11 +1307,11 @@ export default class OperatingIndicatorMR extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
// disabled={false} disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[16]} defaultValue={tableMeta.rowData[16]}
inputProps={{ inputProps={{
style: { style: {
color: "#5198ea", color: this.state.get_for == 'view'? "black" : "#5198ea",
textAlign: 'right', textAlign: 'right',
backgroundColor: '#ffac99' backgroundColor: '#ffac99'
} }
...@@ -1317,6 +1328,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1317,6 +1328,7 @@ export default class OperatingIndicatorMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
defaultValue={tableMeta.rowData[16]} defaultValue={tableMeta.rowData[16]}
disabled={this.state.get_for == 'view'}
inputProps={{ inputProps={{
style: { style: {
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea', color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea',
...@@ -1391,7 +1403,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1391,7 +1403,7 @@ export default class OperatingIndicatorMR extends Component {
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
{(this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <a data-tip={'Download Template'} data-for="template"> {this.state.get_for == 'edit' && (this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <a data-tip={'Download Template'} data-for="template">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -1405,7 +1417,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1405,7 +1417,7 @@ export default class OperatingIndicatorMR extends Component {
</button> </button>
</a>} </a>}
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
{(this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <a data-tip={'Upload'} data-for="upload"> {this.state.get_for == 'edit' && (this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <a data-tip={'Upload'} data-for="upload">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -1473,7 +1485,20 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1473,7 +1485,20 @@ export default class OperatingIndicatorMR extends Component {
</button> </button>
</div> </div>
{!this.state.emptyData && (this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> {!this.state.emptyData && (this.props.permission.create || this.props.permission.edit) && this.props.isSubmit && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button {this.state.get_for == 'view' && <button
type="button"
onClick={() => {
this.setState({loading: true}, () => {
this.handleGetFor('edit')
})
}}
style={{ marginRight: 20 }}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Edit</Typography>
</div>
</button>}
{this.state.get_for == 'edit' && <button
type="button" type="button"
onClick={() => onClick={() =>
this.setState({ loading: true, editable: false }, () => { this.setState({ loading: true, editable: false }, () => {
...@@ -1488,8 +1513,8 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1488,8 +1513,8 @@ export default class OperatingIndicatorMR extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div> </div>
</button> </button>}
<button {this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
disabled={this.state.editable} disabled={this.state.editable}
...@@ -1515,8 +1540,8 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1515,8 +1540,8 @@ export default class OperatingIndicatorMR extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
} }
</div> </div>
</button> </button>}
<button {this.state.get_for == 'edit' && <button
type="button" type="button"
disabled={this.state.editable} disabled={this.state.editable}
onClick={() => this.setState({ loading: true }, () => { onClick={() => this.setState({ loading: true }, () => {
...@@ -1541,7 +1566,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1541,7 +1566,7 @@ export default class OperatingIndicatorMR extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
} }
</div> </div>
</button> </button>}
</div>} </div>}
</div> </div>
</Paper> </Paper>
......
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