Compare commits
6 Commits
renovate/e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 838a1bb731 | |||
|
|
e5cb8241eb | ||
| ecfda1b739 | |||
|
|
75836e3159 | ||
| e616a66278 | |||
|
|
bfb8fcde29 |
@@ -337,7 +337,7 @@ class Scheduler extends Command
|
||||
}
|
||||
break;
|
||||
case 'Daily':
|
||||
if (now()->format('H:i') == '11:30') {
|
||||
if (now()->format('H:i') == '09:30') {
|
||||
try {
|
||||
\Artisan::call('send-import-transit', [
|
||||
'schedule_type' => $rule->schedule_type,
|
||||
|
||||
@@ -3529,14 +3529,80 @@ class QualityValidationResource extends Resource
|
||||
|
||||
$mPlantName = $mailData['plant_name'];
|
||||
$emails = $mailData['emails'];
|
||||
$ccEmails = $mailData['cc_emails'] ?? [];
|
||||
$mUserName = Filament::auth()->user()->name;
|
||||
|
||||
if (! empty($emails)) {
|
||||
// Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
||||
Mail::to($emails)->send(
|
||||
new InvalidQualityMail($state, $mPorder, $mPlantName, $mLinePart, $mUserName, $mExpectedValue, 'InvalidPartNumber')
|
||||
);
|
||||
} else {
|
||||
// if (! empty($emails)) {
|
||||
// if (is_array($emails)) {
|
||||
// $emailList = collect($emails)
|
||||
// ->flatMap(fn ($email) => explode(',', $email))
|
||||
// ->map(fn ($email) => trim($email))
|
||||
// ->filter()
|
||||
// ->toArray();
|
||||
// } else {
|
||||
// $emailList = array_map('trim', explode(',', $emails));
|
||||
// }
|
||||
|
||||
// $ccList = [];
|
||||
|
||||
// if (!empty($cc_emails)) {
|
||||
// if (is_array($cc_emails)) {
|
||||
// $ccList = collect($cc_emails)
|
||||
// ->flatMap(fn ($email) => explode(',', $email))
|
||||
// ->map(fn ($email) => trim($email))
|
||||
// ->filter()
|
||||
// ->toArray();
|
||||
// } else {
|
||||
// $ccList = collect(explode(',', $cc_emails))
|
||||
// ->map(fn ($email) => trim($email))
|
||||
// ->filter()
|
||||
// ->toArray();
|
||||
// }
|
||||
// }
|
||||
|
||||
// Mail::to($emailList)
|
||||
// ->cc($ccList)
|
||||
// ->send(
|
||||
// new InvalidQualityMail(
|
||||
// $state,
|
||||
// $mPorder,
|
||||
// $mPlantName,
|
||||
// $mLinePart,
|
||||
// $mUserName,
|
||||
// $mExpectedValue,
|
||||
// 'InvalidPartNumber'
|
||||
// )
|
||||
// );
|
||||
// }
|
||||
if (!empty($emails)) {
|
||||
|
||||
$emailList = collect(is_array($emails) ? $emails : explode(',', $emails))
|
||||
->flatMap(fn ($email) => explode(',', $email))
|
||||
->map(fn ($email) => trim($email))
|
||||
->filter()
|
||||
->toArray();
|
||||
|
||||
$ccList = collect(is_array($ccEmails) ? $ccEmails : explode(',', $ccEmails))
|
||||
->flatMap(fn ($email) => explode(',', $email))
|
||||
->map(fn ($email) => trim($email))
|
||||
->filter()
|
||||
->toArray();
|
||||
|
||||
Mail::to($emailList)
|
||||
->cc($ccList)
|
||||
->send(
|
||||
new InvalidQualityMail(
|
||||
$state,
|
||||
$mPorder,
|
||||
$mPlantName,
|
||||
$mLinePart,
|
||||
$mUserName,
|
||||
$mExpectedValue,
|
||||
'InvalidPartNumber'
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
\Log::warning("No recipients found for plant {$mPlantName}, module Serial, rule invalid_serial.");
|
||||
}
|
||||
$set('part_validation1', null);
|
||||
@@ -3978,6 +4044,7 @@ class QualityValidationResource extends Resource
|
||||
->where('module', 'QualityValidation')
|
||||
->where('rule_name', 'QualityMail')
|
||||
->where(fn ($q) => $q->whereNull('schedule_type')->orWhere('schedule_type', ''))
|
||||
// ->get()
|
||||
->pluck('email')
|
||||
->toArray();
|
||||
|
||||
@@ -3995,13 +4062,16 @@ class QualityValidationResource extends Resource
|
||||
->where('module', 'QualityValidation')
|
||||
->where('rule_name', 'QualityMail')
|
||||
->where(fn ($q) => $q->whereNull('schedule_type')->orWhere('schedule_type', ''))
|
||||
->pluck('email')
|
||||
->toArray();
|
||||
->get(['email', 'cc_emails']);
|
||||
// ->pluck('email')
|
||||
// ->toArray();
|
||||
|
||||
return [
|
||||
'plant_id' => $plantId,
|
||||
'plant_name' => $mPlantName,
|
||||
'emails' => $emails,
|
||||
'emails' => $emails->pluck('email')->filter()->toArray(),
|
||||
'cc_emails' => $emails->pluck('cc_emails')->filter()->toArray(),
|
||||
// 'emails' => $emails,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -813,7 +813,7 @@ class TestingPanelReadingResource extends Resource
|
||||
if ($plantId) {
|
||||
return MotorTestingMaster::whereHas('testingPanelReadings', function ($query) {
|
||||
$query->whereNotNull('id');
|
||||
})->orderBy('subassembly_code')->pluck('subassembly_code', 'id');
|
||||
})->whereNotNull('subassembly_code')->orderBy('subassembly_code')->pluck('subassembly_code', 'id');
|
||||
} else {
|
||||
return [];
|
||||
// return Item::whereHas('motorTestingMasters')
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"alperenersoy/filament-export": "^3.0",
|
||||
"althinect/filament-spatie-roles-permissions": "^2.3",
|
||||
"diogogpinto/filament-auth-ui-enhancer": "^1.0",
|
||||
"erag/laravel-pwa": "^2.0",
|
||||
"erag/laravel-pwa": "^1.9",
|
||||
"filament/filament": "^3.3",
|
||||
"intervention/image": "^3.11",
|
||||
"irazasyed/telegram-bot-sdk": "^3.15",
|
||||
|
||||
Reference in New Issue
Block a user