Compare commits
10 Commits
renovate/e
...
02990f1f5d
| Author | SHA1 | Date | |
|---|---|---|---|
| 02990f1f5d | |||
|
|
8d8e433ce9 | ||
| 7f773c6b92 | |||
|
|
afcbadaee0 | ||
| 838a1bb731 | |||
|
|
e5cb8241eb | ||
| ecfda1b739 | |||
|
|
75836e3159 | ||
| e616a66278 | |||
|
|
bfb8fcde29 |
@@ -337,7 +337,7 @@ class Scheduler extends Command
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Daily':
|
case 'Daily':
|
||||||
if (now()->format('H:i') == '11:30') {
|
if (now()->format('H:i') == '09:30') {
|
||||||
try {
|
try {
|
||||||
\Artisan::call('send-import-transit', [
|
\Artisan::call('send-import-transit', [
|
||||||
'schedule_type' => $rule->schedule_type,
|
'schedule_type' => $rule->schedule_type,
|
||||||
|
|||||||
@@ -53,50 +53,12 @@ class SendImportTransit extends Command
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// $todayRecordExists = ImportTransit::whereDate('created_at', now()->toDateString())->first();
|
|
||||||
|
|
||||||
// if (!$todayRecordExists) {
|
|
||||||
// $this->info('No records created today. Mail not sent.');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $tableData = ImportTransit::select([
|
|
||||||
// 'cri_rfq_number',
|
|
||||||
// 'mail_received_date',
|
|
||||||
// 'pricol_ref_number',
|
|
||||||
// 'requester',
|
|
||||||
// 'shipper',
|
|
||||||
// 'shipper_location',
|
|
||||||
// 'shipper_invoice',
|
|
||||||
// 'shipper_invoice_date',
|
|
||||||
// 'customs_agent_name',
|
|
||||||
// 'eta_date',
|
|
||||||
// 'status',
|
|
||||||
// 'delivery_location',
|
|
||||||
// 'etd_date',
|
|
||||||
// 'mode',
|
|
||||||
// 'inco_terms',
|
|
||||||
// 'port_of_loading',
|
|
||||||
// 'port_of_discharge',
|
|
||||||
// 'delivery_city',
|
|
||||||
// 'packages',
|
|
||||||
// 'type_of_package',
|
|
||||||
// 'gross_weight',
|
|
||||||
// 'volume',
|
|
||||||
// 'bill_number',
|
|
||||||
// 'bill_received_date',
|
|
||||||
// 'vessel_number',
|
|
||||||
// 'remark',
|
|
||||||
// 'is_transit_identified',
|
|
||||||
// ])
|
|
||||||
// ->where('status', '!=', 'Delivered')
|
|
||||||
// ->get();
|
|
||||||
|
|
||||||
$tableData = ImportTransit::where('status', '!=', 'Delivered')->orderByRaw("
|
$tableData = ImportTransit::where('status', '!=', 'Delivered')->orderByRaw("
|
||||||
CAST(
|
CASE
|
||||||
regexp_replace(cri_rfq_number, '.*-([0-9]+).*', '\\1')
|
WHEN cri_rfq_number ~ '[0-9]+'
|
||||||
AS INTEGER
|
THEN CAST(regexp_replace(cri_rfq_number, '[^0-9]', '', 'g') AS INTEGER)
|
||||||
)
|
ELSE NULL
|
||||||
|
END NULLS LAST
|
||||||
")->get();
|
")->get();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3529,14 +3529,80 @@ class QualityValidationResource extends Resource
|
|||||||
|
|
||||||
$mPlantName = $mailData['plant_name'];
|
$mPlantName = $mailData['plant_name'];
|
||||||
$emails = $mailData['emails'];
|
$emails = $mailData['emails'];
|
||||||
|
$ccEmails = $mailData['cc_emails'] ?? [];
|
||||||
$mUserName = Filament::auth()->user()->name;
|
$mUserName = Filament::auth()->user()->name;
|
||||||
|
|
||||||
if (! empty($emails)) {
|
// if (! empty($emails)) {
|
||||||
// Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
// if (is_array($emails)) {
|
||||||
Mail::to($emails)->send(
|
// $emailList = collect($emails)
|
||||||
new InvalidQualityMail($state, $mPorder, $mPlantName, $mLinePart, $mUserName, $mExpectedValue, 'InvalidPartNumber')
|
// ->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 {
|
}
|
||||||
|
else {
|
||||||
\Log::warning("No recipients found for plant {$mPlantName}, module Serial, rule invalid_serial.");
|
\Log::warning("No recipients found for plant {$mPlantName}, module Serial, rule invalid_serial.");
|
||||||
}
|
}
|
||||||
$set('part_validation1', null);
|
$set('part_validation1', null);
|
||||||
@@ -3978,6 +4044,7 @@ class QualityValidationResource extends Resource
|
|||||||
->where('module', 'QualityValidation')
|
->where('module', 'QualityValidation')
|
||||||
->where('rule_name', 'QualityMail')
|
->where('rule_name', 'QualityMail')
|
||||||
->where(fn ($q) => $q->whereNull('schedule_type')->orWhere('schedule_type', ''))
|
->where(fn ($q) => $q->whereNull('schedule_type')->orWhere('schedule_type', ''))
|
||||||
|
// ->get()
|
||||||
->pluck('email')
|
->pluck('email')
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|
||||||
@@ -3995,13 +4062,16 @@ class QualityValidationResource extends Resource
|
|||||||
->where('module', 'QualityValidation')
|
->where('module', 'QualityValidation')
|
||||||
->where('rule_name', 'QualityMail')
|
->where('rule_name', 'QualityMail')
|
||||||
->where(fn ($q) => $q->whereNull('schedule_type')->orWhere('schedule_type', ''))
|
->where(fn ($q) => $q->whereNull('schedule_type')->orWhere('schedule_type', ''))
|
||||||
->pluck('email')
|
->get(['email', 'cc_emails']);
|
||||||
->toArray();
|
// ->pluck('email')
|
||||||
|
// ->toArray();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
'plant_name' => $mPlantName,
|
'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) {
|
if ($plantId) {
|
||||||
return MotorTestingMaster::whereHas('testingPanelReadings', function ($query) {
|
return MotorTestingMaster::whereHas('testingPanelReadings', function ($query) {
|
||||||
$query->whereNotNull('id');
|
$query->whereNotNull('id');
|
||||||
})->orderBy('subassembly_code')->pluck('subassembly_code', 'id');
|
})->whereNotNull('subassembly_code')->orderBy('subassembly_code')->pluck('subassembly_code', 'id');
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
// return Item::whereHas('motorTestingMasters')
|
// return Item::whereHas('motorTestingMasters')
|
||||||
|
|||||||
@@ -29,6 +29,10 @@
|
|||||||
<td>Item Code</td>
|
<td>Item Code</td>
|
||||||
<td style="text-align: center;">{{ $request->item->code ?? $request->code }}</td>
|
<td style="text-align: center;">{{ $request->item->code ?? $request->code }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Description</td>
|
||||||
|
<td style="text-align: center;">{{ $request->item->description ?? $request->description }}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Job Number</td>
|
<td>Job Number</td>
|
||||||
<td style="text-align: center;">{{ $request->aufnr }}</td>
|
<td style="text-align: center;">{{ $request->aufnr }}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user