Merge pull request 'Added logic for applying leave dates plan quantity in produciton mail' (#1403) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Reviewed-on: #1403
This commit was merged in pull request #1403.
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Mail\ProductionMail;
|
||||
use App\Models\Item;
|
||||
use App\Models\Line;
|
||||
use App\Models\Plant;
|
||||
use App\Models\ProductionCalendar;
|
||||
use App\Models\ProductionPlan;
|
||||
use App\Models\ProductionQuantity;
|
||||
use Illuminate\Console\Command;
|
||||
@@ -260,6 +261,17 @@ class SendProductionReport extends Command
|
||||
|
||||
// $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') {
|
||||
|
||||
$productionQuantity = \App\Models\QualityValidation::where('plant_id', $plant->id)
|
||||
|
||||
Reference in New Issue
Block a user