mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:44:29 -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 ? '...' : '');
|
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
|
* @param $account
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
@ -66,11 +66,17 @@
|
|||||||
->addGroupClass('amount')
|
->addGroupClass('amount')
|
||||||
->append('<span data-bind="html: expenseCurrencyCode"></span>') !!}
|
->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')
|
{!! Former::select('client_id')
|
||||||
->addOption('', '')
|
->addOption('', '')
|
||||||
->label(trans('texts.client'))
|
->label(trans('texts.client'))
|
||||||
->data_bind('combobox: client_id')
|
->data_bind('combobox: client_id')
|
||||||
->addGroupClass('client-select') !!}
|
->addGroupClass('client-select') !!}
|
||||||
|
@endif
|
||||||
|
|
||||||
@if (!$expense || ($expense && !$expense->invoice_id && !$expense->client_id))
|
@if (!$expense || ($expense && !$expense->invoice_id && !$expense->client_id))
|
||||||
{!! Former::checkbox('should_be_invoiced')
|
{!! Former::checkbox('should_be_invoiced')
|
||||||
|
@ -47,9 +47,21 @@
|
|||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-body">
|
<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('client')->addOption('', '')->addGroupClass('client-select') !!}
|
||||||
{!! Former::select('project_id')->addOption('', '')->addGroupClass('project-select')
|
{!! Former::select('project_id')->addOption('', '')->addGroupClass('project-select')
|
||||||
->label(trans('texts.project')) !!}
|
->label(trans('texts.project')) !!}
|
||||||
|
@endif
|
||||||
|
|
||||||
{!! Former::textarea('description')->rows(3) !!}
|
{!! Former::textarea('description')->rows(3) !!}
|
||||||
|
|
||||||
@if ($task)
|
@if ($task)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user