mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Add additional tax rate 3 into the system
This commit is contained in:
parent
d39d837895
commit
eca7452de3
@ -124,6 +124,8 @@ class CompanySettings extends BaseSettings
|
||||
public $tax_rate1 = 0;
|
||||
public $tax_name2 = '';
|
||||
public $tax_rate2 = 0;
|
||||
public $tax_name3 = '';
|
||||
public $tax_rate3 = 0;
|
||||
public $enable_second_tax_rate = false;
|
||||
public $payment_type_id = '';
|
||||
public $convert_products = false;
|
||||
@ -184,8 +186,12 @@ class CompanySettings extends BaseSettings
|
||||
'has_custom_design1' => 'bool',
|
||||
'has_custom_design2' => 'bool',
|
||||
'has_custom_design3' => 'bool',
|
||||
'tax_name1' => 'string',
|
||||
'tax_name2' => 'string',
|
||||
'tax_name3' => 'string',
|
||||
'tax_rate1' => 'float',
|
||||
'tax_rate2' => 'float',
|
||||
'tax_rate3' => 'float',
|
||||
'require_invoice_signature' => 'bool',
|
||||
'require_quote_signature' => 'bool',
|
||||
'show_accept_quote_terms' => 'bool',
|
||||
|
@ -63,6 +63,8 @@ class Invoice extends BaseModel
|
||||
'tax_rate1',
|
||||
'tax_name2',
|
||||
'tax_rate2',
|
||||
'tax_name3',
|
||||
'tax_rate3',
|
||||
'is_amount_discount',
|
||||
'invoice_footer',
|
||||
'partial',
|
||||
|
@ -34,8 +34,10 @@ class Product extends BaseModel
|
||||
'quantity',
|
||||
'tax_name1',
|
||||
'tax_name2',
|
||||
'tax_name3',
|
||||
'tax_rate1',
|
||||
'tax_rate2',
|
||||
'tax_rate3',
|
||||
];
|
||||
|
||||
public function company()
|
||||
|
@ -36,8 +36,10 @@ class Quote extends BaseModel
|
||||
'terms',
|
||||
'tax_name1',
|
||||
'tax_name2',
|
||||
'tax_name3',
|
||||
'tax_rate1',
|
||||
'tax_rate2',
|
||||
'tax_rate3',
|
||||
'custom_value1',
|
||||
'custom_value2',
|
||||
'custom_value3',
|
||||
|
@ -68,8 +68,10 @@ class RecurringInvoice extends BaseModel
|
||||
'terms',
|
||||
'tax_name1',
|
||||
'tax_name2',
|
||||
'tax_name3',
|
||||
'tax_rate1',
|
||||
'tax_rate2',
|
||||
'tax_rate3',
|
||||
'custom_value1',
|
||||
'custom_value2',
|
||||
'custom_value3',
|
||||
|
@ -67,8 +67,10 @@ class RecurringQuote extends BaseModel
|
||||
'terms',
|
||||
'tax_name1',
|
||||
'tax_name2',
|
||||
'tax_name3',
|
||||
'tax_rate1',
|
||||
'tax_rate2',
|
||||
'tax_rate3',
|
||||
'custom_value1',
|
||||
'custom_value2',
|
||||
'custom_value3',
|
||||
|
@ -48,6 +48,8 @@ class InvoiceTransformer extends EntityTransformer
|
||||
'tax_rate1' => (float) $invoice->tax_rate1,
|
||||
'tax_name2' => $invoice->tax_name2 ? $invoice->tax_name2 : '',
|
||||
'tax_rate2' => (float) $invoice->tax_rate2,
|
||||
'tax_name3' => $invoice->tax_name3 ? $invoice->tax_name3 : '',
|
||||
'tax_rate3' => (float) $invoice->tax_rate3,
|
||||
'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false),
|
||||
'invoice_footer' => $invoice->invoice_footer ?: '',
|
||||
'partial' => (float) ($invoice->partial ?: 0.0),
|
||||
|
@ -103,6 +103,8 @@ class InvoiceTransformer extends EntityTransformer
|
||||
'tax_rate1' => (float) $invoice->tax_rate1,
|
||||
'tax_name2' => $invoice->tax_name2 ? $invoice->tax_name2 : '',
|
||||
'tax_rate2' => (float) $invoice->tax_rate2,
|
||||
'tax_name3' => $invoice->tax_name3 ? $invoice->tax_name3 : '',
|
||||
'tax_rate3' => (float) $invoice->tax_rate3,
|
||||
'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false),
|
||||
'invoice_footer' => $invoice->invoice_footer ?: '',
|
||||
'partial' => (float) ($invoice->partial ?: 0.0),
|
||||
|
@ -64,11 +64,13 @@ class ProductTransformer extends EntityTransformer
|
||||
'notes' => $product->notes ?: '',
|
||||
'cost' => (float) $product->cost ?: 0,
|
||||
'price' => (float) $product->price ?: 0,
|
||||
'quantity' => (float) ($product->quantity ?: 0.0),
|
||||
'quantity' => (float) $product->quantity ?: 1.0,
|
||||
'tax_name1' => $product->tax_name1 ?: '',
|
||||
'tax_rate1' => (float) $product->tax_rate1 ?: 0,
|
||||
'tax_name2' => $product->tax_name2 ?: '',
|
||||
'tax_rate2' => (float) $product->tax_rate2 ?: 0,
|
||||
'tax_name3' => $product->tax_name3 ?: '',
|
||||
'tax_rate3' => (float) $product->tax_rate3 ?: 0,
|
||||
'updated_at' => $product->updated_at,
|
||||
'archived_at' => $product->deleted_at,
|
||||
'custom_value1' => $product->custom_value1 ?: '',
|
||||
|
@ -100,6 +100,8 @@ class QuoteTransformer extends EntityTransformer
|
||||
'tax_rate1' => (float) $quote->tax_rate1 ?: '',
|
||||
'tax_name2' => $quote->tax_name2 ? $quote->tax_name2 : '',
|
||||
'tax_rate2' => (float) $quote->tax_rate2 ?: '',
|
||||
'tax_name3' => $quote->tax_name3 ? $quote->tax_name3 : '',
|
||||
'tax_rate3' => (float) $quote->tax_rate3 ?: '',
|
||||
'is_amount_discount' => (bool) ($quote->is_amount_discount ?: false),
|
||||
'quote_footer' => $quote->quote_footer ?: '',
|
||||
'partial' => (float) ($quote->partial ?: 0.0),
|
||||
|
@ -99,6 +99,8 @@ class RecurringInvoiceTransformer extends EntityTransformer
|
||||
'tax_rate1' => (float) $invoice->tax_rate1 ?: '',
|
||||
'tax_name2' => $invoice->tax_name2 ? $invoice->tax_name2 : '',
|
||||
'tax_rate2' => (float) $invoice->tax_rate2 ?: '',
|
||||
'tax_name3' => $invoice->tax_name3 ? $invoice->tax_name3 : '',
|
||||
'tax_rate3' => (float) $invoice->tax_rate3 ?: '',
|
||||
'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false),
|
||||
'invoice_footer' => $invoice->invoice_footer ?: '',
|
||||
'partial' => (float) ($invoice->partial ?: 0.0),
|
||||
|
@ -99,6 +99,8 @@ class RecurringQuoteTransformer extends EntityTransformer
|
||||
'tax_rate1' => (float) $quote->tax_rate1 ?: '',
|
||||
'tax_name2' => $quote->tax_name2 ? $quote->tax_name2 : '',
|
||||
'tax_rate2' => (float) $quote->tax_rate2 ?: '',
|
||||
'tax_name3' => $quote->tax_name3 ? $quote->tax_name3 : '',
|
||||
'tax_rate3' => (float) $quote->tax_rate3 ?: '',
|
||||
'is_amount_discount' => (bool) ($quote->is_amount_discount ?: false),
|
||||
'quote_footer' => $quote->quote_footer ?: '',
|
||||
'partial' => (float) ($quote->partial ?: 0.0),
|
||||
|
@ -33,6 +33,7 @@ trait MakesInvoiceValues
|
||||
'quantity',
|
||||
'tax_name1',
|
||||
'tax_name2',
|
||||
'tax_name3',
|
||||
'line_total',
|
||||
'custom_label1',
|
||||
'custom_label2',
|
||||
|
@ -15,6 +15,8 @@ $factory->define(App\Models\Invoice::class, function (Faker $faker) {
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
'custom_value1' => $faker->numberBetween(1,4),
|
||||
'custom_value2' => $faker->numberBetween(1,4),
|
||||
'custom_value3' => $faker->numberBetween(1,4),
|
||||
|
@ -13,6 +13,8 @@ $factory->define(App\Models\Product::class, function (Faker $faker) {
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
'custom_value1' => $faker->text(20),
|
||||
'custom_value2' => $faker->text(20),
|
||||
'custom_value3' => $faker->text(20),
|
||||
|
@ -14,6 +14,8 @@ $factory->define(App\Models\Quote::class, function (Faker $faker) {
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
'custom_value1' => $faker->numberBetween(1,4),
|
||||
'custom_value2' => $faker->numberBetween(1,4),
|
||||
'custom_value3' => $faker->numberBetween(1,4),
|
||||
|
@ -13,6 +13,8 @@ $factory->define(App\Models\RecurringInvoice::class, function (Faker $faker) {
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
'custom_value1' => $faker->numberBetween(1,4),
|
||||
'custom_value2' => $faker->numberBetween(1,4),
|
||||
'custom_value3' => $faker->numberBetween(1,4),
|
||||
|
@ -14,6 +14,8 @@ $factory->define(App\Models\RecurringQuote::class, function (Faker $faker) {
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
'custom_value1' => $faker->numberBetween(1,4),
|
||||
'custom_value2' => $faker->numberBetween(1,4),
|
||||
'custom_value3' => $faker->numberBetween(1,4),
|
||||
|
@ -367,10 +367,12 @@ class CreateUsersTable extends Migration
|
||||
$table->decimal('max_limit', 13, 2)->nullable();
|
||||
$table->decimal('fee_amount', 13, 2)->nullable();
|
||||
$table->decimal('fee_percent', 13, 2)->nullable();
|
||||
$table->decimal('fee_tax_name1', 13, 2)->nullable();
|
||||
$table->decimal('fee_tax_name2', 13, 2)->nullable();
|
||||
$table->string('fee_tax_name1')->nullable();
|
||||
$table->string('fee_tax_name2')->nullable();
|
||||
$table->string('fee_tax_name3')->nullable();
|
||||
$table->decimal('fee_tax_rate1', 13, 2)->nullable();
|
||||
$table->decimal('fee_tax_rate2', 13, 2)->nullable();
|
||||
$table->decimal('fee_tax_rate3', 13, 2)->nullable();
|
||||
$table->unsignedInteger('fee_cap')->default(0);
|
||||
$table->boolean('adjust_fee_percent');
|
||||
|
||||
@ -420,6 +422,10 @@ class CreateUsersTable extends Migration
|
||||
$t->string('tax_name2')->nullable();
|
||||
$t->decimal('tax_rate2', 13, 3)->default(0);
|
||||
|
||||
$t->string('tax_name3')->nullable();
|
||||
$t->decimal('tax_rate3', 13, 3)->default(0);
|
||||
|
||||
|
||||
$t->string('custom_value1')->nullable();
|
||||
$t->string('custom_value2')->nullable();
|
||||
$t->string('custom_value3')->nullable();
|
||||
@ -476,6 +482,9 @@ class CreateUsersTable extends Migration
|
||||
$t->string('tax_name2')->nullable();
|
||||
$t->decimal('tax_rate2', 13, 3)->default(0);
|
||||
|
||||
$t->string('tax_name3')->nullable();
|
||||
$t->decimal('tax_rate3', 13, 3)->default(0);
|
||||
|
||||
$t->string('custom_value1')->nullable();
|
||||
$t->string('custom_value2')->nullable();
|
||||
$t->string('custom_value3')->nullable();
|
||||
@ -535,6 +544,9 @@ class CreateUsersTable extends Migration
|
||||
$t->string('tax_name2')->nullable();
|
||||
$t->decimal('tax_rate2', 13, 3)->default(0);
|
||||
|
||||
$t->string('tax_name3')->nullable();
|
||||
$t->decimal('tax_rate3', 13, 3)->default(0);
|
||||
|
||||
$t->string('custom_value1')->nullable();
|
||||
$t->string('custom_value2')->nullable();
|
||||
$t->string('custom_value3')->nullable();
|
||||
@ -593,6 +605,9 @@ class CreateUsersTable extends Migration
|
||||
$t->string('tax_name2')->nullable();
|
||||
$t->decimal('tax_rate2', 13, 3)->default(0);
|
||||
|
||||
$t->string('tax_name3')->nullable();
|
||||
$t->decimal('tax_rate3', 13, 3)->default(0);
|
||||
|
||||
$t->string('custom_value1')->nullable();
|
||||
$t->string('custom_value2')->nullable();
|
||||
$t->string('custom_value3')->nullable();
|
||||
@ -682,6 +697,8 @@ class CreateUsersTable extends Migration
|
||||
$t->decimal('tax_rate1', 13, 3)->default(0);
|
||||
$t->string('tax_name2')->nullable();
|
||||
$t->decimal('tax_rate2', 13, 3)->default(0);
|
||||
$t->string('tax_name3')->nullable();
|
||||
$t->decimal('tax_rate3', 13, 3)->default(0);
|
||||
|
||||
$t->boolean('is_deleted')->default(false);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user