Commit f4b95bab authored by fahrur huzain's avatar fahrur huzain

Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'

Env dev

See merge request !2294
parents 842cc5b1 36540f87
...@@ -3,7 +3,7 @@ import { TextField, Typography, Snackbar, withStyles } from '@material-ui/core'; ...@@ -3,7 +3,7 @@ import { TextField, Typography, Snackbar, withStyles } from '@material-ui/core';
import * as R from 'ramda'; import * as R from 'ramda';
import api from '../../../api'; import api from '../../../api';
import Autocomplete from '@material-ui/lab/Autocomplete'; import Autocomplete from '@material-ui/lab/Autocomplete';
import { titleCase } from '../../../library/Utils'; import { fixNumber, titleCase } from '../../../library/Utils';
import format from "date-fns/format"; import format from "date-fns/format";
import { DatePicker } from '@material-ui/pickers'; import { DatePicker } from '@material-ui/pickers';
import Images from '../../../assets/Images'; import Images from '../../../assets/Images';
...@@ -184,10 +184,10 @@ export default class CreateMasterDataCAT extends Component { ...@@ -184,10 +184,10 @@ export default class CreateMasterDataCAT extends Component {
getData.map((item) => { getData.map((item) => {
jumlah += Number(item.weight) jumlah += Number(item.weight)
}) })
console.log(jumlah) console.log(fixNumber(jumlah,3))
if ( jumlah > 100/100 ) { if ( fixNumber(jumlah,3) > 100/100 ) {
this.setState({ errorWeight: true, msgErrorWeight: 'Weight more than 100%' }) this.setState({ errorWeight: true, msgErrorWeight: 'Weight more than 100%' })
} else if (jumlah < 100/100) { } else if (fixNumber(jumlah,3) < 100/100) {
this.setState({ errorWeight: true, msgErrorWeight: 'Weight less than 100%' }) this.setState({ errorWeight: true, msgErrorWeight: 'Weight less than 100%' })
} }
else { else {
......
...@@ -6,7 +6,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete'; ...@@ -6,7 +6,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete';
import MuiAlert from '@material-ui/lab/Alert'; import MuiAlert from '@material-ui/lab/Alert';
import api from '../../../api'; import api from '../../../api';
import * as R from 'ramda' import * as R from 'ramda'
import { titleCase } from '../../../library/Utils'; import { fixNumber, titleCase } from '../../../library/Utils';
import Images from '../../../assets/Images'; import Images from '../../../assets/Images';
import Constant from '../../../library/Constant'; import Constant from '../../../library/Constant';
const Alert = withStyles({ const Alert = withStyles({
...@@ -194,10 +194,10 @@ export default class EditMasterDataCAT extends Component { ...@@ -194,10 +194,10 @@ export default class EditMasterDataCAT extends Component {
getData.map((item) => { getData.map((item) => {
jumlah += Number(item.weight) jumlah += Number(item.weight)
}) })
console.log(jumlah) console.log(fixNumber(jumlah,3))
if ( jumlah > 100/100 ) { if ( fixNumber(jumlah,3) > 100/100 ) {
this.setState({ errorWeight: true, msgErrorWeight: 'Weight more than 100%' }) this.setState({ errorWeight: true, msgErrorWeight: 'Weight more than 100%' })
} else if (jumlah < 100/100) { } else if (fixNumber(jumlah,3) < 100/100) {
this.setState({ errorWeight: true, msgErrorWeight: 'Weight less than 100%' }) this.setState({ errorWeight: true, msgErrorWeight: 'Weight less than 100%' })
} }
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