Fixes for subscriptions - allow currency id to be passed through

This commit is contained in:
David Bomba 2022-07-29 10:34:33 +10:00
parent 1196ea8122
commit 3a510ffd4a
3 changed files with 14 additions and 3 deletions

View File

@ -263,6 +263,17 @@ class BillingPortalPurchase extends Component
} }
} }
if(array_key_exists('currency_id', $this->request_data)) {
$currency = Cache::get('currencies')->filter(function ($item){
return $item->id == $this->request_data['currency_id'];
})->first();
if($currency)
$data['settings']->currency_id = $currency->id;
}
if (array_key_exists('locale', $this->request_data)) { if (array_key_exists('locale', $this->request_data)) {
$request = $this->request_data; $request = $this->request_data;

View File

@ -177,7 +177,7 @@ class CompanyTransformer extends EntityTransformer
'inventory_notification_threshold' => (int) $company->inventory_notification_threshold, 'inventory_notification_threshold' => (int) $company->inventory_notification_threshold,
'track_inventory' => (bool) $company->track_inventory, 'track_inventory' => (bool) $company->track_inventory,
'enable_applying_payments' => (bool) $company->enable_applying_payments, 'enable_applying_payments' => (bool) $company->enable_applying_payments,
'enabled_expense_tax_rates' =. (bool) $company->enabled_expense_tax_rates, 'enabled_expense_tax_rates' => (bool) $company->enabled_expense_tax_rates,
]; ];
} }

View File

@ -20,7 +20,7 @@
@foreach($subscription->service()->products() as $product) @foreach($subscription->service()->products() as $product)
<div class="flex items-center justify-between mb-4 bg-white rounded px-6 py-4 shadow-sm border"> <div class="flex items-center justify-between mb-4 bg-white rounded px-6 py-4 shadow-sm border">
<div> <div>
<p class="text-sm text-gray-800">{!! $product->notes !!}</p> <p class="text-sm text-gray-800">{!! nl2br($product->notes) !!}</p>
</div> </div>
<div data-ref="price-and-quantity-container"> <div data-ref="price-and-quantity-container">
<span <span
@ -40,7 +40,7 @@
@foreach($subscription->service()->recurring_products() as $product) @foreach($subscription->service()->recurring_products() as $product)
<div class="flex items-center justify-between mb-4 bg-white rounded px-6 py-4 shadow-sm border"> <div class="flex items-center justify-between mb-4 bg-white rounded px-6 py-4 shadow-sm border">
<div class="text-sm">{!! $product->notes !!}</div> <div class="text-sm">{!! nl2br($product->notes) !!}</div>
<div data-ref="price-and-quantity-container"> <div data-ref="price-and-quantity-container">
<span <span
data-ref="price">{{ \App\Utils\Number::formatMoney($product->price, $subscription->company) }}</span> data-ref="price">{{ \App\Utils\Number::formatMoney($product->price, $subscription->company) }}</span>