Add additional tax rate 3 into the system

This commit is contained in:
David Bomba 2019-10-05 12:28:23 +10:00
parent d39d837895
commit eca7452de3
19 changed files with 59 additions and 3 deletions

View File

@ -124,6 +124,8 @@ class CompanySettings extends BaseSettings
public $tax_rate1 = 0; public $tax_rate1 = 0;
public $tax_name2 = ''; public $tax_name2 = '';
public $tax_rate2 = 0; public $tax_rate2 = 0;
public $tax_name3 = '';
public $tax_rate3 = 0;
public $enable_second_tax_rate = false; public $enable_second_tax_rate = false;
public $payment_type_id = ''; public $payment_type_id = '';
public $convert_products = false; public $convert_products = false;
@ -184,8 +186,12 @@ class CompanySettings extends BaseSettings
'has_custom_design1' => 'bool', 'has_custom_design1' => 'bool',
'has_custom_design2' => 'bool', 'has_custom_design2' => 'bool',
'has_custom_design3' => 'bool', 'has_custom_design3' => 'bool',
'tax_name1' => 'string',
'tax_name2' => 'string',
'tax_name3' => 'string',
'tax_rate1' => 'float', 'tax_rate1' => 'float',
'tax_rate2' => 'float', 'tax_rate2' => 'float',
'tax_rate3' => 'float',
'require_invoice_signature' => 'bool', 'require_invoice_signature' => 'bool',
'require_quote_signature' => 'bool', 'require_quote_signature' => 'bool',
'show_accept_quote_terms' => 'bool', 'show_accept_quote_terms' => 'bool',

View File

@ -63,6 +63,8 @@ class Invoice extends BaseModel
'tax_rate1', 'tax_rate1',
'tax_name2', 'tax_name2',
'tax_rate2', 'tax_rate2',
'tax_name3',
'tax_rate3',
'is_amount_discount', 'is_amount_discount',
'invoice_footer', 'invoice_footer',
'partial', 'partial',

View File

@ -34,8 +34,10 @@ class Product extends BaseModel
'quantity', 'quantity',
'tax_name1', 'tax_name1',
'tax_name2', 'tax_name2',
'tax_name3',
'tax_rate1', 'tax_rate1',
'tax_rate2', 'tax_rate2',
'tax_rate3',
]; ];
public function company() public function company()

View File

@ -36,8 +36,10 @@ class Quote extends BaseModel
'terms', 'terms',
'tax_name1', 'tax_name1',
'tax_name2', 'tax_name2',
'tax_name3',
'tax_rate1', 'tax_rate1',
'tax_rate2', 'tax_rate2',
'tax_rate3',
'custom_value1', 'custom_value1',
'custom_value2', 'custom_value2',
'custom_value3', 'custom_value3',

View File

@ -68,8 +68,10 @@ class RecurringInvoice extends BaseModel
'terms', 'terms',
'tax_name1', 'tax_name1',
'tax_name2', 'tax_name2',
'tax_name3',
'tax_rate1', 'tax_rate1',
'tax_rate2', 'tax_rate2',
'tax_rate3',
'custom_value1', 'custom_value1',
'custom_value2', 'custom_value2',
'custom_value3', 'custom_value3',

View File

@ -67,8 +67,10 @@ class RecurringQuote extends BaseModel
'terms', 'terms',
'tax_name1', 'tax_name1',
'tax_name2', 'tax_name2',
'tax_name3',
'tax_rate1', 'tax_rate1',
'tax_rate2', 'tax_rate2',
'tax_rate3',
'custom_value1', 'custom_value1',
'custom_value2', 'custom_value2',
'custom_value3', 'custom_value3',

View File

