1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-17 16:42:48 +01:00

Added fields for future features

This commit is contained in:
Hillel Coren 2016-10-23 14:41:26 +03:00
parent 6a55cf5b43
commit 12d9bac3fd
2 changed files with 48 additions and 1 deletions

View File

@ -102,6 +102,21 @@ class Account extends Eloquent
ACCOUNT_USER_MANAGEMENT,
];
public static $modules = [
1 => ENTITY_RECURRING_INVOICE,
2 => ENTITY_CREDIT,
4 => ENTITY_QUOTE,
8 => ENTITY_TASK,
16 => ENTITY_EXPENSE,
32 => ENTITY_VENDOR,
];
public static $dashboardSections = [
1 => 'total_revenue',
2 => 'average_invoice',
4 => 'outstanding',
];
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
@ -459,7 +474,7 @@ class Account extends Eloquent
if ( ! $decorator) {
$decorator = $this->show_currency_code ? CURRENCY_DECORATOR_CODE : CURRENCY_DECORATOR_SYMBOL;
}
return Utils::formatMoney($amount, $currencyId, $countryId, $decorator);
}

View File

@ -16,6 +16,22 @@ class AddExpenseToActivities extends Migration
{
$table->unsignedInteger('expense_id')->nullable();
});
Schema::table('accounts', function($table)
{
$table->date('financial_year_start')->nullable();
$table->smallInteger('enabled_modules')->default(63);
$table->smallInteger('enabled_dashboard_sections')->default(7);
$table->boolean('show_accept_invoice_terms')->default(false);
$table->boolean('show_accept_quote_terms')->default(false);
$table->boolean('require_invoice_signature')->default(false);
$table->boolean('require_quote_signature')->default(false);
});
Schema::table('payments', function($table)
{
$table->text('credit_ids')->nullable();
});
}
/**
@ -29,5 +45,21 @@ class AddExpenseToActivities extends Migration
{
$table->dropColumn('expense_id');
});
Schema::table('accounts', function($table)
{
$table->dropColumn('financial_year_start');
$table->dropColumn('enabled_modules');
$table->dropColumn('enabled_dashboard_sections');
$table->dropColumn('show_accept_invoice_terms');
$table->dropColumn('show_accept_quote_terms');
$table->dropColumn('require_invoice_signature');
$table->dropColumn('require_quote_signature');
});
Schema::table('payments', function($table)
{
$table->dropColumn('credit_ids');
});
}
}