mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Working on recurring expenses
This commit is contained in:
parent
68ec5291b7
commit
ab06b72e66
@ -112,6 +112,10 @@ class ExpenseController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
if ($expense->recurring_expense_id) {
|
||||
$actions[] = ['url' => URL::to("recurring_expenses/{$expense->recurring_expense->public_id}/edit"), 'label' => trans('texts.view_recurring_expense')];
|
||||
}
|
||||
|
||||
$actions[] = \DropdownButton::DIVIDER;
|
||||
if (! $expense->trashed()) {
|
||||
$actions[] = ['url' => 'javascript:submitAction("archive")', 'label' => trans('texts.archive_expense')];
|
||||
|
@ -142,6 +142,15 @@ class Expense extends EntityModel
|
||||
return $this->belongsTo('App\Models\PaymentType');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function recurring_expense()
|
||||
{
|
||||
return $this->belongsTo('App\Models\RecurringExpense');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
@ -183,6 +183,7 @@ class RecurringExpenseRepository extends BaseRepository
|
||||
$expense->expense_date = $account->getDateTime()->format('Y-m-d');
|
||||
$expense->exchange_rate = 1;
|
||||
$expense->invoice_currency_id = $recurringExpense->expense_currency_id;
|
||||
$expense->recurring_expense_id = $recurringExpense->id;
|
||||
$expense->save();
|
||||
|
||||
$recurringExpense->last_sent_date = $account->getDateTime()->format('Y-m-d');
|
||||
|
@ -2287,6 +2287,7 @@ $LANG = array(
|
||||
'delete_recurring_expense' => 'Delete Recurring Expense',
|
||||
'deleted_recurring_expense' => 'Successfully deleted project',
|
||||
'deleted_recurring_expense' => 'Successfully deleted :count projects',
|
||||
'view_recurring_expense' => 'View Recurring Expense',
|
||||
|
||||
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user