mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Working on recurring expenses
This commit is contained in:
parent
337f57e1ac
commit
f492cca9fe
@ -24,6 +24,41 @@ class UpdateDarkMode extends Migration
|
|||||||
set invoice_item_type_id = 2
|
set invoice_item_type_id = 2
|
||||||
where invoices.has_tasks = 1
|
where invoices.has_tasks = 1
|
||||||
and invoice_item_type_id = 1');
|
and invoice_item_type_id = 1');
|
||||||
|
|
||||||
|
Schema::create('recurring_expenses', function (Blueprint $table) {
|
||||||
|
$table->increments('id');
|
||||||
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
|
|
||||||
|
$table->unsignedInteger('account_id')->index();
|
||||||
|
$table->unsignedInteger('vendor_id')->nullable();
|
||||||
|
$table->unsignedInteger('user_id');
|
||||||
|
$table->unsignedInteger('client_id')->nullable();
|
||||||
|
$table->boolean('is_deleted')->default(false);
|
||||||
|
$table->decimal('amount', 13, 2);
|
||||||
|
$table->text('private_notes');
|
||||||
|
$table->text('public_notes');
|
||||||
|
$table->unsignedInteger('invoice_currency_id')->nullable(false);
|
||||||
|
$table->unsignedInteger('expense_currency_id')->nullable()->index();
|
||||||
|
$table->boolean('should_be_invoiced')->default(true);
|
||||||
|
$table->unsignedInteger('expense_category_id')->nullable()->index();
|
||||||
|
$table->string('tax_name1')->nullable();
|
||||||
|
$table->decimal('tax_rate1', 13, 3);
|
||||||
|
$table->string('tax_name2')->nullable();
|
||||||
|
$table->decimal('tax_rate2', 13, 3);
|
||||||
|
|
||||||
|
// Relations
|
||||||
|
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
|
$table->foreign('invoice_currency_id')->references('id')->on('currencies');
|
||||||
|
$table->foreign('expense_currency_id')->references('id')->on('currencies');
|
||||||
|
$table->foreign('expense_category_id')->references('id')->on('expense_categories')->onDelete('cascade');
|
||||||
|
|
||||||
|
// Indexes
|
||||||
|
$table->unsignedInteger('public_id')->index();
|
||||||
|
$table->unique(['account_id', 'public_id']);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,6 +68,6 @@ class UpdateDarkMode extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
//
|
Schema::drop('recurring_expenses');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
class="form-control pull-left" placeholder="{{ trans('texts.filter') }}" value="{{ Input::get('filter') }}"/>
|
class="form-control pull-left" placeholder="{{ trans('texts.filter') }}" value="{{ Input::get('filter') }}"/>
|
||||||
|
|
||||||
@if ($entityType == ENTITY_EXPENSE)
|
@if ($entityType == ENTITY_EXPENSE)
|
||||||
|
{!! Button::normal(trans('texts.recurring'))->asLinkTo(URL::to('/recurring_categories'))->appendIcon(Icon::create('list')) !!}
|
||||||
{!! Button::normal(trans('texts.categories'))->asLinkTo(URL::to('/expense_categories'))->appendIcon(Icon::create('list')) !!}
|
{!! Button::normal(trans('texts.categories'))->asLinkTo(URL::to('/expense_categories'))->appendIcon(Icon::create('list')) !!}
|
||||||
@elseif ($entityType == ENTITY_TASK)
|
@elseif ($entityType == ENTITY_TASK)
|
||||||
{!! Button::normal(trans('texts.projects'))->asLinkTo(URL::to('/projects'))->appendIcon(Icon::create('list')) !!}
|
{!! Button::normal(trans('texts.projects'))->asLinkTo(URL::to('/projects'))->appendIcon(Icon::create('list')) !!}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user