feat: updates

This commit is contained in:
JP
2024-08-15 20:11:21 +08:00
parent 52431a2c61
commit 3af7207ec3
61 changed files with 1674 additions and 480 deletions

View File

@@ -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);
}
}