Car-Repairs-Shop/app/Models/EstimateLineItem.php
sackey e3b2b220d2
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
Enhance UI and functionality across various components
- Increased icon sizes in service items, service orders, users, and technician management for better visibility.
- Added custom loading indicators with appropriate icons in search fields for vehicles, work orders, and technicians.
- Introduced invoice management routes for better organization and access control.
- Created a new test for the estimate PDF functionality to ensure proper rendering and data integrity.
2025-08-16 14:36:58 +00:00

49 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class EstimateLineItem extends Model
{
use HasFactory;
protected $fillable = [
'estimate_id',
'type', // 'labour', 'parts', 'miscellaneous'
'part_id',
'description',
'quantity',
'unit_price',
'total_amount',
'labor_hours',
'labor_rate',
'markup_percentage',
'notes',
'required',
'category',
];
protected $casts = [
'quantity' => 'decimal:2',
'unit_price' => 'decimal:2',
'total_amount' => 'decimal:2',
'labor_hours' => 'decimal:2',
'labor_rate' => 'decimal:2',
'markup_percentage' => 'decimal:2',
'required' => 'boolean',
];
public function estimate(): BelongsTo
{
return $this->belongsTo(Estimate::class);
}
public function part(): BelongsTo
{
return $this->belongsTo(Part::class);
}
}