mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add enabled_expense_tax_rates
This commit is contained in:
parent
7357e4026f
commit
1196ea8122
@ -119,6 +119,7 @@ class Company extends BaseModel
|
|||||||
'track_inventory',
|
'track_inventory',
|
||||||
'inventory_notification_threshold',
|
'inventory_notification_threshold',
|
||||||
'stock_notification',
|
'stock_notification',
|
||||||
|
'enabled_expense_tax_rates',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
|
@ -177,6 +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,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\Company;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('companies', function (Blueprint $table) {
|
||||||
|
$table->boolean('enabled_expense_tax_rates')->default(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
Company::query()->where('enabled_item_tax_rates', true)->cursor()->each(function ($company){
|
||||||
|
|
||||||
|
$company->enabled_expense_tax_rates = true;
|
||||||
|
$company->save();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user