Compare commits
18 Commits
renovate/e
...
20583ee55b
| Author | SHA1 | Date | |
|---|---|---|---|
| 20583ee55b | |||
|
|
02db70c0bd | ||
| c81769aeae | |||
|
|
1d6a914c04 | ||
| 841526e1cd | |||
|
|
0e1d823581 | ||
| b39067d7f8 | |||
|
|
2a57b87bfa | ||
| 02990f1f5d | |||
|
|
8d8e433ce9 | ||
| 7f773c6b92 | |||
|
|
afcbadaee0 | ||
| 838a1bb731 | |||
|
|
e5cb8241eb | ||
| ecfda1b739 | |||
|
|
75836e3159 | ||
| e616a66278 | |||
|
|
bfb8fcde29 |
@@ -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();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ use Illuminate\Support\Facades\DB;
|
|||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
use Filament\Tables\Actions\ImportAction;
|
use Filament\Tables\Actions\ImportAction;
|
||||||
|
use Filament\Forms\Components\DateTimePicker;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Tables\Filters\Filter;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
// use PhpOffice\PhpSpreadsheet\IOFactory;
|
// use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
||||||
class ImportTransitResource extends Resource
|
class ImportTransitResource extends Resource
|
||||||
@@ -402,7 +406,100 @@ class ImportTransitResource extends Resource
|
|||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
Tables\Filters\TrashedFilter::make(),
|
Tables\Filters\TrashedFilter::make(),
|
||||||
|
Filter::make('advanced_filters')
|
||||||
|
->label('Advanced Filters')
|
||||||
|
->form([
|
||||||
|
TextInput::make('cri_rfq_number')
|
||||||
|
->label('CRI RFQ Number')
|
||||||
|
->reactive()
|
||||||
|
->placeholder('Enter Rfq Number')
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||||
|
$set('created_from', null);
|
||||||
|
$set('created_to', null);
|
||||||
|
}),
|
||||||
|
TextInput::make('status')
|
||||||
|
->label('Status')
|
||||||
|
->reactive()
|
||||||
|
->placeholder('Enter Status')
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||||
|
$set('created_from', null);
|
||||||
|
$set('created_to', null);
|
||||||
|
}),
|
||||||
|
Select::make('is_transit_identified')
|
||||||
|
->label('Is Transit Identified')
|
||||||
|
->reactive()
|
||||||
|
->options([
|
||||||
|
0 => 0,
|
||||||
|
1 => 1,
|
||||||
|
])
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||||
|
$set('created_from', null);
|
||||||
|
$set('created_to', null);
|
||||||
|
}),
|
||||||
|
DateTimePicker::make(name: 'created_from')
|
||||||
|
->label('Created From')
|
||||||
|
->placeholder(placeholder: 'Select From DateTime')
|
||||||
|
->reactive()
|
||||||
|
->native(false),
|
||||||
|
DateTimePicker::make('created_to')
|
||||||
|
->label('Created To')
|
||||||
|
->placeholder(placeholder: 'Select To DateTime')
|
||||||
|
->reactive()
|
||||||
|
->native(false),
|
||||||
|
])
|
||||||
|
->query(function ($query, array $data) {
|
||||||
|
// Hide all records initially if no filters are applied
|
||||||
|
if (empty($data['cri_rfq_number']) && empty($data['status']) && ! isset($data['is_transit_identified']) && empty($data['created_from']) && empty($data['created_to'])) {
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['cri_rfq_number'])) {
|
||||||
|
$query->where('cri_rfq_number', 'like', '%'.$data['cri_rfq_number'].'%');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['status'])) {
|
||||||
|
$query->where('status', 'like', '%'.$data['status'].'%');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['is_transit_identified'])) {
|
||||||
|
$query->where('is_transit_identified', $data['is_transit_identified']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['created_from'])) {
|
||||||
|
$query->where('created_at', '>=', $data['created_from']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['created_to'])) {
|
||||||
|
$query->where('created_at', '<=', $data['created_to']);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->indicateUsing(function (array $data) {
|
||||||
|
$indicators = [];
|
||||||
|
|
||||||
|
if (! empty($data['cri_rfq_number'])) {
|
||||||
|
$indicators[] = 'CRI Rfq Number: '.$data['cri_rfq_number'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['status'])) {
|
||||||
|
$indicators[] = 'Status: '.$data['status'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['is_transit_identified'])) {
|
||||||
|
$indicators[] = 'Is Transit Identified: '.$data['is_transit_identified'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['created_from'])) {
|
||||||
|
$indicators[] = 'From: '.$data['created_from'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['created_to'])) {
|
||||||
|
$indicators[] = 'To: '.$data['created_to'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $indicators;
|
||||||
|
}),
|
||||||
])
|
])
|
||||||
|
->filtersFormMaxHeight('280px')
|
||||||
->actions([
|
->actions([
|
||||||
Tables\Actions\ViewAction::make(),
|
Tables\Actions\ViewAction::make(),
|
||||||
Tables\Actions\EditAction::make(),
|
Tables\Actions\EditAction::make(),
|
||||||
|
|||||||
@@ -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))
|
||||||
} else {
|
// ->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.");
|
\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')
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class ImportTransitMail extends Mailable
|
|||||||
{
|
{
|
||||||
$now = now();
|
$now = now();
|
||||||
$reportDate = $now->format('d/m/Y');
|
$reportDate = $now->format('d/m/Y');
|
||||||
$greeting = '<b>Dear Sir/Madam</b>,<br>Kindly find attached the Pending Import Shipment Status Report as on ' . $reportDate . ' for your reference.<br>We request you to review the shipments highlighted in <span style="background-color: yellow; font-weight: bold;">yellow</span> and arrange for their clearance at the earliest to avoid further delays and additional charges.<br>Please note that for shipments pending under <b>Telex Release</b> and <b>Duty Payment</b>, CFS charges will be commenced post ETA. We therefore urge you to expedite the necessary actions at your end.';
|
$greeting = '<b>Dear Sir/Madam</b>,<br>Kindly find attached the Pending Import Shipment Status Report as on ' . $reportDate . ' for your reference.<br>We request you to review the shipments highlighted in <span style="background-color: yellow; font-weight: bold;">yellow</span> and arrange for their clearance at the earliest to avoid further delays and additional charges.<br>Please note that for shipments pending under <b>Telex Release</b> and <b>Duty Payment</b>, CFS charges will be commenced post ETA. We therefore urge you to expedite the necessary actions at your end.<br>FCL shipment will take 5-6 Days for clearance & LCL shipment will take 7-8 Days for clearance after arrival of the shipment @ destination Port.</br>';
|
||||||
|
|
||||||
//$greeting1 = 'Dear C.R.I Branch Team, <br><br> Please follow and ensure the same';
|
//$greeting1 = 'Dear C.R.I Branch Team, <br><br> Please follow and ensure the same';
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"alperenersoy/filament-export": "^3.0",
|
"alperenersoy/filament-export": "^3.0",
|
||||||
"althinect/filament-spatie-roles-permissions": "^2.3",
|
"althinect/filament-spatie-roles-permissions": "^2.3",
|
||||||
"diogogpinto/filament-auth-ui-enhancer": "^1.0",
|
"diogogpinto/filament-auth-ui-enhancer": "^1.0",
|
||||||
"erag/laravel-pwa": "^2.0",
|
"erag/laravel-pwa": "^1.9",
|
||||||
"filament/filament": "^3.3",
|
"filament/filament": "^3.3",
|
||||||
"intervention/image": "^3.11",
|
"intervention/image": "^3.11",
|
||||||
"irazasyed/telegram-bot-sdk": "^3.15",
|
"irazasyed/telegram-bot-sdk": "^3.15",
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -89,38 +89,27 @@
|
|||||||
<tr style="{{ $row['is_transit_identified'] == 1 ? 'background-color:#FFFF00;' . 'font-weight: bold;' : '' }}">
|
<tr style="{{ $row['is_transit_identified'] == 1 ? 'background-color:#FFFF00;' . 'font-weight: bold;' : '' }}">
|
||||||
<td>{{ $loop->iteration }}</td>
|
<td>{{ $loop->iteration }}</td>
|
||||||
<td>{{ $row['cri_rfq_number'] }}</td>
|
<td>{{ $row['cri_rfq_number'] }}</td>
|
||||||
{{-- <td>{{ $row['mail_received_date'] }}</td> --}}
|
|
||||||
{{-- <td>{{ \Carbon\Carbon::parse($row['mail_received_date'])->format('Y-m-d') }}</td> --}}
|
|
||||||
{{-- <td>{{ $row['pricol_ref_number'] }}</td> --}}
|
|
||||||
<td>{{ $row['requester'] }}</td>
|
<td>{{ $row['requester'] }}</td>
|
||||||
<td>{{ $row['shipper'] }}</td>
|
<td>{{ $row['shipper'] }}</td>
|
||||||
<td>{{ $row['shipper_location'] }}</td>
|
<td>{{ $row['shipper_location'] }}</td>
|
||||||
<td>{{ $row['shipper_invoice'] }}</td>
|
<td>{{ $row['shipper_invoice'] }}</td>
|
||||||
{{-- <td>{{ $row['shipper_invoice_date'] }}</td> --}}
|
{{-- <td>{{ \Carbon\Carbon::parse($row['shipper_invoice_date'])->format('Y-m-d') }}</td> --}}
|
||||||
<td>{{ \Carbon\Carbon::parse($row['shipper_invoice_date'])->format('Y-m-d') }}</td>
|
<td>
|
||||||
|
{{ !empty($row['shipper_invoice_date']) ? \Carbon\Carbon::parse($row['shipper_invoice_date'])->format('Y-m-d') : '' }}
|
||||||
|
</td>
|
||||||
<td>{{ $row['customs_agent_name'] }}</td>
|
<td>{{ $row['customs_agent_name'] }}</td>
|
||||||
{{-- <td>{{ $row['eta_date'] }}</td> --}}
|
{{-- <td>{{ \Carbon\Carbon::parse($row['eta_date'])->format('Y-m-d') }}</td> --}}
|
||||||
<td>{{ \Carbon\Carbon::parse($row['eta_date'])->format('Y-m-d') }}</td>
|
<td>
|
||||||
{{-- <td>{{ $row['status'] }}</td> --}}
|
{{ !empty($row['eta_date']) ? \Carbon\Carbon::parse($row['eta_date'])->format('Y-m-d') : '' }}
|
||||||
|
</td>
|
||||||
<td class="status-column">
|
<td class="status-column">
|
||||||
{{ $row['status'] }}
|
{{ $row['status'] }}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $row['delivery_location'] }}</td>
|
<td>{{ $row['delivery_location'] }}</td>
|
||||||
{{-- <td>{{ $row['etd_date'] }}</td> --}}
|
{{-- <td>{{ \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') }}</td> --}}
|
||||||
<td>{{ \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') }}</td>
|
<td>
|
||||||
{{-- <td>{{ $row['mode'] }}</td>
|
{{ !empty($row['etd_date']) ? \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') : '' }}
|
||||||
<td>{{ $row['inco_terms'] }}</td>
|
</td>
|
||||||
<td>{{ $row['port_of_loading'] }}</td>
|
|
||||||
<td>{{ $row['port_of_discharge'] }}</td>
|
|
||||||
<td>{{ $row['delivery_city'] }}</td>
|
|
||||||
<td>{{ $row['packages'] }}</td>
|
|
||||||
<td>{{ $row['type_of_package'] }}</td>
|
|
||||||
<td>{{ $row['gross_weight'] }}</td>
|
|
||||||
<td>{{ $row['volume'] }}</td>
|
|
||||||
<td>{{ $row['bill_number'] }}</td> --}}
|
|
||||||
{{-- <td>{{ $row['bill_received_date'] }}</td> --}}
|
|
||||||
{{-- <td>{{ \Carbon\Carbon::parse($row['bill_received_date'])->format('Y-m-d') }}</td>
|
|
||||||
<td>{{ $row['vessel_number'] }}</td> --}}
|
|
||||||
<td>{{ $row['remark'] }}</td>
|
<td>{{ $row['remark'] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|||||||
Reference in New Issue
Block a user