Commit e4e3fd1b authored by Faisal Hamdi's avatar Faisal Hamdi

Merge branch 'faisal' into 'master'

Faisal

See merge request !1391
parents f36f3058 ba7aac6b
...@@ -149,6 +149,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -149,6 +149,7 @@ export default class BalanceSheetOLPA extends Component {
"company_id": this.props.company.company_id "company_id": this.props.company.company_id
} }
api.create().getLastestUpdateOLPA(payload).then(response => { api.create().getLastestUpdateOLPA(payload).then(response => {
// console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -527,7 +528,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -527,7 +528,7 @@ export default class BalanceSheetOLPA extends Component {
// console.log(this.state.dataTable) // console.log(this.state.dataTable)
dataTable.map((i, index) => { dataTable.map((i, index) => {
if (String(i[5]) == "Control (should be nil)") { if (String(i[5]) == "Control (should be nil)") {
if ( Number(i[17]) < this.state.minValue || Number(i[17]) > this.state.maxValue ) { if (Number(i[17]) < this.state.minValue || Number(i[17]) > this.state.maxValue) {
err = true err = true
} else if (Number(i[18]) < this.state.minValue || Number(i[18]) > this.state.maxValue) { } else if (Number(i[18]) < this.state.minValue || Number(i[18]) > this.state.maxValue) {
err = true err = true
...@@ -572,20 +573,20 @@ export default class BalanceSheetOLPA extends Component { ...@@ -572,20 +573,20 @@ export default class BalanceSheetOLPA extends Component {
if (response.data.data.result && err === false) { if (response.data.data.result && err === false) {
this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false }) this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
if (kansas == 0) { if (kansas == 0) {
this.setState({kansas: 1, loading: true}, () => { this.setState({ kansas: 1, loading: true }, () => {
this.handleValidate() this.handleValidate()
}) })
} else { } else {
this.setState({kansas: 0}) this.setState({ kansas: 0 })
} }
} else { } else {
this.setState({ loading: false, buttonError: true, editable: true, saveDraft: true }) this.setState({ loading: false, buttonError: true, editable: true, saveDraft: true })
if (kansas == 0) { if (kansas == 0) {
this.setState({kansas: 1, loading: true}, () => { this.setState({ kansas: 1, loading: true }, () => {
this.handleValidate() this.handleValidate()
}) })
} else { } else {
this.setState({kansas: 0}) this.setState({ kansas: 0 })
} }
} }
} else { } else {
...@@ -1879,10 +1880,11 @@ export default class BalanceSheetOLPA extends Component { ...@@ -1879,10 +1880,11 @@ export default class BalanceSheetOLPA extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography>
) )
}) : }) :
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>-</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>-</Typography>
} }
</div> </div>
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 5 }}>Notes : {this.state.notes}</Typography>
</div> </div>
<div className="grid grid-2x" style={{ marginTop: 20 }}> <div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1"> <div className="col-1">
......
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