Transaction and Transfer show page add new relation slider
This commit is contained in:
@ -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;
|
||||
|
||||
|
@ -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');
|
||||
|
18
app/View/Components/Transactions/Show/Transfer.php
Normal file
18
app/View/Components/Transactions/Show/Transfer.php
Normal 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');
|
||||
}
|
||||
}
|
18
app/View/Components/Transfers/Show/Transactions.php
Normal file
18
app/View/Components/Transfers/Show/Transactions.php
Normal 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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user