Only show invoice button for expenses and tasks if an invoice can be created

This commit is contained in:
Joshua Dwire 2016-03-15 22:38:35 -04:00
parent 36284431c9
commit 9ef448c2b8

View File

@ -9,12 +9,14 @@
{!! Former::text('public_id') !!} {!! Former::text('public_id') !!}
</div> </div>
@if ($entityType == ENTITY_TASK) @if (\App\Models\Invoice::canCreate())
{!! Button::primary(trans('texts.invoice'))->withAttributes(['class'=>'invoice', 'onclick' =>'submitForm("invoice")'])->appendIcon(Icon::create('check')) !!} @if ($entityType == ENTITY_TASK)
@endif {!! Button::primary(trans('texts.invoice'))->withAttributes(['class'=>'invoice', 'onclick' =>'submitForm("invoice")'])->appendIcon(Icon::create('check')) !!}
@if ($entityType == ENTITY_EXPENSE) @endif
{!! Button::primary(trans('texts.invoice'))->withAttributes(['class'=>'invoice', 'onclick' =>'submitForm("invoice")'])->appendIcon(Icon::create('check')) !!} @if ($entityType == ENTITY_EXPENSE)
@endif {!! Button::primary(trans('texts.invoice'))->withAttributes(['class'=>'invoice', 'onclick' =>'submitForm("invoice")'])->appendIcon(Icon::create('check')) !!}
@endif
@endif
{!! DropdownButton::normal(trans('texts.archive'))->withContents([ {!! DropdownButton::normal(trans('texts.archive'))->withContents([
['label' => trans('texts.archive_'.$entityType), 'url' => 'javascript:submitForm("archive")'], ['label' => trans('texts.archive_'.$entityType), 'url' => 'javascript:submitForm("archive")'],