@ -48,6 +48,8 @@ class InvoiceTransformer extends EntityTransformer
'tax_rate1' => (float) $invoice->tax_rate1, 'tax_rate1' => (float) $invoice->tax_rate1,
'tax_name2' => $invoice->tax_name2 ? $invoice->tax_name2 : '', 'tax_name2' => $invoice->tax_name2 ? $invoice->tax_name2 : '',
'tax_rate2' => (float) $invoice->tax_rate2, '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), 'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false),
'invoice_footer' => $invoice->invoice_footer ?: '', 'invoice_footer' => $invoice->invoice_footer ?: '',
'partial' => (float) ($invoice->partial ?: 0.0), 'partial' => (float) ($invoice->partial ?: 0.0),

View File

@ -103,6 +103,8 @@ class InvoiceTransformer extends EntityTransformer
'tax_rate1' => (float) $invoice->tax_rate1, 'tax_rate1' => (float) $invoice->tax_rate1,
'tax_name2' => $invoice->tax_name2 ? $invoice->tax_name2 : '', 'tax_name2' => $invoice->tax_name2 ? $invoice->tax_name2 : '',
'tax_rate2' => (float) $invoice->tax_rate2, '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), 'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false),
'invoice_footer' => $invoice->invoice_footer ?: '', 'invoice_footer' => $invoice->invoice_footer ?: '',
'partial' => (float) ($invoice->partial ?: 0.0), 'partial' => (float) ($invoice->partial ?: 0.0),

View File

@ -64,11 +64,13 @@ class ProductTransformer extends EntityTransformer
'notes' => $product->notes ?: '', 'notes' => $product->notes ?: '',
'cost' => (float) $product->cost ?: 0, 'cost' => (float) $product->cost ?: 0,
'price' => (float) $product->price ?: 0, 'price' => (float) $product->price ?: 0,
'quantity' => (float) ($product->quantity ?: 0.0), 'quantity' => (float) $product->quantity ?: 1.0,
'tax_name1' => $product->tax_name1 ?: '', 'tax_name1' => $product->tax_name1 ?: '',
'tax_rate1' => (float) $product->tax_rate1 ?: 0, 'tax_rate1' => (float) $product->tax_rate1 ?: 0,
'tax_name2' => $product->tax_name2 ?: '', 'tax_name2' => $product->tax_name2 ?: '',
'tax_rate2' => (float) $product->tax_rate2 ?: 0, 'tax_rate2' => (float) $product->tax_rate2 ?: 0,
'tax_name3' => $product->tax_name3 ?: '',
'tax_rate3' => (float) $product->tax_rate3 ?: 0,
'updated_at' => $product->updated_at, 'updated_at' => $product->updated_at,
'archived_at' => $product->deleted_at, 'archived_at' => $product->deleted_at,
'custom_value1' => $product->custom_value1 ?: '', 'custom_value1' => $product->custom_value1 ?: '',

View File

@ -100,6 +100,8 @@ class QuoteTransformer extends EntityTransformer
'tax_rate1' => (float) $quote->tax_rate1 ?: '', 'tax_rate1' => (float) $quote->tax_rate1 ?: '',
'tax_name2' => $quote->tax_name2 ? $quote->tax_name2 : '', 'tax_name2' => $quote->tax_name2 ? $quote->tax_name2 : '',
'tax_rate2' => (float) $quote->tax_rate2 ?: '', '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), 'is_amount_discount' => (bool) ($quote->is_amount_discount ?: false),
'quote_footer' => $quote->quote_footer ?: '', 'quote_footer' => $quote->quote_footer ?: '',
'partial' => (float) ($quote->partial ?: 0.0), 'partial' => (float) ($quote->partial ?: 0.0),

View File

@ -99,6 +99,8 @@ class RecurringInvoiceTransformer extends EntityTransformer
'tax_rate1' => (float) $invoice->tax_rate1 ?: '', 'tax_rate1' => (float) $invoice->tax_rate1 ?: '',
'tax_name2' => $invoice->tax_name2 ? $invoice->tax_name2 : '', 'tax_name2' => $invoice->tax_name2 ? $invoice->tax_name2 : '',
'tax_rate2' => (float) $invoice->tax_rate2 ?: '', '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), 'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false),
'invoice_footer' => $invoice->invoice_footer ?: '', 'invoice_footer' => $invoice->invoice_footer ?: '',
'partial' => (float) ($invoice->partial ?: 0.0), 'partial' => (float) ($invoice->partial ?: 0.0),

