'decimal:2', 'unit_price' => 'decimal:2', 'total_price' => 'decimal:2', 'total_price_usd' => 'decimal:2', ]; public function tenant() { return $this->belongsTo(Tenant::class); } public function item() { return $this->belongsTo(Item::class); } public function warehouse() { return $this->belongsTo(Warehouse::class); } public function project() { return $this->belongsTo(Project::class); } public function currency() { return $this->belongsTo(Currency::class); } public function createdBy() { return $this->belongsTo(User::class, 'created_by'); } /** * Scope: filter by type */ public function scopeByType($query, $type) { return $query->where('type', $type); } }