mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-12-06 13:25:30 -05:00
Subscriptions v2
This commit is contained in:
parent
af465ac31a
commit
41dcb7cf4a
@ -234,7 +234,7 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
'price' => Number::formatMoney($total, $this->subscription->company).' / '. RecurringInvoice::frequencyForKey($this->subscription->frequency_id),
|
'price' => Number::formatMoney($total, $this->subscription->company).' / '. RecurringInvoice::frequencyForKey($this->subscription->frequency_id),
|
||||||
'total' => $total,
|
'total' => $total,
|
||||||
'qty' => $qty,
|
'qty' => $qty,
|
||||||
'is_recurring' => true
|
'is_recurring' => true,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -108,6 +108,8 @@ class Csv extends BaseImport implements ImportInterface
|
|||||||
$bank_transaction_count = $this->ingest($data, $entity_type);
|
$bank_transaction_count = $this->ingest($data, $entity_type);
|
||||||
$this->entity_count['bank_transactions'] = $bank_transaction_count;
|
$this->entity_count['bank_transactions'] = $bank_transaction_count;
|
||||||
|
|
||||||
|
nlog("bank matching co id = {$this->company->id}");
|
||||||
|
|
||||||
BankMatchingService::dispatchSync($this->company->id, $this->company->db);
|
BankMatchingService::dispatchSync($this->company->id, $this->company->db);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,8 @@ class BankMatchingService implements ShouldQueue
|
|||||||
|
|
||||||
protected $db;
|
protected $db;
|
||||||
|
|
||||||
|
protected $middleware_key;
|
||||||
|
|
||||||
public function __construct($company_id, $db)
|
public function __construct($company_id, $db)
|
||||||
{
|
{
|
||||||
$this->company_id = $company_id;
|
$this->company_id = $company_id;
|
||||||
|
|||||||
@ -46,6 +46,10 @@ class ProcessBankRules extends AbstractService
|
|||||||
|
|
||||||
$this->credit_rules = $this->bank_transaction->company->credit_rules();
|
$this->credit_rules = $this->bank_transaction->company->credit_rules();
|
||||||
|
|
||||||
|
if(!is_array($this->credit_rules))
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
$this->invoices = Invoice::where('company_id', $this->bank_transaction->company_id)
|
$this->invoices = Invoice::where('company_id', $this->bank_transaction->company_id)
|
||||||
->whereIn('status_id', [1,2,3])
|
->whereIn('status_id', [1,2,3])
|
||||||
->where('is_deleted', 0)
|
->where('is_deleted', 0)
|
||||||
@ -81,6 +85,9 @@ class ProcessBankRules extends AbstractService
|
|||||||
|
|
||||||
$this->categories = collect(Cache::get('bank_categories'));
|
$this->categories = collect(Cache::get('bank_categories'));
|
||||||
|
|
||||||
|
if(!is_array($this->debit_rules))
|
||||||
|
return;
|
||||||
|
|
||||||
foreach($this->debit_rules as $bank_transaction_rule)
|
foreach($this->debit_rules as $bank_transaction_rule)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -14,9 +14,9 @@
|
|||||||
@if(!empty($subscription->recurring_product_ids))
|
@if(!empty($subscription->recurring_product_ids))
|
||||||
@foreach($recurring_products as $index => $product)
|
@foreach($recurring_products as $index => $product)
|
||||||
<li class="flex py-6">
|
<li class="flex py-6">
|
||||||
@if(false)
|
@if(filter_var($product->custom_value1, FILTER_VALIDATE_URL))
|
||||||
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200">
|
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200 mr-2">
|
||||||
<img src="https://tailwindui.com/img/ecommerce-images/shopping-cart-page-04-product-01.jpg" alt="Salmon orange fabric pouch with match zipper, gray zipper pull, and adjustable hip belt." class="h-full w-full object-cover object-center">
|
<img src="{{$product->custom_value1}}" alt="" class="h-full w-full object-cover object-center">
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
<div class="ml-0 flex flex-1 flex-col">
|
<div class="ml-0 flex flex-1 flex-col">
|
||||||
@ -52,9 +52,9 @@
|
|||||||
@if(!empty($subscription->product_ids))
|
@if(!empty($subscription->product_ids))
|
||||||
@foreach($products as $product)
|
@foreach($products as $product)
|
||||||
<li class="flex py-6">
|
<li class="flex py-6">
|
||||||
@if(false)
|
@if(filter_var($product->custom_value1, FILTER_VALIDATE_URL))
|
||||||
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200">
|
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200">
|
||||||
<img src="https://tailwindui.com/img/ecommerce-images/shopping-cart-page-04-product-01.jpg" alt="Salmon orange fabric pouch with match zipper, gray zipper pull, and adjustable hip belt." class="h-full w-full object-cover object-center">
|
<img src="{{$product->custom_value1}}" alt="" class="h-full w-full object-cover object-center">
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
<div class="ml-0 flex flex-1 flex-col">
|
<div class="ml-0 flex flex-1 flex-col">
|
||||||
@ -79,10 +79,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@if(!empty($subscription->optional_recurring_product_ids) || !empty($subscription->optional_product_ids))
|
||||||
<div class="w-full p-4 md:max-w-3xl">
|
<div class="w-full p-4 md:max-w-3xl">
|
||||||
<h2 class="text-2xl font-normal text-left border-b-4">Optional products</h2>
|
<h2 class="text-2xl font-normal text-left border-b-4">Optional products</h2>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
<div class="w-full px-4 md:max-w-3xl">
|
<div class="w-full px-4 md:max-w-3xl">
|
||||||
|
|
||||||
<!-- Optional Recurring Products-->
|
<!-- Optional Recurring Products-->
|
||||||
@ -90,9 +91,9 @@
|
|||||||
@if(!empty($subscription->optional_recurring_product_ids))
|
@if(!empty($subscription->optional_recurring_product_ids))
|
||||||
@foreach($optional_recurring_products as $index => $product)
|
@foreach($optional_recurring_products as $index => $product)
|
||||||
<li class="flex py-6">
|
<li class="flex py-6">
|
||||||
@if(false)
|
@if(filter_var($product->custom_value1, FILTER_VALIDATE_URL))
|
||||||
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200 mr-2">
|
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200">
|
||||||
<img src="https://tailwindui.com/img/ecommerce-images/shopping-cart-page-04-product-01.jpg" alt="Salmon orange fabric pouch with match zipper, gray zipper pull, and adjustable hip belt." class="h-full w-full object-cover object-center">
|
<img src="{{$product->custom_value1}}" alt="" class="h-full w-full object-cover object-center">
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
<div class="ml-0 flex flex-1 flex-col">
|
<div class="ml-0 flex flex-1 flex-col">
|
||||||
@ -104,19 +105,19 @@
|
|||||||
<p class="mt-1 text-sm text-gray-500"></p>
|
<p class="mt-1 text-sm text-gray-500"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex content-end text-sm mt-1">
|
<div class="flex content-end text-sm mt-1">
|
||||||
|
@if(is_numeric($product->custom_value2))
|
||||||
<p class="text-gray-500 w-full"></p>
|
<p class="text-gray-500 w-full"></p>
|
||||||
<div class="flex place-content-end">
|
<div class="flex place-content-end">
|
||||||
<p class="text-sm font-light text-gray-700 text-right mr-2 mt-2">{{ ctrans('texts.qty') }}</p>
|
<p class="text-sm font-light text-gray-700 text-right mr-2 mt-2">{{ ctrans('texts.qty') }}</p>
|
||||||
<input wire:model.debounce.300ms="data.{{ $index }}.optional_recurring_qty" type="text" class="w-1/4 rounded-md border-gray-300 shadow-sm sm:text-sm text-center" placeholder="0"/>
|
<select wire:model.debounce.300ms="data.{{ $index }}.optional_recurring_qty" class="rounded-md border-gray-300 shadow-sm sm:text-sm">
|
||||||
|
<option value="0" selected="selected">0</option>
|
||||||
|
@for ($i = 1; $i < $product->custom_value2; $i++)
|
||||||
|
<option value="{{$i}}">{{$i}}</option>
|
||||||
|
@endfor
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@error("data.{$index}.optional_recurring_qty")
|
|
||||||
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert">
|
|
||||||
<span class="block sm:inline">{{ $message }} </span>
|
|
||||||
<span class="absolute top-0 bottom-0 right-0 px-4 py-3">
|
|
||||||
</div>
|
|
||||||
@enderror
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
@ -124,9 +125,9 @@
|
|||||||
@if(!empty($subscription->optional_product_ids))
|
@if(!empty($subscription->optional_product_ids))
|
||||||
@foreach($optional_products as $index => $product)
|
@foreach($optional_products as $index => $product)
|
||||||
<li class="flex py-6">
|
<li class="flex py-6">
|
||||||
@if(false)
|
@if(filter_var($product->custom_value1, FILTER_VALIDATE_URL))
|
||||||
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200 mr-2">
|
<div class="h-24 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200">
|
||||||
<img src="https://tailwindui.com/img/ecommerce-images/shopping-cart-page-04-product-01.jpg" alt="Salmon orange fabric pouch with match zipper, gray zipper pull, and adjustable hip belt." class="h-full w-full object-cover object-center">
|
<img src="{{$product->custom_value1}}" alt="" class="h-full w-full object-cover object-center">
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
<div class="ml-0 flex flex-1 flex-col">
|
<div class="ml-0 flex flex-1 flex-col">
|
||||||
@ -138,18 +139,19 @@
|
|||||||
<p class="mt-1 text-sm text-gray-500"></p>
|
<p class="mt-1 text-sm text-gray-500"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex content-end text-sm mt-1">
|
<div class="flex content-end text-sm mt-1">
|
||||||
|
@if(is_numeric($product->custom_value2))
|
||||||
<p class="text-gray-500 w-full"></p>
|
<p class="text-gray-500 w-full"></p>
|
||||||
<div class="flex place-content-end">
|
<div class="flex place-content-end">
|
||||||
<p class="text-sm font-light text-gray-700 text-right mr-2 mt-2">{{ ctrans('texts.qty') }}</p>
|
<p class="text-sm font-light text-gray-700 text-right mr-2 mt-2">{{ ctrans('texts.qty') }}</p>
|
||||||
<input type="text" wire:model.debounce.300ms="data.{{ $index }}.optional_qty" class="w-1/4 rounded-md border-gray-300 shadow-sm sm:text-sm text-center" placeholder="0">
|
<select wire:model.debounce.300ms="data.{{ $index }}.optional_qty" class="rounded-md border-gray-300 shadow-sm sm:text-sm">
|
||||||
|
<option value="0" selected="selected">0</option>
|
||||||
|
@for ($i = 1; $i < $product->custom_value2; $i++)
|
||||||
|
<option value="{{$i}}">{{$i}}</option>
|
||||||
|
@endfor
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@error("data.{$index}.optional_qty")
|
|
||||||
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert">
|
|
||||||
<span class="block sm:inline">{{ $message }} </span>
|
|
||||||
<span class="absolute top-0 bottom-0 right-0 px-4 py-3">
|
|
||||||
</div>
|
|
||||||
@enderror
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user