Commit 664c4666 authored by Riri Novita's avatar Riri Novita

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents 892d3578 24fd3af5
......@@ -303,7 +303,7 @@ export default class BalanceSheetMR extends Component {
orders: i[0] === undefined ? "" : String(i[0]).trim(),
item_report_id: i[1] === undefined ? "" : String(i[1]).trim(),
item_report: i[2] === undefined ? "" : String(i[2]).trim(),
actual: i[3] === undefined ? "0" : reg.test(String(i[2])) === false ? "0" : String(i[3]).trim(),
actual: i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(),
mtd_vs_previous_month: i[4] === undefined ? "" : String(i[4]).trim(),
mtd_vs_mb: i[5] === undefined ? "" : String(i[5]).trim(),
mtd_vs_rb: i[6] === undefined ? "" : String(i[6]).trim(),
......@@ -709,7 +709,7 @@ export default class BalanceSheetMR extends Component {
let data = tableMeta.rowData[20] == null? [] : tableMeta.rowData[20]
let indexID = data.findIndex((val) => val.item_formula == String(`${item}`))
if (indexID !== -1) {
console.log(tableMeta)
// console.log(tableMeta)
let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
......@@ -1858,7 +1858,7 @@ export default class BalanceSheetMR extends Component {
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{/* {!this.state.loading && ( */}
{!this.state.loading && (
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
......@@ -1866,7 +1866,7 @@ export default class BalanceSheetMR extends Component {
options={options}
/>
</MuiThemeProvider>
{/* )} */}
)}
</div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
......@@ -2014,7 +2014,7 @@ export default class BalanceSheetMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{this.state.dataLoaded && (
{this.state.dataLoaded && !this.state.loading && (
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
......
......@@ -427,7 +427,7 @@ export default class CashFlowMR extends Component {
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<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>
</div>
<div style={{ width: '50%' }}>
......
......@@ -64,7 +64,10 @@ export default class CorporateAnnualTargetMR extends Component {
getOptionLabel: (option) => titleCase(option.value),
},
visibleCATMR: true,
updateBy: '-'
updateBy: '-',
notes: "",
judulColumn: null,
get_for: "view"
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -76,6 +79,15 @@ export default class CorporateAnnualTargetMR extends Component {
this.getMaxAch()
}
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getItemHierarki()
this.getLatestUpdate()
this.getKPIType()
this.getMaxAch()
})
}
getLatestUpdate() {
let payload = {
"report_id": this.props.report_id,
......@@ -91,7 +103,8 @@ export default class CorporateAnnualTargetMR extends Component {
if (response.data) {
if (response.data.status === "success") {
this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update,
notes: response.data.data.notes_update === null ? "" : response.data.data.notes_update
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, typeAlert: 'warning', loading: false }, () => {
......@@ -117,7 +130,8 @@ export default class CorporateAnnualTargetMR extends Component {
"periode": "2021",
"company_id": this.props.company.company_id,
"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 => {
......@@ -194,7 +208,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
})
// console.log(dataTable);
this.setState({ dataTable, loading: false })
this.setState({ dataTable, loading: false, saveDraft: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
......@@ -208,7 +222,7 @@ export default class CorporateAnnualTargetMR extends Component {
} else {
// console.log('terrrr')
//
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, saveDraft: true })
}
console.log(dataTable);
})
......@@ -216,10 +230,10 @@ export default class CorporateAnnualTargetMR extends Component {
downloadTemplate = async () => {
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/monthly_report/cat/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/monthly_report/cat/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=2021`
)
res = await res.blob()
console.log(res);
res = await res.blob()
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
......@@ -350,15 +364,15 @@ export default class CorporateAnnualTargetMR extends Component {
})
})
let body = {
"monthly_report_id": this.props.monthlyReportId,
// "monthly_report_id": this.props.monthlyReportId,
"company_id": this.props.company.company_id,
"periode": this.props.periode,
"periode": "2021",
"report_id": this.props.report_id,
"status": type,
"months": this.props.month.month_id,
"corporate_annual_target": data
}
console.log(data);
console.log(JSON.stringify(body));
api.create('UPLOAD').uploadMonthlyReportCAT(body).then(response => {
// console.log(response);
if (response.data) {
......@@ -494,7 +508,7 @@ export default class CorporateAnnualTargetMR extends Component {
let payload = {
"monthly_report_id": this.props.monthlyReportId,
"company_id": this.props.company.company_id,
"periode": this.props.periode,
"periode": "2021",
"report_id": this.props.report_id,
"status": type,
"months": this.props.month.month_id,
......@@ -926,12 +940,12 @@ export default class CorporateAnnualTargetMR extends Component {
control={
<NumberFormat
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"
placeholder=""
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={false}
disabled={this.state.get_for == 'view'}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1119,11 +1133,11 @@ export default class CorporateAnnualTargetMR extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
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) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1178,7 +1192,7 @@ export default class CorporateAnnualTargetMR extends Component {
</div>
<div style={{ width: '50%' }}>
<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
style={{
backgroundColor: 'transparent',
......@@ -1190,9 +1204,9 @@ export default class CorporateAnnualTargetMR extends Component {
>
<img src={Images.template} />
</button>
</a>
</a>}
<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
style={{
backgroundColor: 'transparent',
......@@ -1204,7 +1218,7 @@ export default class CorporateAnnualTargetMR extends Component {
>
<img src={Images.upload} />
</button>
</a>
</a>}
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download">
<button
......@@ -1241,6 +1255,7 @@ export default class CorporateAnnualTargetMR extends Component {
)}
</div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Notes : {this.state.notes}</Typography>
</div>
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1">
......@@ -1267,7 +1282,27 @@ export default class CorporateAnnualTargetMR extends Component {
<div className="col-2"></div>
:
<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"
type="button"
style={{
......@@ -1280,8 +1315,8 @@ export default class CorporateAnnualTargetMR extends Component {
onClick={() => {
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false })
// this.handleValidate()
this.setState({ loading: false })
}, 100);
})
}}
......@@ -1289,38 +1324,43 @@ export default class CorporateAnnualTargetMR extends Component {
<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>
</div>
</button>
<button
</button>}
{this.state.get_for === 'edit' && <button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: this.state.editable !== true ? 'pointer' : 'default',
cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() =>
this.state.editable === true ?
this.state.saveDraft === true ?
null :
this.state.handleTekTekTek === 1 ? null :
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.backToMonthlyReport('draft')
})
}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
{this.state.saveDraft?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</LightTooltip> :
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div>
</button>
<button
</button>}
{this.state.get_for === 'edit' && <button
type="button"
disabled={this.state.buttonError}
onClick={() =>
this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
:
this.state.handleTekTekTek === 1 ? null :
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.backToMonthlyReport('submitted')
})}
......@@ -1332,9 +1372,14 @@ export default class CorporateAnnualTargetMR extends Component {
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
{this.state.buttonError?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</LightTooltip> :
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
}
</div>
</button>
</button>}
</div>
}
</div>
......@@ -1346,7 +1391,7 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ padding: 20 }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {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>
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
......@@ -1360,13 +1405,13 @@ export default class CorporateAnnualTargetMR extends Component {
</MuiThemeProvider>
)}
</div>
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1">
<div className="grid grid-2x" style={{ marginTop: 10, padding: 20 }}>
<div className="col-1" style={{paddingLeft: 0}}>
<button
type="button"
onClick={() => this.setState({ loading: true }, () => {
onClick={() => this.setState({ loading: true, visibleCATMR: true }, () => {
setTimeout(() => {
this.props.onClickClose()
this.getItemHierarki()
}, 100);
})}
style={{
......@@ -1381,8 +1426,6 @@ export default class CorporateAnnualTargetMR extends Component {
</div>
</button>
</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') ? */}
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
className="button"
......@@ -1427,7 +1470,12 @@ export default class CorporateAnnualTargetMR extends Component {
}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
{this.state.saveDraft?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</LightTooltip> :
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div>
</button>
<button
......
......@@ -1374,7 +1374,7 @@ export default class FixedAssetsMovementMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 5 }}>Notes : {this.state.notesUpdate}</Typography>
</div>
<div className="grid grid-2x" style={{ padding: 20 }}>
<div className="col-1" style={{ paddingLeft: 0, }}>
<div className="col-1" style={{ paddingLeft: 0 }}>
<button
type="button"
onClick={() => this.setState({ loading: true }, () => {
......@@ -1405,8 +1405,7 @@ export default class FixedAssetsMovementMR extends Component {
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
outline: 'none'
}}
onClick={() => {
this.setState({loading: true}, () => {
......@@ -1524,7 +1523,7 @@ export default class FixedAssetsMovementMR extends Component {
)}
</div>
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1">
<div className="col-1" style={{ paddingLeft: 0 }}>
<button
type="button"
onClick={() => this.setState({ loading: true, visibleFAMMR: true }, () => {
......@@ -1546,7 +1545,7 @@ export default class FixedAssetsMovementMR extends Component {
</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') ? */}
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
<button
className="button"
type="button"
......@@ -1584,7 +1583,7 @@ export default class FixedAssetsMovementMR extends Component {
this.state.saveDraft === true ?
null :
this.state.handleTekTekTek === 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.uploadFAMMR('draft')
})
}
......@@ -1607,7 +1606,7 @@ export default class FixedAssetsMovementMR extends Component {
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
:
this.state.handleTekTekTek === 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.uploadFAMMR('submitted')
})}
style={{
......
......@@ -88,7 +88,8 @@ export default class ListOfCreditFacilities extends Component {
snekbarMsg: '',
visibleLOCFMR: true,
saveDraft: true,
saveComp: true
saveComp: true,
get_for: 'view'
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -99,6 +100,14 @@ export default class ListOfCreditFacilities extends Component {
this.getSubmission()
}
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getBankData()
this.getTypeOfCredit()
this.getSubmission()
})
}
getItemHierarki() {
let payload = {
"report_id": this.props.report_id,
......@@ -106,7 +115,8 @@ export default class ListOfCreditFacilities extends Component {
"periode": this.props.periode,
"company_id": this.props.company.company_id,
"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 => {
console.log(payload);
......@@ -298,7 +308,7 @@ export default class ListOfCreditFacilities extends Component {
// }
})
// console.log(dataTable);
if (dataTable.length == 0) {
if (dataTable.length == 0 && this.state.get_for == 'edit') {
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 ],
[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 {
name: "",
options: {
filter: false,
display: true,
display: this.state.get_for == 'view'? false : true,
customHeadRender: (columnMeta) => (
<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>
......@@ -1554,12 +1564,13 @@ export default class ListOfCreditFacilities extends Component {
onChange={(event, newInputValue) => handleChange(newInputValue, tableMeta, tableMeta.columnIndex)}
debug
disableClearable
disabled={this.state.get_for == 'view'}
// disabled={!handleAction(tableMeta.rowData[2], tableMeta.rowData[0])}
value={handleValueDropDown(val, 'bankName', tableMeta)}
style={{ padding: 0, margin: 0}}
renderInput={(params) =>
<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>
}
/>
......@@ -1589,11 +1600,12 @@ export default class ListOfCreditFacilities extends Component {
debug
value={handleValueDropDown(val, 'typeOfCreditList', tableMeta)}
disableClearable
disabled={this.state.get_for == 'view'}
// disabled={!handleAction(tableMeta.rowData[2], tableMeta.rowData[0])}
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: "#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>
}
/>
......@@ -1617,13 +1629,13 @@ export default class ListOfCreditFacilities extends Component {
{ tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9?
null :
<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)} />
</div>
// <ThemeProvider theme={theme}>
// <Input
// 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"
// placeholder=""
// disabled={tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9? true : false}
......@@ -1664,6 +1676,7 @@ export default class ListOfCreditFacilities extends Component {
// label="Valid To"
format="dd-MM-yyyy"
value={val}
disabled={this.state.get_for == 'view'}
onChange={(e) => handleChange(e, tableMeta, tableMeta.columnIndex, 'date')}
// minDate={this.state.startDate}
KeyboardButtonProps={{
......@@ -1712,10 +1725,11 @@ export default class ListOfCreditFacilities extends Component {
control={
<NumberFormat
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"
placeholder=""
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)}
decimalScale={2}
onBlur={(event) => {
......@@ -1748,10 +1762,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[11]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -1825,10 +1839,10 @@ export default class ListOfCreditFacilities extends Component {
control={
<NumberFormat
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"
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)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 12)
......@@ -1870,10 +1884,10 @@ export default class ListOfCreditFacilities extends Component {
control={
<NumberFormat
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[13]).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 13)
......@@ -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' }}
type="text"
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)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 14)
......@@ -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' }}
type="text"
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)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 15)
......@@ -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' }}
type="text"
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)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 16)
......@@ -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' }}
type="text"
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)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 17)
......@@ -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 }}
type="text"
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]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -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' }}
type="text"
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)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 19)
......@@ -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' }}
type="text"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[20]).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 20)
......@@ -2574,10 +2588,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[25]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -2654,10 +2668,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[27]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -2734,10 +2748,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[29]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -2814,10 +2828,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[31]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -2897,10 +2911,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[33]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -2922,10 +2936,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[34]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -2950,10 +2964,10 @@ export default class ListOfCreditFacilities extends Component {
control={
<NumberFormat
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[35]).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 35)
......@@ -3008,10 +3022,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[36]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -3033,10 +3047,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[37]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -3061,10 +3075,10 @@ export default class ListOfCreditFacilities extends Component {
control={
<NumberFormat
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[38]).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 20)
......@@ -3119,10 +3133,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[39]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -3144,10 +3158,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[40]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -3172,10 +3186,10 @@ export default class ListOfCreditFacilities extends Component {
control={
<NumberFormat
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[41]).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 20)
......@@ -3230,10 +3244,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[42]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -3255,10 +3269,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[43]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -3283,10 +3297,10 @@ export default class ListOfCreditFacilities extends Component {
control={
<NumberFormat
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
value={Number(tableMeta.rowData[20]).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 20)
......@@ -3320,10 +3334,10 @@ export default class ListOfCreditFacilities extends Component {
<ThemeProvider theme={theme}>
<Input
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"
placeholder=""
disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[45]}
onBlur={(event) => {
// // // console.log(event.target.value)
......@@ -3493,7 +3507,7 @@ export default class ListOfCreditFacilities extends Component {
</div>
<div style={{ width: '50%' }}>
<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>
<a data-tip={'Download Template'} data-for="template">
<button
......@@ -3510,8 +3524,8 @@ export default class ListOfCreditFacilities extends Component {
</a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
</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>
<a data-tip={'Upload'} data-for="upload">
<button
......@@ -3530,7 +3544,7 @@ export default class ListOfCreditFacilities extends Component {
</a>
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
</div>
{/* )} */}
)}
<a data-tip={'Download'} data-for="download">
<button
style={{
......@@ -3609,10 +3623,31 @@ export default class ListOfCreditFacilities extends Component {
</div>
</button>
</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%' }}>
<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"
type="button"
style={{
......@@ -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' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div>
</button>
<button
</button>}
{this.state.get_for == 'edit' && <button
className="button"
type="button"
onClick={() =>
......@@ -3658,8 +3693,8 @@ export default class ListOfCreditFacilities extends Component {
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>}
</div>
</button>
<button
</button>}
{this.state.get_for == 'edit' && <button
type="button"
// disabled={this.state.buttonError}
onClick={() =>
......@@ -3687,8 +3722,8 @@ export default class ListOfCreditFacilities extends Component {
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>}
</div>
</button>
</div>
</button>}
</div>}
{/* : null } */}
</div>
</Paper>
......
......@@ -62,7 +62,8 @@ export default class OperatingIndicatorMR extends Component {
disabledSave: true,
editable: true,
emptyData: false,
templateNull: true
templateNull: true,
get_for: 'view'
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -73,6 +74,13 @@ export default class OperatingIndicatorMR extends Component {
this.getLatestUpdate()
}
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getSettingControl()
this.getLatestUpdate()
})
}
getLatestUpdate() {
let payload = {
"operating_indicator_id": this.props.data.operatingIndID,
......@@ -166,7 +174,8 @@ export default class OperatingIndicatorMR extends Component {
"report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id,
"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 => {
console.log(response);
......@@ -978,10 +987,10 @@ export default class OperatingIndicatorMR extends Component {
control={
<NumberFormat
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"
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)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
......@@ -1247,10 +1256,11 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
// disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[15]}
inputProps={{
style: {
color: "#5198ea",
color: this.state.get_for == 'view'? "black" : "#5198ea",
textAlign: 'right',
backgroundColor: '#ffac99'
}
......@@ -1266,6 +1276,7 @@ export default class OperatingIndicatorMR extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[15]}
inputProps={{
style: {
......@@ -1296,11 +1307,11 @@ export default class OperatingIndicatorMR extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={false}
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[16]}
inputProps={{
style: {
color: "#5198ea",
color: this.state.get_for == 'view'? "black" : "#5198ea",
textAlign: 'right',
backgroundColor: '#ffac99'
}
......@@ -1317,6 +1328,7 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
defaultValue={tableMeta.rowData[16]}
disabled={this.state.get_for == 'view'}
inputProps={{
style: {
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 {
</div>
<div style={{ width: '50%' }}>
<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
style={{
backgroundColor: 'transparent',
......@@ -1405,7 +1417,7 @@ export default class OperatingIndicatorMR extends Component {
</button>
</a>}
<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
style={{
backgroundColor: 'transparent',
......@@ -1473,7 +1485,20 @@ export default class OperatingIndicatorMR extends Component {
</button>
</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%' }}>
<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"
onClick={() =>
this.setState({ loading: true, editable: false }, () => {
......@@ -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' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div>
</button>
<button
</button>}
{this.state.get_for == 'edit' && <button
className="button"
type="button"
disabled={this.state.editable}
......@@ -1515,8 +1540,8 @@ export default class OperatingIndicatorMR extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div>
</button>
<button
</button>}
{this.state.get_for == 'edit' && <button
type="button"
disabled={this.state.editable}
onClick={() => this.setState({ loading: true }, () => {
......@@ -1541,7 +1566,7 @@ export default class OperatingIndicatorMR extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
}
</div>
</button>
</button>}
</div>}
</div>
</Paper>
......
......@@ -574,7 +574,7 @@ export default class TaxPlanningMR extends Component {
}
} else {
let data = tableMeta.rowData[12]
let indexID = data.findIndex((val) => val.item_formula == String(`${item}`) && val.periode == Number(this.props.periode))
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
if (indexID !== -1) {
let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
......
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