'object', 'updated_at' => 'timestamp', 'created_at' => 'timestamp', 'deleted_at' => 'timestamp', 'is_deleted' => 'bool', ]; public function client() { return $this->belongsTo(Client::class)->withTrashed(); } public function company() { return $this->belongsTo(Company::class); } public function user() { return $this->belongsTo(User::class)->withTrashed(); } public function assigned_user() { return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed(); } public function documents() { return $this->morphMany(Document::class, 'documentable'); } public function invoices() { return $this->morphedByMany(Invoice::class, 'paymentable')->withPivot('amount'); } public function company_ledger() { return $this->morphMany(CompanyLedger::class, 'company_ledgerable'); } public function type() { return $this->belongsTo(PaymentType::class); } public function paymentables() { return $this->hasMany(Paymentable::class); } public function formattedAmount() { return Number::formatMoney($this->amount, $this->client); } public function clientPaymentDate() { if (!$this->date) { return ''; } $date_format = DateFormat::find($this->client->getSetting('date_format_id')); return $this->createClientDate($this->date, $this->client->timezone()->name)->format($date_format->format); } public static function badgeForStatus(int $status) { switch ($status) { case self::STATUS_PENDING: return '