'float', ]; } public function company(): BelongsTo { return $this->belongsTo(Company::class); } public function currency(): BelongsTo { return $this->belongsTo(Currency::class); } /** * Log the rate a priced record (invoice, estimate, expense, payment) was * captured with. The company side of the pair is read from settings. */ public static function addExchangeRateLog(mixed $model): self { return static::create([ 'exchange_rate' => $model->exchange_rate, 'company_id' => $model->company_id, 'base_currency_id' => $model->currency_id, 'currency_id' => CompanySetting::getSetting('currency', $model->company_id), ]); } }