@dynamatix/gb-schemas 2.3.298 → 2.3.299
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicant-welcome-call.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-welcome-call.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"applicant-welcome-call.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-welcome-call.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAmuBhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAEnF,eAAe,gBAAgB,CAAC"}
|
|
@@ -617,11 +617,21 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(async function () {
|
|
|
617
617
|
mortgage = application.mortgageId;
|
|
618
618
|
}
|
|
619
619
|
if (mortgage) {
|
|
620
|
+
// Helper function to format currency with commas
|
|
621
|
+
const formatCurrency = (value) => {
|
|
622
|
+
if (isNaN(value) || value === null || value === undefined) {
|
|
623
|
+
return '0.00';
|
|
624
|
+
}
|
|
625
|
+
return value.toLocaleString('en-GB', {
|
|
626
|
+
minimumFractionDigits: 2,
|
|
627
|
+
maximumFractionDigits: 2
|
|
628
|
+
});
|
|
629
|
+
};
|
|
620
630
|
// Get rental income - check if it exists (even if 0)
|
|
621
631
|
if (mortgage.monthlyRentalIncome !== undefined && mortgage.monthlyRentalIncome !== null) {
|
|
622
632
|
// Convert to number first, then format
|
|
623
633
|
const numericValue = Number(mortgage.monthlyRentalIncome);
|
|
624
|
-
const rentalValue = isNaN(numericValue) ? '0.00' : numericValue
|
|
634
|
+
const rentalValue = isNaN(numericValue) ? '0.00' : formatCurrency(numericValue);
|
|
625
635
|
rentalIncome = `£${rentalValue}`;
|
|
626
636
|
}
|
|
627
637
|
// Get monthly repayment amount from productFeatures collection
|
|
@@ -632,7 +642,7 @@ welcomeCallSchema.virtual('financeSummaryHtml').get(async function () {
|
|
|
632
642
|
});
|
|
633
643
|
if (productFeatures && productFeatures.repayment !== undefined && productFeatures.repayment !== null) {
|
|
634
644
|
const numericValue = Number(productFeatures.repayment);
|
|
635
|
-
const repaymentValue = isNaN(numericValue) ? '0.00' : numericValue
|
|
645
|
+
const repaymentValue = isNaN(numericValue) ? '0.00' : formatCurrency(numericValue);
|
|
636
646
|
monthlyRepayment = `£${repaymentValue}`;
|
|
637
647
|
}
|
|
638
648
|
else {
|