mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Set default tax id to 1 for all products
This commit is contained in:
parent
fbd47c1e40
commit
e14656129f
@ -55,7 +55,7 @@ class TaxModel
|
||||
{
|
||||
|
||||
$this->regions->EU->has_sales_above_threshold = false;
|
||||
$this->regions->EU->tax_all = false;
|
||||
$this->regions->EU->tax_all_subregions = false;
|
||||
$this->regions->EU->vat_threshold = 10000;
|
||||
$this->euSubRegions();
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
region:
|
||||
US:
|
||||
tax_all: false
|
||||
seller_region: CA
|
||||
tax_all_subregions: false
|
||||
seller_subregion: CA
|
||||
has_sales_above_threshold: false
|
||||
subregions:
|
||||
AL:
|
||||
|
@ -35,6 +35,7 @@ class ProductFactory
|
||||
$product->custom_value3 = '';
|
||||
$product->custom_value4 = '';
|
||||
$product->is_deleted = 0;
|
||||
$product->tax_id = 1;
|
||||
|
||||
return $product;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Product;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
@ -26,6 +27,10 @@ return new class extends Migration
|
||||
$table->dropColumn('tax_all_products');
|
||||
});
|
||||
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->unsignedInteger('tax_id')->nullable(); // the product tax constant
|
||||
});
|
||||
|
||||
Company::query()
|
||||
->cursor()
|
||||
->each(function ($company) {
|
||||
@ -40,6 +45,13 @@ return new class extends Migration
|
||||
$client->save();
|
||||
});
|
||||
|
||||
Product::query()
|
||||
->cursor()
|
||||
->each(function ($product) {
|
||||
$product->tax_id = 1;
|
||||
$product->save();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user