Commit c83ec53b authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

apdet

See merge request !1313
parents a4aba230 9c66bd58
...@@ -173,9 +173,9 @@ export default class OperatingIndicatorRO extends Component { ...@@ -173,9 +173,9 @@ export default class OperatingIndicatorRO extends Component {
item.level, item.level,
item.description, item.description,
item.uom, item.uom,
item.rolling_outlook.january === "" ? "0" : item.rolling_outlook.january, item.rolling_outlook.january,
item.rolling_outlook.february === "" ? "0" : item.rolling_outlook.february, item.rolling_outlook.february,
item.rolling_outlook.march === "" ? "0" : item.rolling_outlook.march, item.rolling_outlook.march,
item.rolling_outlook.april === "" ? "0" : item.rolling_outlook.april, item.rolling_outlook.april === "" ? "0" : item.rolling_outlook.april,
item.rolling_outlook.may === "" ? "0" : item.rolling_outlook.may, item.rolling_outlook.may === "" ? "0" : item.rolling_outlook.may,
item.rolling_outlook.june === "" ? "0" : item.rolling_outlook.june, item.rolling_outlook.june === "" ? "0" : item.rolling_outlook.june,
...@@ -206,9 +206,9 @@ export default class OperatingIndicatorRO extends Component { ...@@ -206,9 +206,9 @@ export default class OperatingIndicatorRO extends Component {
item.level, item.level,
item.description, item.description,
item.uom, item.uom,
item.rolling_outlook.january === "" ? "0" : item.rolling_outlook.january, item.rolling_outlook.january,
item.rolling_outlook.february === "" ? "0" : item.rolling_outlook.february, item.rolling_outlook.february,
item.rolling_outlook.march === "" ? "0" : item.rolling_outlook.march, item.rolling_outlook.march,
item.rolling_outlook.april === "" ? "0" : item.rolling_outlook.april, item.rolling_outlook.april === "" ? "0" : item.rolling_outlook.april,
item.rolling_outlook.may === "" ? "0" : item.rolling_outlook.may, item.rolling_outlook.may === "" ? "0" : item.rolling_outlook.may,
item.rolling_outlook.june === "" ? "0" : item.rolling_outlook.june, item.rolling_outlook.june === "" ? "0" : item.rolling_outlook.june,
...@@ -351,6 +351,9 @@ export default class OperatingIndicatorRO extends Component { ...@@ -351,6 +351,9 @@ export default class OperatingIndicatorRO extends Component {
a.download = 'Template Rolling Outlook Operating Indicator.xlsx'; a.download = 'Template Rolling Outlook Operating Indicator.xlsx';
a.click(); a.click();
} }
setTimeout(() => {
this.setState({loading: false})
}, 500);
} }
async downloadAllData() { async downloadAllData() {
...@@ -369,6 +372,9 @@ export default class OperatingIndicatorRO extends Component { ...@@ -369,6 +372,9 @@ export default class OperatingIndicatorRO extends Component {
a.download = 'Master Budget Operating Indicator.xlsx'; a.download = 'Master Budget Operating Indicator.xlsx';
a.click(); a.click();
} }
setTimeout(() => {
this.setState({loading: false})
}, 500);
} }
fileHandler = (event) => { fileHandler = (event) => {
...@@ -821,7 +827,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -821,7 +827,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)} value={ value === "" ? "" : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -840,7 +846,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -840,7 +846,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)} value={ value === "" ? "" : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -862,7 +868,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -862,7 +868,7 @@ export default class OperatingIndicatorRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
value={value === "0" ? "" : Number(value).toFixed(1)} value={value === "" ? "" : Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={true} disabled={true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} // disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
...@@ -917,7 +923,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -917,7 +923,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ value === "0" ? "" :Number(handleParent(tableMeta)).toFixed(1)} value={ value === "" ? "" :Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -936,7 +942,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -936,7 +942,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)} value={ value === "" ? "" : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -958,7 +964,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -958,7 +964,7 @@ export default class OperatingIndicatorRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
// value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
value={value === "0" ? "" : Number(value).toFixed(1)} value={value === "" ? "" : Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={true} disabled={true}
// disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} // disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
...@@ -1012,7 +1018,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1012,7 +1018,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ value === "0" ? "" : Number(handleParent(tableMeta)).toFixed(1)} value={ value === "" ? "" : Number(handleParent(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
/> />
...@@ -1031,7 +1037,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1031,7 +1037,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value === "0" ? "" : Number(handleFormula(tableMeta)).toFixed(1)} value={value === "" ? "" : Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1052,7 +1058,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -1052,7 +1058,7 @@ export default class OperatingIndicatorRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value === "0" ? "" : Number(value).toFixed(1)} value={value === "" ? "" : Number(value).toFixed(1)}
// value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={true} disabled={true}
...@@ -2058,11 +2064,9 @@ export default class OperatingIndicatorRO extends Component { ...@@ -2058,11 +2064,9 @@ export default class OperatingIndicatorRO extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => { onClick={() => this.setState({loading: true}, () => {
// this.setState({loading: true}, () => {
this.downloadTemplate() this.downloadTemplate()
// }) })}
}}
> >
<img src={Images.template} /> <img src={Images.template} />
</button> </button>
...@@ -2090,7 +2094,10 @@ export default class OperatingIndicatorRO extends Component { ...@@ -2090,7 +2094,10 @@ export default class OperatingIndicatorRO extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => this.downloadAllData()} onClick={() =>
this.setState({ loading: true }, () => {
this.downloadAllData()
})}
> >
<img src={Images.download} /> <img src={Images.download} />
</button> </button>
......
...@@ -246,9 +246,9 @@ export default class ProfitLossROO extends Component { ...@@ -246,9 +246,9 @@ export default class ProfitLossROO extends Component {
item.description, item.description,
item.profit_loss.notes, item.profit_loss.notes,
item.profit_loss.last_year_total === "" ? "0" : item.profit_loss.last_year_total, item.profit_loss.last_year_total === "" ? "0" : item.profit_loss.last_year_total,
item.profit_loss.january === "" ? "0" : item.profit_loss.january, item.profit_loss.january,
item.profit_loss.february === "" ? "0" : item.profit_loss.february, item.profit_loss.february,
item.profit_loss.march === "" ? "0" : item.profit_loss.march, item.profit_loss.march,
item.profit_loss.april === "" ? "0" : item.profit_loss.april, item.profit_loss.april === "" ? "0" : item.profit_loss.april,
item.profit_loss.may === "" ? "0" : item.profit_loss.may, item.profit_loss.may === "" ? "0" : item.profit_loss.may,
item.profit_loss.june === "" ? "0" : item.profit_loss.june, item.profit_loss.june === "" ? "0" : item.profit_loss.june,
...@@ -281,9 +281,9 @@ export default class ProfitLossROO extends Component { ...@@ -281,9 +281,9 @@ export default class ProfitLossROO extends Component {
item.description, item.description,
item.profit_loss.notes, item.profit_loss.notes,
item.profit_loss.last_year_total === "" ? "0" : item.profit_loss.last_year_total, item.profit_loss.last_year_total === "" ? "0" : item.profit_loss.last_year_total,
item.profit_loss.january === "" ? "0" : item.profit_loss.january, item.profit_loss.january,
item.profit_loss.february === "" ? "0" : item.profit_loss.february, item.profit_loss.february,
item.profit_loss.march === "" ? "0" : item.profit_loss.march, item.profit_loss.march,
item.profit_loss.april === "" ? "0" : item.profit_loss.april, item.profit_loss.april === "" ? "0" : item.profit_loss.april,
item.profit_loss.may === "" ? "0" : item.profit_loss.may, item.profit_loss.may === "" ? "0" : item.profit_loss.may,
item.profit_loss.june === "" ? "0" : item.profit_loss.june, item.profit_loss.june === "" ? "0" : item.profit_loss.june,
...@@ -340,6 +340,9 @@ export default class ProfitLossROO extends Component { ...@@ -340,6 +340,9 @@ export default class ProfitLossROO extends Component {
a.download = 'Template Rolling Outlook Profit Loss.xlsx'; a.download = 'Template Rolling Outlook Profit Loss.xlsx';
a.click(); a.click();
} }
setTimeout(() => {
this.setState({loading: false})
}, 500);
} }
async downloadAllData() { async downloadAllData() {
...@@ -358,6 +361,9 @@ export default class ProfitLossROO extends Component { ...@@ -358,6 +361,9 @@ export default class ProfitLossROO extends Component {
a.download = 'Rolling Outlook Profit Loss.xlsx'; a.download = 'Rolling Outlook Profit Loss.xlsx';
a.click(); a.click();
} }
setTimeout(() => {
this.setState({loading: false})
}, 500);
} }
backToRollingOutlook(type) { backToRollingOutlook(type) {
...@@ -1034,7 +1040,7 @@ export default class ProfitLossROO extends Component { ...@@ -1034,7 +1040,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)} value={val === "" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1051,7 +1057,7 @@ export default class ProfitLossROO extends Component { ...@@ -1051,7 +1057,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "" ? "" : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1072,7 +1078,7 @@ export default class ProfitLossROO extends Component { ...@@ -1072,7 +1078,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={val === "" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1089,7 +1095,7 @@ export default class ProfitLossROO extends Component { ...@@ -1089,7 +1095,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "" ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1132,7 +1138,7 @@ export default class ProfitLossROO extends Component { ...@@ -1132,7 +1138,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)} value={val === "" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1149,7 +1155,7 @@ export default class ProfitLossROO extends Component { ...@@ -1149,7 +1155,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "" ? "" : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1170,7 +1176,7 @@ export default class ProfitLossROO extends Component { ...@@ -1170,7 +1176,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={val === "" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1187,7 +1193,7 @@ export default class ProfitLossROO extends Component { ...@@ -1187,7 +1193,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "" ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1230,7 +1236,7 @@ export default class ProfitLossROO extends Component { ...@@ -1230,7 +1236,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(val).toFixed(1)} // value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)} value={val === "" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1247,7 +1253,7 @@ export default class ProfitLossROO extends Component { ...@@ -1247,7 +1253,7 @@ export default class ProfitLossROO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "" ? "" : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1268,7 +1274,7 @@ export default class ProfitLossROO extends Component { ...@@ -1268,7 +1274,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)} value={val === "" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
/> />
} }
/> />
...@@ -1285,7 +1291,7 @@ export default class ProfitLossROO extends Component { ...@@ -1285,7 +1291,7 @@ export default class ProfitLossROO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "" ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -2345,7 +2351,9 @@ export default class ProfitLossROO extends Component { ...@@ -2345,7 +2351,9 @@ export default class ProfitLossROO extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => this.downloadTemplate()} onClick={() => this.setState({loading: true}, () => {
this.downloadTemplate()
})}
> >
<img src={Images.template} /> <img src={Images.template} />
</button> </button>
...@@ -2375,9 +2383,7 @@ export default class ProfitLossROO extends Component { ...@@ -2375,9 +2383,7 @@ export default class ProfitLossROO extends Component {
}} }}
onClick={() => onClick={() =>
this.setState({ loading: true }, () => { this.setState({ loading: true }, () => {
setTimeout(() => {
this.downloadAllData() this.downloadAllData()
}, 100);
})} })}
> >
<img src={Images.download} /> <img src={Images.download} />
......
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