Refactor purchase context and dispatch purchase next

This commit is contained in:
Benjamin Beganović 2024-02-19 18:16:37 +01:00
parent f119c26905
commit 9acdb89ab8

View File

@ -71,7 +71,16 @@ class Methods extends Component
'bundle' => $this->context['bundle'],
], now()->addMinutes(60));
$payable_amount = $invoice->partial > 0
? \App\Utils\Number::formatValue($invoice->partial, $invoice->client->currency())
: \App\Utils\Number::formatValue($invoice->balance, $invoice->client->currency());
$this->dispatch('purchase.context', property: 'form.company_gateway_id', value: $company_gateway_id);
$this->dispatch('purchase.context', property: 'form.payment_method_id', value: $gateway_type_id);
$this->dispatch('purchase.context', property: 'form.invoice_hashed_id', value: $invoice->hashed_id);
$this->dispatch('purchase.context', property: 'form.payable_amount', value: $payable_amount);
$this->dispatch('purchase.next');
}
public function render()