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