wip: Circular event referencing

This commit is contained in:
Benjamin Beganović 2024-02-15 19:33:20 +01:00
parent 14f069161d
commit 39840acd1b

View File

@ -33,6 +33,8 @@ class Summary extends Component
// The following may not be needed, as we can pass arround $context. // The following may not be needed, as we can pass arround $context.
// cache()->set($this->hash, $this->context); // cache()->set($this->hash, $this->context);
// $this->dispatch('purchase.context', property: 'products', value: $products);
return $this; return $this;
} }
@ -146,6 +148,7 @@ class Summary extends Component
$products[] = [ $products[] = [
'product_key' => $item['product']['product_key'], 'product_key' => $item['product']['product_key'],
'quantity' => $item['quantity'], '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), '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[] = [ $products[] = [
'product_key' => $item['product']['product_key'], 'product_key' => $item['product']['product_key'],
'quantity' => $item['quantity'], '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), '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[] = [ $products[] = [
'product_key' => $item['product']['product_key'], 'product_key' => $item['product']['product_key'],
'quantity' => $item['quantity'], 'quantity' => $item['quantity'],
'total_raw' => $item['product']['cost'] * $item['quantity'],
'total' => Number::formatMoney($item['product']['cost'] * $item['quantity'], $this->subscription->company), 'total' => Number::formatMoney($item['product']['cost'] * $item['quantity'], $this->subscription->company),
]; ];
} }
@ -170,6 +175,7 @@ class Summary extends Component
$products[] = [ $products[] = [
'product_key' => $item['product']['product_key'], 'product_key' => $item['product']['product_key'],
'quantity' => $item['quantity'], 'quantity' => $item['quantity'],
'total_raw' => $item['product']['cost'] * $item['quantity'],
'total' => Number::formatMoney($item['product']['cost'] * $item['quantity'], $this->subscription->company), 'total' => Number::formatMoney($item['product']['cost'] * $item['quantity'], $this->subscription->company),
]; ];
} }