several changes
This commit is contained in:
@@ -98,12 +98,13 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
|
|||||||
policy_stop_service_percentage: Yup.number()
|
policy_stop_service_percentage: Yup.number()
|
||||||
.typeError('Please enter a valid number')
|
.typeError('Please enter a valid number')
|
||||||
.min(0, 'Minimum atleast 0')
|
.min(0, 'Minimum atleast 0')
|
||||||
.required('Percentage Stop is required')
|
.max(100, 'Allowed maximum is 100')
|
||||||
.test('max', 'Total should not exceed 100 %', function (value) {
|
.required('Percentage Stop is required'),
|
||||||
const { policy_minimal_alert_percentage } = this.parent;
|
// .test('max', 'Total should not exceed 100 %', function (value) {
|
||||||
const { policy_minimal_deposit_percentage } = this.parent;
|
// const { policy_minimal_alert_percentage } = this.parent;
|
||||||
return value == 100 - policy_minimal_alert_percentage - policy_minimal_deposit_percentage;
|
// const { policy_minimal_deposit_percentage } = this.parent;
|
||||||
}),
|
// return value == 100 - policy_minimal_alert_percentage - policy_minimal_deposit_percentage;
|
||||||
|
// }),
|
||||||
parent_id: Yup.string().when('type', {
|
parent_id: Yup.string().when('type', {
|
||||||
is: 'subcorporate',
|
is: 'subcorporate',
|
||||||
then: Yup.string().required('Corporate is required because type is Sub Corporate'),
|
then: Yup.string().required('Corporate is required because type is Sub Corporate'),
|
||||||
@@ -146,6 +147,7 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
|
|||||||
policy_stop_service_percentage: Yup.number()
|
policy_stop_service_percentage: Yup.number()
|
||||||
.typeError('Please enter a valid number')
|
.typeError('Please enter a valid number')
|
||||||
.min(0, 'Minimum atleast 0')
|
.min(0, 'Minimum atleast 0')
|
||||||
|
.max(100, 'Allowed maximum is 100')
|
||||||
.required('Percentage Stop is required'),
|
.required('Percentage Stop is required'),
|
||||||
// .test('max', 'Total should not exceed 100 %', function (value) {
|
// .test('max', 'Total should not exceed 100 %', function (value) {
|
||||||
// const { policy_minimal_alert_percentage } = this.parent;
|
// const { policy_minimal_alert_percentage } = this.parent;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs';
|
|||||||
import BasePagination from '../../components/BasePagination';
|
import BasePagination from '../../components/BasePagination';
|
||||||
import { fCurrency } from '../../utils/formatNumber';
|
import { fCurrency } from '../../utils/formatNumber';
|
||||||
import { enqueueSnackbar } from 'notistack';
|
import { enqueueSnackbar } from 'notistack';
|
||||||
|
import { fDate } from '@/utils/formatTime';
|
||||||
|
|
||||||
export default function Corporates() {
|
export default function Corporates() {
|
||||||
const { themeStretch } = useSettings();
|
const { themeStretch } = useSettings();
|
||||||
@@ -341,7 +342,7 @@ export default function Corporates() {
|
|||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<Link to={`/corporate/${row.id}/corporate-history`}>
|
<Link to={`/corporate/${row.id}/corporate-history`}>
|
||||||
<HistoryIcon />
|
<HistoryIcon />
|
||||||
</Link>
|
</Link>
|
||||||
</Stack>
|
</Stack>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@@ -379,36 +380,67 @@ export default function Corporates() {
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<Grid Grid container>
|
<Grid container>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
Period
|
Period
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
: {row.current_policy?.start} - {row.current_policy?.end}
|
<Box sx={{ display: 'flex', placeContent: 'space-between' }}>
|
||||||
|
<span>: {fDate(row.current_policy?.start)}</span>-
|
||||||
|
<span>{fDate(row.current_policy?.end)}</span>
|
||||||
|
</Box>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
Total Premi
|
Total Premi
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
: {row.current_policy ? fCurrency(row.current_policy?.total_premi) : '-'}
|
{row.current_policy ? (
|
||||||
|
<Box sx={{ display: 'flex', placeContent: 'space-between' }}>
|
||||||
|
<span>
|
||||||
|
: {fCurrency(row.current_policy?.total_premi).split(' ')[0]}
|
||||||
|
</span>
|
||||||
|
<span>{fCurrency(row.current_policy?.total_premi).split(' ')[1]}</span>
|
||||||
|
</Box>
|
||||||
|
) : (
|
||||||
|
'-'
|
||||||
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
Minimal Deposit
|
Minimal Deposit
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
:{' '}
|
{row.current_policy ? (
|
||||||
{row.current_policy
|
<Box sx={{ display: 'flex', placeContent: 'space-between' }}>
|
||||||
? fCurrency(row.current_policy?.minimal_deposit_net)
|
<span>
|
||||||
: '-'}
|
: {fCurrency(row.current_policy?.minimal_deposit_net).split(' ')[0]}
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
{fCurrency(row.current_policy?.minimal_deposit_net).split(' ')[1]}
|
||||||
|
</span>
|
||||||
|
</Box>
|
||||||
|
) : (
|
||||||
|
'-'
|
||||||
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
Corporate Limit
|
Corporate Limit
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
: {row.current_policy ? fCurrency(row.current_policy?.limit_balance) : '-'}
|
{row.current_policy ? (
|
||||||
|
<Box sx={{ display: 'flex', placeContent: 'space-between' }}>
|
||||||
|
<span>
|
||||||
|
: {fCurrency(row.current_policy?.limit_balance).split(' ')[0]}
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
{fCurrency(row.current_policy?.limit_balance).split(' ')[1]}
|
||||||
|
</span>
|
||||||
|
</Box>
|
||||||
|
) : (
|
||||||
|
'-'
|
||||||
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
Reference in New Issue
Block a user