NTP-5975 | fix emi count (#1160)

This commit is contained in:
Aman Chaturvedi
2024-10-14 14:12:02 +05:30
committed by GitHub
parent 849a9a7095
commit fcdd6db1ad
4 changed files with 5 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ const CustomerSummary = () => {
}));
const emiEndDate = pageDetail?.emiSummary?.lastEmiDate;
const emiEndDateFormatted = dayjs(emiEndDate).format('DD MMM, YYYY');
const totalEmis = pageDetail?.details?.data ? pageDetail?.details?.data?.allDues.length : 0;
const totalEmis = pageDetail?.details?.data ? pageDetail?.details?.data?.totalDuesCount : 0;
const paidEmis = pageDetail?.details?.data?.dues?.filter(due => due?.paid)?.length || 0;
const paidEmiPercentage = (paidEmis / totalEmis) * 100;
const riskTagIndex =

View File

@@ -48,12 +48,12 @@ const FeedbackSummaryBox = () => {
callHistory = [],
loanAmount,
activationDate,
allDues,
totalDuesCount,
dues,
pendingEmiSchedules,
ptpPerEmiCountMap
} = caseDetails || ({} as CustomerDetailApiResponse);
const totalEmis = allDues?.length;
const totalEmis = totalDuesCount;
const paidEmis = dues?.filter(due => due?.paid)?.length;
return [
{

View File

@@ -275,6 +275,7 @@ export interface CustomerDetailApiResponse {
assignedFieldAgent?: string;
editAccessFlag?: boolean;
escalationDetails?: IEscalationStatus;
totalDuesCount: number;
}
export interface FlashFeedback {
feedbackType: string;

View File

@@ -131,6 +131,7 @@ const caseDetailsSlice = createSlice({
return date1 - date2;
}
);
data.totalDuesCount = duesWithNewWaiverInfo.length + pendingEmiSchedules.length;
data.allDues = allDues;
// trying to get second last emi record as last emi record doesnot match with the actual emi amount
const secondLastEmiRecord = allDues?.[allDues?.length - 2] as PendingEmiSchedule;