mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Recurring expenses
This commit is contained in:
parent
df6ec9af70
commit
b694d35994
@ -80,6 +80,7 @@ class HistoryUtils
|
||||
ENTITY_QUOTE,
|
||||
ENTITY_TASK,
|
||||
ENTITY_EXPENSE,
|
||||
//ENTITY_RECURRING_EXPENSE,
|
||||
];
|
||||
|
||||
if (! in_array($entityType, $trackedTypes)) {
|
||||
|
@ -312,6 +312,7 @@ class EntityModel extends Eloquent
|
||||
'invoices' => 'file-pdf-o',
|
||||
'payments' => 'credit-card',
|
||||
'recurring_invoices' => 'files-o',
|
||||
'recurring_expenses' => 'files-o',
|
||||
'credits' => 'credit-card',
|
||||
'quotes' => 'file-text-o',
|
||||
'tasks' => 'clock-o',
|
||||
|
@ -46,8 +46,8 @@ class RecurringExpense extends EntityModel
|
||||
'tax_rate2',
|
||||
'tax_name2',
|
||||
'should_be_invoiced',
|
||||
'start_date',
|
||||
'end_date',
|
||||
//'start_date',
|
||||
//'end_date',
|
||||
'frequency_id',
|
||||
];
|
||||
|
||||
|
@ -114,6 +114,9 @@ class RecurringExpenseRepository extends BaseRepository
|
||||
$expense->fill($input);
|
||||
|
||||
if (isset($input['start_date'])) {
|
||||
if ($expense->exists && $expense->start_date && $expense->start_date != Utils::toSqlDate($input['start_date'])) {
|
||||
$expense->last_sent_date = null;
|
||||
}
|
||||
$expense->start_date = Utils::toSqlDate($input['start_date']);
|
||||
}
|
||||
if (isset($input['end_date'])) {
|
||||
|
@ -376,11 +376,20 @@
|
||||
@if ($isRecurring)
|
||||
$('#start_date, #end_date').datepicker();
|
||||
@if ($expense && $expense->start_date)
|
||||
$('#start_date').datepicker('update', '{{ Utils::fromSqlDate($expense->start_date) }}');
|
||||
$('#start_date').datepicker('update', '{{ $expense && $expense->start_date ? Utils::fromSqlDate($expense->start_date) : 'new Date()' }}');
|
||||
@elseif (! $expense)
|
||||
$('#start_date').datepicker('update', new Date());
|
||||
@endif
|
||||
@if ($expense && $expense->end_date)
|
||||
$('#end_date').datepicker('update', '{{ Utils::fromSqlDate($expense->end_date) }}');
|
||||
@endif
|
||||
|
||||
$('.start_date .input-group-addon').click(function() {
|
||||
toggleDatePicker('start_date');
|
||||
});
|
||||
$('.end_date .input-group-addon').click(function() {
|
||||
toggleDatePicker('end_date');
|
||||
});
|
||||
@elseif (Auth::user()->account->hasFeature(FEATURE_DOCUMENTS))
|
||||
$('.main-form').submit(function(){
|
||||
if($('#document-upload .fallback input').val())$(this).attr('enctype', 'multipart/form-data')
|
||||
|
Loading…
x
Reference in New Issue
Block a user