feat: updates
This commit is contained in:
@@ -18,14 +18,6 @@ class Branch extends Model
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Get the client that owns the Branch
|
||||
*/
|
||||
public function client(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Client::class);
|
||||
}
|
||||
|
||||
public function getCurrentSeriesAttribute()
|
||||
{
|
||||
if ($this->series()->count() > 0) {
|
||||
@@ -43,8 +35,21 @@ class Branch extends Model
|
||||
return $this->hasMany(Series::class);
|
||||
}
|
||||
|
||||
public function getIsClientVatableAttribute(): bool
|
||||
{
|
||||
return $this->client->vatable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the sales for the Branch
|
||||
* Get the client that owns the Branch
|
||||
*/
|
||||
public function client(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Client::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the sales for the Branch
|
||||
*/
|
||||
public function sales(): HasMany
|
||||
{
|
||||
@@ -52,7 +57,7 @@ class Branch extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the expenses for the Branch
|
||||
* Get all the expenses for the Branch
|
||||
*/
|
||||
public function expenses(): HasMany
|
||||
{
|
||||
@@ -68,4 +73,9 @@ class Branch extends Model
|
||||
{
|
||||
return $this->belongsToThrough(Account::class, Balance::class);
|
||||
}
|
||||
|
||||
public function transactions(): HasMany
|
||||
{
|
||||
return $this->hasMany(Transaction::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user