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);
|
return this.processIfStatements(bodyText, 'custom', this.getCustomValueFromString);
|
||||||
},
|
},
|
||||||
displayMSRFeeAlert() {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -307,15 +315,15 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.mobileFeePart.isInsurable) {
|
return !this.mobileFeePart.isInsurable;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
msrFeeAlertCopy() {
|
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);
|
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;
|
return content;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue