Transaction and Transfer show page add new relation slider

This commit is contained in:
Cüneyt Şentürk
2022-06-28 19:20:27 +03:00
parent 239b4d6276
commit 90a2330ae2
10 changed files with 142 additions and 1 deletions

View File

@ -285,6 +285,9 @@ abstract class Show extends Component
/** @var bool */
public $hideChildren;
/** @var bool */
public $hideTransfer;
/** @var bool */
public $hideAttachment;
@ -329,7 +332,7 @@ abstract class Show extends Component
string $textRelatedTransansaction = '', string $textRelatedDocumentNumber = '', string $textRelatedContact = '', string $textRelatedDocumentDate = '', string $textRelatedDocumentAmount = '', string $textRelatedAmount = '',
string $routeDocumentShow = '', string $routeTransactionShow = '', string $textButtonAddNew = '',
bool $hideSchedule = false, bool $hideChildren = false, bool $hideAttachment = false, $attachment = [],
bool $hideSchedule = false, bool $hideChildren = false, bool $hideTransfer = false, bool $hideAttachment = false, $attachment = [],
array $connectTranslations = [], string $textRecurringType = '', bool $hideRecurringMessage = false, bool $hideCreated = false
) {
$this->type = $type;
@ -386,6 +389,9 @@ abstract class Show extends Component
// Hide Children
$this->hideChildren = $hideChildren;
// Hide Transfer
$this->hideTransfer = $hideTransfer;
// Hide Attachment
$this->hideAttachment = $hideAttachment;

View File

@ -141,6 +141,19 @@ class Transaction extends Model
return $this->morphOne('App\Models\Common\Recurring', 'recurable');
}
public function transfer()
{
if ($this->type == self::INCOME_TYPE) {
return $this->belongsTo('App\Models\Banking\Transfer', 'id', 'income_transaction_id');
}
if ($this->type == self::EXPENSE_TYPE) {
return $this->belongsTo('App\Models\Banking\Transfer', 'id', 'expense_transaction_id');
}
return null;
}
public function splits()
{
return $this->hasMany('App\Models\Banking\Transaction', 'split_id');

View File

@ -0,0 +1,18 @@
<?php
namespace App\View\Components\Transactions\Show;
use App\Abstracts\View\Components\Transactions\Show as Component;
class Transfer extends Component
{
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.transactions.show.transfer');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\View\Components\Transfers\Show;
use App\Abstracts\View\Components\Transfers\Show as Component;
class Transactions extends Component
{
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.transfers.show.transactions');
}
}