Added logic for applying leave dates plan quantity in produciton mail
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m22s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m57s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 48s
Laravel Larastan / larastan (pull_request) Failing after 24m39s
Laravel Pint / pint (pull_request) Successful in 28m21s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m22s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m57s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 48s
Laravel Larastan / larastan (pull_request) Failing after 24m39s
Laravel Pint / pint (pull_request) Successful in 28m21s
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Mail\ProductionMail;
|
|||||||
use App\Models\Item;
|
use App\Models\Item;
|
||||||
use App\Models\Line;
|
use App\Models\Line;
|
||||||
use App\Models\Plant;
|
use App\Models\Plant;
|
||||||
|
use App\Models\ProductionCalendar;
|
||||||
use App\Models\ProductionPlan;
|
use App\Models\ProductionPlan;
|
||||||
use App\Models\ProductionQuantity;
|
use App\Models\ProductionQuantity;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
@@ -260,6 +261,17 @@ class SendProductionReport extends Command
|
|||||||
|
|
||||||
// $capacityQuan = $totalHourlyQuantity * 22.5;
|
// $capacityQuan = $totalHourlyQuantity * 22.5;
|
||||||
|
|
||||||
|
$leaveDates = ProductionCalendar::where('plant_id', $plant->id)
|
||||||
|
->whereMonth('created_at', $month)
|
||||||
|
->whereYear('created_at', $year)
|
||||||
|
->value('leave_dates');
|
||||||
|
|
||||||
|
$leaveDates = $leaveDates ? array_map('trim', explode(',', $leaveDates)) : [];
|
||||||
|
|
||||||
|
if (in_array($startDate->format('Y-m-d'), $leaveDates)) {
|
||||||
|
$totalTargetQuantity = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (strtolower($line->type) == 'fg line') {
|
if (strtolower($line->type) == 'fg line') {
|
||||||
|
|
||||||
$productionQuantity = \App\Models\QualityValidation::where('plant_id', $plant->id)
|
$productionQuantity = \App\Models\QualityValidation::where('plant_id', $plant->id)
|
||||||
|
|||||||
Reference in New Issue
Block a user