style: refine layout and formatting in Index.vue for improved readability and consistency
This commit is contained in:
parent
7d39f85da7
commit
21adde11fd
15
BEST_PRACTICE.md
Normal file
15
BEST_PRACTICE.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Best Practices
|
||||||
|
|
||||||
|
## PHP
|
||||||
|
|
||||||
|
### Traits
|
||||||
|
- Gabungkan multiple `use` trait menjadi satu baris dengan koma.
|
||||||
|
- **Hindari:**
|
||||||
|
```php
|
||||||
|
use FlashesEntityMessage;
|
||||||
|
use ParsesDataTableQuery;
|
||||||
|
```
|
||||||
|
- **Gunakan:**
|
||||||
|
```php
|
||||||
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
|
```
|
||||||
@ -17,8 +17,7 @@
|
|||||||
|
|
||||||
class CashController extends Controller
|
class CashController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly CashService $cashService,
|
private readonly CashService $cashService,
|
||||||
|
|||||||
@ -17,8 +17,7 @@
|
|||||||
|
|
||||||
class EmployeeAdvanceController extends Controller
|
class EmployeeAdvanceController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly EmployeeAdvanceService $employeeAdvanceService,
|
private readonly EmployeeAdvanceService $employeeAdvanceService,
|
||||||
|
|||||||
@ -15,8 +15,7 @@
|
|||||||
|
|
||||||
class ExpenseController extends Controller
|
class ExpenseController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ExpenseService $expenseService,
|
private readonly ExpenseService $expenseService,
|
||||||
|
|||||||
@ -13,8 +13,7 @@
|
|||||||
|
|
||||||
class PayrollPeriodController extends Controller
|
class PayrollPeriodController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly PayrollService $payrollService,
|
private readonly PayrollService $payrollService,
|
||||||
|
|||||||
@ -18,8 +18,7 @@
|
|||||||
|
|
||||||
class EmployeeController extends Controller
|
class EmployeeController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly EmployeeService $employeeService,
|
private readonly EmployeeService $employeeService,
|
||||||
|
|||||||
@ -18,8 +18,7 @@
|
|||||||
|
|
||||||
class LeaveRequestController extends Controller
|
class LeaveRequestController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly LeaveRequestService $leaveRequestService,
|
private readonly LeaveRequestService $leaveRequestService,
|
||||||
|
|||||||
@ -17,8 +17,7 @@
|
|||||||
|
|
||||||
class CuttingController extends Controller
|
class CuttingController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly CuttingService $cuttingService,
|
private readonly CuttingService $cuttingService,
|
||||||
|
|||||||
@ -19,8 +19,7 @@
|
|||||||
|
|
||||||
class OrderController extends Controller
|
class OrderController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly OrderService $orderService,
|
private readonly OrderService $orderService,
|
||||||
|
|||||||
@ -15,8 +15,7 @@
|
|||||||
|
|
||||||
class PurchaseController extends Controller
|
class PurchaseController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly PurchaseService $purchaseService,
|
private readonly PurchaseService $purchaseService,
|
||||||
|
|||||||
@ -15,8 +15,7 @@
|
|||||||
|
|
||||||
class CategoryController extends Controller
|
class CategoryController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage,ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly CategoryService $categoryService,
|
private readonly CategoryService $categoryService,
|
||||||
|
|||||||
@ -16,8 +16,7 @@
|
|||||||
|
|
||||||
class CustomerController extends Controller
|
class CustomerController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly CustomerService $customerService,
|
private readonly CustomerService $customerService,
|
||||||
|
|||||||
@ -21,8 +21,7 @@
|
|||||||
|
|
||||||
class ProductController extends Controller
|
class ProductController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly CuttingService $cuttingService,
|
private readonly CuttingService $cuttingService,
|
||||||
|
|||||||
@ -18,8 +18,7 @@
|
|||||||
|
|
||||||
class RawMaterialController extends Controller
|
class RawMaterialController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly RawMaterialService $rawMaterialService,
|
private readonly RawMaterialService $rawMaterialService,
|
||||||
|
|||||||
@ -15,8 +15,7 @@
|
|||||||
|
|
||||||
class SupplierController extends Controller
|
class SupplierController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly SupplierService $supplierService,
|
private readonly SupplierService $supplierService,
|
||||||
|
|||||||
@ -17,8 +17,7 @@
|
|||||||
|
|
||||||
class RoleController extends Controller
|
class RoleController extends Controller
|
||||||
{
|
{
|
||||||
use FlashesEntityMessage;
|
use FlashesEntityMessage, ParsesDataTableQuery;
|
||||||
use ParsesDataTableQuery;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly RoleService $roleService,
|
private readonly RoleService $roleService,
|
||||||
|
|||||||
@ -26,9 +26,7 @@
|
|||||||
])]
|
])]
|
||||||
class Attendance extends Model implements HasMedia
|
class Attendance extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasModuleMedia, InteractsWithActivityLog;
|
||||||
use HasModuleMedia;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -14,8 +14,7 @@
|
|||||||
#[Appends(['balance_formatted'])]
|
#[Appends(['balance_formatted'])]
|
||||||
class CashAccount extends Model
|
class CashAccount extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,10 +26,7 @@
|
|||||||
])]
|
])]
|
||||||
class CashTransaction extends Model implements HasMedia
|
class CashTransaction extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasModuleMedia, InteractsWithActivityLog, SoftDeletes;
|
||||||
use HasModuleMedia;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -14,9 +14,7 @@
|
|||||||
#[Sluggable(from: 'name', to: 'slug')]
|
#[Sluggable(from: 'name', to: 'slug')]
|
||||||
class Category extends Model
|
class Category extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
public function products(): BelongsToMany
|
public function products(): BelongsToMany
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,9 +12,7 @@
|
|||||||
#[Guarded(['id'])]
|
#[Guarded(['id'])]
|
||||||
class Customer extends Model
|
class Customer extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
public function orders(): HasMany
|
public function orders(): HasMany
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,10 +21,7 @@
|
|||||||
])]
|
])]
|
||||||
class Cutting extends Model
|
class Cutting extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasRejection, InteractsWithActivityLog, SoftDeletes;
|
||||||
use HasRejection;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,9 +26,7 @@
|
|||||||
])]
|
])]
|
||||||
class CuttingMaterial extends Model
|
class CuttingMaterial extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,9 +12,7 @@
|
|||||||
#[Guarded(['id'])]
|
#[Guarded(['id'])]
|
||||||
class CuttingResult extends Model
|
class CuttingResult extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,8 +15,7 @@
|
|||||||
#[Appends(['price_formatted', 'cost_per_unit_formatted', 'type_label'])]
|
#[Appends(['price_formatted', 'cost_per_unit_formatted', 'type_label'])]
|
||||||
class CuttingResultPrice extends Model
|
class CuttingResultPrice extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,9 +20,7 @@
|
|||||||
#[Appends(['base_salary_formatted', 'join_date_formatted', 'resign_date_formatted', 'join_date_input', 'employment_status_label'])]
|
#[Appends(['base_salary_formatted', 'join_date_formatted', 'resign_date_formatted', 'join_date_input', 'employment_status_label'])]
|
||||||
class Employee extends Model
|
class Employee extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,9 +27,7 @@
|
|||||||
])]
|
])]
|
||||||
class EmployeeAdvance extends Model
|
class EmployeeAdvance extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasRejection, InteractsWithActivityLog;
|
||||||
use HasRejection;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,10 +17,7 @@
|
|||||||
#[Appends(['amount_formatted', 'created_at_formatted', 'created_by_name'])]
|
#[Appends(['amount_formatted', 'created_at_formatted', 'created_by_name'])]
|
||||||
class Expense extends Model implements HasMedia
|
class Expense extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasModuleMedia, InteractsWithActivityLog, SoftDeletes;
|
||||||
use HasModuleMedia;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,9 +12,7 @@
|
|||||||
#[Guarded(['id'])]
|
#[Guarded(['id'])]
|
||||||
class HomepageConfiguration extends Model implements HasMedia
|
class HomepageConfiguration extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasModuleMedia, InteractsWithActivityLog;
|
||||||
use HasModuleMedia;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
public static function mediaModuleName(): string
|
public static function mediaModuleName(): string
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,9 +27,7 @@
|
|||||||
])]
|
])]
|
||||||
class LeaveRequest extends Model
|
class LeaveRequest extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasRejection, InteractsWithActivityLog;
|
||||||
use HasRejection;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -30,9 +30,7 @@
|
|||||||
])]
|
])]
|
||||||
class Order extends Model
|
class Order extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,9 +21,7 @@
|
|||||||
])]
|
])]
|
||||||
class OrderItem extends Model
|
class OrderItem extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,8 +27,7 @@
|
|||||||
])]
|
])]
|
||||||
class Payroll extends Model
|
class Payroll extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,8 +15,7 @@
|
|||||||
#[Appends(['amount_formatted', 'type_label', 'created_at_formatted', 'created_by_name'])]
|
#[Appends(['amount_formatted', 'type_label', 'created_at_formatted', 'created_by_name'])]
|
||||||
class PayrollAdjustment extends Model
|
class PayrollAdjustment extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,7 @@
|
|||||||
#[Appends(['period_label', 'status_label', 'closed_at_formatted'])]
|
#[Appends(['period_label', 'status_label', 'closed_at_formatted'])]
|
||||||
class PayrollPeriod extends Model
|
class PayrollPeriod extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,10 +28,7 @@
|
|||||||
])]
|
])]
|
||||||
class Product extends Model
|
class Product extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasRejection, InteractsWithActivityLog, SoftDeletes;
|
||||||
use HasRejection;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,10 +15,7 @@
|
|||||||
#[Guarded(['id'])]
|
#[Guarded(['id'])]
|
||||||
class ProductVariant extends Model implements HasMedia
|
class ProductVariant extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasModuleMedia, InteractsWithActivityLog, SoftDeletes;
|
||||||
use HasModuleMedia;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
private const MIN_STOCK = 5;
|
private const MIN_STOCK = 5;
|
||||||
|
|
||||||
|
|||||||
@ -24,10 +24,7 @@
|
|||||||
])]
|
])]
|
||||||
class Purchase extends Model implements HasMedia
|
class Purchase extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasModuleMedia, InteractsWithActivityLog, SoftDeletes;
|
||||||
use HasModuleMedia;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,9 +21,7 @@
|
|||||||
])]
|
])]
|
||||||
class PurchaseItem extends Model
|
class PurchaseItem extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -18,9 +18,7 @@
|
|||||||
#[Appends(['unit_label', 'unit_abbreviation'])]
|
#[Appends(['unit_label', 'unit_abbreviation'])]
|
||||||
class RawMaterial extends Model
|
class RawMaterial extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -18,10 +18,7 @@
|
|||||||
#[Appends(['price_formatted', 'stock_formatted', 'price_input', 'stock_input'])]
|
#[Appends(['price_formatted', 'stock_formatted', 'price_input', 'stock_input'])]
|
||||||
class RawMaterialPrice extends Model implements HasMedia
|
class RawMaterialPrice extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasModuleMedia, InteractsWithActivityLog, SoftDeletes;
|
||||||
use HasModuleMedia;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,8 +12,7 @@
|
|||||||
#[Guarded(['id'])]
|
#[Guarded(['id'])]
|
||||||
class Rejection extends Model
|
class Rejection extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
public function rejectable(): MorphTo
|
public function rejectable(): MorphTo
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,9 +12,7 @@
|
|||||||
#[Guarded(['id'])]
|
#[Guarded(['id'])]
|
||||||
class Supplier extends Model
|
class Supplier extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
public function purchases(): HasMany
|
public function purchases(): HasMany
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,9 +12,7 @@
|
|||||||
#[Guarded(['id'])]
|
#[Guarded(['id'])]
|
||||||
class SystemConfiguration extends Model implements HasMedia
|
class SystemConfiguration extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasModuleMedia, InteractsWithActivityLog;
|
||||||
use HasModuleMedia;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
|
|
||||||
public static function mediaModuleName(): string
|
public static function mediaModuleName(): string
|
||||||
{
|
{
|
||||||
|
|||||||
@ -24,12 +24,7 @@
|
|||||||
#[Appends(['role_label'])]
|
#[Appends(['role_label'])]
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
use CausesActivity;
|
use CausesActivity, HasFactory, HasRoles, InteractsWithActivityLog, Notifiable, SoftDeletes;
|
||||||
use HasFactory;
|
|
||||||
use HasRoles;
|
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use Notifiable;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,9 +17,7 @@
|
|||||||
#[Appends(['birth_date_formatted', 'birth_date_input', 'gender_label'])]
|
#[Appends(['birth_date_formatted', 'birth_date_input', 'gender_label'])]
|
||||||
class UserProfile extends Model
|
class UserProfile extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
||||||
use InteractsWithActivityLog;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -66,7 +66,7 @@ const tablePagination = computed(() => ({
|
|||||||
const firstItem = computed(() =>
|
const firstItem = computed(() =>
|
||||||
props.rawMaterials.data.length > 0
|
props.rawMaterials.data.length > 0
|
||||||
? (props.rawMaterials.current_page - 1) * props.rawMaterials.per_page +
|
? (props.rawMaterials.current_page - 1) * props.rawMaterials.per_page +
|
||||||
1
|
1
|
||||||
: 0,
|
: 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -83,21 +83,16 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<Head title="Bahan Baku" />
|
<Head title="Bahan Baku" />
|
||||||
|
|
||||||
<AdminLayout>
|
<AdminLayout>
|
||||||
<div
|
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||||
class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"
|
|
||||||
>
|
|
||||||
<div class="space-y-1">
|
<div class="space-y-1">
|
||||||
<h2 class="text-2xl font-bold tracking-tight">Bahan Baku</h2>
|
<h2 class="text-2xl font-bold tracking-tight">Bahan Baku</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button
|
<Button v-if="can('raw-materials.create')" as-child class="shrink-0 self-start sm:self-center">
|
||||||
v-if="can('raw-materials.create')"
|
|
||||||
as-child
|
|
||||||
class="shrink-0 self-start sm:self-center"
|
|
||||||
>
|
|
||||||
<Link href="/admin/master/raw-materials/create">
|
<Link href="/admin/master/raw-materials/create">
|
||||||
<Plus class="size-4" />
|
<Plus class="size-4" />
|
||||||
Tambah
|
Tambah
|
||||||
@ -105,34 +100,17 @@ watch(
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MasterOutOfStockCatalogSection
|
<MasterOutOfStockCatalogSection severity="warning" title="Stok Menipis" empty-title="Tidak ada peringatan stok"
|
||||||
severity="warning"
|
empty-description="Stok bahan baku dibawah 5 pcs." :groups="stockWarningGroups" />
|
||||||
title="Bahan Baku Stok Menipis"
|
|
||||||
description="Stok masih ada, tapi di bawah batas minimum satuan · Klik kartu untuk melihat data."
|
|
||||||
empty-title="Tidak ada peringatan stok"
|
|
||||||
empty-description="Semua varian masih berada di atas batas stok minimum."
|
|
||||||
:groups="stockWarningGroups"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<MasterOutOfStockCatalogSection
|
<MasterOutOfStockCatalogSection title="Stok Habis" empty-title="Tidak ada stok habis"
|
||||||
title="Bahan Baku Stok Habis"
|
empty-description="Stok bahan baku dibawah 0 pcs." :groups="outOfStockGroups" />
|
||||||
description="Klik kartu untuk melihat data."
|
|
||||||
:groups="outOfStockGroups"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Card class="min-w-0">
|
<Card class="min-w-0">
|
||||||
<CardContent class="min-w-0">
|
<CardContent class="min-w-0">
|
||||||
<RawMaterialGroupedTable
|
<RawMaterialGroupedTable v-model:search="search" :materials="rawMaterials.data" :first-item="firstItem"
|
||||||
v-model:search="search"
|
:pagination="tablePagination" :pagination-links="rawMaterials.links" :filter-defs="filterDefs"
|
||||||
:materials="rawMaterials.data"
|
:filter-values="filterValues" @filter-change="setFilter" @filters-reset="resetFilters" />
|
||||||
:first-item="firstItem"
|
|
||||||
:pagination="tablePagination"
|
|
||||||
:pagination-links="rawMaterials.links"
|
|
||||||
:filter-defs="filterDefs"
|
|
||||||
:filter-values="filterValues"
|
|
||||||
@filter-change="setFilter"
|
|
||||||
@filters-reset="resetFilters"
|
|
||||||
/>
|
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</AdminLayout>
|
</AdminLayout>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user