Commit 672e1044 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

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

parents 14fabc65 05a0c2a1
...@@ -204,6 +204,7 @@ const create = (type = "") => { ...@@ -204,6 +204,7 @@ const create = (type = "") => {
const checkApprover = () => api.get('transaction/master_budget/is_approver') const checkApprover = () => api.get('transaction/master_budget/is_approver')
const approvalSubmission = (body) => api.post('transaction/master_budget/approval_submission', body) const approvalSubmission = (body) => api.post('transaction/master_budget/approval_submission', body)
const getCompanySubmitted = (body) => api.post('transaction/get_company_submitted', body) const getCompanySubmitted = (body) => api.post('transaction/get_company_submitted', body)
const getLastPeriod = (idCompany) => api.get(`transaction/get_last_periode/${idCompany}`)
const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body) const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body)
const getOpetratingIndID = (body) => api.post('transaction/get_operating_indicator_id', body) const getOpetratingIndID = (body) => api.post('transaction/get_operating_indicator_id', body)
...@@ -367,7 +368,8 @@ const create = (type = "") => { ...@@ -367,7 +368,8 @@ const create = (type = "") => {
historyApproval, historyApproval,
checkApprover, checkApprover,
approvalSubmission, approvalSubmission,
getCompanySubmitted getCompanySubmitted,
getLastPeriod
} }
} }
......
...@@ -70,7 +70,7 @@ export default class BudgetTahunan extends Component { ...@@ -70,7 +70,7 @@ export default class BudgetTahunan extends Component {
this.props.selectIndex('Master Budget & CAT') this.props.selectIndex('Master Budget & CAT')
if (this.props.location.state !== undefined) { if (this.props.location.state !== undefined) {
console.log(this.props); console.log(this.props);
this.setState({ userType: this.props.location.state.userType, intent: 'Home', rawData: this.props.location.state.rawData }, () => { this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData }, () => {
this.checkApprover() this.checkApprover()
}) })
} else { } else {
...@@ -231,8 +231,8 @@ export default class BudgetTahunan extends Component { ...@@ -231,8 +231,8 @@ export default class BudgetTahunan extends Component {
getOptionLabel: (option) => titleCase(option.company_name), getOptionLabel: (option) => titleCase(option.company_name),
}; };
let index = arrayBaru.findIndex((val) => val.company_id == comID) let index = arrayBaru.findIndex((val) => val.company_id == comID)
this.setState({ listCompany: defaultProps, company: index == -1 ? arrayBaru[0] : arrayBaru[index] }, () => { this.setState({ listCompany: defaultProps, company: arrayBaru.length < 1? companyData[0] : (index == -1 ? arrayBaru[0] : arrayBaru[index]) }, () => {
this.getPeriode() this.getLastPeriod()
}) })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -250,10 +250,21 @@ export default class BudgetTahunan extends Component { ...@@ -250,10 +250,21 @@ export default class BudgetTahunan extends Component {
}) })
} }
getLastPeriod(){
api.create().getLastPeriod(this.state.company.company_id).then(response => {
console.log(response);
if (response.data.status === "success") {
this.setState({ lastPeriod : response.data.data.last_periode}, ()=> {
this.getPeriode()
})
}
})
}
getPeriode() { getPeriode() {
api.create().getPeriodeTransaction().then(response => { api.create().getPeriodeTransaction().then(response => {
let dateNow = new Date // let dateNow = new Date
let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy') // let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy')
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let data = response.data.data let data = response.data.data
...@@ -266,7 +277,7 @@ export default class BudgetTahunan extends Component { ...@@ -266,7 +277,7 @@ export default class BudgetTahunan extends Component {
options: periodeData, options: periodeData,
getOptionLabel: (option) => option.periode, getOptionLabel: (option) => option.periode,
}; };
let index = data.sort((a, b) => a - b).findIndex((val) => val === year) let index = data.sort((a, b) => a - b).findIndex((val) => val === this.state.lastPeriod)
this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => { this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => {
if (this.state.isApprover === true) { if (this.state.isApprover === true) {
this.getCompanySubmitted() this.getCompanySubmitted()
...@@ -1162,6 +1173,7 @@ export default class BudgetTahunan extends Component { ...@@ -1162,6 +1173,7 @@ export default class BudgetTahunan extends Component {
status={this.state.status} status={this.state.status}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.prevRevision}
/> />
)} )}
...@@ -1181,6 +1193,7 @@ export default class BudgetTahunan extends Component { ...@@ -1181,6 +1193,7 @@ export default class BudgetTahunan extends Component {
status={this.state.status} status={this.state.status}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.prevRevision}
/> />
)} )}
{this.state.visibleFAM && ( {this.state.visibleFAM && (
...@@ -1199,6 +1212,7 @@ export default class BudgetTahunan extends Component { ...@@ -1199,6 +1212,7 @@ export default class BudgetTahunan extends Component {
status={this.state.status} status={this.state.status}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.prevRevision}
/> />
)} )}
{this.state.visibleCAT && ( {this.state.visibleCAT && (
...@@ -1216,6 +1230,7 @@ export default class BudgetTahunan extends Component { ...@@ -1216,6 +1230,7 @@ export default class BudgetTahunan extends Component {
getReport={this.getSubmission.bind(this)} getReport={this.getSubmission.bind(this)}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.prevRevision}
/> />
)} )}
{this.state.visibleCF && ( {this.state.visibleCF && (
...@@ -1231,6 +1246,7 @@ export default class BudgetTahunan extends Component { ...@@ -1231,6 +1246,7 @@ export default class BudgetTahunan extends Component {
saveToMasterBudget={this.saveToMasterBudget.bind(this)} saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleCF: false, visibleBudgetTahunan: true })} onClickClose={() => this.setState({ visibleCF: false, visibleBudgetTahunan: true })}
getReport={this.getSubmission.bind(this)} getReport={this.getSubmission.bind(this)}
prevRevision={this.state.prevRevision}
/> />
)} )}
......
...@@ -87,7 +87,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -87,7 +87,7 @@ export default class CorporateAnnualTarget extends Component {
componentDidMount() { componentDidMount() {
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate() this.getLatestUpdate()
console.log(this.props); console.log(this.props.lastStatus);
this.getKPIType() this.getKPIType()
this.getMaxAch() this.getMaxAch()
...@@ -121,9 +121,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -121,9 +121,9 @@ export default class CorporateAnnualTarget extends Component {
item.description, item.description,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : item.cat.weight, item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : item.cat.weight,
parentTrue? item.cat.uom : item.uom, parentTrue? item.cat.uom : item.uom,
item.cat.kpi_type == "" ? null : { value: item.cat.kpi_type }, parentTrue? item.cat.kpi_type == "" ? null : { value: item.cat.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type },
item.cat.max_ach == "" ? null : { value: item.cat.max_ach }, parentTrue? item.cat.max_ach == "" ? null : { value: item.cat.max_ach } : item.max_ach == "" ? null : { value: item.max_ach },
item.cat.formula == "" ? null : { value: item.cat.formula }, parentTrue? item.cat.formula == "" ? null : { value: item.cat.formula }: item.formula_ytd == "" ? null : { value: item.formula_ytd },
item.cat.total_actual_before == "" ? item.cat.total_actual_before : String(item.cat.total_actual_before).indexOf(".") == -1 ? Number(item.cat.total_actual_before) : Number(item.cat.total_actual_before).toFixed(1), item.cat.total_actual_before == "" ? item.cat.total_actual_before : String(item.cat.total_actual_before).indexOf(".") == -1 ? Number(item.cat.total_actual_before) : Number(item.cat.total_actual_before).toFixed(1),
item.cat.january == "" ? item.cat.january : String(item.cat.january).indexOf(".") == -1 ? Number(item.cat.january) : Number(item.cat.january).toFixed(1), item.cat.january == "" ? item.cat.january : String(item.cat.january).indexOf(".") == -1 ? Number(item.cat.january) : Number(item.cat.january).toFixed(1),
item.cat.february == "" ? item.cat.february : String(item.cat.february).indexOf(".") == -1 ? Number(item.cat.february) : Number(item.cat.february).toFixed(1), item.cat.february == "" ? item.cat.february : String(item.cat.february).indexOf(".") == -1 ? Number(item.cat.february) : Number(item.cat.february).toFixed(1),
...@@ -216,10 +216,11 @@ export default class CorporateAnnualTarget extends Component { ...@@ -216,10 +216,11 @@ export default class CorporateAnnualTarget extends Component {
console.log('masuk') console.log('masuk')
let bram = [this.props.submissionID, this.props.report_id, this.props.company.company_id, this.props.periode, this.props.revision] let bram = [this.props.submissionID, this.props.report_id, this.props.company.company_id, this.props.periode, this.props.revision]
console.log(bram) console.log(bram)
let resReal = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let resNull = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let res = await fetch( let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` this.props.submissionID == null? resNull : resReal
) )
res = await res.blob() res = await res.blob()
console.log(res) console.log(res)
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -1078,7 +1079,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1078,7 +1079,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
maxLength={4} maxLength={4}
onBlur={(event) => { onBlur={(event) => {
// updateValue(some) // updateValue(some)
...@@ -1118,7 +1119,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1118,7 +1119,7 @@ export default class CorporateAnnualTarget extends Component {
placeholder="" placeholder=""
defaultValue={value} defaultValue={value}
color={"#5198ea"} color={"#5198ea"}
disabled={this.props.isApprover ? true : !handleAction(tableMeta.rowData[2])} disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !handleAction(tableMeta.rowData[2]))}
onBlur={(event) => { onBlur={(event) => {
console.log(event.target.value) console.log(event.target.value)
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1134,7 +1135,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1134,7 +1135,7 @@ export default class CorporateAnnualTarget extends Component {
placeholder="" placeholder=""
defaultValue={value} defaultValue={value}
color={"#5198ea"} color={"#5198ea"}
disabled={this.props.isApprover ? true : !handleAction(tableMeta.rowData[2])} disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !handleAction(tableMeta.rowData[2]))}
onBlur={(event) => { onBlur={(event) => {
console.log(event.target.value) console.log(event.target.value)
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1169,7 +1170,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1169,7 +1170,7 @@ export default class CorporateAnnualTarget extends Component {
onChange={(event, newInputValue) => handleChangeDropdown(newInputValue, tableMeta)} onChange={(event, newInputValue) => handleChangeDropdown(newInputValue, tableMeta)}
debug debug
disableClearable disableClearable
disabled={this.props.isApprover ? true : !handleAction(tableMeta.rowData[2])} disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !handleAction(tableMeta.rowData[2]))}
value={val} value={val}
style={{ padding: 0, margin: 0 }} style={{ padding: 0, margin: 0 }}
renderInput={(params) => renderInput={(params) =>
...@@ -1205,7 +1206,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1205,7 +1206,7 @@ export default class CorporateAnnualTarget extends Component {
disableClearable disableClearable
value={val} value={val}
style={{ padding: 0, margin: 0 }} style={{ padding: 0, margin: 0 }}
disabled={this.props.isApprover ? true : !handleAction(tableMeta.rowData[2])} disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !handleAction(tableMeta.rowData[2]))}
renderInput={(params) => renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}> <div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<input style={{ borderColor: 'white', width: 96, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} /> <input style={{ borderColor: 'white', width: 96, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} />
...@@ -1242,7 +1243,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1242,7 +1243,7 @@ export default class CorporateAnnualTarget extends Component {
debug debug
disableClearable disableClearable
value={val} value={val}
disabled={this.props.isApprover ? true : !handleAction(tableMeta.rowData[2])} disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !handleAction(tableMeta.rowData[2]))}
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 }}>
...@@ -1281,7 +1282,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1281,7 +1282,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1322,7 +1323,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1322,7 +1323,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1363,7 +1364,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1363,7 +1364,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1405,7 +1406,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1405,7 +1406,7 @@ export default class CorporateAnnualTarget extends Component {
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1445,7 +1446,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1445,7 +1446,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1485,7 +1486,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1485,7 +1486,7 @@ export default class CorporateAnnualTarget extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1526,7 +1527,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1526,7 +1527,7 @@ export default class CorporateAnnualTarget extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1568,7 +1569,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1568,7 +1569,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1608,8 +1609,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1608,8 +1609,8 @@ export default class CorporateAnnualTarget extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1649,7 +1650,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1649,7 +1650,7 @@ export default class CorporateAnnualTarget extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
...@@ -1691,7 +1692,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1691,7 +1692,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1732,7 +1733,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1732,7 +1733,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1773,7 +1774,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1773,7 +1774,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1852,7 +1853,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1852,7 +1853,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1893,7 +1894,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1893,7 +1894,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1931,7 +1932,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1931,7 +1932,7 @@ export default class CorporateAnnualTarget extends Component {
style={{ fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -5 }} style={{ fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -5 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
defaultValue={value} defaultValue={value}
onBlur={(event) => { onBlur={(event) => {
console.log(event.target.value) console.log(event.target.value)
...@@ -1971,7 +1972,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1971,7 +1972,7 @@ export default class CorporateAnnualTarget extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -5 }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -5 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover} disabled={this.props.isApprover? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true)}
defaultValue={value} defaultValue={value}
onBlur={(event) => { onBlur={(event) => {
console.log(event.target.value) console.log(event.target.value)
...@@ -2041,7 +2042,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2041,7 +2042,7 @@ export default class CorporateAnnualTarget 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" />
<a data-tip={'Upload'} data-for="upload"> {((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ) && <a data-tip={'Upload'} data-for="upload">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -2053,7 +2054,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2053,7 +2054,7 @@ export default class CorporateAnnualTarget 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
...@@ -2135,7 +2136,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2135,7 +2136,7 @@ export default class CorporateAnnualTarget extends Component {
<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.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ) && <button
className="button" className="button"
type="button" type="button"
style={{ style={{
...@@ -2158,8 +2159,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2158,8 +2159,8 @@ export default class CorporateAnnualTarget extends Component {
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div> </div>
</button> </button>}
<button {((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ) && <button
type="button" type="button"
// disabled={this.state.buttonError} // disabled={this.state.buttonError}
onClick={() => this.state.buttonError ? onClick={() => this.state.buttonError ?
...@@ -2179,7 +2180,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2179,7 +2180,7 @@ export default class CorporateAnnualTarget extends Component {
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div> </div>
</button> </button>}
</div>} </div>}
</div> </div>
</Paper> </Paper>
...@@ -2228,7 +2229,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2228,7 +2229,7 @@ export default class CorporateAnnualTarget extends Component {
</button> </button>
</div> </div>
{!this.props.isApprover && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> {!this.props.isApprover && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button {this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' && <button
type="button" type="button"
onClick={() => onClick={() =>
this.setState({ loading: true }, () => { this.setState({ loading: true }, () => {
...@@ -2242,8 +2243,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2242,8 +2243,8 @@ export default class CorporateAnnualTarget 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.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' && <button
className="button" className="button"
type="button" type="button"
disabled={this.state.buttonError} disabled={this.state.buttonError}
...@@ -2268,8 +2269,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2268,8 +2269,8 @@ export default class CorporateAnnualTarget extends Component {
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div> </div>
</button> </button>}
<button {this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' && <button
type="button" type="button"
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -2292,7 +2293,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2292,7 +2293,7 @@ export default class CorporateAnnualTarget extends Component {
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div> </div>
</button> </button>}
</div>} </div>}
</div> </div>
</div> </div>
......
...@@ -726,7 +726,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -726,7 +726,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -814,7 +814,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -814,7 +814,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -903,7 +903,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -903,7 +903,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -992,7 +992,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -992,7 +992,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1081,7 +1081,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1081,7 +1081,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1170,7 +1170,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1170,7 +1170,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1259,7 +1259,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1259,7 +1259,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1348,7 +1348,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1348,7 +1348,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1437,7 +1437,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1437,7 +1437,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1526,7 +1526,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1526,7 +1526,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1615,7 +1615,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1615,7 +1615,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1704,7 +1704,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1704,7 +1704,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1831,7 +1831,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1831,7 +1831,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1920,7 +1920,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1920,7 +1920,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
......
...@@ -662,7 +662,7 @@ export default class ProfitLoss extends Component { ...@@ -662,7 +662,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
defaultValue={value} defaultValue={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -737,7 +737,7 @@ export default class ProfitLoss extends Component { ...@@ -737,7 +737,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -826,7 +826,7 @@ export default class ProfitLoss extends Component { ...@@ -826,7 +826,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -916,7 +916,7 @@ export default class ProfitLoss extends Component { ...@@ -916,7 +916,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1006,7 +1006,7 @@ export default class ProfitLoss extends Component { ...@@ -1006,7 +1006,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1096,7 +1096,7 @@ export default class ProfitLoss extends Component { ...@@ -1096,7 +1096,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1186,7 +1186,7 @@ export default class ProfitLoss extends Component { ...@@ -1186,7 +1186,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1276,7 +1276,7 @@ export default class ProfitLoss extends Component { ...@@ -1276,7 +1276,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1366,7 +1366,7 @@ export default class ProfitLoss extends Component { ...@@ -1366,7 +1366,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1456,7 +1456,7 @@ export default class ProfitLoss extends Component { ...@@ -1456,7 +1456,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1546,7 +1546,7 @@ export default class ProfitLoss extends Component { ...@@ -1546,7 +1546,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1636,7 +1636,7 @@ export default class ProfitLoss extends Component { ...@@ -1636,7 +1636,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1726,7 +1726,7 @@ export default class ProfitLoss extends Component { ...@@ -1726,7 +1726,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1863,7 +1863,7 @@ export default class ProfitLoss extends Component { ...@@ -1863,7 +1863,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1953,7 +1953,7 @@ export default class ProfitLoss extends Component { ...@@ -1953,7 +1953,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? false : true} disabled={this.props.isApprover == true ? true : (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : true}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -2072,7 +2072,7 @@ export default class ProfitLoss extends Component { ...@@ -2072,7 +2072,7 @@ export default class ProfitLoss extends Component {
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.props.isApprover == true || this.state.dataTable.length == 0 ? null : {this.props.isApprover == true || this.state.dataTable.length == 0 ? null :
<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.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ) && (
<div> <div>
<a data-tip={'Download Template'} data-for="template"> <a data-tip={'Download Template'} data-for="template">
<button <button
...@@ -2090,7 +2090,7 @@ export default class ProfitLoss extends Component { ...@@ -2090,7 +2090,7 @@ export default class ProfitLoss extends Component {
<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.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ) && (
<div> <div>
<a data-tip={'Upload'} data-for="upload"> <a data-tip={'Upload'} data-for="upload">
<button <button
...@@ -2166,7 +2166,7 @@ export default class ProfitLoss extends Component { ...@@ -2166,7 +2166,7 @@ export default class ProfitLoss extends Component {
</button> </button>
</div> </div>
{this.props.isApprover === true || this.state.dataTable.length == 0 ? null : {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION' ? (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ?
<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 <button
className="button" className="button"
......
...@@ -128,7 +128,7 @@ export default class OperatingIndicator extends Component { ...@@ -128,7 +128,7 @@ export default class OperatingIndicator extends Component {
getOptionLabel: (option) => titleCase(option.company_name), getOptionLabel: (option) => titleCase(option.company_name),
}; };
this.setState({ listCompany: defaultProps, company: arrayBaru[0] }, () => { this.setState({ listCompany: defaultProps, company: arrayBaru.length < 1? companyData[0] : arrayBaru[0] }, () => {
this.getPeriode() this.getPeriode()
}) })
} else { } else {
......
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