diff --git a/frontend/dashboard/src/pages/Corporates/Form.tsx b/frontend/dashboard/src/pages/Corporates/Form.tsx
index a82b3a90..37e18366 100644
--- a/frontend/dashboard/src/pages/Corporates/Form.tsx
+++ b/frontend/dashboard/src/pages/Corporates/Form.tsx
@@ -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;
diff --git a/frontend/dashboard/src/pages/Corporates/Index.tsx b/frontend/dashboard/src/pages/Corporates/Index.tsx
index 80704d66..580600c5 100644
--- a/frontend/dashboard/src/pages/Corporates/Index.tsx
+++ b/frontend/dashboard/src/pages/Corporates/Index.tsx
@@ -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() {
-
+
@@ -379,36 +380,67 @@ export default function Corporates() {
-
+
Period
- : {row.current_policy?.start} - {row.current_policy?.end}
+
+ : {fDate(row.current_policy?.start)}-
+ {fDate(row.current_policy?.end)}
+
Total Premi
- : {row.current_policy ? fCurrency(row.current_policy?.total_premi) : '-'}
+ {row.current_policy ? (
+
+
+ : {fCurrency(row.current_policy?.total_premi).split(' ')[0]}
+
+ {fCurrency(row.current_policy?.total_premi).split(' ')[1]}
+
+ ) : (
+ '-'
+ )}
Minimal Deposit
- :{' '}
- {row.current_policy
- ? fCurrency(row.current_policy?.minimal_deposit_net)
- : '-'}
+ {row.current_policy ? (
+
+
+ : {fCurrency(row.current_policy?.minimal_deposit_net).split(' ')[0]}
+
+
+ {fCurrency(row.current_policy?.minimal_deposit_net).split(' ')[1]}
+
+
+ ) : (
+ '-'
+ )}
Corporate Limit
- : {row.current_policy ? fCurrency(row.current_policy?.limit_balance) : '-'}
+ {row.current_policy ? (
+
+
+ : {fCurrency(row.current_policy?.limit_balance).split(' ')[0]}
+
+
+ {fCurrency(row.current_policy?.limit_balance).split(' ')[1]}
+
+
+ ) : (
+ '-'
+ )}