Commit 865e989e authored by fahrur huzain's avatar fahrur huzain

validasi convertable item report

parent 897bc06a
...@@ -47,6 +47,7 @@ export default class CreateReportItems extends Component { ...@@ -47,6 +47,7 @@ export default class CreateReportItems extends Component {
errorCondition: false, errorCondition: false,
errorJenisLaporan: false, errorJenisLaporan: false,
errorPerusahaan: false, errorPerusahaan: false,
errorCovertible: false,
msgErrorJenisLaporan: '', msgErrorJenisLaporan: '',
msgErrorPerusahaan: '', msgErrorPerusahaan: '',
msgErrorTipeData: '', msgErrorTipeData: '',
...@@ -57,6 +58,7 @@ export default class CreateReportItems extends Component { ...@@ -57,6 +58,7 @@ export default class CreateReportItems extends Component {
msgErrorRV: '', msgErrorRV: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorCovertible: '',
disabledFormula: true, disabledFormula: true,
disabledFormulaSum: true, disabledFormulaSum: true,
disabledCondt: true, disabledCondt: true,
...@@ -115,6 +117,7 @@ export default class CreateReportItems extends Component { ...@@ -115,6 +117,7 @@ export default class CreateReportItems extends Component {
errorEndDate: false, errorEndDate: false,
errorTipeData: false, errorTipeData: false,
errorCondition: false, errorCondition: false,
errorCovertible: false,
msgErrorTipeData: '', msgErrorTipeData: '',
msgErrorCondition: '', msgErrorCondition: '',
msgErrorOrder: '', msgErrorOrder: '',
...@@ -123,6 +126,7 @@ export default class CreateReportItems extends Component { ...@@ -123,6 +126,7 @@ export default class CreateReportItems extends Component {
msgErrorRV: '', msgErrorRV: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorCovertible: '',
}) })
} else if (isDate && type === 'end_date') { } else if (isDate && type === 'end_date') {
this.setState({ this.setState({
...@@ -135,6 +139,7 @@ export default class CreateReportItems extends Component { ...@@ -135,6 +139,7 @@ export default class CreateReportItems extends Component {
errorEndDate: false, errorEndDate: false,
errorTipeData: false, errorTipeData: false,
errorCondition: false, errorCondition: false,
errorCovertible: false,
msgErrorTipeData: '', msgErrorTipeData: '',
msgErrorCondition: '', msgErrorCondition: '',
msgErrorOrder: '', msgErrorOrder: '',
...@@ -143,6 +148,7 @@ export default class CreateReportItems extends Component { ...@@ -143,6 +148,7 @@ export default class CreateReportItems extends Component {
msgErrorRV: '', msgErrorRV: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorCovertible: '',
}) })
} else { } else {
this.setState({ this.setState({
...@@ -155,6 +161,7 @@ export default class CreateReportItems extends Component { ...@@ -155,6 +161,7 @@ export default class CreateReportItems extends Component {
errorEndDate: false, errorEndDate: false,
errorTipeData: false, errorTipeData: false,
errorCondition: false, errorCondition: false,
errorCovertible: false,
msgErrorTipeData: '', msgErrorTipeData: '',
msgErrorCondition: '', msgErrorCondition: '',
msgErrorOrder: '', msgErrorOrder: '',
...@@ -163,6 +170,7 @@ export default class CreateReportItems extends Component { ...@@ -163,6 +170,7 @@ export default class CreateReportItems extends Component {
msgErrorRV: '', msgErrorRV: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorCovertible: '',
}) })
} }
} }
...@@ -197,6 +205,9 @@ export default class CreateReportItems extends Component { ...@@ -197,6 +205,9 @@ export default class CreateReportItems extends Component {
else if (R.isNil(this.state.endDate)) { else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' }) this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' })
} }
else if (R.isNil(this.state.convertible)){
this.setState({ errorCovertible: true, msgErrorCovertible: 'Convetible Cannot be Empty' })
}
else { else {
this.addReportItems() this.addReportItems()
} }
...@@ -1072,6 +1083,8 @@ export default class CreateReportItems extends Component { ...@@ -1072,6 +1083,8 @@ export default class CreateReportItems extends Component {
label="Convertible" label="Convertible"
margin="normal" margin="normal"
style={{ marginTop: 7 }} style={{ marginTop: 7 }}
error={this.state.errorCovertible}
helperText={this.state.msgErrorCovertible}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }} InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }} InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
/> />
......
...@@ -48,6 +48,7 @@ export default class EditReportItems extends Component { ...@@ -48,6 +48,7 @@ export default class EditReportItems extends Component {
errorEndDate: false, errorEndDate: false,
errorJenisLaporan: false, errorJenisLaporan: false,
errorPerusahaan: false, errorPerusahaan: false,
errorCovertible: false,
msgErrorJenisLaporan: '', msgErrorJenisLaporan: '',
msgErrorPerusahaan: '', msgErrorPerusahaan: '',
msgErrorOrder: '', msgErrorOrder: '',
...@@ -60,6 +61,7 @@ export default class EditReportItems extends Component { ...@@ -60,6 +61,7 @@ export default class EditReportItems extends Component {
msgErrorRV: '', msgErrorRV: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorCovertible: '',
disabledFormula: true, disabledFormula: true,
disabledCondt: true, disabledCondt: true,
disabledValue: true, disabledValue: true,
...@@ -105,12 +107,14 @@ export default class EditReportItems extends Component { ...@@ -105,12 +107,14 @@ export default class EditReportItems extends Component {
errorRV: false, errorRV: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
errorCovertible: false,
msgErrorOrder: '', msgErrorOrder: '',
msgErrorDesc: '', msgErrorDesc: '',
msgErrorFormula: '', msgErrorFormula: '',
msgErrorRV: '', msgErrorRV: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorCovertible: '',
}) })
} else if (isDate && type === 'end_date') { } else if (isDate && type === 'end_date') {
this.setState({ this.setState({
...@@ -121,12 +125,14 @@ export default class EditReportItems extends Component { ...@@ -121,12 +125,14 @@ export default class EditReportItems extends Component {
errorRV: false, errorRV: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
errorCovertible: false,
msgErrorOrder: '', msgErrorOrder: '',
msgErrorDesc: '', msgErrorDesc: '',
msgErrorFormula: '', msgErrorFormula: '',
msgErrorRV: '', msgErrorRV: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorCovertible: '',
}) })
} else { } else {
this.setState({ this.setState({
...@@ -137,12 +143,14 @@ export default class EditReportItems extends Component { ...@@ -137,12 +143,14 @@ export default class EditReportItems extends Component {
errorRV: false, errorRV: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
errorCovertible: false,
msgErrorOrder: '', msgErrorOrder: '',
msgErrorDesc: '', msgErrorDesc: '',
msgErrorFormula: '', msgErrorFormula: '',
msgErrorRV: '', msgErrorRV: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
msgErrorCovertible: '',
}) })
} }
} }
...@@ -168,7 +176,9 @@ export default class EditReportItems extends Component { ...@@ -168,7 +176,9 @@ export default class EditReportItems extends Component {
} else if (R.isNil(this.state.tempData.start_date)) { } else if (R.isNil(this.state.tempData.start_date)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Valid From Cannot be Empty' }) this.setState({ errorStartDate: true, msgErrorSD: 'Valid From Cannot be Empty' })
} else if (R.isNil(this.state.tempData.end_date)) { } else if (R.isNil(this.state.tempData.end_date)) {
this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' }) this.setState({errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty'})
} else if (R.isNil(this.state.convertible)) {
this.setState({errorCovertible: true, msgErrorCovertible: 'Convetible Cannot be Empty' })
} else { } else {
this.updateReportItems() this.updateReportItems()
} }
...@@ -1045,6 +1055,8 @@ export default class EditReportItems extends Component { ...@@ -1045,6 +1055,8 @@ export default class EditReportItems extends Component {
{...params} {...params}
label="Convertible" label="Convertible"
margin="normal" margin="normal"
error={this.state.errorCovertible}
helperText={this.state.msgErrorCovertible}
style={{ marginTop: 7 }} style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }} InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }} InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
......
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