diff --git a/app/Models/Product.php b/app/Models/Product.php index 9309074..dd950fb 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -13,9 +13,10 @@ use Illuminate\Support\Facades\File; use Illuminate\Support\Str; use Leenooks\Traits\ScopeActive; +use App\Casts\CollectionOrNull; use App\Http\Controllers\AccountingController; use App\Interfaces\{IDs,ProductItem}; -use App\Traits\{ProductDetails,ProviderRef,SiteID}; +use App\Traits\{ProductDetails,ProviderRef}; /** * Class Product @@ -65,10 +66,10 @@ use App\Traits\{ProductDetails,ProviderRef,SiteID}; */ class Product extends Model implements IDs { - use HasFactory,SiteID,ProductDetails,ScopeActive,ProviderRef; + use HasFactory,ProductDetails,ScopeActive,ProviderRef; protected $casts = [ - 'pricing'=>'collection', + 'pricing' => CollectionOrNull::class, ]; /* STATIC */ diff --git a/app/Models/Service.php b/app/Models/Service.php index eaddfa8..3125087 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -901,7 +901,9 @@ class Service extends Model implements IDs */ public function getStatusAttribute(): string { - return $this->active ? $this->order_status : 'INACTIVE'; + return $this->active + ? strtolower($this->order_status) + : ((strtolower($this->order_status) === 'cancelled') ? 'cancelled' : 'inactive'); } /** diff --git a/resources/views/theme/backend/adminlte/service/widget/information.blade.php b/resources/views/theme/backend/adminlte/service/widget/information.blade.php index 44a151f..2bfe85c 100644 --- a/resources/views/theme/backend/adminlte/service/widget/information.blade.php +++ b/resources/views/theme/backend/adminlte/service/widget/information.blade.php @@ -1,4 +1,4 @@ - +