View File

@ -99,6 +99,8 @@ class RecurringQuoteTransformer extends EntityTransformer
'tax_rate1' => (float) $quote->tax_rate1 ?: '', 'tax_rate1' => (float) $quote->tax_rate1 ?: '',
'tax_name2' => $quote->tax_name2 ? $quote->tax_name2 : '', 'tax_name2' => $quote->tax_name2 ? $quote->tax_name2 : '',
'tax_rate2' => (float) $quote->tax_rate2 ?: '', '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), 'is_amount_discount' => (bool) ($quote->is_amount_discount ?: false),
'quote_footer' => $quote->quote_footer ?: '', 'quote_footer' => $quote->quote_footer ?: '',
'partial' => (float) ($quote->partial ?: 0.0), 'partial' => (float) ($quote->partial ?: 0.0),

View File

@ -33,6 +33,7 @@ trait MakesInvoiceValues
'quantity', 'quantity',
'tax_name1', 'tax_name1',
'tax_name2', 'tax_name2',
'tax_name3',
'line_total', 'line_total',
'custom_label1', 'custom_label1',
'custom_label2', 'custom_label2',

View File

@ -15,6 +15,8 @@ $factory->define(App\Models\Invoice::class, function (Faker $faker) {
'tax_rate1' => 10, 'tax_rate1' => 10,
'tax_name2' => 'VAT', 'tax_name2' => 'VAT',
'tax_rate2' => 17.5, 'tax_rate2' => 17.5,
'tax_name3' => 'THIRDTAX',
'tax_rate3' => 5,
'custom_value1' => $faker->numberBetween(1,4), 'custom_value1' => $faker->numberBetween(1,4),
'custom_value2' => $faker->numberBetween(1,4), 'custom_value2' => $faker->numberBetween(1,4),
'custom_value3' => $faker->numberBetween(1,4), 'custom_value3' => $faker->numberBetween(1,4),

View File

@ -13,6 +13,8 @@ $factory->define(App\Models\Product::class, function (Faker $faker) {
'tax_rate1' => 10, 'tax_rate1' => 10,
'tax_name2' => 'VAT', 'tax_name2' => 'VAT',
'tax_rate2' => 17.5, 'tax_rate2' => 17.5,
'tax_name3' => 'THIRDTAX',
'tax_rate3' => 5,
'custom_value1' => $faker->text(20), 'custom_value1' => $faker->text(20),
'custom_value2' => $faker->text(20), 'custom_value2' => $faker->text(20),
'custom_value3' => $faker->text(20), 'custom_value3' => $faker->text(20),

View File

@ -14,6 +14,8 @@ $factory->define(App\Models\Quote::class, function (Faker $faker) {
'tax_rate1' => 10, 'tax_rate1' => 10,
'tax_name2' => 'VAT', 'tax_name2' => 'VAT',
'tax_rate2' => 17.5, 'tax_rate2' => 17.5,
'tax_name3' => 'THIRDTAX',
'tax_rate3' => 5,
'custom_value1' => $faker->numberBetween(1,4), 'custom_value1' => $faker->numberBetween(1,4),
'custom_value2' => $faker->numberBetween(1,4), 'custom_value2' => $faker->numberBetween(1,4),
'custom_value3' => $faker->numberBetween(1,4), 'custom_value3' => $faker->numberBetween(1,4),

View File

@ -13,6 +13,8 @@ $factory->define(App\Models\RecurringInvoice::class, function (Faker $faker) {
'tax_rate1' => 10, 'tax_rate1' => 10,
'tax_name2' => 'VAT', 'tax_name2' => 'VAT',
'tax_rate2' => 17.5, 'tax_rate2' => 17.5,
'tax_name3' => 'THIRDTAX',
'tax_rate3' => 5,
'custom_value1' => $faker->numberBetween(1,4), 'custom_value1' => $faker->numberBetween(1,4),
'custom_value2' => $faker->numberBetween(1,4), 'custom_value2' => $faker->numberBetween(1,4),
'custom_value3' => $faker->numberBetween(1,4), 'custom_value3' => $faker->numberBetween(1,4),

View File

@ -14,6 +14,8 @@ $factory->define(App\Models\RecurringQuote::class, function (Faker $faker) {
'tax_rate1' => 10, 'tax_rate1' => 10,
'tax_name2' => 'VAT', 'tax_name2' => 'VAT',
'tax_rate2' => 17.5, 'tax_rate2' => 17.5,
'tax_name3' => 'THIRDTAX',
'tax_rate3' => 5,
'custom_value1' => $faker->numberBetween(1,4), 'custom_value1' => $faker->numberBetween(1,4),
'custom_value2' => $faker->numberBetween(1,4), 'custom_value2' => $faker->numberBetween(1,4),
'custom_value3' => $faker->numberBetween(1,4), 'custom_value3' => $faker->numberBetween(1,4),

View File

@ -367,10 +367,12 @@ class CreateUsersTable extends Migration
$table->decimal('max_limit', 13, 2)->nullable(); $table->decimal('max_limit', 13, 2)->nullable();
$table->decimal('fee_amount', 13, 2)->nullable(); $table->decimal('fee_amount', 13, 2)->nullable();
$table->decimal('fee_percent', 13, 2)->nullable(); $table->decimal('fee_percent', 13, 2)->nullable();
$table->decimal('fee_tax_name1', 13, 2)->nullable(); $table->string('fee_tax_name1')->nullable();
$table->decimal('fee_tax_name2', 13, 2)->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_rate1', 13, 2)->nullable();
$table->decimal('fee_tax_rate2', 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->unsignedInteger('fee_cap')->default(0);
$table->boolean('adjust_fee_percent'); $table->boolean('adjust_fee_percent');
@ -420,6 +422,10 @@ class CreateUsersTable extends Migration
$t->string('tax_name2')->nullable(); $t->string('tax_name2')->nullable();
$t->decimal('tax_rate2', 13, 3)->default(0); $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_value1')->nullable();
$t->string('custom_value2')->nullable(); $t->string('custom_value2')->nullable();
$t->string('custom_value3')->nullable(); $t->string('custom_value3')->nullable();
@ -476,6 +482,9 @@ class CreateUsersTable extends Migration
$t->string('tax_name2')->nullable(); $t->string('tax_name2')->nullable();
$t->decimal('tax_rate2', 13, 3)->default(0); $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_value1')->nullable();
$t->string('custom_value2')->nullable(); $t->string('custom_value2')->nullable();
$t->string('custom_value3')->nullable(); $t->string('custom_value3')->nullable();
@ -535,6 +544,9 @@ class CreateUsersTable extends Migration
$t->string('tax_name2')->nullable(); $t->string('tax_name2')->nullable();
$t->decimal('tax_rate2', 13, 3)->default(0); $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_value1')->nullable();
$t->string('custom_value2')->nullable(); $t->string('custom_value2')->nullable();
$t->string('custom_value3')->nullable(); $t->string('custom_value3')->nullable();
@ -593,6 +605,9 @@ class CreateUsersTable extends Migration
$t->string('tax_name2')->nullable(); $t->string('tax_name2')->nullable();
$t->decimal('tax_rate2', 13, 3)->default(0); $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_value1')->nullable();
$t->string('custom_value2')->nullable(); $t->string('custom_value2')->nullable();
$t->string('custom_value3')->nullable(); $t->string('custom_value3')->nullable();
@ -682,6 +697,8 @@ class CreateUsersTable extends Migration
$t->decimal('tax_rate1', 13, 3)->default(0); $t->decimal('tax_rate1', 13, 3)->default(0);
$t->string('tax_name2')->nullable(); $t->string('tax_name2')->nullable();
$t->decimal('tax_rate2', 13, 3)->default(0); $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); $t->boolean('is_deleted')->default(false);