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->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->regions->EU->vat_threshold = 10000;
|
||||||
$this->euSubRegions();
|
$this->euSubRegions();
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
region:
|
region:
|
||||||
US:
|
US:
|
||||||
tax_all: false
|
tax_all_subregions: false
|
||||||
seller_region: CA
|
seller_subregion: CA
|
||||||
has_sales_above_threshold: false
|
has_sales_above_threshold: false
|
||||||
subregions:
|
subregions:
|
||||||
AL:
|
AL:
|
||||||
|
@ -35,7 +35,8 @@ class ProductFactory
|
|||||||
$product->custom_value3 = '';
|
$product->custom_value3 = '';
|
||||||
$product->custom_value4 = '';
|
$product->custom_value4 = '';
|
||||||
$product->is_deleted = 0;
|
$product->is_deleted = 0;
|
||||||
|
$product->tax_id = 1;
|
||||||
|
|
||||||
return $product;
|
return $product;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
|
use App\Models\Product;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
@ -26,6 +27,10 @@ return new class extends Migration
|
|||||||
$table->dropColumn('tax_all_products');
|
$table->dropColumn('tax_all_products');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Schema::table('products', function (Blueprint $table) {
|
||||||
|
$table->unsignedInteger('tax_id')->nullable(); // the product tax constant
|
||||||
|
});
|
||||||
|
|
||||||
Company::query()
|
Company::query()
|
||||||
->cursor()
|
->cursor()
|
||||||
->each(function ($company) {
|
->each(function ($company) {
|
||||||
@ -40,6 +45,13 @@ return new class extends Migration
|
|||||||
$client->save();
|
$client->save();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Product::query()
|
||||||
|
->cursor()
|
||||||
|
->each(function ($product) {
|
||||||
|
$product->tax_id = 1;
|
||||||
|
$product->save();
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user