feat(client): add financial reports and ledger management
- Add trial balance and general ledger pages to client resource with interactive tables - Implement sales and expenses relation managers for client-specific transactions - Enhance transaction handling with proper tax and withholding calculations - Add date casting to Transaction model and define client relationships - Configure super admin role bypass in AppServiceProvider - Update Filament components and fix JavaScript formatting issues
This commit is contained in:
@@ -47,6 +47,16 @@ class Account extends Model
|
||||
return $this->hasMany(Balance::class);
|
||||
}
|
||||
|
||||
public function latestBalance(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
{
|
||||
return $this->hasOne(Balance::class)->latestOfMany();
|
||||
}
|
||||
|
||||
public function ledgers(): HasMany
|
||||
{
|
||||
return $this->hasMany(Ledger::class);
|
||||
}
|
||||
|
||||
public function getCurrentBalanceAttribute()
|
||||
{
|
||||
if ($this->balances()->exists()) {
|
||||
|
||||
Reference in New Issue
Block a user