Expand admin access; enforce workshop-scoped warehouse staff; add billing rules and payroll recalculation#125
Merged
Kettailor merged 1 commit intoDec 25, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
core/Controller::authorizeto broaden admin/test flows and to restrict accounts inTrangThai(e.g.Tạm nghỉ) to personal controllers, and addedVT_ADMINwhere appropriate in multiple controllers (QualityController,SuddenlyController,Factory_planController,BillController,Warehouse_sheetController, etc.).models/Employee(getActiveWarehouseEmployeesByWorkshop*), added per-workshop assignment filtering inmodels/WorkshopAssignmentandcontrollers/WorkshopController, and replaced single-manager fields with multi-manager support inmodels/Warehouse(syncWarehouseManagers,getWarehouseManagerIds) plus UI (views/warehouse/*).controllers/PlanControllerplan cancel updates workshop plans and order status;controllers/Factory_planControllerandcontrollers/WorkshopControllernow present cancel/tam ngung flows and disable delete buttons in views;controllers/WarehouseController/Warehouse_sheetController/Human_resourcesController/SuddenlyController/QualityControllerdelete actions replaced with warnings).models/OrdergainsgetOrdersEligibleForBilling;controllers/BillControllerandviews/bill/*enforce invoice creation only for orders with all related workshop plans completed, captureThue,MaBuuDien,GhiChu, and convert deletes into invoice-statusHủy.controllers/SalaryController, changed insurance computation to 10.5% and applied toKhauTru/TongBaoHiemand bulk recalculation inmodels/Salary::recalculateAll, updated payroll wizard UI and views, addedSelf_salaryController+views/self_salary/index.phpfor personal payroll view.controllers/Workshop_planControllernow syncs parent production plan status when all workshop plans complete and notifies inspection-type workshops after end-of-shift lot creation.hoa_doninmodels/Bill, small UI and navbar updates to surface new personal salary link and remove delete actions from lists.Testing
Codex Task