document show contact link
This commit is contained in:
parent
e47d575087
commit
9dade70dc4
@ -2,19 +2,20 @@
|
||||
|
||||
namespace App\Abstracts\View\Components\Documents;
|
||||
|
||||
use App\Abstracts\View\Component;
|
||||
use App\Models\Common\Media;
|
||||
use Image;
|
||||
use ReflectionProperty;
|
||||
use App\Traits\DateTime;
|
||||
use App\Traits\Documents;
|
||||
use App\Traits\Tailwind;
|
||||
use App\Traits\Documents;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\Common\Media;
|
||||
use App\Traits\ViewComponents;
|
||||
use App\Abstracts\View\Component;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Intervention\Image\Exception\NotReadableException;
|
||||
use Image;
|
||||
|
||||
abstract class Template extends Component
|
||||
{
|
||||
@ -123,6 +124,9 @@ abstract class Template extends Component
|
||||
|
||||
public $hideNote;
|
||||
|
||||
/** @var bool */
|
||||
public $print;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
@ -137,7 +141,7 @@ abstract class Template extends Component
|
||||
string $textDocumentTitle = '', string $textDocumentSubheading = '',
|
||||
string $textContactInfo = '', string $textDocumentNumber = '', string $textOrderNumber = '', string $textIssuedAt = '', string $textDueAt = '',
|
||||
bool $hideItems = false, bool $hideName = false, bool $hideDescription = false, bool $hideQuantity = false, bool $hidePrice = false, bool $hideDiscount = false, bool $hideAmount = false, bool $hideNote = false,
|
||||
string $textItems = '', string $textQuantity = '', string $textPrice = '', string $textAmount = ''
|
||||
string $textItems = '', string $textQuantity = '', string $textPrice = '', string $textAmount = '', bool $print = false
|
||||
) {
|
||||
$this->type = $type;
|
||||
$this->item = $item;
|
||||
@ -187,6 +191,8 @@ abstract class Template extends Component
|
||||
$this->textPrice = $this->getTextPrice($type, $textPrice);
|
||||
$this->textAmount = $this->getTextAmount($type, $textAmount);
|
||||
|
||||
$this->print = $this->getPrint($print);
|
||||
|
||||
// Set Parent data
|
||||
//$this->setParentData();
|
||||
}
|
||||
@ -677,4 +683,22 @@ abstract class Template extends Component
|
||||
// @todo what return value invoice or always false??
|
||||
return setting('invoice.hide_amount', $hideAmount);
|
||||
}
|
||||
|
||||
protected function getPrint($print)
|
||||
{
|
||||
if (! empty($print)) {
|
||||
return $print;
|
||||
}
|
||||
|
||||
$self = new ReflectionProperty($this::class, 'methodCache');
|
||||
$self->setAccessible(true);
|
||||
|
||||
$values = $self->getValue();
|
||||
|
||||
if (array_key_exists('App\View\Components\Layouts\Admin', $values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -122,9 +122,20 @@
|
||||
|
||||
@stack('name_input_start')
|
||||
@if (! $hideContactName)
|
||||
@if ($print)
|
||||
<p>
|
||||
{{ $document->contact_name }}
|
||||
</p>
|
||||
@else
|
||||
<x-link href="{{ route('customers.show', $document->contact_id) }}"
|
||||
override="class"
|
||||
class="py-1.5 mb-3 sm:mb-0 text-xs bg-transparent hover:bg-transparent font-medium leading-6"
|
||||
>
|
||||
<x-link.hover>
|
||||
{{ $document->contact_name }}
|
||||
</x-link.hover>
|
||||
</x-link>
|
||||
@endif
|
||||
@endif
|
||||
@stack('name_input_end')
|
||||
|
||||
|
@ -78,12 +78,27 @@
|
||||
<div class="col-60">
|
||||
<div class="text p-index-left">
|
||||
@if (! $hideContactInfo)
|
||||
<p class="font-semibold mb-0">{{ trans($textContactInfo) }}</p>
|
||||
<p class="font-semibold mb-0">
|
||||
{{ trans($textContactInfo) }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
@stack('name_input_start')
|
||||
@if (! $hideContactName)
|
||||
<p>{{ $document->contact_name }}</p>
|
||||
@if ($print)
|
||||
<p>
|
||||
{{ $document->contact_name }}
|
||||
</p>
|
||||
@else
|
||||
<x-link href="{{ route('customers.show', $document->contact_id) }}"
|
||||
override="class"
|
||||
class="py-1.5 mb-3 sm:mb-0 text-xs bg-transparent hover:bg-transparent font-medium leading-6"
|
||||
>
|
||||
<x-link.hover>
|
||||
{{ $document->contact_name }}
|
||||
</x-link.hover>
|
||||
</x-link>
|
||||
@endif
|
||||
@endif
|
||||
@stack('name_input_end')
|
||||
|
||||
|
@ -91,9 +91,20 @@
|
||||
|
||||
@stack('name_input_start')
|
||||
@if (! $hideContactName)
|
||||
@if ($print)
|
||||
<p>
|
||||
{{ $document->contact_name }}
|
||||
</p>
|
||||
@else
|
||||
<x-link href="{{ route('customers.show', $document->contact_id) }}"
|
||||
override="class"
|
||||
class="py-1.5 mb-3 sm:mb-0 text-xs bg-transparent hover:bg-transparent font-medium leading-6"
|
||||
>
|
||||
<x-link.hover>
|
||||
{{ $document->contact_name }}
|
||||
</x-link.hover>
|
||||
</x-link>
|
||||
@endif
|
||||
@endif
|
||||
@stack('name_input_end')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user