$this->id, 'origin' => $this->origin, 'financial_plan_account_id' => $this->financial_plan_account_id, 'plan_account' => $this->whenLoaded('planAccount', fn () => $this->planAccount ? [ 'id' => $this->planAccount->id, 'code' => $this->planAccount->code, 'description' => $this->planAccount->description, ] : null), 'history' => $this->history, 'value' => (float) $this->value, 'paid_value' => (float) $this->paid_value, 'discount' => (float) $this->discount, 'fine' => (float) $this->fine, 'due_date' => $this->due_date?->format('Y-m-d'), 'payment_date' => $this->payment_date?->format('Y-m-d'), 'status' => $this->status, 'obs' => $this->obs, ]; } }