From 39840acd1b9c701abe6d7816931252dbe6949151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Thu, 15 Feb 2024 19:33:20 +0100 Subject: [PATCH] wip: Circular event referencing --- app/Livewire/BillingPortal/Summary.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Livewire/BillingPortal/Summary.php b/app/Livewire/BillingPortal/Summary.php index baf8809d26b6..7e3adb619fdc 100644 --- a/app/Livewire/BillingPortal/Summary.php +++ b/app/Livewire/BillingPortal/Summary.php @@ -33,6 +33,8 @@ class Summary extends Component // The following may not be needed, as we can pass arround $context. // cache()->set($this->hash, $this->context); + // $this->dispatch('purchase.context', property: 'products', value: $products); + return $this; } @@ -146,6 +148,7 @@ class Summary extends Component $products[] = [ 'product_key' => $item['product']['product_key'], 'quantity' => $item['quantity'], + 'total_raw' => $item['product']['cost'] * $item['quantity'], 'total' => Number::formatMoney($item['product']['cost'] * $item['quantity'], $this->subscription->company) . ' / ' . RecurringInvoice::frequencyForKey($this->subscription->frequency_id), ]; } @@ -154,6 +157,7 @@ class Summary extends Component $products[] = [ 'product_key' => $item['product']['product_key'], 'quantity' => $item['quantity'], + 'total_raw' => $item['product']['cost'] * $item['quantity'], 'total' => Number::formatMoney($item['product']['cost'] * $item['quantity'], $this->subscription->company) . ' / ' . RecurringInvoice::frequencyForKey($this->subscription->frequency_id), ]; } @@ -162,6 +166,7 @@ class Summary extends Component $products[] = [ 'product_key' => $item['product']['product_key'], 'quantity' => $item['quantity'], + 'total_raw' => $item['product']['cost'] * $item['quantity'], 'total' => Number::formatMoney($item['product']['cost'] * $item['quantity'], $this->subscription->company), ]; } @@ -170,6 +175,7 @@ class Summary extends Component $products[] = [ 'product_key' => $item['product']['product_key'], 'quantity' => $item['quantity'], + 'total_raw' => $item['product']['cost'] * $item['quantity'], 'total' => Number::formatMoney($item['product']['cost'] * $item['quantity'], $this->subscription->company), ]; }