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