Commit 4ede5db7 authored by EKSAD's avatar EKSAD

Update validasi report item

parent 8fcf1da3
...@@ -121,9 +121,9 @@ export default class ProfitLoss extends Component { ...@@ -121,9 +121,9 @@ export default class ProfitLoss extends Component {
handleValue(data) { handleValue(data) {
let total = 0 let total = 0
this.state.dataTable.map((item,index) => { this.state.dataTable.map((item, index) => {
if (data.rowData[1] == item[2]) { if (data.rowData[1] == item[2]) {
total = item[6] == undefined? (total + 0) : (total + item[6]) total = item[data.columnIndex] == undefined ? (total + 0) : (total + item[data.columnIndex])
} }
}) })
let indexParent = this.state.dataTable.findIndex((val) => val[1] == this.state.dataTable[data.rowIndex][2]) let indexParent = this.state.dataTable.findIndex((val) => val[1] == this.state.dataTable[data.rowIndex][2])
...@@ -133,17 +133,17 @@ export default class ProfitLoss extends Component { ...@@ -133,17 +133,17 @@ export default class ProfitLoss extends Component {
} }
handleChange(value, tableMeta) { handleChange(value, tableMeta) {
let val = String(value).split(",").join("")
let data = this.state.dataTable let data = this.state.dataTable
let indexParent = data.findIndex((val) => val[1] == data[tableMeta.rowIndex][2]) let indexParent = data.findIndex((val) => val[1] == data[tableMeta.rowIndex][2])
// console.log(indexParent);
if (indexParent > 0) { if (indexParent > 0) {
let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(value) let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
let jagain = data[indexParent][tableMeta.columnIndex] let jagain = data[indexParent][tableMeta.columnIndex]
a = data[indexParent][tableMeta.columnIndex] = jagain == undefined? (0 + Number(value)) : (jagain + Number(value)) a = data[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val))
} else { } else {
let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(value) data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
} }
// console.log(this.state.dataTable)
// this.setState({ // this.setState({
// data: a, // data: a,
// }, () => console.log(this.state.dataTable)) // }, () => console.log(this.state.dataTable))
...@@ -155,26 +155,26 @@ export default class ProfitLoss extends Component { ...@@ -155,26 +155,26 @@ export default class ProfitLoss extends Component {
options: { options: {
display: false display: false
} }
},{ }, {
name: "", name: "",
options: { options: {
display: false display: false
} }
},{ }, {
name: "", name: "",
options: { options: {
display: false display: false
} }
},{ }, {
name: "", name: "",
options: { options: {
display: false display: false
} }
},{ }, {
name: "Account", name: "Account",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#354960', width: 388 }}> <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#354960', width: 300 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -185,7 +185,7 @@ export default class ProfitLoss extends Component { ...@@ -185,7 +185,7 @@ export default class ProfitLoss extends Component {
{tableMeta.rowData[3] == 0 ? {tableMeta.rowData[3] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(val).toUpperCase()}</span> <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(val).toUpperCase()}</span>
: :
tableMeta.rowData[3] === 1? tableMeta.rowData[3] === 1 ?
<span style={{ fontSize: 12, marginLeft: 20 }}>{val}</span> : <span style={{ fontSize: 12, marginLeft: 20 }}>{val}</span> :
<span style={{ fontSize: 12, marginLeft: 40 }}>{val}</span> <span style={{ fontSize: 12, marginLeft: 40 }}>{val}</span>
} }
...@@ -197,18 +197,53 @@ export default class ProfitLoss extends Component { ...@@ -197,18 +197,53 @@ export default class ProfitLoss extends Component {
name: "Keterangan", name: "Keterangan",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style2, top: 0, zIndex: 102, backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ customBodyRender: (value, tableMeta, updateValue) => {
style: { return (
position: "sticky", <div style={{ textAlign: 'right' }}>
left: 420, {tableMeta.rowData[0] === 4 ?
background: "white", <div style={{ flex: 1 }}>
zIndex: 101 <FormControlLabel
} style={{ margin: 0 }}
}) value={value}
control={
<TextField
style={{ color: "red", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
InputProps={{ disableUnderline: true }}
onChange={event => {
// console.log(event.target)
updateValue(event.target.value)
this.handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<TextField
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
InputProps={{ disableUnderline: true }}
disabled={true}
value={this.handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div>
)
}
} }
}, { }, {
name: "31 Dec 2020 Actual", name: "31 Dec 2020 Actual",
...@@ -218,6 +253,19 @@ export default class ProfitLoss extends Component { ...@@ -218,6 +253,19 @@ export default class ProfitLoss extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
// customHeadRender: (columnMeta) => (
// <TableCell key={columnMeta.index} style={{ ...style2, top: 0, zIndex: 102, backgroundColor: '#354960', width: 96 }}>
// <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
// </TableCell>
// ),
// setCellProps: () => ({
// style: {
// position: "sticky",
// left: 420,
// background: "white",
// zIndex: 101
// }
// }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -243,12 +291,21 @@ export default class ProfitLoss extends Component { ...@@ -243,12 +291,21 @@ export default class ProfitLoss extends Component {
/> />
</div> : </div> :
tableMeta.rowData[0] === 2 ? tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>{this.handleValue(tableMeta)}</span> <span style={{ fontSize: 12, textAlign: 'right' }}>
: <NumberFormat
tableMeta.rowData[0] === 1 ? thousandSeparator={true}
<span>-</span> style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
: type="text"
<span>validasi</span> placeholder=""
disabled={true}
value={this.handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
} }
</div> </div>
) )
...@@ -258,18 +315,54 @@ export default class ProfitLoss extends Component { ...@@ -258,18 +315,54 @@ export default class ProfitLoss extends Component {
name: "January 2021", name: "January 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style2, top: 0, zIndex: 102, backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ customBodyRender: (value, tableMeta, updateValue) => {
style: { return (
position: "sticky", <div style={{ textAlign: 'right' }}>
left: 420, {tableMeta.rowData[0] === 4 ?
background: "white", <div style={{ flex: 1 }}>
zIndex: 101 <FormControlLabel
} style={{ margin: 0 }}
}) value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onChange={event => {
// console.log(event.target)
updateValue(event.target.value)
this.handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
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={this.handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div>
)
}
} }
}, { }, {
name: "February 2021", name: "February 2021",
...@@ -279,10 +372,47 @@ export default class ProfitLoss extends Component { ...@@ -279,10 +372,47 @@ export default class ProfitLoss extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
customBodyRender: (val) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 96 }}> <div style={{ textAlign: 'right' }}>
{val} {tableMeta.rowData[0] === 4 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onChange={event => {
// console.log(event.target)
updateValue(event.target.value)
this.handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
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={this.handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div> </div>
) )
} }
...@@ -295,10 +425,47 @@ export default class ProfitLoss extends Component { ...@@ -295,10 +425,47 @@ export default class ProfitLoss extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
customBodyRender: (val) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 96 }}> <div style={{ textAlign: 'right' }}>
{val} {tableMeta.rowData[0] === 4 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onChange={event => {
// console.log(event.target)
updateValue(event.target.value)
this.handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
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={this.handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div> </div>
) )
} }
...@@ -311,10 +478,47 @@ export default class ProfitLoss extends Component { ...@@ -311,10 +478,47 @@ export default class ProfitLoss extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
customBodyRender: (val) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 96 }}> <div style={{ textAlign: 'right' }}>
{val} {tableMeta.rowData[0] === 4 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onChange={event => {
// console.log(event.target)
updateValue(event.target.value)
this.handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
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={this.handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div> </div>
) )
} }
...@@ -327,10 +531,47 @@ export default class ProfitLoss extends Component { ...@@ -327,10 +531,47 @@ export default class ProfitLoss extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
customBodyRender: (val) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 96 }}> <div style={{ textAlign: 'right' }}>
{val} {tableMeta.rowData[0] === 4 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onChange={event => {
// console.log(event.target)
updateValue(event.target.value)
this.handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
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={this.handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div> </div>
) )
} }
...@@ -343,10 +584,47 @@ export default class ProfitLoss extends Component { ...@@ -343,10 +584,47 @@ export default class ProfitLoss extends Component {
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
customBodyRender: (val) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 96 }}> <div style={{ textAlign: 'right' }}>
{val} {tableMeta.rowData[0] === 4 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onChange={event => {
// console.log(event.target)
updateValue(event.target.value)
this.handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
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={this.handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 1 ?
<span>-</span>
:
<span>validasi</span>
}
</div> </div>
) )
} }
......
...@@ -147,32 +147,32 @@ export default class CreateReportItems extends Component { ...@@ -147,32 +147,32 @@ export default class CreateReportItems extends Component {
validasi() { validasi() {
// alert('coba ya') // alert('coba ya')
if (R.isNil(this.state.reportType)) { if (R.isNil(this.state.reportType)) {
this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report type is required.'}) this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report type cannot be empty.'})
} else if (R.isNil(this.state.company)){ } else if (R.isNil(this.state.company)){
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company is required.'}) this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company name cannot be empty.'})
} else if (R.isEmpty(this.state.order)) { } else if (R.isEmpty(this.state.order)) {
this.setState({ errorOrder: true, msgErrorOrder: 'Order is required.' }) this.setState({ errorOrder: true, msgErrorOrder: 'Order cannot be empty.' })
} }
else if (R.isEmpty(this.state.description)) { else if (R.isEmpty(this.state.description)) {
this.setState({ errorDesc: true, msgErrorDesc: 'Description is required.' }) this.setState({ errorDesc: true, msgErrorDesc: 'Description cannot be empty.' })
} }
else if (R.isNil(this.state.InputType)) { else if (R.isNil(this.state.InputType)) {
this.setState({ errorTipeData: true, msgErrorTipeData: 'Data type is required.' }) this.setState({ errorTipeData: true, msgErrorTipeData: 'Data type cannot be empty.' })
} }
else if (this.state.disabledFormula === false && R.isEmpty(this.state.formula)) { else if (this.state.disabledFormula === false && R.isEmpty(this.state.formula)) {
this.setState({ errorFormula: true, msgErrorFormula: 'Formula is required.' }) this.setState({ errorFormula: true, msgErrorFormula: 'Formula cannot be empty.' })
} }
else if (this.state.disabledValue === false && R.isEmpty(this.state.realVal)) { else if (this.state.disabledValue === false && R.isEmpty(this.state.realVal)) {
this.setState({ errorRV: true, msgErrorRV: 'True value is required.' }) this.setState({ errorRV: true, msgErrorRV: 'True value cannot be empty.' })
} }
else if (this.state.disabledCondt === false && R.isEmpty(this.state.condition)) { else if (this.state.disabledCondt === false && R.isEmpty(this.state.condition)) {
this.setState({ errorCondition: true, msgErrorCondition: 'False condition is required.' }) this.setState({ errorCondition: true, msgErrorCondition: 'False condition cannot be empty.' })
} }
else if (R.isNil(this.state.startDate)) { else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required.' }) this.setState({ errorStartDate: true, msgErrorSD: 'Valid From cannot be empty.' })
} }
else if (R.isNil(this.state.endDate)) { else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorED: 'End date is required.' }) this.setState({ errorEndDate: true, msgErrorED: 'Valid To cannot be empty.' })
} }
else { else {
this.addReportItems() this.addReportItems()
......
...@@ -128,25 +128,25 @@ export default class EditReportItems extends Component { ...@@ -128,25 +128,25 @@ export default class EditReportItems extends Component {
validasi() { validasi() {
// alert('coba ya') // alert('coba ya')
if (R.isNil(this.state.reportType)){ if (R.isNil(this.state.reportType)){
this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report type is required.'}) this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Report type cannot be empty.'})
} else if (R.isNil(this.state.company)){ } else if (R.isNil(this.state.company)){
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company is required.'}) this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company name cannot be empty.'})
} else if (R.isEmpty(this.state.tempData.order)) { } else if (R.isEmpty(this.state.tempData.order)) {
this.setState({ errorOrder: true, msgErrorOrder: 'Order is required..' }) this.setState({ errorOrder: true, msgErrorOrder: 'Order cannot be empty.' })
} else if (R.isEmpty(this.state.tempData.description)) { } else if (R.isEmpty(this.state.tempData.description)) {
this.setState({ errorDesc: true, msgErrorDesc: 'Description is required..' }) this.setState({ errorDesc: true, msgErrorDesc: 'Description cannot be empty.' })
} else if (R.isNil(this.state.InputType)) { } else if (R.isNil(this.state.InputType)) {
this.setState({ errorTipeData: true, msgErrorTipeData: 'Data type is required.' }) this.setState({ errorTipeData: true, msgErrorTipeData: 'Data type cannot be empty.' })
} else if ((this.state.InputType.type_item_report_name === 'Formula' && R.isEmpty(this.state.tempData.formula)) || (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.formula))) { } else if ((this.state.InputType.type_item_report_name === 'Formula' && R.isEmpty(this.state.tempData.formula)) || (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.formula))) {
this.setState({ errorFormula: true, msgErrorFormula: 'Formula is required.' }) this.setState({ errorFormula: true, msgErrorFormula: 'Formula cannot be empty.' })
} else if (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.condition_it_should_be)) { } else if (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.condition_it_should_be)) {
this.setState({ errorRV: true, msgErrorRV: 'True value is required.' }) this.setState({ errorRV: true, msgErrorRV: 'True value cannot be empty.' })
} else if (this.state.InputType.type_item_report_name === 'Validation' && R.isNil(this.state.tempData.condition_if_wrong)) { } else if (this.state.InputType.type_item_report_name === 'Validation' && R.isNil(this.state.tempData.condition_if_wrong)) {
this.setState({ errorCondition: true, msgErrorCondition: 'False condition is required.' }) this.setState({ errorCondition: true, msgErrorCondition: 'False condition cannot be empty.' })
} else if (R.isNil(this.state.tempData.start_date)) { } else if (R.isNil(this.state.tempData.start_date)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required.' }) 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: 'End date is required.' }) this.setState({ errorEndDate: true, msgErrorED: 'Valid To cannot be empty.' })
} else { } else {
this.updateReportItems() this.updateReportItems()
} }
......
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