MSR Fee amount fix

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
AHumphriesSL 2026-06-18 15:08:37 -04:00 committed by GitHub
parent c616ad51b4
commit 57a1067a3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -294,7 +294,15 @@ export default {
return this.processIfStatements(bodyText, 'custom', this.getCustomValueFromString);
},
displayMSRFeeAlert() {
if (!this.mobileFeePart || this.mobileFeePart.sellingPrice === 0 || !isMSRPart(this.mobileFeePart)) {
if (!this.mobileFeePart || !isMSRPart(this.mobileFeePart)) {
return false;
}
const mobileFeeAmount = (this.mobileFeePart.kitPrice ?? 0)
+ (this.mobileFeePart.laborAmount ?? 0)
+ (this.mobileFeePart.sellingPrice ?? 0);
if (mobileFeeAmount <= 0) {
return false;
}
@ -307,15 +315,15 @@ export default {
return false;
}
if (!this.mobileFeePart.isInsurable) {
return true;
}
return false;
return !this.mobileFeePart.isInsurable;
},
msrFeeAlertCopy() {
const mobileFeeAmount = (this.mobileFeePart?.kitPrice ?? 0)
+ (this.mobileFeePart?.laborAmount ?? 0)
+ (this.mobileFeePart?.sellingPrice ?? 0);
let content = this.getCmsContent('AlertMSRFeeWidget', widgetFields.ALERT_WIDGET.BODY_TEXT);
content = content.replace('{custom:mobileFee}', `${this.mobileFeePart.sellingPrice.toFixed(2)}`);
content = content.replace('{custom:mobileFee}', `${mobileFeeAmount.toFixed(2)}`);
return content;
}
},