truong-leave-day #124
			
				
			
		
		
		
	| 
						 | 
					@ -628,15 +628,27 @@ class TicketController extends Controller
 | 
				
			||||||
                $days_will_use = 0;
 | 
					                $days_will_use = 0;
 | 
				
			||||||
                $days_will_use_without_pay = $monthData['days_requested'];
 | 
					                $days_will_use_without_pay = $monthData['days_requested'];
 | 
				
			||||||
            } else if ($remainingDaysInMonthRemaining < $monthData['days_requested']) { // không đủ ngày phép
 | 
					            } else if ($remainingDaysInMonthRemaining < $monthData['days_requested']) { // không đủ ngày phép
 | 
				
			||||||
                $hasInsufficientDays = true;
 | 
					                if (
 | 
				
			||||||
                $month_data_status = 'insufficient_days';
 | 
					                    $remainingDaysInMonthRemaining >= $maxDaysPerMonth
 | 
				
			||||||
                $daysNotEnough = $monthData['days_requested'] - $remainingDaysInMonthRemaining;
 | 
					                ) {
 | 
				
			||||||
                $monthMessage = "* Tháng {$monthData['month']}/{$monthData['year']}: \n - Số ngày phép còn lại: {$remainingDaysInMonthRemaining}, Số ngày yêu cầu: {$monthData['days_requested']}.\n - Bạn sẽ sử dụng {$remainingDaysInMonthRemaining} ngày phép và {$daysNotEnough} ngày không phép.";
 | 
					                    $hasInsufficientDays = true;
 | 
				
			||||||
                $errorMessage .= $errorMessage ? "\n\n" . $monthMessage : $monthMessage;
 | 
					                    $month_data_status = 'exceed_max_days';
 | 
				
			||||||
                $remainingDaysInMonthIsUsed = $remainingDaysInMonth; // lấy số ngày phép còn lại của tháng đó
 | 
					                    $daysNotEnough = $monthData['days_requested'] - $remainingDaysInMonthRemaining;
 | 
				
			||||||
 | 
					                    $monthMessage = "* Theo quy định ngày phép tối đa mỗi tháng là {$maxDaysPerMonth} ngày. \nTháng {$monthData['month']}/{$monthData['year']}: \n - Bạn đã sử dụng {$usedDaysInMonth} ngày phép, còn lại {$remainingDaysInMonthRemaining} ngày phép.\n - Bạn sẽ sử dụng {$maxDaysPerMonth} ngày phép và {$daysNotEnough} ngày không phép.";
 | 
				
			||||||
 | 
					                    $errorMessage .= $errorMessage ? "\n\n" . $monthMessage : $monthMessage;
 | 
				
			||||||
 | 
					                    $days_will_use = $maxDaysPerMonth;
 | 
				
			||||||
 | 
					                    $days_will_use_without_pay = $monthData['days_requested'] - $maxDaysPerMonth;
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                    $hasInsufficientDays = true;
 | 
				
			||||||
 | 
					                    $month_data_status = 'insufficient_days';
 | 
				
			||||||
 | 
					                    $daysNotEnough = $monthData['days_requested'] - $remainingDaysInMonthRemaining;
 | 
				
			||||||
 | 
					                    $monthMessage = "* Tháng {$monthData['month']}/{$monthData['year']}: \n - Số ngày phép còn lại: {$remainingDaysInMonthRemaining}, Số ngày yêu cầu: {$monthData['days_requested']}.\n - Bạn sẽ sử dụng {$remainingDaysInMonthRemaining} ngày phép và {$daysNotEnough} ngày không phép.";
 | 
				
			||||||
 | 
					                    $errorMessage .= $errorMessage ? "\n\n" . $monthMessage : $monthMessage;
 | 
				
			||||||
 | 
					                    $remainingDaysInMonthIsUsed = $remainingDaysInMonth; // lấy số ngày phép còn lại của tháng đó
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                $days_will_use = $remainingDaysInMonthRemaining;
 | 
					                    $days_will_use = $remainingDaysInMonthRemaining;
 | 
				
			||||||
                $days_will_use_without_pay = $daysNotEnough;
 | 
					                    $days_will_use_without_pay = $daysNotEnough;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            } else if (
 | 
					            } else if (
 | 
				
			||||||
                $remainingDaysInMonthRemaining >= $monthData['days_requested']
 | 
					                $remainingDaysInMonthRemaining >= $monthData['days_requested']
 | 
				
			||||||
            ) { // Đủ ngày phép ở tháng đó
 | 
					            ) { // Đủ ngày phép ở tháng đó
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue