mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 14:34:34 -04:00
Configure subscription recurring products to use both maxseats +/- inventory if configured
This commit is contained in:
parent
4096631de0
commit
753cfa9585
@ -94,8 +94,6 @@ class Kernel extends ConsoleKernel
|
|||||||
/* Performs system maintenance such as pruning the backup table */
|
/* Performs system maintenance such as pruning the backup table */
|
||||||
$schedule->job(new SystemMaintenance)->sundays()->at('02:30')->withoutOverlapping()->name('system-maintenance-job')->onOneServer();
|
$schedule->job(new SystemMaintenance)->sundays()->at('02:30')->withoutOverlapping()->name('system-maintenance-job')->onOneServer();
|
||||||
|
|
||||||
/* Pulls in bank transactions from third party services */
|
|
||||||
$schedule->job(new BankTransactionSync)->dailyAt('04:10')->withoutOverlapping()->name('bank-trans-sync-job')->onOneServer();
|
|
||||||
|
|
||||||
if (Ninja::isSelfHost()) {
|
if (Ninja::isSelfHost()) {
|
||||||
|
|
||||||
@ -110,6 +108,9 @@ class Kernel extends ConsoleKernel
|
|||||||
|
|
||||||
$schedule->job(new AdjustEmailQuota)->dailyAt('23:30')->withoutOverlapping();
|
$schedule->job(new AdjustEmailQuota)->dailyAt('23:30')->withoutOverlapping();
|
||||||
|
|
||||||
|
/* Pulls in bank transactions from third party services */
|
||||||
|
$schedule->job(new BankTransactionSync)->dailyAt('04:10')->withoutOverlapping()->name('bank-trans-sync-job')->onOneServer();
|
||||||
|
|
||||||
//not used @deprecate
|
//not used @deprecate
|
||||||
// $schedule->job(new SendFailedEmails)->daily()->withoutOverlapping();
|
// $schedule->job(new SendFailedEmails)->daily()->withoutOverlapping();
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ class BankTransactionSync implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
|
||||||
//multiDB environment, need to
|
//multiDB environment, need to
|
||||||
foreach (MultiDB::$dbs as $db)
|
foreach (MultiDB::$dbs as $db)
|
||||||
{
|
{
|
||||||
|
@ -51,18 +51,34 @@
|
|||||||
</div>
|
</div>
|
||||||
<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 justify-between text-sm mt-1">
|
||||||
@if($subscription->per_seat_enabled)
|
@if($subscription->per_seat_enabled)
|
||||||
<p class="text-gray-500 w-full"></p>
|
<p class="text-gray-500 w-3/4"></p>
|
||||||
<div class="flex place-content-end">
|
<div class="flex place-content-end">
|
||||||
|
@if($subscription->use_inventory_management && $product->in_stock_quantity == 0)
|
||||||
|
<p class="text-sm font-light text-red-500 text-right mr-2 mt-2">Out of stock</p>
|
||||||
|
@else
|
||||||
<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>
|
||||||
|
@endif
|
||||||
|
<select wire:model.debounce.300ms="data.{{ $index }}.recurring_qty" class="rounded-md border-gray-300 shadow-sm sm:text-sm"
|
||||||
|
@if($subscription->use_inventory_management && $product->in_stock_quantity == 0)
|
||||||
|
disabled
|
||||||
|
@endif
|
||||||
|
>
|
||||||
|
<option value="1" selected="selected">1</option>
|
||||||
|
|
||||||
<select wire:model.debounce.300ms="data.{{ $index }}.recurring_qty" class="rounded-md border-gray-300 shadow-sm sm:text-sm">
|
@if($subscription->max_seats_limit > 1)
|
||||||
<option value="1" selected="selected">1</option>
|
{
|
||||||
@for ($i = 2; $i <= $subscription->max_seats_limit; $i++)
|
@for ($i = 2; $i <= ($subscription->use_inventory_management ? min($subscription->max_seats_limit,$product->in_stock_quantity) : $subscription->max_seats_limit); $i++)
|
||||||
<option value="{{$i}}">{{$i}}</option>
|
<option value="{{$i}}">{{$i}}</option>
|
||||||
@endfor
|
@endfor
|
||||||
</select>
|
}
|
||||||
|
@else
|
||||||
|
@for ($i = 2; $i <= ($subscription->use_inventory_management ? min($product->in_stock_quantity, max(100,$product->custom_value2)) : max(100,$product->custom_value2)); $i++)
|
||||||
|
<option value="{{$i}}">{{$i}}</option>
|
||||||
|
@endfor
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user