fixes to amounts

This commit is contained in:
2025-09-18 14:12:41 -04:00
parent dc71eee4db
commit f7bc23d9ed
4 changed files with 247 additions and 42 deletions

View File

@@ -343,9 +343,12 @@ export default defineComponent({
},
computed: {
finalChargeAmount(): number {
// If promo is active, use server-calculated totals (which include discounts)
// If promo is active, use server-calculated totals with fees added
if (this.promo_active && this.total_amount_after_discount > 0) {
return this.total_amount_after_discount;
let total = this.total_amount_after_discount;
if (this.deliveryOrder.prime === 1) total += Number(this.pricing.price_prime);
if (this.deliveryOrder.same_day === 1) total += Number(this.pricing.price_same_day);
return total;
}
// Otherwise, calculate locally