mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 13:04:38 -04:00
fix for archiving tax rates
This commit is contained in:
parent
5b59efa437
commit
f544f7ac23
@ -21,6 +21,7 @@ use App\Http\Requests\TaxRate\UpdateTaxRateRequest;
|
|||||||
use App\Models\TaxRate;
|
use App\Models\TaxRate;
|
||||||
use App\Repositories\BaseRepository;
|
use App\Repositories\BaseRepository;
|
||||||
use App\Transformers\TaxRateTransformer;
|
use App\Transformers\TaxRateTransformer;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,6 +30,8 @@ use Illuminate\Http\Request;
|
|||||||
*/
|
*/
|
||||||
class TaxRateController extends BaseController
|
class TaxRateController extends BaseController
|
||||||
{
|
{
|
||||||
|
use MakesHash;
|
||||||
|
|
||||||
protected $entity_type = TaxRate::class;
|
protected $entity_type = TaxRate::class;
|
||||||
|
|
||||||
protected $entity_transformer = TaxRateTransformer::class;
|
protected $entity_transformer = TaxRateTransformer::class;
|
||||||
@ -425,10 +428,10 @@ class TaxRateController extends BaseController
|
|||||||
|
|
||||||
$ids = request()->input('ids');
|
$ids = request()->input('ids');
|
||||||
|
|
||||||
$tax_rate = TaxRate::withTrashed()->find($this->transformKeys($ids));
|
$tax_rates = TaxRate::withTrashed()->find($this->transformKeys($ids));
|
||||||
|
|
||||||
|
|
||||||
$tax_rate->each(function ($tax_rat, $key) use ($action) {
|
$tax_rates->each(function ($tax_rate, $key) use ($action) {
|
||||||
if (auth()->user()->can('edit', $tax_rate)) {
|
if (auth()->user()->can('edit', $tax_rate)) {
|
||||||
$this->base_repo->{$action}($tax_rate);
|
$this->base_repo->{$action}($tax_rate);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddIsDeletedToGroupSettings extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('group_settings', function (Blueprint $table) {
|
||||||
|
$table->boolean('is_deleted')->default(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user