mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Don't allow changing client once task/expense has been invoiced
This commit is contained in:
parent
db26b169cd
commit
f275d1a295
@ -26,6 +26,11 @@ class TaskPresenter extends EntityPresenter
|
||||
return substr($this->entity->description, 0, 40) . (strlen($this->entity->description) > 40 ? '...' : '');
|
||||
}
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->entity->project ? $this->entity->project->name : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $account
|
||||
* @return mixed
|
||||
|
@ -66,11 +66,17 @@
|
||||
->addGroupClass('amount')
|
||||
->append('<span data-bind="html: expenseCurrencyCode"></span>') !!}
|
||||
|
||||
@if ($expense && $expense->invoice_id)
|
||||
{!! Former::plaintext()
|
||||
->label('client')
|
||||
->value($expense->client->getDisplayName()) !!}
|
||||
@else
|
||||
{!! Former::select('client_id')
|
||||
->addOption('', '')
|
||||
->label(trans('texts.client'))
|
||||
->data_bind('combobox: client_id')
|
||||
->addGroupClass('client-select') !!}
|
||||
@endif
|
||||
|
||||
@if (!$expense || ($expense && !$expense->invoice_id && !$expense->client_id))
|
||||
{!! Former::checkbox('should_be_invoiced')
|
||||
|
@ -47,9 +47,21 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
@if ($task && $task->invoice_id)
|
||||
{!! Former::plaintext()
|
||||
->label('client')
|
||||
->value($task->client->getDisplayName()) !!}
|
||||
@if ($task->project)
|
||||
{!! Former::plaintext()
|
||||
->label('project')
|
||||
->value($task->present()->project) !!}
|
||||
@endif
|
||||
@else
|
||||
{!! Former::select('client')->addOption('', '')->addGroupClass('client-select') !!}
|
||||
{!! Former::select('project_id')->addOption('', '')->addGroupClass('project-select')
|
||||
->label(trans('texts.project')) !!}
|
||||
@endif
|
||||
|
||||
{!! Former::textarea('description')->rows(3) !!}
|
||||
|
||||
@if ($task)
|
||||
|
Loading…
x
Reference in New Issue
Block a user