Skip to content

Commit

Permalink
Transaction show contact show and contact pages styling..
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jun 30, 2021
1 parent 4a18e50 commit fd1f6b4
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 12 deletions.
48 changes: 41 additions & 7 deletions app/Abstracts/View/Components/TransactionShow.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ abstract class TransactionShow extends Base
/** @var string */
public $routeButtonPrint;

/** @var string */
public $routeContactShow;

/** @var string */
public $signedUrl;

Expand Down Expand Up @@ -319,17 +322,17 @@ abstract class TransactionShow extends Base
public function __construct(
$type, $transaction, $transactionTemplate = '', $logo = '', array $payment_methods = [],
bool $hideButtonAddNew = false, bool $hideButtonMoreActions = false, bool $hideButtonEdit = false, bool $hideButtonDuplicate = false, bool $hideButtonPrint = false, bool $hideButtonShare = false,
bool $hideButtonEmail = false, bool $hideButtonPdf = false, bool $hideButtonDelete = false, bool $checkButtonReconciled = true,
bool $hideButtonEmail = false, bool $hideButtonPdf = false, bool $hideButtonDelete = false, bool $checkButtonReconciled = true,
bool $hideButtonGroupDivider1 = false, bool $hideButtonGroupDivider2 = false, bool $hideButtonGroupDivider3 = false,
string $permissionCreate = '', string $permissionUpdate = '', string $permissionDelete = '',
string $routeButtonAddNew = '', string $routeButtonEdit = '', string $routeButtonDuplicate = '', string $routeButtonPrint = '', string $signedUrl = '',
string $routeButtonEmail = '', string $routeButtonPdf = '', string $routeButtonDelete = '',
string $routeButtonEmail = '', string $routeButtonPdf = '', string $routeButtonDelete = '', string $routeContactShow = '',
string $textDeleteModal = '',
bool $hideHeader = false, bool $hideHeaderAccount = false, bool $hideHeaderCategory = false, bool $hideHeaderContact = false, bool $hideHeaderAmount = false, bool $hideHeaderPaidAt = false,
string $textHeaderAccount = '', string $textHeaderCategory = '', string $textHeaderContact = '', string $textHeaderAmount = '', string $textHeaderPaidAt = '',
string $classHeaderAccount = '', string $classHeaderCategory = '', string $classHeaderContact = '', string $classHeaderAmount = '', string $classHeaderPaidAt = '',

bool $hideCompany = false, bool $hideCompanyLogo = false, bool $hideCompanyDetails = false, bool $hideCompanyName = false, bool $hideCompanyAddress = false,
bool $hideCompany = false, bool $hideCompanyLogo = false, bool $hideCompanyDetails = false, bool $hideCompanyName = false, bool $hideCompanyAddress = false,
bool $hideCompanyTaxNumber = false, bool $hideCompanyPhone = false, bool $hideCompanyEmail = false,
bool $hideContentTitle = false,bool $hidePaidAt = false, bool $hideAccount = false, bool $hideCategory = false, bool $hidePaymentMethods = false, bool $hideReference = false, bool $hideDescription = false,
bool $hideAmount = false,
Expand All @@ -342,7 +345,7 @@ public function __construct(
string $routeDocumentShow = '',

bool $hideAttachment = false, $attachment = [],
bool $hideFooter = false, bool $hideFooterHistories = false, $histories = [],
bool $hideFooter = false, bool $hideFooterHistories = false, $histories = [],
string $textHistories = '', string $classFooterHistories = ''
) {
$this->type = $type;
Expand Down Expand Up @@ -381,11 +384,12 @@ public function __construct(
$this->routeButtonEmail = $this->getRouteButtonEmail($type, $routeButtonEmail);
$this->routeButtonPdf = $this->getRouteButtonPdf($type, $routeButtonPdf);
$this->routeButtonDelete = $this->getRouteButtonDelete($type, $routeButtonDelete);
$this->routeContactShow = $this->getRouteContactShow($type, $routeContactShow);

// Navbar Text
$this->textDeleteModal = $textDeleteModal;

// Header Hide
// Header Hide
$this->hideHeader = $hideHeader;

$this->hideHeaderAccount = $hideHeaderAccount;
Expand Down Expand Up @@ -483,7 +487,7 @@ public function __construct(
$this->hideFooter = $hideFooter;
$this->hideFooterHistories = $hideFooterHistories;

// Histories
// Histories
$this->histories = $this->getHistories($histories);
$this->textHistories = $this->getTextHistories($type, $textHistories);
$this->classFooterHistories = $this->getClassFooterHistories($type, $classFooterHistories);
Expand Down Expand Up @@ -713,6 +717,36 @@ protected function getRouteButtonDelete($type, $routeButtonDelete)
return 'revenues.destroy';
}

protected function getRouteContactShow($type, $routeContactShow)
{
if (!empty($routeContactShow)) {
return $routeContactShow;
}

//example route parameter.
$parameter = 1;

$route = Str::plural(config('type.' . $type . '.contact_type'), 2) . '.show';

try {
route($route, $config_parameters);
} catch (\Exception $e) {
try {
$route = Str::plural($type, 2) . '.' . $config_key;

route($route, $config_parameters);
} catch (\Exception $e) {
$route = '';
}
}

if (!empty($route)) {
return $route;
}

return 'customers.show';
}

protected function getPermissionCreate($type, $permissionCreate)
{
if (!empty($permissionCreate)) {
Expand Down Expand Up @@ -1242,4 +1276,4 @@ protected function getClassFooterHistories($type, $classFooterHistories)

return 'col-sm-6 col-md-6 col-lg-6 col-xl-6';
}
}
}
7 changes: 5 additions & 2 deletions resources/views/components/transactions/show/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@

<strong>
<span class="float-left long-texts mwpx-300 transaction-head-text">
{{ $transaction->contact->name }}
<a href="{{ route($routeContactShow, $transaction->contact->id) }}">
{{ $transaction->contact->name }}
</a>

</span>
</strong>
<br><br>
Expand Down Expand Up @@ -78,4 +81,4 @@
</div>
@endif
@stack('header_paid_at_end')
</div>
</div>
2 changes: 1 addition & 1 deletion resources/views/purchases/vendors/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<tbody>
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1 tr-py">
<td class="col-xs-6 col-sm-2">@date($item->paid_at)</td>
<td class="col-xs-6 col-sm-2"><a href="{{ route('payments.show', $item->id) }}">@date($item->paid_at)</a></td>
<td class="col-xs-6 col-sm-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-4 d-none d-sm-block">{{ $item->category->name }}</td>
<td class="col-sm-4 d-none d-sm-block">{{ $item->account->name }}</td>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/sales/customers/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
@stack('revenue_button_end')

<div class="dropdown-divider"></div>

@stack('delete_button_start')
@can('delete-sales-customers')
{!! Form::deleteLink($customer, 'customers.destroy') !!}
Expand Down Expand Up @@ -254,7 +254,7 @@
<tbody>
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1 tr-py">
<td class="col-xs-6 col-sm-2">@date($item->paid_at)</td>
<td class="col-xs-6 col-sm-2"><a href="{{ route('revenues.show', $item->id) }}">@date($item->paid_at)</a></td>
<td class="col-xs-6 col-sm-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-4 d-none d-sm-block">{{ $item->category->name }}</td>
<td class="col-sm-4 d-none d-sm-block">{{ $item->account->name }}</td>
Expand Down

0 comments on commit fd1f6b4

Please sign in to comment.