Skip to content

A free open source IT asset/license management system

Fix showCheckoutButton/showCheckinButton to call availability methods

copilot-swe-agent[bot]c4c8750b2669
diff --git a/app/Models/SnipeModel.php b/app/Models/SnipeModel.php
index 3d4eb56b43..cede985177 100644
--- a/app/Models/SnipeModel.php
+++ b/app/Models/SnipeModel.php
@@ -241,7 +241,7 @@ class SnipeModel extends Model
return true;
}
- if ((method_exists($item, 'availableForCheckout')) && ($item->deleted_at == '')) {
+ if ((method_exists($item, 'availableForCheckout')) && ($item->availableForCheckout())) {
return true;
}
@@ -254,7 +254,7 @@ class SnipeModel extends Model
return true;
}
- if ((method_exists($item, 'availableForCheckIn')) && ($item->assigned_to != '') && ($item->deleted_at == '')) {
+ if ((method_exists($item, 'availableForCheckIn')) && ($item->availableForCheckIn())) {
return true;
}