belongsTo(FilamentCompanies::companyModel(), 'company_id'); } public function bankAccount(): BelongsTo { return $this->belongsTo(BankAccount::class, 'bank_account_id'); } public function currency(): BelongsTo { return $this->belongsTo(Currency::class, 'currency_code', 'code'); } public function salesTax(): BelongsTo { return $this->belongsTo(Tax::class, 'sales_tax_id', 'id') ->where('type', TaxType::Sales); } public function purchaseTax(): BelongsTo { return $this->belongsTo(Tax::class, 'purchase_tax_id', 'id') ->where('type', TaxType::Purchase); } public function salesDiscount(): BelongsTo { return $this->belongsTo(Discount::class, 'sales_discount_id', 'id') ->where('type', DiscountType::Sales); } public function purchaseDiscount(): BelongsTo { return $this->belongsTo(Discount::class, 'purchase_discount_id', 'id') ->where('type', DiscountType::Purchase); } public function incomeCategory(): BelongsTo { return $this->belongsTo(Category::class, 'income_category_id', 'id') ->where('type', CategoryType::Income); } public function expenseCategory(): BelongsTo { return $this->belongsTo(Category::class, 'expense_category_id', 'id') ->where('type', CategoryType::Expense); } public function createdBy(): BelongsTo { return $this->belongsTo(FilamentCompanies::userModel(), 'created_by'); } public function updatedBy(): BelongsTo { return $this->belongsTo(FilamentCompanies::userModel(), 'updated_by'); } protected static function newFactory(): Factory { return CompanyDefaultFactory::new(); } }