MSR Fee amount fix
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
c616ad51b4
commit
57a1067a3d
1 changed files with 15 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue