1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Added setting to hide second tax rate

This commit is contained in:
Hillel Coren 2016-05-29 12:56:10 +03:00
parent 607fb58c29
commit c254544b19
2 changed files with 29 additions and 9 deletions

View File

@ -14,9 +14,9 @@ class AddQuotes extends Migration {
{
Schema::table('invoices', function($table)
{
$table->boolean('is_quote')->default(0);
$table->boolean('invoice_type_id')->default(0);
$table->unsignedInteger('quote_id')->nullable();
$table->unsignedInteger('quote_invoice_id')->nullable();
$table->unsignedInteger('quote_invoice_id')->nullable();
});
}
@ -30,7 +30,7 @@ class AddQuotes extends Migration {
Schema::table('invoices', function($table)
{
$table->dropColumn('is_quote');
$table->dropColumn('quote_id');
$table->dropColumn('invoice_type_id');
$table->dropColumn('quote_invoice_id');
});
}

View File

@ -12,9 +12,20 @@ class AddInvoiceTypeSupport extends Migration
*/
public function up()
{
Schema::table('invoices', function ($table) {
$table->renameColumn('is_quote', 'invoice_type_id');
});
if (Schema::hasColumn('invoices', 'is_quote')) {
DB::update('update invoices set is_quote = is_quote + 1');
Schema::table('invoices', function ($table) {
$table->renameColumn('is_quote', 'invoice_type_id');
});
}
Schema::table('accounts', function($table)
{
$table->boolean('enable_second_tax_rate')->default(false);
});
}
/**
@ -24,8 +35,17 @@ class AddInvoiceTypeSupport extends Migration
*/
public function down()
{
Schema::table('invoices', function ($table) {
$table->renameColumn('invoice_type_id', 'is_quote');
});
if (Schema::hasColumn('invoices', 'invoice_type_id')) {
DB::update('update invoices set invoice_type_id = invoice_type_id - 1');
Schema::table('invoices', function ($table) {
$table->renameColumn('invoice_type_id', 'is_quote');
});
}
Schema::table('accounts', function($table)
{
$table->dropColumn('enable_second_tax_rate');
});
}
}