Commit 8c02602f authored by Faisal Hamdi's avatar Faisal Hamdi

Merge branch 'faisal' into 'master'

update ro bs!

See merge request !1380
parents a4d59990 a1545e65
...@@ -339,18 +339,18 @@ export default class BalanceSheetRO extends Component { ...@@ -339,18 +339,18 @@ export default class BalanceSheetRO extends Component {
data.push({ data.push({
"item_report_id": i[1], "item_report_id": i[1],
"total_december_last_year": String(Number(i[6]).toFixed(1)), "total_december_last_year": String(Number(i[6]).toFixed(1)),
"january": String(Number(i[7]).toFixed(1)), "january": i[7].value !== undefined ? String(Number(i[7].value).toFixed(1)) : String(Number(i[7]).toFixed(1)),
"february": String(Number(i[8]).toFixed(1)), "february": i[8].value !== undefined ? String(Number(i[8].value).toFixed(1)) : String(Number(i[8]).toFixed(1)),
"march": String(Number(i[9]).toFixed(1)), "march": i[9].value !== undefined ? String(Number(i[9].value).toFixed(1)) : String(Number(i[9]).toFixed(1)),
"april": String(Number(i[10]).toFixed(1)), "april": i[10].value !== undefined ? String(Number(i[10].value).toFixed(1)) : String(Number(i[10]).toFixed(1)),
"may": String(Number(i[11]).toFixed(1)), "may": i[11].value !== undefined ? String(Number(i[11].value).toFixed(1)) : String(Number(i[11]).toFixed(1)),
"june": String(Number(i[12]).toFixed(1)), "june": i[12].value !== undefined ? String(Number(i[12].value).toFixed(1)) : String(Number(i[12]).toFixed(1)),
"july": String(Number(i[13]).toFixed(1)), "july": i[13].value !== undefined ? String(Number(i[13].value).toFixed(1)) : String(Number(i[13]).toFixed(1)),
"august": String(Number(i[14]).toFixed(1)), "august": i[14].value !== undefined ? String(Number(i[14].value).toFixed(1)) : String(Number(i[14]).toFixed(1)),
"september": String(Number(i[15]).toFixed(1)), "september": i[15].value !== undefined ? String(Number(i[15].value).toFixed(1)) : String(Number(i[15]).toFixed(1)),
"october": String(Number(i[16]).toFixed(1)), "october": i[16].value !== undefined ? String(Number(i[16].value).toFixed(1)) : String(Number(i[16]).toFixed(1)),
"november": String(Number(i[17]).toFixed(1)), "november": i[17].value !== undefined ? String(Number(i[17].value).toFixed(1)) : String(Number(i[17]).toFixed(1)),
"december": String(Number(i[18]).toFixed(1)), "december": i[18].value !== undefined ? String(Number(i[18].value).toFixed(1)) : String(Number(i[18]).toFixed(1)),
"total_december_year": String(Number(i[19]).toFixed(1)) "total_december_year": String(Number(i[19]).toFixed(1))
}) })
}) })
...@@ -552,18 +552,18 @@ export default class BalanceSheetRO extends Component { ...@@ -552,18 +552,18 @@ export default class BalanceSheetRO extends Component {
item.level, item.level,
item.item_report, item.item_report,
item.total_december_last_year === "" ? "0" : item.total_december_last_year, item.total_december_last_year === "" ? "0" : item.total_december_last_year,
item.january === "" ? "0" : item.january, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.january, formula: item.january_formula } : Number(item.january).toFixed(1),
item.february === "" ? "0" : item.february, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.february, formula: item.february_formula } : Number(item.february).toFixed(1),
item.march === "" ? "0" : item.march, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.march, formula: item.march_formula } : Number(item.march).toFixed(1),
item.april === "" ? "0" : item.april, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.april, formula: item.april_formula } : Number(item.april).toFixed(1),
item.may === "" ? "0" : item.may, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.may, formula: item.may_formula } : Number(item.may).toFixed(1),
item.june === "" ? "0" : item.june, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.june, formula: item.june_formula } : Number(item.june).toFixed(1),
item.july === "" ? "0" : item.july, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.july, formula: item.july_formula } : Number(item.july).toFixed(1),
item.august === "" ? "0" : item.august, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.august, formula: item.august_formula } : Number(item.august).toFixed(1),
item.september === "" ? "0" : item.september, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.september, formula: item.september_formula } : Number(item.september).toFixed(1),
item.october === "" ? "0" : item.october, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.october, formula: item.october_formula } : Number(item.october).toFixed(1),
item.november === "" ? "0" : item.november, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.november, formula: item.november_formula } : Number(item.november).toFixed(1),
item.december === "" ? "0" : item.december, String(item.item_report).toLocaleLowerCase() == "profit (loss) mtd" ? { value: item.december, formula: item.december_formula } : Number(item.december).toFixed(1),
item.total_december_year === "" ? "0" : item.total_december_year, item.total_december_year === "" ? "0" : item.total_december_year,
item.order, item.order,
item.condition_it_should_be, item.condition_it_should_be,
...@@ -591,18 +591,18 @@ export default class BalanceSheetRO extends Component { ...@@ -591,18 +591,18 @@ export default class BalanceSheetRO extends Component {
data.push({ data.push({
"item_report_id": i[1], "item_report_id": i[1],
"total_december_last_year": String(Number(i[6]).toFixed(1)), "total_december_last_year": String(Number(i[6]).toFixed(1)),
"january": String(Number(i[7]).toFixed(1)), "january": i[7].value !== undefined ? String(Number(i[7].value).toFixed(1)) : String(Number(i[7]).toFixed(1)),
"february": String(Number(i[8]).toFixed(1)), "february": i[8].value !== undefined ? String(Number(i[8].value).toFixed(1)) : String(Number(i[8]).toFixed(1)),
"march": String(Number(i[9]).toFixed(1)), "march": i[9].value !== undefined ? String(Number(i[9].value).toFixed(1)) : String(Number(i[9]).toFixed(1)),
"april": String(Number(i[10]).toFixed(1)), "april": i[10].value !== undefined ? String(Number(i[10].value).toFixed(1)) : String(Number(i[10]).toFixed(1)),
"may": String(Number(i[11]).toFixed(1)), "may": i[11].value !== undefined ? String(Number(i[11].value).toFixed(1)) : String(Number(i[11]).toFixed(1)),
"june": String(Number(i[12]).toFixed(1)), "june": i[12].value !== undefined ? String(Number(i[12].value).toFixed(1)) : String(Number(i[12]).toFixed(1)),
"july": String(Number(i[13]).toFixed(1)), "july": i[13].value !== undefined ? String(Number(i[13].value).toFixed(1)) : String(Number(i[13]).toFixed(1)),
"august": String(Number(i[14]).toFixed(1)), "august": i[14].value !== undefined ? String(Number(i[14].value).toFixed(1)) : String(Number(i[14]).toFixed(1)),
"september": String(Number(i[15]).toFixed(1)), "september": i[15].value !== undefined ? String(Number(i[15].value).toFixed(1)) : String(Number(i[15]).toFixed(1)),
"october": String(Number(i[16]).toFixed(1)), "october": i[16].value !== undefined ? String(Number(i[16].value).toFixed(1)) : String(Number(i[16]).toFixed(1)),
"november": String(Number(i[17]).toFixed(1)), "november": i[17].value !== undefined ? String(Number(i[17].value).toFixed(1)) : String(Number(i[17]).toFixed(1)),
"december": String(Number(i[18]).toFixed(1)), "december": i[18].value !== undefined ? String(Number(i[18].value).toFixed(1)) : String(Number(i[18]).toFixed(1)),
"total_december_year": String(Number(i[19]).toFixed(1)) "total_december_year": String(Number(i[19]).toFixed(1))
}) })
}) })
...@@ -962,93 +962,6 @@ export default class BalanceSheetRO extends Component { ...@@ -962,93 +962,6 @@ export default class BalanceSheetRO extends Component {
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd" ? Number(val.value).toFixed(1) : Number(val).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd" ? Number(val.value).toFixed(1) : Number(val).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={val === "0" ? "" : Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true}
value={val === "0" ? "" : Number(val).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={val === "0" ? "" : Number(handleValueFormula(val, tableMeta)).toFixed(1)}
/>
}
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValidation(val, tableMeta)).toFixed(1) >= Number(this.state.minValue) && Number(handleValidation(val, tableMeta)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={val == 0 ? "" : Number(handleValidation(val, tableMeta)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={val == 0 ? "" : Number(handleValidation(val, tableMeta)).toFixed(1)}
/>
</LightTooltip>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1059,8 +972,8 @@ export default class BalanceSheetRO extends Component { ...@@ -1059,8 +972,8 @@ export default class BalanceSheetRO 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={String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd" ? Number(val.value).toFixed(1) : Number(val).toFixed(1)}
disabled={true} disabled={true}
value={val == 0 ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1094,93 +1007,6 @@ export default class BalanceSheetRO extends Component { ...@@ -1094,93 +1007,6 @@ export default class BalanceSheetRO extends Component {
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd" ? Number(val.value).toFixed(1) : Number(val).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd" ? Number(val.value).toFixed(1) : Number(val).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={val === "0" ? "" : Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true}
value={val === "0" ? "" : Number(val).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={val === "0" ? "" : Number(handleValueFormula(val, tableMeta)).toFixed(1)}
/>
}
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValidation(val, tableMeta)).toFixed(1) >= Number(this.state.minValue) && Number(handleValidation(val, tableMeta)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={val == 0 ? "" : Number(handleValidation(val, tableMeta)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={val == 0 ? "" : Number(handleValidation(val, tableMeta)).toFixed(1)}
/>
</LightTooltip>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1191,8 +1017,8 @@ export default class BalanceSheetRO extends Component { ...@@ -1191,8 +1017,8 @@ export default class BalanceSheetRO 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={String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd" ? Number(val.value).toFixed(1) : Number(val).toFixed(1)}
disabled={true} disabled={true}
value={val == 0 ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1226,93 +1052,6 @@ export default class BalanceSheetRO extends Component { ...@@ -1226,93 +1052,6 @@ export default class BalanceSheetRO extends Component {
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd" ? Number(val.value).toFixed(1) : Number(val).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd" ? Number(val.value).toFixed(1) : Number(val).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={val === "0" ? "" : Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true}
value={val === "0" ? "" : Number(val).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={val === "0" ? "" : Number(handleValueFormula(val, tableMeta)).toFixed(1)}
/>
}
/>
</div> :
tableMeta.rowData[0] === 7 ?
this.props.quarter === 'q1' || this.props.quarter === 'q2' || this.props.quarter === 'q3' ? null :
(Number(handleValidation(val, tableMeta)).toFixed(1) >= Number(this.state.minValue) && Number(handleValidation(val, tableMeta)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={val == 0 ? "" : Number(handleValidation(val, tableMeta)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={val == 0 ? "" : Number(handleValidation(val, tableMeta)).toFixed(1)}
/>
</LightTooltip>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1323,8 +1062,8 @@ export default class BalanceSheetRO extends Component { ...@@ -1323,8 +1062,8 @@ export default class BalanceSheetRO 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={String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd" ? Number(val.value).toFixed(1) : Number(val).toFixed(1)}
disabled={true} disabled={true}
value={val == 0 ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -2963,9 +2702,6 @@ export default class BalanceSheetRO extends Component { ...@@ -2963,9 +2702,6 @@ export default class BalanceSheetRO extends Component {
)} )}
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Notes : {this.state.notes}</Typography>
</div> </div>
<div className="grid grid-2x" style={{ padding: 20 }}> <div className="grid grid-2x" style={{ padding: 20 }}>
<div className="col-1" style={{ paddingLeft: 0 }}> <div className="col-1" style={{ paddingLeft: 0 }}>
......
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